Commit 90744313 sunke

Merge remote-tracking branch 'origin/master'

2 个父辈 cc567ecb cb57bfe9
......@@ -56,19 +56,19 @@ public class DataInitManager {
if (admin == null) {
log.info("开始创建默认菜单...");
Set<String> menuIdSet = MenuInitNew() ;
Set<String> menuIdSet = MenuInitNew();
// Group group=new Group("未分组");
// group=groupManager.save(group);
// log.info("创建默认组:" + group.toString());
Set<String> groupIds= new HashSet<>();
Set<String> groupIds = new HashSet<>();
// groupIds.add(group.getId());
Role role = new Role(menuIdSet,"admin","管理员");
role= roleManager.save(role);
Role role = new Role(menuIdSet, "admin", "管理员");
role = roleManager.save(role);
log.info("创建默认角色:" + role.toString());
admin = new User( userName, "admin@qq.com","zh",role.getId(), "$2a$10$Egp1/gvFlt7zhlXVfEFw4OfWQCGPw0ClmMcc6FjTnvXNRVf9zdMRa", true, true, new Date(), groupIds,"" );
admin = new User(userName, "admin@qq.com", "zh", role.getId(), "$2a$10$Egp1/gvFlt7zhlXVfEFw4OfWQCGPw0ClmMcc6FjTnvXNRVf9zdMRa", true, true, new Date(), groupIds, "");
userManager.save(admin);
log.info("创建默认用户:" + admin.toString());
......@@ -78,10 +78,19 @@ public class DataInitManager {
log.info("初始化环境完成...");
}
List<Menu> menus=menuManager.findByQuery(new Query(Criteria.where("path").ne("")));
for (Menu me:menus
) {
if(me.getTitleKey()==null|| me.getTitleKey()==""){
List<Menu> helpMenus = menuManager.findByQuery(new Query(Criteria.where("title").is("帮助")));
if (helpMenus == null || helpMenus.size() <= 0) {
Menu helpAbout = Menu.CreatePMenu("帮助", 30, "help", 2, "help");
Menu instruMenu = new Menu(new ArrayList<Menu>(), 1, "instruction", "说明书", 1, "instruction", "system/instruction/index", "", 0, "aboutBook");
Menu aboutMenu = new Menu(new ArrayList<Menu>(), 1, "about", "关于", 1, "about", "system/about/index", "", 0, "message");
createMenus(helpAbout, instruMenu, aboutMenu);
}
List<Menu> menus = menuManager.findByQuery(new Query(Criteria.where("path").ne("")));
for (Menu me : menus
) {
if (me.getTitleKey() == null || me.getTitleKey() == "") {
me.setTitleKey(me.getPath());
menuManager.saveMenu(me);
}
......@@ -161,7 +170,7 @@ public class DataInitManager {
String[] subPers = defaultMenus.get(per);
if (subPers.length <= 0) {
// subPers = new String[]{per + ":edit", per + ":del", per + ":add"};
subPers = new String[]{per };
subPers = new String[]{per+":manager" };
}
for (String subPer :
subPers) {
......@@ -221,6 +230,12 @@ public class DataInitManager {
menus.addAll(createMenus(pMenuUser, menuUser, menuRole));
Menu helpAbout = Menu.CreatePMenu("帮助", 30, "help", 2, "help");
Menu instruMenu = new Menu(new ArrayList<Menu>(), 1, "instruction", "说明书", 1, "instruction", "system/instruction/index", "", 0, "aboutBook");
Menu aboutMenu = new Menu(new ArrayList<Menu>(), 1, "about", "关于", 1, "about", "system/about/index", "", 0, "message");
menus.addAll(createMenus(helpAbout,instruMenu,aboutMenu));
Set<String> menuIdSet = new HashSet<String>() {};
for (Menu menu : menus) {
log.info("创建默认菜单:" + menu.toString());
......
......@@ -96,7 +96,7 @@ public class DeviceController {
* 流水线入库查找空的料格
*/
@ApiOperation("环行线扫码获取库位号")
@PostMapping(value = "/emptyPosForPutin")
@PostMapping(value = "/service/store/emptyPosForPutin")
@ResponseBody
@AnonymousAccess
public Map<String,Object> emptyPosForPutin(HttpServletRequest request) {
......
......@@ -155,9 +155,9 @@ public class BoxKanbanController {
statusOk = true;
}
} else {
if (datalog.getStatus().equals(OP_STATUS.WAIT.name()) || datalog.getStatus().equals(OP_STATUS.FINISHED.name())) {
// if (datalog.getStatus().equals(OP_STATUS.WAIT.name()) || datalog.getStatus().equals(OP_STATUS.FINISHED.name())) {
statusOk = true;
}
// }
}
if (!statusOk) {
continue;
......
......@@ -524,11 +524,11 @@ public class TaskService {
* @param barcode
* @return
*/
public StoragePos findEmptyPosForPutIn(List<Storage> storageList, Barcode barcode, String inRFID,String lastPosId) throws ValidateException{
verifyBarcodePutIn(storageList ,barcode, inRFID);
public StoragePos findEmptyPosForPutIn(List<Storage> storageList, Barcode barcode, String inRFID,String lastPosId) throws ValidateException {
verifyBarcodePutIn(storageList, barcode, inRFID);
//查找任务数最少的料仓
final Map<String,Integer> storageTaskCountMap = new HashMap<>();
final Map<String, Integer> storageTaskCountMap = new HashMap<>();
for (Storage storage : storageList) {
storageTaskCountMap.put(storage.getId(), 0);
}
......@@ -537,20 +537,20 @@ public class TaskService {
//如果有正在执行的任务,把库位发过去
Collection<DataLog> allTasks = taskMap.values();
for (DataLog task : allTasks) {
if(barcode.getBarcode().equals(task.getBarcode())){
if (barcode.getBarcode().equals(task.getBarcode())) {
String posId = task.getPosId();
log.info(barcode.getBarcode() + " 已有任务,返回任务中的库位:" + task.getPosName());
return storagePosManager.get(posId);
}
String storageId = task.getStorageId();
if(!Strings.isNullOrEmpty(storageId)){
if (!Strings.isNullOrEmpty(storageId)) {
Integer taskCount = storageTaskCountMap.get(storageId);
if(taskCount != null){
if (taskCount != null) {
taskCount = taskCount + 1;
storageTaskCountMap.put(storageId, taskCount);
}
if(task.isCheckOutTask()){
if (task.isCheckOutTask()) {
hasOutTaskStorageIds.add(storageId);
}
}
......@@ -587,27 +587,26 @@ public class TaskService {
//可用的料仓(在线,且可以放入)
List<Storage> availbleStorageList = new ArrayList<>();
for(Storage storage : storageList){
if(storage.canPutIn(barcode.getPlateSize(),barcode.getHeight())){
for (Storage storage : storageList) {
if (storage.canPutIn(barcode.getPlateSize(), barcode.getHeight())) {
availbleStorageList.add(storage);
}
}
if(availbleStorageList.isEmpty()){
throw new ValidateException("smfcode.noValidStorage","料仓列表中未找到可用的料仓");
if (availbleStorageList.isEmpty()) {
throw new ValidateException("smfcode.noValidStorage", "料仓列表中未找到可用的料仓");
}
availbleStorageList.sort(new Comparator<Storage>() {
@Override
public int compare(Storage o1, Storage o2) {
Integer taskCount1 = storageTaskCountMap.get(o1.getId());
Integer taskCount2 = storageTaskCountMap.get(o2.getId());
return taskCount1.compareTo(taskCount2);
}
});
availbleStorageList.sort(new Comparator<Storage>() {
@Override
public int compare(Storage o1, Storage o2) {
Integer taskCount1 = storageTaskCountMap.get(o1.getId());
Integer taskCount2 = storageTaskCountMap.get(o2.getId());
return taskCount1.compareTo(taskCount2);
}
});
// return findEmptyPosInStorages(barcode, availbleStorageList, storageTaskCountMap,lastPosId);
return null;
return findEmptyPosInStorages(barcode, availbleStorageList, storageTaskCountMap, lastPosId);
}
private synchronized StoragePos findEmptyPosInStorages(Barcode barcode, List<Storage> availbleStorageList, final Map<String,Integer> executingTaskCountMap,String lastPosId){
......
......@@ -123,18 +123,19 @@ public class RoleController {
if (resources.getId() == null) {
throw new ValidateException("smfcode.valueCanotNull","{0}不能为空",new String[]{"ID"} );
}
Role role = roleManager.get(resources.getId());
//判断ID是否存在
Set<String> menuIds=resources.getMenus();
Query query=new Query(Criteria.where("id").in(menuIds));
List<Menu> menus=menuManager.findByQuery(query);
if(menus==null&&(menus.size()!=menuIds.size())){
throw new ValidateException("smfcode.menuNotExist","菜单{0}不存在",new String[]{"ID"} );
}
roleManager.updateMenu(resources);
return new ResponseEntity<>(HttpStatus.OK);
throw new ValidateException("smfcode.valueCanotNull","{0}不能为空",new String[]{"ID"} );
// Role role = roleManager.get(resources.getId());
// //判断ID是否存在
//
// Set<String> menuIds=resources.getMenus();
//
// Query query=new Query(Criteria.where("id").in(menuIds));
// List<Menu> menus=menuManager.findByQuery(query);
// if(menus==null&&(menus.size()!=menuIds.size())){
// throw new ValidateException("smfcode.menuNotExist","菜单{0}不存在",new String[]{"ID"} );
// }
// roleManager.updateMenu(resources);
// return new ResponseEntity<>(HttpStatus.OK);
}
@ApiOperation("删除角色")
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!