diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java index 5621b9ccf..0234fdf5a 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java @@ -252,10 +252,10 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { e.printStackTrace(); } if (standardAutodoorDeviceDriver.getOpen() == 1 && standardAutodoorDeviceDriver.getToOpen() == 1) { - log.info("下发开门信号值为:{},下发关门信号值为:{}", standardAutodoorDeviceDriver.getToOpen(), standardAutodoorDeviceDriver.getToClose()); + log.info("下发开门信号值为:{},读取开门信号值为:{}", standardAutodoorDeviceDriver.getToOpen(), standardAutodoorDeviceDriver.getOpen()); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); } else { - log.info("未下发NDC信号原因: 下发开门信号值为:{},下发关门信号值为:{}", standardAutodoorDeviceDriver.getToOpen(), standardAutodoorDeviceDriver.getToClose()); + log.info("未下发NDC信号原因: 下发开门信号值为:{},读取开门信号值为:{}", standardAutodoorDeviceDriver.getToOpen(), standardAutodoorDeviceDriver.getToClose()); } } // } 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 2957b8233..666a1c7cf 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 @@ -131,12 +131,6 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic // message = "该指令号未找到对应指令:" + ikey; // logServer.deviceExecuteLog(this.device_code, "", "", "该指令号未找到对应指令:" + ikey); // return; - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("当前指令号为:" + inst.getInstruction_code()) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); task = taskService.findByTaskCode(inst.getTask_code()); } else { LuceneLogDto logDto = LuceneLogDto.builder() @@ -194,12 +188,6 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } inst.setCarno(String.valueOf(carno)); instructionService.update(inst); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); } //到达取货点 //(Itype=1/2/3,需要WCS反馈Phase) @@ -257,15 +245,15 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic log.info("当前任务号{},创建任务号{}", task.getTask_code(), task_code); if (StrUtil.isEmpty(task_code) || !task_code.equals(task.getTask_code())) { LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("任务号为空") .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -276,16 +264,16 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic message = "等待LMS系统进行确认允许取货,设备号:" + device_code + ",指令号:" + ikey; logServer.deviceExecuteLog(this.device_code, "", "", "等待LMS系统进行确认允许取货,设备号" + device.getDevice_code() + ",指令号" + ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("等待LMS系统进行确认允许取货,设备号" + device.getDevice_code() + ",指令号" + ikey) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -293,7 +281,6 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); - try { standardInspectSiteDeviceDriver.writing(1); } catch (Exception e) { @@ -301,19 +288,17 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if ((standardInspectSiteDeviceDriver.getMove() == 1 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, standardInspectSiteDeviceDriver.getMove(), standardInspectSiteDeviceDriver.getAction() - , standardInspectSiteDeviceDriver.getError(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); @@ -328,18 +313,18 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } else { - message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; + message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "行架不允许取货条件"; log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); @@ -353,19 +338,17 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if (hongXiangStationDeviceDriver.getMove() > 0) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } else { - message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() - , hongXiangStationDeviceDriver.getError(), ikey); + message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + "无货不满足取货条件"; LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); @@ -380,19 +363,17 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if (paperTubePickSiteDeviceDriver.getAction() == 1 && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() - , paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); @@ -463,9 +444,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic Map map = new LinkedHashMap<>(); map.put("to_command", "2"); wasteFoilWeighingStationDriver.writing(map); - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -475,19 +456,17 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } } else { message = "设备号:" + device_code + "光电信号:" + wasteFoilWeighingStationDriver.getMove() + ",动作信号:" + wasteFoilWeighingStationDriver.getAction() + "报警信号:" + wasteFoilWeighingStationDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, wasteFoilWeighingStationDriver.getMove(), wasteFoilWeighingStationDriver.getAction() - , wasteFoilWeighingStationDriver.getError(), wasteFoilWeighingStationDriver.getMode(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -503,7 +482,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if (agvaddr < 1) { LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agv地址参数有误,phase:" + phase) .build(); logDto.setLog_level(2); @@ -529,7 +508,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic if (ObjectUtil.isEmpty(device_code)) { log.info(agvaddr + "对应设备号为空!"); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("对应设备号为空" + device_code) .build(); logDto.setLog_level(4); @@ -551,17 +530,17 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic && StrUtil.equals("true", this.device.getExtraValue().get("wait").toString()) && StrUtil.equals(task.getTask_type(), "1")) { standardOrdinarySiteDeviceDriver.setOption(0); - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -573,12 +552,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) { JSONObject jsonObject = new JSONObject(); jsonObject.put("task_code", task_code); - LuceneLogDto logDto = LuceneLogDto.builder() + LuceneLogDto logDto1 = LuceneLogDto.builder() .device_code(standardOrdinarySiteDeviceDriver.getDevice_code()) .content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + standardOrdinarySiteDeviceDriver.getDeviceCode()) .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); acsToWmsService.actionFinishRequest2(jsonObject); } }); @@ -590,9 +569,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } catch (Exception e) { e.printStackTrace(); } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -620,19 +599,17 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if (hongXiangStationDeviceDriver.getMove() > 0) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } else { - message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() - , hongXiangStationDeviceDriver.getError(), ikey); + message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",指令号:" + ikey + "不满足取货条件"; LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); @@ -647,19 +624,17 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if (paperTubePickSiteDeviceDriver.getAction() == 1 && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货完成反馈,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() - , paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); @@ -674,19 +649,17 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if ((standardInspectSiteDeviceDriver.getMove() != 1 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, standardInspectSiteDeviceDriver.getMove(), standardInspectSiteDeviceDriver.getAction() - , standardInspectSiteDeviceDriver.getError(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); @@ -700,9 +673,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic Map map = new LinkedHashMap<>(); map.put("to_command", "3"); wasteFoilWeighingStationDriver.writing(map); - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -712,19 +685,17 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } } else { message = "设备号:" + device_code + "光电信号:" + wasteFoilWeighingStationDriver.getMove() + ",动作信号:" + wasteFoilWeighingStationDriver.getAction() + "报警信号:" + wasteFoilWeighingStationDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, wasteFoilWeighingStationDriver.getMove(), wasteFoilWeighingStationDriver.getAction() - , wasteFoilWeighingStationDriver.getError(), wasteFoilWeighingStationDriver.getMode(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -774,159 +745,151 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } String agv_inst_type = inst.getAgv_inst_type(); - if (StrUtil.equals(agv_inst_type, CommonFinalParam.ONE) || StrUtil.equals(agv_inst_type, "3")) { - if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { - standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); - standardOrdinarySiteDeviceDriver.setAgvphase(phase); - if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait")) - && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())) { - if (standardOrdinarySiteDeviceDriver.getOption() == 1) { - standardOrdinarySiteDeviceDriver.setAgvphase(0); - String task_code = standardOrdinarySiteDeviceDriver.getTask_code(); - log.info("当前任务号{},创建任务号{}", task.getTask_code(), task_code); - if (StrUtil.isEmpty(task_code) || !task_code.equals(task.getTask_code())) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("任务号为空!") - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - } else { - log.info("等待LMS系统进行确认允许取货,设备号{},指令号{}", device_code, ikey); - message = "等待LMS系统进行确认允许取货,设备号:" + device_code + ",指令号:" + ikey; - logServer.deviceExecuteLog(this.device_code, "", "", "等待LMS系统进行确认允许取货,设备号" + device.getDevice_code()); + if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { + standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); + standardOrdinarySiteDeviceDriver.setAgvphase(phase); + if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait")) + && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())) { + if (standardOrdinarySiteDeviceDriver.getOption() == 1) { + standardOrdinarySiteDeviceDriver.setAgvphase(0); + String task_code = standardOrdinarySiteDeviceDriver.getTask_code(); + log.info("当前任务号{},创建任务号{}", task.getTask_code(), task_code); + if (StrUtil.isEmpty(task_code) || !task_code.equals(task.getTask_code())) { LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(message) + .device_code(this.getDeviceCode()) + .content("任务号为空!") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + 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 { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + log.info("等待LMS系统进行确认允许取货,设备号{},指令号{}", device_code, ikey); + message = "等待LMS系统进行确认允许取货,设备号:" + device_code + ",指令号:" + ikey; + logServer.deviceExecuteLog(this.device_code, "", "", "等待LMS系统进行确认允许取货,设备号" + device.getDevice_code()); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) + .device_code(this.getDeviceCode()) + .content(message) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } - } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { - manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); + } else { + 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 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(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1") - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { - paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); - try { - paperTubePickSiteDeviceDriver.writing(2); - } catch (Exception e) { - e.printStackTrace(); - } - if (paperTubePickSiteDeviceDriver.getAction() == 1 - && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() - , paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(message) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { - hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); - try { - hongXiangStationDeviceDriver.writing(1); - } catch (Exception e) { - e.printStackTrace(); - } - if (hongXiangStationDeviceDriver.getMove() > 0) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() - , hongXiangStationDeviceDriver.getError(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(message) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { - standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) 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 if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { + paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); + try { + paperTubePickSiteDeviceDriver.writing(2); + } catch (Exception e) { + e.printStackTrace(); + } + if (paperTubePickSiteDeviceDriver.getAction() == 1 + && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { + 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 + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { + hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); + try { + hongXiangStationDeviceDriver.writing(1); + } catch (Exception e) { + e.printStackTrace(); + } + if (hongXiangStationDeviceDriver.getMove() > 0) { + 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 + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { + standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); - try { - standardInspectSiteDeviceDriver.writing(1); - } catch (Exception e) { - e.printStackTrace(); - } - if ((standardInspectSiteDeviceDriver.getMove() == 1 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, standardInspectSiteDeviceDriver.getMove(), standardInspectSiteDeviceDriver.getAction() - , standardInspectSiteDeviceDriver.getError(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(message) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - }/* else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) { + try { + standardInspectSiteDeviceDriver.writing(1); + } catch (Exception e) { + e.printStackTrace(); + } + if ((standardInspectSiteDeviceDriver.getMove() == 1 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) { + 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 + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + }/* else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) { rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver(); ISysParamService paramService = SpringContextHolder.getBean(ISysParamService.class); String device_code1 = device.getDevice_code(); @@ -978,15 +941,15 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic log.info("设备{},偏移数据出错导致未反馈{},指令号{}", device_code, rangingStationsDeviceDriver.getLength1() + "," + rangingStationsDeviceDriver.getLength2(), ikey); } }*/ else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } + } // 取货完毕 //(Itype=1、3,需要WCS反馈) @@ -1028,137 +991,128 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic return; } String agv_inst_type = inst.getAgv_inst_type(); - if (StrUtil.equals(agv_inst_type, CommonFinalParam.ONE) || StrUtil.equals(agv_inst_type, "3")) { - if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { - standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); - if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait")) - && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())) { - standardOrdinarySiteDeviceDriver.setOption(0); - } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - standardOrdinarySiteDeviceDriver.setAgvphase(phase); - standardOrdinarySiteDeviceDriver.setIndex(index); - standardOrdinarySiteDeviceDriver.setInst(inst); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - - } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { - hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); - try { - hongXiangStationDeviceDriver.writing(0); - } catch (Exception e) { - e.printStackTrace(); - } - if (hongXiangStationDeviceDriver.getMove() == 0) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() - , hongXiangStationDeviceDriver.getError(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(message) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { - manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); - - try { - manipulatorAgvStationDeviceDriver.writing(3); - } catch (Exception e) { - e.printStackTrace(); - } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { - paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); - try { - paperTubePickSiteDeviceDriver.writing(3); - } catch (Exception e) { - e.printStackTrace(); - } - if (paperTubePickSiteDeviceDriver.getAction() == 1 - && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() - , paperTubePickSiteDeviceDriver.getError(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(message) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { - standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); - - try { - standardInspectSiteDeviceDriver.writing(1); - } catch (Exception e) { - e.printStackTrace(); - } - if ((standardInspectSiteDeviceDriver.getMove() == 1 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, standardInspectSiteDeviceDriver.getMove(), standardInspectSiteDeviceDriver.getAction() - , standardInspectSiteDeviceDriver.getError(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(message) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } + if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { + standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); + if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait")) + && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())) { + standardOrdinarySiteDeviceDriver.setOption(0); } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + standardOrdinarySiteDeviceDriver.setAgvphase(phase); + standardOrdinarySiteDeviceDriver.setIndex(index); + standardOrdinarySiteDeviceDriver.setInst(inst); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { + hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); + try { + hongXiangStationDeviceDriver.writing(0); + } catch (Exception e) { + e.printStackTrace(); + } + if (hongXiangStationDeviceDriver.getMove() == 0) { + 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 + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { + manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); + try { + manipulatorAgvStationDeviceDriver.writing(3); + } catch (Exception e) { + e.printStackTrace(); + } + 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 if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { + paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); + try { + paperTubePickSiteDeviceDriver.writing(3); + } catch (Exception e) { + e.printStackTrace(); + } + if (paperTubePickSiteDeviceDriver.getAction() == 1 + && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { + 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 + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { + standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); + + try { + standardInspectSiteDeviceDriver.writing(1); + } catch (Exception e) { + e.printStackTrace(); + } + if ((standardInspectSiteDeviceDriver.getMove() == 1 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) { + 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 + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } else { + 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); } + } //(Itype=1,上传称重数据) else if (phase == 0x64) { @@ -1186,7 +1140,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic task.setCarno(this.device_code); taskService.update(task); } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1237,9 +1191,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -1257,9 +1211,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if (paperTubePickSiteDeviceDriver.getAction() == 1 && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -1269,7 +1223,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足放货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() , paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); @@ -1284,9 +1238,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -1295,7 +1249,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); @@ -1309,9 +1263,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if (hongXiangStationDeviceDriver.getMove() == 0) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -1321,7 +1275,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() , hongXiangStationDeviceDriver.getError(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); @@ -1331,9 +1285,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); standardInspectSiteDeviceDriver.writing(1); if ((standardInspectSiteDeviceDriver.getMove() == 0 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -1343,7 +1297,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic log.info("设备{}当前光电信号{},动作信号{} ,报警信号{},不满足放货条件,指令号{}", device_code, standardInspectSiteDeviceDriver.getMove(), standardInspectSiteDeviceDriver.getAction() , standardInspectSiteDeviceDriver.getError(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); @@ -1408,9 +1362,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic Map map = new LinkedHashMap<>(); map.put("to_command", "4"); wasteFoilWeighingStationDriver.writing(map); - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -1423,16 +1377,16 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, wasteFoilWeighingStationDriver.getMove(), wasteFoilWeighingStationDriver.getAction() , wasteFoilWeighingStationDriver.getError(), wasteFoilWeighingStationDriver.getMode(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -1494,9 +1448,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic // } else { // data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); // } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -1510,9 +1464,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } catch (Exception e) { e.printStackTrace(); } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -1525,9 +1479,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if (hongXiangStationDeviceDriver.getMove() > 0) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -1537,7 +1491,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足放货完成反馈,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() , hongXiangStationDeviceDriver.getError(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); @@ -1568,9 +1522,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if (paperTubePickSiteDeviceDriver.getAction() == 1 && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -1581,7 +1535,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() , paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); @@ -1591,9 +1545,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); standardInspectSiteDeviceDriver.writing(0); if ((standardInspectSiteDeviceDriver.getMove() == 1)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -1607,9 +1561,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic Map map = new LinkedHashMap<>(); map.put("to_command", "5"); wasteFoilWeighingStationDriver.writing(map); - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -1622,16 +1576,16 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, wasteFoilWeighingStationDriver.getMove(), wasteFoilWeighingStationDriver.getAction() , wasteFoilWeighingStationDriver.getError(), wasteFoilWeighingStationDriver.getMode(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -1678,8 +1632,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic return; } String agv_inst_type = inst.getAgv_inst_type(); - if (StrUtil.equals(agv_inst_type, CommonFinalParam.ONE) || StrUtil.equals(agv_inst_type, "3")) { - if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { + if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { // standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); // if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait")) // && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString()) @@ -1695,95 +1648,95 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic // } else { // data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); // } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + 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); + this.setPhase(phase); + + } else 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(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); - this.setPhase(phase); - - } else 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(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(message) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { - hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); - try { - hongXiangStationDeviceDriver.writing(1); - } catch (Exception e) { - e.printStackTrace(); - } - if (hongXiangStationDeviceDriver.getMove() == 0) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() - , hongXiangStationDeviceDriver.getError(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(message) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { - paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); - try { - paperTubePickSiteDeviceDriver.writing(4); - } catch (Exception e) { - e.printStackTrace(); - } - if (paperTubePickSiteDeviceDriver.getAction() == 1 - && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() - , paperTubePickSiteDeviceDriver.getError(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(message) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - }/* else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) { + } else { + message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; + log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { + hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); + try { + hongXiangStationDeviceDriver.writing(1); + } catch (Exception e) { + e.printStackTrace(); + } + if (hongXiangStationDeviceDriver.getMove() == 0) { + 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 + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() + , hongXiangStationDeviceDriver.getError(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { + paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); + try { + paperTubePickSiteDeviceDriver.writing(4); + } catch (Exception e) { + e.printStackTrace(); + } + if (paperTubePickSiteDeviceDriver.getAction() == 1 + && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { + 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 + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() + , paperTubePickSiteDeviceDriver.getError(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + }/* else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) { rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver(); ISysParamService paramService = SpringContextHolder.getBean(ISysParamService.class); String device_code1 = device.getDevice_code(); @@ -1841,14 +1794,13 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic log.info("设备{},偏移数据出错导致未反馈{},指令号{}", device_code, rangingStationsDeviceDriver.getLength1() + "," + rangingStationsDeviceDriver.getLength2(), ikey); } }*/ else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } + 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); } } //放货完成 @@ -1891,8 +1843,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic return; } String agv_inst_type = inst.getAgv_inst_type(); - if (StrUtil.equals(agv_inst_type, CommonFinalParam.ONE) || StrUtil.equals(agv_inst_type, "3")) { - if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { + if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { // standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); // if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait")) // && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString()) @@ -1908,91 +1859,90 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic // } else { // data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); // } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - this.setPhase(phase); + 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); + this.setPhase(phase); - } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { - manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); - try { - manipulatorAgvStationDeviceDriver.writing(5); - } catch (Exception e) { - e.printStackTrace(); - } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { + manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); + try { + manipulatorAgvStationDeviceDriver.writing(5); + } catch (Exception e) { + e.printStackTrace(); + } + 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 if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { + paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); + try { + paperTubePickSiteDeviceDriver.writing(5); + } catch (Exception e) { + e.printStackTrace(); + } + if (paperTubePickSiteDeviceDriver.getAction() == 1 + && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); - } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { - paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); - try { - paperTubePickSiteDeviceDriver.writing(5); - } catch (Exception e) { - e.printStackTrace(); - } - if (paperTubePickSiteDeviceDriver.getAction() == 1 - && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() - , paperTubePickSiteDeviceDriver.getError(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(message) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { - hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); - try { - hongXiangStationDeviceDriver.writing(0); - } catch (Exception e) { - e.printStackTrace(); - } - if (hongXiangStationDeviceDriver.getMove() > 0) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() - , hongXiangStationDeviceDriver.getError(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(message) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() + , paperTubePickSiteDeviceDriver.getError(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) + .device_code(this.getDeviceCode()) + .content(message) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } + } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { + hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); + try { + hongXiangStationDeviceDriver.writing(0); + } catch (Exception e) { + e.printStackTrace(); + } + if (hongXiangStationDeviceDriver.getMove() > 0) { + 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 + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() + , hongXiangStationDeviceDriver.getError(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } else { + 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); } } //上传AGV电量 @@ -2136,6 +2086,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic TwoNDCSocketConnectionAutoRun.write(data); } } + } @Override diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java index c0eba6b43..0413bc49e 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java @@ -236,11 +236,11 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple String move = ""; String option = ""; if (this.getOption() == 0) { - action = LangProcess.msg("universal_actionMessage1"); + option = LangProcess.msg("universal_actionMessage1"); } else if (this.getOption() == 1) { - action = LangProcess.msg("universal_actionMessage2"); + option = LangProcess.msg("universal_actionMessage2"); } else if (this.getOption() == 2) { - action = LangProcess.msg("universal_actionMessage3"); + option = LangProcess.msg("universal_actionMessage3"); } if (this.getMode() == 0) { mode = LangProcess.msg("universal_off-line"); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/ItemProtocol.java index 8f29094fc..228fd1aba 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/ItemProtocol.java @@ -128,7 +128,7 @@ ItemProtocol { list.add(new ItemDto(item_walk_y, "行走列", "DB1.B4")); list.add(new ItemDto(item_error, "报警信号", "DB1.B5")); list.add(new ItemDto(item_task, "任务号", "DB1.D6")); - list.add(new ItemDto(item_barcode, "任务号", "DB1.B7")); + list.add(new ItemDto(item_barcode, "气胀轴编号", "DB1.B7")); return list; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java index faea6ca16..5c7d46db2 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java @@ -151,7 +151,7 @@ public interface AcsToWmsService { HttpResponse applyBlankButtonTask(JSONObject param); /** - * 向lms申请反馈 + * RGV工位上有货申请行架任务 * @param param * @return */ 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 f8c9d67d1..2c37582da 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 @@ -347,6 +347,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { .header("Authorization", token).body(String.valueOf(data)) .execute(); // //System.out.println(result2); + LuceneLogDto luceneLogDto = new LuceneLogDto(4,"feedbackTaskStatusToWms", String.valueOf(result2.getStatus()), + String.valueOf(data), String.valueOf(result2.body()), "ACS向WMS反馈任务状态"); + luceneLogService.interfaceExecuteLog(luceneLogDto); } catch (Exception e) { String msg = e.getMessage(); //网络不通 @@ -364,6 +367,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { type = "info"; JSONObject jo = JSONObject.parseObject(result2.body()); log.info("feedbackTaskStatusToWms-----输出参数{}", jo.toString()); + LuceneLogDto luceneLogDto = new LuceneLogDto(4,"feedbackTaskStatusToWms", String.valueOf(result2.getStatus()), + String.valueOf(data), String.valueOf(result2.body()), "ACS向WMS反馈任务状态"); + luceneLogService.interfaceExecuteLog(luceneLogDto); return result2; } else { type = "error"; @@ -445,7 +451,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { @Override public ApplyPlugPullSitResponse applyPlugPullSiteRequest(ApplyPlugPullSiteRequest param) { - log.info("向LMS申请反馈,请求参数{}",param); + log.info("向lms申请套管工位请求,请求参数{}",param); String result = ""; try { MDC.put(log_file_type, log_type); @@ -455,14 +461,15 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { AddressDto addressDto = addressService.findByCode("applyPlugPullSiteRequest"); String methods_url = addressDto.getMethods_url(); String url = wmsUrl + methods_url; - log.info("ApplyPlugPullSiteRequest----请求参数:{}", JSONObject.toJSONString(param)); + log.info("A向lms申请套管工位请求----请求参数:{}", JSONObject.toJSONString(param)); try { // result = HttpRequest.post(url) .body(JSON.toJSONString(param)) .execute().body(); JSONObject jsonObject = JSONObject.parseObject(result); - log.info("ApplyPlugPullSitResponse----返回参数{}", result); + log.info("向lms申请套管工位请求----返回参数{}", ("1".equals(param.getType()) ? "套轴" : "2".equals(param.getType()) ? "套轴完成" : "3".equals(param.getType()) ? "拔轴完成" : + "4".equals(param.getType()) ? "拔轴" : "缓存线已满,生成行架任务")); applyPlugPullSitResponse = JSONObject.toJavaObject(jsonObject, ApplyPlugPullSitResponse.class); LuceneLogDto luceneLogDto = new LuceneLogDto(4, "ApplyPlugPullSiteRequest", String.valueOf(applyPlugPullSitResponse.getstatus()), JSON.toJSONString(param), String.valueOf(result), "ACS向LMS申请" @@ -471,7 +478,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { luceneLogService.interfaceExecuteLog(luceneLogDto); } catch (Exception e) { JSONObject jsonObject = JSONObject.parseObject(result); - log.info("ApplyPlugPullSitResponse----返回参数{}", result); + log.info("向lms申请套管工位请求----返回参数{}", result); applyPlugPullSitResponse = JSONObject.toJavaObject(jsonObject, ApplyPlugPullSitResponse.class); LuceneLogDto luceneLogDto = new LuceneLogDto(4, "ApplyPlugPullSiteRequest", String.valueOf(applyPlugPullSitResponse.getstatus()), JSON.toJSONString(param), String.valueOf(result), "ACS向LMS申请失败"); @@ -491,7 +498,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { @Override public ApplyfeedbackSubVolumeWeightResponse applyfeedbackSubVolumeWeight(ApplyfeedbackSubVolumeWeightRequest param) { - log.info("向LMS申请反馈,请求参数{}", param); + log.info("向LMS反馈子卷重量,请求参数{}", param); String result = ""; ApplyfeedbackSubVolumeWeightResponse applyfeedbackSubVolumeWeightResponse = new ApplyfeedbackSubVolumeWeightResponse(); if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { @@ -499,18 +506,18 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { AddressDto addressDto = addressService.findByCode("applyfeedbackSubVolumeWeightRequest"); String methods_url = addressDto.getMethods_url(); String url = wmsUrl + methods_url; - log.info("applyfeedbackSubVolumeWeightRequest----请求参数:{}", JSONObject.toJSONString(param)); + log.info("向LMS反馈子卷重量----请求参数:{}", JSONObject.toJSONString(param)); try { // result = HttpRequest.post(url) .body(JSON.toJSONString(param)) .execute().body(); JSONObject jsonObject = JSONObject.parseObject(result); - log.info("applyfeedbackSubVolumeWeightRequest----返回参数{}", result); + log.info("向LMS反馈子卷重量----返回参数{}", result); applyfeedbackSubVolumeWeightResponse = JSONObject.toJavaObject(jsonObject, ApplyfeedbackSubVolumeWeightResponse.class); } catch (Exception e) { JSONObject jsonObject = JSONObject.parseObject(result); - log.info("applyfeedbackSubVolumeWeightRequest----返回参数{}", result); + log.info("向LMS反馈子卷重量----返回参数{}", result); JSONObject map = new JSONObject(); map.put("status", 400); map.put("message", e.getMessage()); @@ -525,7 +532,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { @Override public ApplyManipulatorActionResponse applyManipulatorActionRequest(ApplyManipulatorActionRequest param) { - log.info("向LMS申请反馈,请求参数{}", param); + log.info("RGV工位上有货申请行架任务,请求参数{}", param); String result = ""; ApplyManipulatorActionResponse applyManipulatorActionResponse = new ApplyManipulatorActionResponse(); if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { @@ -533,17 +540,17 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { AddressDto addressDto = addressService.findByCode("applyManipulatorAction"); String methods_url = addressDto.getMethods_url(); String url = wmsUrl + methods_url; - log.info("ApplyManipulatorActionRequest----请求参数:{}", JSONObject.toJSONString(param)); + log.info("RGV工位上有货申请行架任务----请求参数:{}", JSONObject.toJSONString(param)); try { result = HttpRequest.post(url) .body(JSON.toJSONString(param)) .execute().body(); JSONObject jsonObject = JSONObject.parseObject(result); - log.info("ApplyManipulatorActionResponse----返回参数{}", result); + log.info("RGV工位上有货申请行架任务----返回参数{}", result); applyManipulatorActionResponse = JSONObject.toJavaObject(jsonObject, ApplyManipulatorActionResponse.class); } catch (Exception e) { JSONObject jsonObject = JSONObject.parseObject(result); - log.info("ApplyManipulatorActionResponse----返回参数{}", result); + log.info("RGV工位上有货申请行架任务----返回参数{}", result); applyManipulatorActionResponse = JSONObject.toJavaObject(jsonObject, ApplyManipulatorActionResponse.class); LuceneLogDto luceneLogDto = new LuceneLogDto(4, "ApplyManipulatorActionRequest", String.valueOf(applyManipulatorActionResponse.getCode()), JSON.toJSONString(param), String.valueOf(applyManipulatorActionResponse), "ACS向LMS申请反馈子卷重量失败"); @@ -554,7 +561,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { return JSONObject.toJavaObject(map, ApplyManipulatorActionResponse.class); } LuceneLogDto luceneLogDto = new LuceneLogDto(4, "ApplyManipulatorActionRequest", String.valueOf(applyManipulatorActionResponse.getCode()), - JSON.toJSONString(param), String.valueOf(applyManipulatorActionResponse), "ACS向LMS申请反馈子卷重量成功"); + JSON.toJSONString(param), String.valueOf(applyManipulatorActionResponse), "RGV工位上有货申请行架任务"); luceneLogService.interfaceExecuteLog(luceneLogDto); } return applyManipulatorActionResponse; @@ -783,6 +790,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { .body(param.toString()) .execute(); log.info("sendDeviceStatus - 返回参数 {}", response.body()); + LuceneLogDto luceneLogDto = new LuceneLogDto(4,"feedbackDie", String.valueOf(response.getStatus()), + String.valueOf(param), + String.valueOf(response.body()), "向LMS发送设备状态"); + luceneLogService.interfaceExecuteLog(luceneLogDto); } } catch (Throwable ignored) { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index a87729ce2..70746a245 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -626,46 +626,40 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { @Override public Map getTubeMes(String jsonObject) throws Exception { log.info("getTubeMes--------------:输入参数" + jsonObject); - String date = new Date().toString(); - LuceneLogDto luceneLogDto = new LuceneLogDto(4, jsonObject, date + "获取管芯信息"); + LuceneLogDto luceneLogDto = new LuceneLogDto(4, "getTubeMes", "", + String.valueOf(jsonObject), + "", "下发管芯信息"); luceneLogService.interfaceExecuteLog(luceneLogDto); JSONArray datas = JSONArray.parseArray(jsonObject); - JSONObject jo = new JSONObject(); + Map map = new HashMap(); for (int i = 0; i < datas.size(); i++) { JSONObject data = (JSONObject) datas.get(i); String device_code = data.getString("device_code"); String to_material = data.getString("to_material"); String to_spec = data.getString("to_spec"); String to_qty = data.getString("to_qty"); - Device device = deviceAppService.findDeviceByCode(device_code); if (ObjectUtil.isEmpty(device)) { throw new Exception("未找到对应设备:" + device_code); } PaperTubePickSiteDeviceDriver paperTubePickSiteDeviceDriver; - if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) { + if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); - try { - //反馈管芯信息 - Thread.sleep(1000); //休眠1秒 - while (true) { - if (paperTubePickSiteDeviceDriver.getMode() == 2 && paperTubePickSiteDeviceDriver.getFlag() == 3) { - jo.put("to_material", to_material);//当前重量 - jo.put("to_spec", to_spec);//上一次重量 - jo.put("to_qty", to_qty);//重量差 - break; - } - } - } catch (InterruptedException e) { - e.printStackTrace(); + if (ObjectUtil.isEmpty(to_material)){ + map.put("to_material", "0"); + map.put("to_spec", "0"); + map.put("to_qty", "0"); + }else { + map.put("to_material", to_material); + map.put("to_spec", to_spec); + map.put("to_qty", to_qty); } + paperTubePickSiteDeviceDriver.writing(map); } } JSONObject resultJson = new JSONObject(); resultJson.put("status", HttpStatus.OK.value()); resultJson.put("message", "操作成功"); - resultJson.put("data", jo); - log.info("putWeightAction--------------:输出参数" + resultJson.toString()); return resultJson; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/service/impl/LuceneServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/service/impl/LuceneServiceImpl.java index 4dc43c273..8dee30741 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/service/impl/LuceneServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/service/impl/LuceneServiceImpl.java @@ -2,6 +2,7 @@ package org.nl.config.lucene.service.impl; import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSONObject; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -162,31 +163,10 @@ public class LuceneServiceImpl implements LuceneService { } TermRangeQuery termRangeQuery = new TermRangeQuery("logTime", new BytesRef(startDate), new BytesRef(endDate), true, true); booleanQueryBuilder.add(termRangeQuery, BooleanClause.Occur.MUST); - if (whereJson.get("device_code") != null){ - Query termQuery = new TermQuery(new Term("device_code", (String) whereJson.get("device_code"))); - booleanQueryBuilder.add(termQuery,BooleanClause.Occur.MUST); - } if (whereJson.get("method") != null){ Query termQuery = new TermQuery(new Term("method", (String) whereJson.get("method"))); booleanQueryBuilder.add(termQuery,BooleanClause.Occur.MUST); } - if (whereJson.get("status_code") != null){ - Query termQuery = new TermQuery(new Term("status_code", (String) whereJson.get("status_code"))); - booleanQueryBuilder.add(termQuery,BooleanClause.Occur.MUST); - } - if (whereJson.get("requestparam") != null){ - WildcardQuery query = new WildcardQuery(new Term("requestparam", "*"+(String) whereJson.get("requestparam")+"*")); - booleanQueryBuilder.add(query,BooleanClause.Occur.MUST); - } - if (whereJson.get("responseparam") != null){ - WildcardQuery query = new WildcardQuery(new Term("responseparam", "*"+(String) whereJson.get("responseparam")+"*")); - booleanQueryBuilder.add(query,BooleanClause.Occur.MUST); - } - if (whereJson.get("blurry") != null) { - WildcardQuery query = new WildcardQuery(new Term("fieldContent", "*"+(String) whereJson.get("blurry")+"*")); - booleanQueryBuilder.add(query, BooleanClause.Occur.MUST); - } - TopFieldCollector collector = TopFieldCollector.create(new Sort(new SortField("logTime", SortField.Type.LONG,true)), 20000, 0); searcher.search(booleanQueryBuilder.build(), collector); TopDocs topDocs = collector.topDocs(pageNum*pageSize, pageSize); @@ -197,15 +177,17 @@ public class LuceneServiceImpl implements LuceneService { for (ScoreDoc scoreDoc : scoreDocs) { Document doc = open.document(scoreDoc.doc); JSONObject object = new JSONObject(); - object.put("content",doc.get("fieldContent")); - object.put("device_code",doc.get("device_code")); - object.put("logTime",doc.get("logTime")); - object.put("method",doc.get("method")); - object.put("status_code",doc.get("status_code")); - object.put("requestparam",doc.get("requestparam")); - object.put("responseparam",doc.get("responseparam")); - if(doc.get("fieldContent") != null) { - list.add(object); + if (ObjectUtil.isNotEmpty(doc.get("method"))) { + object.put("content", doc.get("fieldContent")); + object.put("logTime", doc.get("logTime") ); + object.put("method", doc.get("method")); + object.put("requestparam", doc.get("requestparam")); + object.put("responseparam", doc.get("responseparam")); + if (doc.get("fieldContent") != null) { + list.add(object); + } + + } } open.close(); diff --git a/acs2/nladmin-ui/src/views/acs/device/driver/standard_autodoor.vue b/acs2/nladmin-ui/src/views/acs/device/driver/standard_autodoor.vue index 59c075a53..47b70d4a5 100644 --- a/acs2/nladmin-ui/src/views/acs/device/driver/standard_autodoor.vue +++ b/acs2/nladmin-ui/src/views/acs/device/driver/standard_autodoor.vue @@ -155,6 +155,14 @@ /> + + + +