Commit 89f66815 zshaohui

1.菜单提交

2.功能优化
1 个父辈 ed3a8c0a
...@@ -243,6 +243,26 @@ public class DataInitManager { ...@@ -243,6 +243,26 @@ public class DataInitManager {
addNewFunctionMenu(121, helpAbout, "instruction", "说明书", "instruction", "system/instruction/index","aboutBook",functionMenuMap); addNewFunctionMenu(121, helpAbout, "instruction", "说明书", "instruction", "system/instruction/index","aboutBook",functionMenuMap);
addNewFunctionMenu(122, helpAbout, "about", "关于","about", "system/about/index","message",functionMenuMap); addNewFunctionMenu(122, helpAbout, "about", "关于","about", "system/about/index","message",functionMenuMap);
Menu s1 = Menu.CreatePMenu("工位1", 13, "/s1", 2, "index", null);
addNewFunctionMenu(123, s1, "outerWarehouse/s1", "入库扫码装箱","outerWarehouse/s1", "outers/outerWarehouse/index","index",functionMenuMap);
addNewFunctionMenu(124, s1, "outOperation/s1", "出库作业","outOperation/s1", "outers/outOperation/index","index",functionMenuMap);
Menu s2 = Menu.CreatePMenu("工位2", 14, "/s2", 2, "index", null);
addNewFunctionMenu(124, s2, "outerWarehouse/s2", "入库扫码装箱","outerWarehouse/s2", "outers/outerWarehouse/index","index",functionMenuMap);
addNewFunctionMenu(125, s2, "outOperation/s2", "出库作业","outOperation/s2", "outers/outOperation/index","index",functionMenuMap);
Menu s3 = Menu.CreatePMenu("工位3", 15, "/s3", 2, "index", null);
addNewFunctionMenu(126, s3, "outerWarehouse/s3", "入库扫码装箱","outerWarehouse/s3", "outers/outerWarehouse/index","index",functionMenuMap);
addNewFunctionMenu(127, s3, "outOperation/s3", "出库作业","outOperation/s3", "outers/outOperation/index","index",functionMenuMap);
Menu s4 = Menu.CreatePMenu("工位4", 16, "/s4", 2, "index", null);
addNewFunctionMenu(128, s4, "outerWarehouse/s4", "入库扫码装箱","outerWarehouse/s4", "outers/outerWarehouse/index","index",functionMenuMap);
addNewFunctionMenu(129, s4, "outOperation/s4", "出库作业","outOperation/s4", "outers/outOperation/index","index",functionMenuMap);
Menu s5 = Menu.CreatePMenu("工位5", 17, "/s5", 2, "index", null);
addNewFunctionMenu(130, s5, "outerWarehouse/s5", "入库扫码装箱","outerWarehouse/s5", "outers/outerWarehouse/index","index",functionMenuMap);
addNewFunctionMenu(131, s5, "outOperation/s5", "出库作业","outOperation/s5", "outers/outOperation/index","index",functionMenuMap);
return functionMenuMap; return functionMenuMap;
} }
......
...@@ -243,7 +243,7 @@ public class AgvBoxDeviceClientController { ...@@ -243,7 +243,7 @@ public class AgvBoxDeviceClientController {
List<DataLog> allTasks = taskService.getAllTasks(); List<DataLog> allTasks = taskService.getAllTasks();
for (DataLog task : allTasks) { for (DataLog task : allTasks) {
if (rfid.startsWith(task.getBarcode())) { if (rfid.startsWith(task.getBarcode())) {
if (!task.isCancel()) { if (!task.isCancel() && !task.isFinished()) {
opTask = task; opTask = task;
} }
break; break;
...@@ -285,7 +285,7 @@ public class AgvBoxDeviceClientController { ...@@ -285,7 +285,7 @@ public class AgvBoxDeviceClientController {
//从库位中取出,需要移到完成队列中,并且清理库存 //从库位中取出,需要移到完成队列中,并且清理库存
outFromPos(opTask); outFromPos(opTask);
//清理锁定库位 //清理锁定库位
ReelLockPosUtil.removeReelLockPosInfo(rfid); ReelLockPosUtil.removeReelLockPosInfo(rfid.replace("A","").replace("B",""));
} }
taskService.updateFinishedTask(opTask); taskService.updateFinishedTask(opTask);
......
...@@ -41,6 +41,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -41,6 +41,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.*; import java.util.*;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Pattern;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -54,8 +55,6 @@ public class WarehouseController { ...@@ -54,8 +55,6 @@ public class WarehouseController {
@Autowired @Autowired
private IBarcodeManager barcodeManager; private IBarcodeManager barcodeManager;
@Autowired
private IComponentManager componentManager;
@Autowired @Autowired
private CodeResolve codeResolve; private CodeResolve codeResolve;
...@@ -80,16 +79,22 @@ public class WarehouseController { ...@@ -80,16 +79,22 @@ public class WarehouseController {
String size = paramMap.get("size"); //尺寸 "7X8" String size = paramMap.get("size"); //尺寸 "7X8"
String num = paramMap.get("num"); //数量 String num = paramMap.get("num"); //数量
String name = paramMap.get("name"); //工位名称 String name = paramMap.get("name"); //工位名称
String currentRfid = paramMap.get("currentRfid"); //当前料箱的RFID
if (StringUtils.isBlank(size) || StringUtils.isBlank(num) || StringUtils.isBlank(name)) {
return ResultBean.newErrorResult(-1, "", "请核实尺寸,数量,工位名称是否为空", new String[]{});
}
String grLabel = paramMap.get("grLabel"); //GR标签 String grLabel = paramMap.get("grLabel"); //GR标签
int platsize = getPlatsizeOrHeight(size, 0); int platsize = getPlatsizeOrHeight(size, 0);
int height = getPlatsizeOrHeight(size, 1); int height = getPlatsizeOrHeight(size, 1);
Station station = new Station();
Station station = StationCacheUtil.getStation(name);
if (station == null) {
station = new Station();
}
station.setPlatsize(platsize); station.setPlatsize(platsize);
station.setHeight(height); station.setHeight(height);
station.setName(name); station.setName(name);
station.setGrLabel(grLabel); station.setGrLabel(grLabel);
station.setCurrentRfid(currentRfid);
station.setReelNum(Integer.valueOf(num)); station.setReelNum(Integer.valueOf(num));
StationCacheUtil.updateStation(station); StationCacheUtil.updateStation(station);
return ResultBean.newOkResult(""); return ResultBean.newOkResult("");
...@@ -140,7 +145,7 @@ public class WarehouseController { ...@@ -140,7 +145,7 @@ public class WarehouseController {
String name = paramMap.get("name"); String name = paramMap.get("name");
Station station = StationCacheUtil.getStation(name); Station station = StationCacheUtil.getStation(name);
if (station == null) { if (station == null) {
return ResultBean.newErrorResult(-1, "", "{}工位不存在", new String[]{name}); return ResultBean.newErrorResult(-1, "", name + "工位不存在", new String[]{});
} }
return ResultBean.newOkResult(station); return ResultBean.newOkResult(station);
} }
...@@ -162,20 +167,23 @@ public class WarehouseController { ...@@ -162,20 +167,23 @@ public class WarehouseController {
Station station = StationCacheUtil.getStation(name); Station station = StationCacheUtil.getStation(name);
String currentRfid = station.getCurrentRfid(); String currentRfid = station.getCurrentRfid();
if (station == null) { if (station == null) {
throw new ValidateException("smfcore.valueNotExist", "{}工位不存在", new String[]{name}); return ResultBean.newErrorResult(-1, "", name + "工位不存在", new String[]{});
} }
//先判断是否料盒 //先判断是否料盒
String newCodeStr = "=" + station.getPlatsize() + "x" + station.getHeight() + "=" + barcodeStr; String newCodeStr = "=" + station.getPlatsize() + "x" + station.getHeight() + "=" + barcodeStr;
CodeBean codeBean = codeResolve.resolveSingleCode(newCodeStr); CodeBean codeBean = codeResolve.resolveSingleCode(newCodeStr);
if (!codeBean.isValid()){
return ResultBean.newErrorResult(-1, "", code+"解析条码失败", new String[]{});
}
if (codeBean.isValid()) { if (codeBean.isValid()) {
Barcode barcode = codeBean.getBarcode(); Barcode barcode = codeBean.getBarcode();
String partNumber = barcode.getPartNumber(); String partNumber = barcode.getPartNumber();
//如果是箱子的话 则取下边的 //如果是箱子的话 则取下边的
if (partNumber.equals("CS") || partNumber.equals("CM") || partNumber.equals("CB") || partNumber.equals("CN")) { if (partNumber.equals("CS") || partNumber.equals("CM") || partNumber.equals("CB") || partNumber.equals("CN")) {
if (StringUtils.isBlank(currentRfid)) { if (StringUtils.isBlank(currentRfid)) {
throw new ValidateException("", "{}不存在", new String[]{currentRfid}); return ResultBean.newErrorResult(-1, "", "RFID不存在", new String[]{});
} else if (!currentRfid.startsWith(barcode.getBarcode())) { } else if (!currentRfid.startsWith(barcode.getBarcode())) {
throw new ValidateException("", "{}与{}不一致", new String[]{code, currentRfid}); return ResultBean.newErrorResult(-1, "", "RFID" + currentRfid + "与" + barcode.getBarcode() + "不一致", new String[]{});
} }
station.setLastScanBoxCode(code); station.setLastScanBoxCode(code);
StationCacheUtil.updateStation(station); StationCacheUtil.updateStation(station);
...@@ -213,26 +221,30 @@ public class WarehouseController { ...@@ -213,26 +221,30 @@ public class WarehouseController {
String code = paramMap.get("barcode"); //料箱条码 String code = paramMap.get("barcode"); //料箱条码
String name = paramMap.get("name"); //工位名称 String name = paramMap.get("name"); //工位名称
String cids = paramMap.get("cids"); //料仓cid String cids = paramMap.get("cids"); //料仓cid
cids = "so1131";
//校验是否存在 //校验是否存在
code = code.replace("A", "").replace("B", "").replace("-", "");
Barcode barcode = barcodeManager.findByBarcode(code); Barcode barcode = barcodeManager.findByBarcode(code);
if (barcode == null) { if (barcode == null) {
return ResultBean.newErrorResult(-1, "", barcode + "不存在", null); return ResultBean.newErrorResult(-1, "", code + "不存在", null);
} }
Station station = StationCacheUtil.getStation(name); Station station = StationCacheUtil.getStation(name);
if (station == null) { if (station == null) {
throw new ValidateException("", "{}工位不存在", new String[]{name}); return ResultBean.newErrorResult(-1, "", name + "工位不存在", new String[]{});
} }
//校验rfid是否一致 //校验rfid是否一致
String currentRfid = station.getCurrentRfid(); String currentRfid = station.getCurrentRfid();
if (StringUtils.isBlank(currentRfid)) { if (StringUtils.isBlank(currentRfid)) {
throw new ValidateException("", "{}不存在", new String[]{currentRfid}); return ResultBean.newErrorResult(-1, "", "RFID不存在", new String[]{});
} else if (!currentRfid.startsWith(barcode.getBarcode())) { } else if (!currentRfid.startsWith(barcode.getBarcode())) {
throw new ValidateException("", "{}与{}不一致", new String[]{code, currentRfid}); return ResultBean.newErrorResult(-1, "", "RFID" + currentRfid + "与" + barcode.getBarcode() + "不一致", new String[]{});
} }
//先找可用料仓 //先找可用料仓
if (StringUtils.isBlank(cids)) { if (StringUtils.isBlank(cids)) {
throw new ValidateException("", "{}不存在", new String[]{cids}); return ResultBean.newErrorResult(-1, "", "料仓不存在", new String[]{});
} }
List<Storage> storageList = Lists.newArrayList(); List<Storage> storageList = Lists.newArrayList();
List<String> cidList = Lists.newArrayList(); List<String> cidList = Lists.newArrayList();
...@@ -251,7 +263,7 @@ public class WarehouseController { ...@@ -251,7 +263,7 @@ public class WarehouseController {
} }
} }
if (storageList.isEmpty()) { if (storageList.isEmpty()) {
throw new ValidateException("", "料仓不存在", null); return ResultBean.newErrorResult(-1, "", "料仓不存在", new String[]{});
} }
//判断是否有出入库任务 //判断是否有出入库任务
for (DataLog dataLog : taskService.getQueueTasks()) { for (DataLog dataLog : taskService.getQueueTasks()) {
...@@ -260,10 +272,10 @@ public class WarehouseController { ...@@ -260,10 +272,10 @@ public class WarehouseController {
if (dataLog.getBarcode().equals(barcode.getBarcode())) { if (dataLog.getBarcode().equals(barcode.getBarcode())) {
if (dataLog.isPutInTask()) { if (dataLog.isPutInTask()) {
//已有入库任务 //已有入库任务
throw new ValidateException("", "物料[" + dataLog.getBarcode() + "]已有入库任务,需继续执行入库动作", null); return ResultBean.newErrorResult(-1, "", "物料[" + dataLog.getBarcode() + "]已有入库任务,需继续执行入库动作", new String[]{});
} else { } else {
//已有出库任务 //已有出库任务
throw new ValidateException("", "物料[" + dataLog.getBarcode() + "]已有出库任务,需继续执行出库动作", null); return ResultBean.newErrorResult(-1, "", "物料[" + dataLog.getBarcode() + "]已有出库任务,需继续执行出库动作", new String[]{});
} }
} }
} }
...@@ -290,7 +302,7 @@ public class WarehouseController { ...@@ -290,7 +302,7 @@ public class WarehouseController {
reelLocInfo.setLockPosId(pos.getId()); reelLocInfo.setLockPosId(pos.getId());
reelLocInfo = ReelLockPosUtil.addReelLockPosInfo(reelLocInfo, cidList); reelLocInfo = ReelLockPosUtil.addReelLockPosInfo(reelLocInfo, cidList);
if (reelLocInfo == null) { if (reelLocInfo == null) {
throw new ValidateException("", "[" + barcode.getBarcode() + "]库位[" + reelLocInfo.getLockPosName() + "]已被锁定,暂停入库", null); return ResultBean.newErrorResult(-1, "", "[" + barcode.getBarcode() + "]库位[" + reelLocInfo.getLockPosName() + "]已被锁定,暂停入库", new String[]{});
} }
} }
//生成任务 //生成任务
...@@ -307,6 +319,9 @@ public class WarehouseController { ...@@ -307,6 +319,9 @@ public class WarehouseController {
public ResultBean finishBoxOut(@RequestBody Map<String, String> paramMap) { public ResultBean finishBoxOut(@RequestBody Map<String, String> paramMap) {
String code = paramMap.get("barcode"); String code = paramMap.get("barcode");
Barcode barcode = barcodeManager.findByBarcode(code); Barcode barcode = barcodeManager.findByBarcode(code);
if (barcode == null) {
return ResultBean.newErrorResult(-1, "", code + "物料不存在", new String[]{});
}
int amount = barcode.getAmount(); int amount = barcode.getAmount();
barcode.setAmount(amount - 1); barcode.setAmount(amount - 1);
Barcode pidBarcode = barcodeManager.get(barcode.getHostBarcodeId()); Barcode pidBarcode = barcodeManager.get(barcode.getHostBarcodeId());
...@@ -314,6 +329,32 @@ public class WarehouseController { ...@@ -314,6 +329,32 @@ public class WarehouseController {
return ResultBean.newOkResult(""); return ResultBean.newOkResult("");
} }
@ApiOperation("出库页面展示")
@RequestMapping("/outIndex")
public ResultBean outIndex(@RequestBody Map<String, String> paramMap) {
String barcode = paramMap.get("barcode"); //料箱barcode
Query query = new Query();
Pattern pattern = Pattern.compile("^.*" + barcode + ".*$", Pattern.CASE_INSENSITIVE);
Criteria criteria = Criteria.where("posName").regex(pattern);
List<Barcode> barcodes = barcodeManager.findByQuery(query.addCriteria(criteria));
List<Map<String, String>> results = new ArrayList<>();
if (barcodes != null && !barcodes.isEmpty()) {
Map<String, List<Barcode>> barcodesPosNameMap = barcodes.stream().collect(Collectors.groupingBy(Barcode::getPosName));
for (Map.Entry<String, List<Barcode>> barcodePosNameMap : barcodesPosNameMap.entrySet()) {
Map<String, String> resultMap = new HashMap<>();
String posName = barcodePosNameMap.getKey();
List<Barcode> barcodePosNames = barcodePosNameMap.getValue();
resultMap.put("posName", posName);
resultMap.put("posNameSize", barcodePosNames.size() + "");
results.add(resultMap);
}
}
return ResultBean.newOkResult(results);
}
private void generateTask(Storage storage, Barcode barcode, StoragePos pos, int type, String status, String loc) { private void generateTask(Storage storage, Barcode barcode, StoragePos pos, int type, String status, String loc) {
//开始入库任务 //开始入库任务
DataLog task = new DataLog(storage, barcode, pos); DataLog task = new DataLog(storage, barcode, pos);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!