Commit 54b1e1df sunke

可以隐藏一级菜单

多选出库时,如果出库失败,忽略
1 个父辈 e8ed6c32
...@@ -277,9 +277,8 @@ public class DataInitManager { ...@@ -277,9 +277,8 @@ public class DataInitManager {
for (String menuToShow : menuListToShow) { for (String menuToShow : menuListToShow) {
menuList.add(menuToShow); menuList.add(menuToShow);
} }
Map<String, Menu> allMenus = getAllMenuMap(); Set<String> showIdSet = showMenu(menuList);
Set<String> showIdSet = showMenu(allMenus,menuList); Set<String> hideIdSet = hideMenu(menuListToHide);
Set<String> hideIdSet = hideMenu(allMenus, menuListToHide);
if(!showIdSet.isEmpty() || !hideIdSet.isEmpty()){ if(!showIdSet.isEmpty() || !hideIdSet.isEmpty()){
List<Role> roles = roleManager.findByQuery(new Query(Criteria.where("name").is("admin"))); List<Role> roles = roleManager.findByQuery(new Query(Criteria.where("name").is("admin")));
Role roleAdmin = roles.get(0); Role roleAdmin = roles.get(0);
...@@ -303,10 +302,11 @@ public class DataInitManager { ...@@ -303,10 +302,11 @@ public class DataInitManager {
/** /**
* 展示菜单 * 展示菜单
*/ */
private Set<String> showMenu(Map<String, Menu> allMenu, List<String> menuListToShow){ private Set<String> showMenu(List<String> menuListToShow){
Map<String, Menu> allMenus = getAllMenuMap();
Set<String> showIdSet = new HashSet<>(); Set<String> showIdSet = new HashSet<>();
for (String showPath : menuListToShow) { for (String showPath : menuListToShow) {
Menu showMenu = allMenu.get(showPath); Menu showMenu = allMenus.get(showPath);
if(showMenu != null){ if(showMenu != null){
showMenu = createMenu(showMenu); showMenu = createMenu(showMenu);
log.info("展示菜单:" + showMenu.getPath()); log.info("展示菜单:" + showMenu.getPath());
...@@ -321,17 +321,15 @@ public class DataInitManager { ...@@ -321,17 +321,15 @@ public class DataInitManager {
/** /**
* 隐藏菜单 * 隐藏菜单
*/ */
private Set<String> hideMenu(Map<String, Menu> allMenu, String[] menuListToHide){ private Set<String> hideMenu(String[] menuListToHide){
Set<String> hideIdSet = new HashSet<>(); Set<String> hideIdSet = new HashSet<>();
for (String hidePath : menuListToHide) { for (String hidePath : menuListToHide) {
Menu hideMenu = menuManager.findByPath(hidePath); Menu hideMenu = menuManager.findByPath(hidePath);
if(hideMenu != null){ if(hideMenu != null){
if(hideMenu != null){ hideMenu.setHidden(true);
hideMenu.setHidden(true); menuManager.saveMenu(hideMenu);
menuManager.saveMenu(hideMenu); log.info("隐藏菜单:" + hideMenu.getPath());
log.info("隐藏菜单:" + hideMenu.getPath()); addToMenuIdSet(hideIdSet,hideMenu);
addToMenuIdSet(hideIdSet,hideMenu);
}
}else{ }else{
log.error("菜单:" + hidePath + "不存在"); log.error("菜单:" + hidePath + "不存在");
} }
......
...@@ -214,39 +214,26 @@ public class NLPShelfHandler extends BaseDeviceHandler { ...@@ -214,39 +214,26 @@ public class NLPShelfHandler extends BaseDeviceHandler {
//亮灯 //亮灯
Collection<DataLog> queueTasks = taskService.getQueueTasks(statusBean.getCid()); Collection<DataLog> queueTasks = taskService.getQueueTasks(statusBean.getCid());
for (DataLog queueTask : queueTasks) { for (DataLog queueTask : queueTasks) {
if (queueTask.isWait()) { if (queueTask.isWait() && queueTask.isCheckOutTask()) {
queueTask.setStatus(OP_STATUS.EXECUTING.name()); queueTask.setStatus(OP_STATUS.EXECUTING.name());
taskService.updateQueueTask(queueTask); taskService.updateQueueTask(queueTask);
String rgb = queueTask.getLightColor(); String rgb = queueTask.getLightColor();
ORDER_COLOR color = ORDER_COLOR.fromRgb(rgb); ORDER_COLOR color = ORDER_COLOR.fromRgb(rgb);
if (color == null) { if (color == null) {
if (queueTask.isPutInTask()) { if (openZhiYin && ObjectUtil.isNotEmpty(queueTask.getSourceId())) {
color = ORDER_COLOR.DARKGREEN; List<DataLog> dataLogList = outMap.get(queueTask.getSourceId());
} else { if (dataLogList == null) {
if (openZhiYin && ObjectUtil.isNotEmpty(queueTask.getSourceId())) { dataLogList = new ArrayList<>();
List<DataLog> dataLogList = outMap.get(queueTask.getSourceId());
if (dataLogList == null) {
dataLogList = new ArrayList<>();
}
dataLogList.add(queueTask);
outMap.put(queueTask.getSourceId(), dataLogList);
} else {
color = ORDER_COLOR.BLUE;
} }
dataLogList.add(queueTask);
outMap.put(queueTask.getSourceId(), dataLogList);
} else {
color = ORDER_COLOR.BLUE;
} }
} }
statusBean.addData("open", queueTask.getPosName() + "=" + color.name()); statusBean.addData("open", queueTask.getPosName() + "=" + color.name());
log.info("库位[" + queueTask.getPosName() + "]+亮灯:" + color.name()); log.info("库位[" + queueTask.getPosName() + "]+亮灯:" + color.name());
} }
// else if(queueTask.isCancel()){
// if(queueTask.isCheckOutTask()){
//
// statusBean.addData("open",queueTask.getPosName()+"="+"orange" );
// log.info("库位["+queueTask.getPosName()+"]+取消:open=orange" );
// //从任务列表中删除
// taskService.removeFinishedTask(queueTask);
// }
// }
} }
List<DataLog> dataLogs = getLightGuideTask(outMap); List<DataLog> dataLogs = getLightGuideTask(outMap);
...@@ -319,7 +306,7 @@ public class NLPShelfHandler extends BaseDeviceHandler { ...@@ -319,7 +306,7 @@ public class NLPShelfHandler extends BaseDeviceHandler {
List<String> newList=new ArrayList<>(); List<String> newList=new ArrayList<>();
for (String posName : hasReelPosList) { for (String posName : hasReelPosList) {
if(disabledPosNameSet.contains(posName)){ if(disabledPosNameSet.contains(posName)){
log.info(cid + "sensorChange hasReelPosList [" + posName + "]库位被禁用,忽略"); //log.info(cid + "sensorChange hasReelPosList [" + posName + "]库位被禁用,忽略");
continue; continue;
}else if(usedPosList.contains(posName)){ }else if(usedPosList.contains(posName)){
log.info(cid + "sensorChange hasReelPosList [" + posName + "]库位已有物料,加入到ok列表"); log.info(cid + "sensorChange hasReelPosList [" + posName + "]库位已有物料,加入到ok列表");
......
...@@ -401,8 +401,9 @@ public class StoragePosController { ...@@ -401,8 +401,9 @@ public class StoragePosController {
for (String pid : checkOutDto.getPids()) { for (String pid : checkOutDto.getPids()) {
StoragePos pos = storagePosManager.get(pid); StoragePos pos = storagePosManager.get(pid);
if (pos == null) { if (pos == null) {
throw new ValidateException("smfcore.valueNotExist", "{0}[{1}]不存在", new String[]{"pid", pid}); //throw new ValidateException("smfcore.valueNotExist", "{0}[{1}]不存在", new String[]{"pid", pid});
// throw new ValidateException("位置[" + pid + "]不存在"); // throw new ValidateException("位置[" + pid + "]不存在");
continue;
} }
Storage storage = dataCache.getStorageById(pos.getStorageId()); Storage storage = dataCache.getStorageById(pos.getStorageId());
if (storage == null) { if (storage == null) {
......
...@@ -108,24 +108,6 @@ public class TaskService { ...@@ -108,24 +108,6 @@ public class TaskService {
String msg = "库位[" + pos.getPosName() + "]中已无物料,忽略"; String msg = "库位[" + pos.getPosName() + "]中已无物料,忽略";
log.info(msg); log.info(msg);
throw new ValidateException("smfcore.allBoxView.noReel", "库位{0}中无物料",new String[]{pos.getPosName()}); throw new ValidateException("smfcore.allBoxView.noReel", "库位{0}中无物料",new String[]{pos.getPosName()});
// Barcode barcode=new Barcode();
// SimpleDateFormat formatter= new SimpleDateFormat("HHmmss");
// Date date = new Date(System.currentTimeMillis());
// barcode.setBarcode("EO-"+formatter.format(date)+pos.getId());
// log.info("库位[" + pos.getPosName() + "]中已无物料,空出,模拟条码:"+barcode.getBarcode());
// barcode.setHeight(pos.getH());
// barcode.setPlateSize(pos.getW());
// barcode.setAmount(999);
// DataLog task = new DataLog(storage, barcode, pos);
// task.setType(OP.CHECKOUT);
// task.setPutInDate(barcode.getPutInDate());
// task.setStatus(OP_STATUS.WAIT.name());
// task.setSingleOut(isSingleOut);
// task.setOperator(opUserName);
// addTaskToExecute(task);
// return "";
} }
DataLog task = new DataLog(storage, pos.getBarcode(), pos); DataLog task = new DataLog(storage, pos.getBarcode(), pos);
......
...@@ -201,7 +201,7 @@ public class NeotelApi extends BaseSmfApiListener { ...@@ -201,7 +201,7 @@ public class NeotelApi extends BaseSmfApiListener {
Date produceDate = DateUtil.toDate(produceDateStr, "yyyy-MM-dd HH:mm:ss"); Date produceDate = DateUtil.toDate(produceDateStr, "yyyy-MM-dd HH:mm:ss");
barcode.setProduceDate(produceDate); barcode.setProduceDate(produceDate);
} }
} catch (ParseException e) { } catch (Exception e) {
log.error("日期转换出错", e); log.error("日期转换出错", e);
} }
...@@ -289,7 +289,7 @@ public class NeotelApi extends BaseSmfApiListener { ...@@ -289,7 +289,7 @@ public class NeotelApi extends BaseSmfApiListener {
Date produceDate = DateUtil.toDate(produceDateStr, "yyyy-MM-dd HH:mm:ss"); Date produceDate = DateUtil.toDate(produceDateStr, "yyyy-MM-dd HH:mm:ss");
barcode.setProduceDate(produceDate); barcode.setProduceDate(produceDate);
} }
} catch (ParseException e) { } catch (Exception e) {
log.error("日期转换出错", e); log.error("日期转换出错", e);
} }
......
...@@ -156,8 +156,8 @@ public class SiemensApi extends BaseSmfApiListener { ...@@ -156,8 +156,8 @@ public class SiemensApi extends BaseSmfApiListener {
component = new com.neotel.smfcore.core.barcode.service.po.Component(); component = new com.neotel.smfcore.core.barcode.service.po.Component();
component.setPartNumber(info.getPartnum()); component.setPartNumber(info.getPartnum());
component.setAmount(info.getQuantity()); component.setAmount(info.getQuantity());
component.setHeight(codebean.getReelWidth()); component.setHeight(codebean.getReelHeight());
component.setPlateSize(codebean.getReelHeight()); component.setPlateSize(codebean.getReelWidth());
component = componentManager.saveComponent(component); component = componentManager.saveComponent(component);
log.info("siemensCheckCode 新增 元器件:[" + component.getPartNumber() + "][" + component.getAmount() + "][" + component.getPlateSize() + "]X[" + component.getHeight() + "]"); log.info("siemensCheckCode 新增 元器件:[" + component.getPartNumber() + "][" + component.getAmount() + "][" + component.getPlateSize() + "]X[" + component.getHeight() + "]");
} else if (component.getAmount() != info.getQuantity()) { } else if (component.getAmount() != info.getQuantity()) {
......
package com.neotel.smfcore.custom.tiantong; package com.neotel.smfcore.custom.tiantong;
import cn.hutool.core.util.ObjectUtil;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.neotel.smfcore.common.bean.ResultBean; import com.neotel.smfcore.common.bean.ResultBean;
...@@ -13,6 +14,7 @@ import com.neotel.smfcore.core.order.LiteOrderCache; ...@@ -13,6 +14,7 @@ import com.neotel.smfcore.core.order.LiteOrderCache;
import com.neotel.smfcore.core.order.service.manager.ILiteOrderManager; import com.neotel.smfcore.core.order.service.manager.ILiteOrderManager;
import com.neotel.smfcore.core.order.service.po.LiteOrder; import com.neotel.smfcore.core.order.service.po.LiteOrder;
import com.neotel.smfcore.core.order.service.po.LiteOrderItem; import com.neotel.smfcore.core.order.service.po.LiteOrderItem;
import com.neotel.smfcore.core.storage.bean.InventoryItem;
import com.neotel.smfcore.core.storage.bean.UsageItem; import com.neotel.smfcore.core.storage.bean.UsageItem;
import com.neotel.smfcore.core.storage.service.manager.IStoragePosManager; import com.neotel.smfcore.core.storage.service.manager.IStoragePosManager;
import com.neotel.smfcore.core.storage.service.po.Storage; import com.neotel.smfcore.core.storage.service.po.Storage;
...@@ -25,6 +27,7 @@ import com.neotel.smfcore.security.annotation.AnonymousAccess; ...@@ -25,6 +27,7 @@ import com.neotel.smfcore.security.annotation.AnonymousAccess;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.logging.log4j.util.Strings;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -49,6 +52,9 @@ public class TianTongController { ...@@ -49,6 +52,9 @@ public class TianTongController {
@Autowired @Autowired
private TaskService taskService; private TaskService taskService;
@Autowired
private DataCache dataCache;
@ApiOperation("创建需求单") @ApiOperation("创建需求单")
@RequestMapping("/outInfo") @RequestMapping("/outInfo")
...@@ -163,21 +169,38 @@ public class TianTongController { ...@@ -163,21 +169,38 @@ public class TianTongController {
@RequestMapping("/inventory") @RequestMapping("/inventory")
@AnonymousAccess @AnonymousAccess
public TianTongResult inventory(@RequestBody Map<String, String> paramMap) { public TianTongResult inventory(@RequestBody Map<String, String> paramMap) {
List<StoragePos> storagePosList = storagePosManager.findNotEmpty(); String pn = paramMap.get("MTRL_ID");
if (storagePosList != null) { Collection<Storage> allStorages = dataCache.getAllStorage().values();
List<Map<String, Object>> resultMapList = new ArrayList<>(); Map<String,InventoryItem> resultItemMap = Maps.newHashMap();
for (StoragePos storagePos : storagePosList) { for (Storage storage : allStorages) {
Barcode barcode = storagePos.getBarcode(); List<InventoryItem> items = new ArrayList<>();
if (barcode != null) { if(Strings.isNotBlank(pn)){
Map<String, Object> resultMap = new HashMap<>(); InventoryItem inventoryItem = dataCache.getStorageInventoryByPartNumber(storage.getCid(),pn);
resultMap.put("MTRL_ID", barcode.getBarcode()); items.add(inventoryItem);
resultMap.put("R_QTY", barcode.getAmount()+""); }else{
resultMapList.add(resultMap); Map<String, InventoryItem> storageInventory = dataCache.getStorageInventory(storage.getCid());
items.addAll(storageInventory.values());
}
for(InventoryItem item : items){
String partNumber = item.getPartNumber();
InventoryItem pnInventoryItem = resultItemMap.get(partNumber);
if(pnInventoryItem == null){
pnInventoryItem = new InventoryItem();
} }
pnInventoryItem.setPartNumber(partNumber);
pnInventoryItem.setStockCount(pnInventoryItem.getStockCount() + item.getStockCount());
pnInventoryItem.setLockCount(pnInventoryItem.getLockCount() + item.getLockCount());
resultItemMap.put(partNumber,pnInventoryItem);
} }
return TianTongResult.okResult(resultMapList);
} }
return TianTongResult.ngResult("未找到实时库存信息"); List<Map<String, Object>> resultMapList = new ArrayList<>();
for (InventoryItem resultItem : resultItemMap.values()) {
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("MTRL_ID", resultItem.getPartNumber());
resultMap.put("R_QTY", resultItem.getStockCount()+"");
resultMapList.add(resultMap);
}
return TianTongResult.okResult(resultMapList);
} }
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!