diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java index 0832349e9..8b49f8fc6 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java @@ -945,7 +945,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic luceneExecuteLogService.deviceExecuteLog(logDto); } - } else if (phase == 0x77) { + } else if (phase == 0x4D) { if (agvaddr == 0) { agvaddr = agvaddr_copy; } @@ -1014,88 +1014,89 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } - } else if (ObjectUtil.isNotEmpty(start_device_code) && StrUtil.equals(device_code, next_device_code)) { - if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { - manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); + } + } else if (ObjectUtil.isNotEmpty(start_device_code) && StrUtil.equals(device_code, next_device_code)) { + if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { + manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); - try { - manipulatorAgvStationDeviceDriver.writing(4); - } catch (Exception e) { - e.printStackTrace(); - } - if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(this.getDeviceCode()) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(this.getDeviceCode()) - .content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1") - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } + try { + manipulatorAgvStationDeviceDriver.writing(4); + } catch (Exception e) { + e.printStackTrace(); } - } else if (ObjectUtil.isNotEmpty(start_device_code) && StrUtil.equals(device_code, start_device_code2)) { - if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { - manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); - - try { - manipulatorAgvStationDeviceDriver.writing(4); - } catch (Exception e) { - e.printStackTrace(); - } - if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(this.getDeviceCode()) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(this.getDeviceCode()) - .content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1") - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - } - } else if (ObjectUtil.isNotEmpty(start_device_code) && StrUtil.equals(device_code, next_device_code2)) { - if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { - manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); - - try { - manipulatorAgvStationDeviceDriver.writing(2); - } catch (Exception e) { - e.printStackTrace(); - } - if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(this.getDeviceCode()) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(this.getDeviceCode()) - .content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1") - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } + if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } + } else if (ObjectUtil.isNotEmpty(start_device_code) && StrUtil.equals(device_code, start_device_code2)) { + if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { + manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); + + try { + manipulatorAgvStationDeviceDriver.writing(4); + } catch (Exception e) { + e.printStackTrace(); + } + if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } + } else if (ObjectUtil.isNotEmpty(start_device_code) && StrUtil.equals(device_code, next_device_code2)) { + if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { + manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); + + try { + manipulatorAgvStationDeviceDriver.writing(2); + } catch (Exception e) { + e.printStackTrace(); + } + if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } + } // else { // data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); // LuceneLogDto logDto = LuceneLogDto.builder() @@ -1105,7 +1106,6 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic // logDto.setLog_level(4); // luceneExecuteLogService.deviceExecuteLog(logDto); // } - } } // 取货完毕 diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java index d4c453b01..578e70d14 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java @@ -325,7 +325,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i if (ObjectUtil.isEmpty(putDeviceCodeList)) { putDeviceCodeList = this.getExtraDeviceCodes("put_device_code"); } - if(CollUtil.isEmpty(getDeviceCodeList) || getDeviceCodeList.size() == 0){ + if (CollUtil.isEmpty(getDeviceCodeList) || getDeviceCodeList.size() == 0) { notCreateInstMessage = "未设置取货点"; } TaskDto task = null; @@ -702,6 +702,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextdevice.getDeviceDriver(); hongXiangConveyorDeviceDriver.writing("to_close_door", "1"); } + /** * 判断经过的烘箱是否关门 */ @@ -875,6 +876,9 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver; if (device.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) device.getDeviceDriver(); +// EXECUTOR.submit(() -> { + toOpenDoor(device); +// }); int mode = hongXiangConveyorDeviceDriver.getMode(); int door = hongXiangConveyorDeviceDriver.getDoor(); int action = hongXiangConveyorDeviceDriver.getAction(); @@ -914,19 +918,19 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } } } else { - feedMessage = "行架机械手:"; - if (mode != 3) { - feedMessage = feedMessage + "工作模式(mode)不为运行中状态,"; - } - if (action != 1) { - feedMessage = feedMessage + "动作信号(action)不为取货中状态,"; - } - if (move != 0) { - feedMessage = feedMessage + "光电信号(move)不为无货状态,"; - } - if (task == 0) { - feedMessage = feedMessage + "当前上报任务号(task)不应该为0。"; - } + feedMessage = "行架机械手:"; + if (mode != 3) { + feedMessage = feedMessage + "工作模式(mode)不为运行中状态,"; + } + if (action != 1) { + feedMessage = feedMessage + "动作信号(action)不为取货中状态,"; + } + if (move != 0) { + feedMessage = feedMessage + "光电信号(move)不为无货状态,"; + } + if (task == 0) { + feedMessage = feedMessage + "当前上报任务号(task)不应该为0。"; + } } //取货完成关闭烘箱门 @@ -941,12 +945,43 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i EXECUTOR.execute(() -> { toCloseDoor(device); }); + int mode = hongXiangConveyorDeviceDriver.getMode(); + int door = hongXiangConveyorDeviceDriver.getDoor(); + int action = hongXiangConveyorDeviceDriver.getAction(); + int error1 = hongXiangConveyorDeviceDriver.getError1(); + int error = hongXiangConveyorDeviceDriver.getError(); + int move = hongXiangConveyorDeviceDriver.getMove(); + if (mode == 1 && door == 2 && action == 2 && error == 0 && error1 == 0 && move == 0) { + map.put("code", "to_command"); + map.put("value", "3"); + list.add(map); + this.writing(list); + this.setRequireActionSucess(true); + } else { + feedMessage = "烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code(); + if (mode != 1) { + feedMessage = feedMessage + "工作模式(mode)信号未联机,"; + } + if (door != 2) { + feedMessage = feedMessage + "门状态(door)信号未关门,"; + } + if (action != 1) { + feedMessage = feedMessage + "允许取放(action)信号未允许取放,"; + } + if (move != 0) { + feedMessage = feedMessage + "取货位光电信号(move)不应该为有货状态,"; + } + if (error1 != 0) { + feedMessage = feedMessage + "故障(error1)信号出现故障,故障值:" + error1 + "。"; + } + } + } else { + map.put("code", "to_command"); + map.put("value", "3"); + list.add(map); + this.writing(list); + this.setRequireActionSucess(true); } - map.put("code", "to_command"); - map.put("value", "3"); - list.add(map); - this.writing(list); - this.setRequireActionSucess(true); } } else { feedMessage = "行架机械手:"; @@ -973,6 +1008,9 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; if (nextDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextDevice.getDeviceDriver(); +// EXECUTOR.submit(() -> { + toOpenDoor(nextDevice); +// }); int mode = hongXiangConveyorDeviceDriver.getMode(); int door = hongXiangConveyorDeviceDriver.getDoor(); int action = hongXiangConveyorDeviceDriver.getAction(); @@ -1052,60 +1090,96 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i map.put("to_time_min", String.valueOf(minutes)); hongXiangConveyorDeviceDriver.writing(map); } - } - - if (nextDevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver||nextDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { - if (!StrUtil.startWith(taskDto.getTask_code(), "-")) { - if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("link_three_lamp"))) { - String lamp = nextDevice.getExtraValue().get("link_three_lamp").toString(); - Device lampDevice = deviceAppService.findDeviceByCode(lamp); - if (ObjectUtil.isEmpty(lampDevice)) { - return; - } - if (lampDevice.getDeviceDriver() instanceof LampThreecolorDeviceDriver) { - lampThreecolorDeviceDriver = (LampThreecolorDeviceDriver) lampDevice.getDeviceDriver(); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(lampDevice.getDeviceDriver().getDeviceCode()) - .content("下发报警灯" + lamp + "报警信号") - .build(); - logDto.setLog_level(3); - luceneExecuteLogService.deviceExecuteLog(logDto); - lampThreecolorDeviceDriver.writing("to_command", "1"); - } + int mode = hongXiangConveyorDeviceDriver.getMode(); + int door = hongXiangConveyorDeviceDriver.getDoor(); + int action = hongXiangConveyorDeviceDriver.getAction(); + int error1 = hongXiangConveyorDeviceDriver.getError1(); + int error = hongXiangConveyorDeviceDriver.getError(); + int move = hongXiangConveyorDeviceDriver.getMove(); + if (mode == 1 && door == 2 && action == 2 && error == 0 && error1 == 0 && move == 1) { + map.put("code", "to_command"); + map.put("value", "5"); + list.add(map); + this.writing(list); + this.setRequireActionSucess(true); + try { + finish_instruction(inst2); + } catch (Exception e) { + e.printStackTrace(); + } + feedMessage = ""; + } else { + feedMessage = "烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code(); + if (mode != 1) { + feedMessage = feedMessage + "工作模式(mode)信号未联机,"; + } + if (door != 2) { + feedMessage = feedMessage + "门状态(door)信号未关门,"; + } + if (action != 1) { + feedMessage = feedMessage + "允许取放(action)信号未允许取放,"; + } + if (move != 1) { + feedMessage = feedMessage + "放货位光电信号不应该为无货状态"; + } + if (error1 != 0) { + feedMessage = feedMessage + "故障(error1)信号出现故障。"; } } + } else { + map.put("code", "to_command"); + map.put("value", "5"); + list.add(map); + this.writing(list); + this.setRequireActionSucess(true); + try { + finish_instruction(inst2); + } catch (Exception e) { + e.printStackTrace(); + } + feedMessage = ""; + } +// if (nextDevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver||nextDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { +// if (!StrUtil.startWith(taskDto.getTask_code(), "-")) { +// if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("link_three_lamp"))) { +// String lamp = nextDevice.getExtraValue().get("link_three_lamp").toString(); +// Device lampDevice = deviceAppService.findDeviceByCode(lamp); +// if (ObjectUtil.isEmpty(lampDevice)) { +// return; +// } +// if (lampDevice.getDeviceDriver() instanceof LampThreecolorDeviceDriver) { +// lampThreecolorDeviceDriver = (LampThreecolorDeviceDriver) lampDevice.getDeviceDriver(); +// LuceneLogDto logDto = LuceneLogDto.builder() +// .device_code(lampDevice.getDeviceDriver().getDeviceCode()) +// .content("下发报警灯" + lamp + "报警信号") +// .build(); +// logDto.setLog_level(3); +// luceneExecuteLogService.deviceExecuteLog(logDto); +// lampThreecolorDeviceDriver.writing("to_command", "1"); +// } +// } +// } +// } - map.put("code", "to_command"); - map.put("value", "5"); - list.add(map); - this.writing(list); - this.setRequireActionSucess(true); - try { - finish_instruction(inst2); - } catch (Exception e) { - e.printStackTrace(); - } - feedMessage = ""; } - } } else { - feedMessage = "行架机械手:"; - if (mode != 3) { - feedMessage = feedMessage + "工作模式(mode)不为运行中状态,"; - } - if (action != 4) { - feedMessage = feedMessage + "动作信号(action)不为放货完成状态,"; - } - if (move != 0) { - feedMessage = feedMessage + "光电信号(move)不为无货状态,"; - } - if (task == 0) { - feedMessage = feedMessage + "当前上报任务号(task)不应该为0。"; - } + feedMessage = "行架机械手:"; + if (mode != 3) { + feedMessage = feedMessage + "工作模式(mode)不为运行中状态,"; + } + if (action != 4) { + feedMessage = feedMessage + "动作信号(action)不为放货完成状态,"; + } + if (move != 0) { + feedMessage = feedMessage + "光电信号(move)不为无货状态,"; + } + if (task == 0) { + feedMessage = feedMessage + "当前上报任务号(task)不应该为0。"; + } + } } } - } public synchronized boolean finish_instruction(Instruction inst) throws Exception { instructionService.finish(inst); @@ -1153,8 +1227,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i this.setMessage("信号连接异常!"); } String requireActionSucess = LangProcess.msg("universal_directives") + ":" + LangProcess.msg("universal_actionMessage4"); - if(this.requireActionSucess){ - requireActionSucess = LangProcess.msg("universal_directives") + ":" + LangProcess.msg("universal_actionMessage5"); + if (this.requireActionSucess) { + requireActionSucess = LangProcess.msg("universal_directives") + ":" + LangProcess.msg("universal_actionMessage5"); } map.put("device_name", this.getDevice().getDevice_name()); map.put("mode", mode); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java index 01c526ee6..d6a37a495 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java @@ -479,15 +479,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { luceneLogService.interfaceExecuteLog(luceneLogDto); } catch (Exception e) { JSONObject jsonObject = JSONObject.parseObject(result); - log.info("向lms申请套管工位请求----返回参数{}", result); + log.info("向lms申请套管工位请求----返回参数{}", e.getMessage()); applyPlugPullSitResponse = JSONObject.toJavaObject(jsonObject, ApplyPlugPullSitResponse.class); LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyPlugPullSiteRequest", String.valueOf(applyPlugPullSitResponse.getstatus()), - JSON.toJSONString(param), String.valueOf(result), "ACS向LMS申请失败"); + JSON.toJSONString(param), String.valueOf(result), "向lms申请套管工位请求失败"); luceneLogService.interfaceExecuteLog(luceneLogDto); - JSONObject map = new JSONObject(); - map.put("status", 400); - map.put("message", e.getMessage()); - return JSONObject.toJavaObject(map, ApplyPlugPullSitResponse.class); } } @@ -517,12 +513,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { log.info("向LMS反馈子卷重量----返回参数{}", result); applyfeedbackSubVolumeWeightResponse = JSONObject.toJavaObject(jsonObject, ApplyfeedbackSubVolumeWeightResponse.class); } catch (Exception e) { + String message = e.getMessage(); JSONObject jsonObject = JSONObject.parseObject(result); log.info("向LMS反馈子卷重量----返回参数{}", result); - JSONObject map = new JSONObject(); - map.put("status", 400); - map.put("message", e.getMessage()); - return JSONObject.toJavaObject(map, ApplyfeedbackSubVolumeWeightResponse.class); + applyfeedbackSubVolumeWeightResponse = JSONObject.toJavaObject(jsonObject, ApplyfeedbackSubVolumeWeightResponse.class); + LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyManipulatorAction", String.valueOf(applyfeedbackSubVolumeWeightResponse.getCode()), + JSON.toJSONString(param), message, "向LMS反馈子卷重量"); + luceneLogService.interfaceExecuteLog(luceneLogDto); } LuceneLogDto luceneLogDto = new LuceneLogDto(4,"applyfeedbackSubVolumeWeightRequest", String.valueOf(applyfeedbackSubVolumeWeightResponse.getCode()), JSON.toJSONString(param), String.valueOf(applyfeedbackSubVolumeWeightResponse.getMessage()), "ACS反馈LMS子卷重量"); @@ -550,16 +547,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { log.info("RGV工位上有货申请行架任务----返回参数{}", result); applyManipulatorActionResponse = JSONObject.toJavaObject(jsonObject, ApplyManipulatorActionResponse.class); } catch (Exception e) { + String message = e.getMessage(); JSONObject jsonObject = JSONObject.parseObject(result); log.info("RGV工位上有货申请行架任务----返回参数{}", result); applyManipulatorActionResponse = JSONObject.toJavaObject(jsonObject, ApplyManipulatorActionResponse.class); LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyManipulatorAction", String.valueOf(applyManipulatorActionResponse.getCode()), - JSON.toJSONString(param), String.valueOf(applyManipulatorActionResponse), "RGV工位上有货申请行架任务失败"); + JSON.toJSONString(param), message, "RGV工位上有货申请行架任务失败"); luceneLogService.interfaceExecuteLog(luceneLogDto); - JSONObject map = new JSONObject(); - map.put("status", 400); - map.put("message", e.getMessage()); - return JSONObject.toJavaObject(map, ApplyManipulatorActionResponse.class); } LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyManipulatorAction", String.valueOf(applyManipulatorActionResponse.getCode()), JSON.toJSONString(param), String.valueOf(applyManipulatorActionResponse), "RGV工位上有货申请行架任务"); @@ -692,11 +686,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("actionFinishRequest2"); String url = wmsurl + addressDto.getMethods_url(); - log.info("actionFinishRequest2 - 设备工位取货完成反馈{}", jsonObject); - LuceneLogDto luceneLogDto = new LuceneLogDto(4,"actionFinishRequest2", "", - String.valueOf(jsonObject), - "", jsonObject.getString("task_code") + "设备工位取货完成反馈"); - luceneLogService.interfaceExecuteLog(luceneLogDto); try { execute = HttpRequest.post(url) .body(String.valueOf(jsonObject)) @@ -705,7 +694,16 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { String msg = e.getMessage(); log.info("feedbackDie-----输出参数{}", msg); //网络不通 + LuceneLogDto luceneLogDto1 = new LuceneLogDto(4,"actionFinishRequest2", String.valueOf(execute.getStatus()), + String.valueOf(jsonObject), + String.valueOf(execute.body()), jsonObject.getString("task_code") + "设备工位取货完成反馈失败"); + luceneLogService.interfaceExecuteLog(luceneLogDto1); } + log.info("actionFinishRequest2 - 设备工位取货完成反馈{}", jsonObject); + LuceneLogDto luceneLogDto = new LuceneLogDto(4,"actionFinishRequest2", "", + String.valueOf(jsonObject), + "", jsonObject.getString("task_code") + "设备工位取货完成反馈"); + luceneLogService.interfaceExecuteLog(luceneLogDto); } catch (Exception e) { LuceneLogDto luceneLogDto = new LuceneLogDto(4,"actionFinishRequest2", String.valueOf(execute.getStatus()), JSON.toJSONString(execute.body()), diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index 65f143594..4e674c810 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -499,12 +499,12 @@ public class InstructionServiceImpl extends CommonServiceImpl findByNextCode(String next_code) { - List instructionList = instructions.stream().filter(item -> item.getNext_device_code().equals(next_code) ).collect(Collectors.toList()); + List instructionList = instructions.stream().filter(item -> item.getNext_device_code().equals(next_code)).collect(Collectors.toList()); return instructionList; } @@ -1949,11 +1965,11 @@ public class InstructionServiceImpl extends CommonServiceImpl findReadyIns() { - //根据时间升序取第一个 - List instructionsList = instructions.stream() - .filter(item -> StrUtil.equals(item.getInstruction_type(), TaskTypeEnum.Truss_Task.getIndex()) - && StrUtil.equals(item.getInstruction_status(), TaskStatusEnum.READY.getIndex())).collect(Collectors.toList()); - return instructionsList; + //根据时间升序取第一个 + List instructionsList = instructions.stream() + .filter(item -> StrUtil.equals(item.getInstruction_type(), TaskTypeEnum.Truss_Task.getIndex()) + && StrUtil.equals(item.getInstruction_status(), TaskStatusEnum.READY.getIndex())).collect(Collectors.toList()); + return instructionsList; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java index fd7a48ad5..dce19578c 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java @@ -236,7 +236,7 @@ public class TaskServiceImpl extends CommonServiceImpl impleme } @Override - public Map queryAll( Map whereJson, Pageable page) { + public Map queryAll(Map whereJson, Pageable page) { String task_code = (String) whereJson.get("task_code"); String vehicle_code = (String) whereJson.get("vehicle_code"); @@ -977,6 +977,29 @@ public class TaskServiceImpl extends CommonServiceImpl impleme instdto.setStart_height(start_height); instdto.setNext_height(next_height); instdto.setAgv_action_type(acsTask.getAgv_action_type()); + if (StrUtil.equals(agv_system_type, CommonFinalParam.TWO)) { + // task_type + //1、生箔; Itype=1:取空,取满,放空,放满; + //2、分切 Itype=3取满、取空、放满、放空; + //3、普通任务 Itype=2:取货、放货; + //4、叉车任务 + //5、输送任务 + //6、行架 + //7、立库 + if (StrUtil.equals(task_type, CommonFinalParam.ONE)) { + instdto.setAgv_inst_type(CommonFinalParam.ONE); + } else if (StrUtil.equals(task_type, "3")) { + instdto.setAgv_inst_type("2"); + } else if (StrUtil.equals(task_type, "2")) { + instdto.setAgv_inst_type("3"); + } else if (StrUtil.equals(task_type, "8")) { + instdto.setAgv_inst_type("2"); + } else { + log.info("未找到对应的AGV指令类型,任务号:" + acsTask.getTask_code() + ",task_type:" + acsTask.getTask_type()); + } + } else { + instdto.setAgv_inst_type("4"); + } instructionservice.create2(instdto); acsTask.setTask_status(CommonFinalParam.ONE); this.update(acsTask); @@ -1633,17 +1656,7 @@ public class TaskServiceImpl extends CommonServiceImpl impleme JSONArray ja = new JSONArray(); ja.add(feed_jo); //TODO 有需要根据上位系统反馈的信息再做进一步处理 - - CompletableFuture.runAsync(() -> { - acstowmsService.feedTaskStatus(ja); - // 异步更新指令状态 - try { - } catch (Exception e) { - e.printStackTrace(); - } - }); - - + acstowmsService.feedTaskStatus(ja); } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/service/dto/LuceneLogDto.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/service/dto/LuceneLogDto.java index e456df43e..28ba5196a 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/service/dto/LuceneLogDto.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/service/dto/LuceneLogDto.java @@ -88,6 +88,8 @@ public class LuceneLogDto { + home; } + + public LuceneLogDto(final Integer log_level,final String method, final String status, final String requestparam, final String responseparam, final String content) { super(); diff --git a/acs2/nladmin-ui/src/views/monitor/logQuery/search.vue b/acs2/nladmin-ui/src/views/monitor/logQuery/search.vue index 269e34814..5e659c22f 100644 --- a/acs2/nladmin-ui/src/views/monitor/logQuery/search.vue +++ b/acs2/nladmin-ui/src/views/monitor/logQuery/search.vue @@ -18,7 +18,7 @@ style="width: 200px" @change="crud.toQuery" > - +