diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/AgvWaitUtil.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/AgvWaitUtil.java index 71cb930e5..345bfcf7e 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/AgvWaitUtil.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/AgvWaitUtil.java @@ -34,6 +34,7 @@ public class AgvWaitUtil { AcsToWmsService acsToWmsService; @Autowired + @Lazy InstructionService instructionService; @Autowired 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 04ddb23b1..d122e90d4 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 @@ -307,11 +307,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } catch (Exception e) { e.printStackTrace(); } - if (paperTubePickSiteDeviceDriver.getMove() > 0 && paperTubePickSiteDeviceDriver.getAction() == 1 + if (paperTubePickSiteDeviceDriver.getAction() == 1 && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); } else { - message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() , paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey); } @@ -478,11 +478,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } catch (Exception e) { e.printStackTrace(); } - if (paperTubePickSiteDeviceDriver.getMove() == 0 && paperTubePickSiteDeviceDriver.getAction() == 1 + if (paperTubePickSiteDeviceDriver.getAction() == 1 && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); } else { - message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货完成反馈,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() , paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey); } @@ -617,11 +617,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } catch (Exception e) { e.printStackTrace(); } - if (paperTubePickSiteDeviceDriver.getMove() == 1 && paperTubePickSiteDeviceDriver.getAction() == 1 + if (paperTubePickSiteDeviceDriver.getAction() == 1 && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); } else { - message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() , paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey); } @@ -792,10 +792,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } catch (Exception e) { e.printStackTrace(); } - if (paperTubePickSiteDeviceDriver.getMove() == 0) { + if (paperTubePickSiteDeviceDriver.getAction() == 1 + && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); } else { - message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() , paperTubePickSiteDeviceDriver.getError(), ikey); } @@ -909,11 +910,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } catch (Exception e) { e.printStackTrace(); } - if (paperTubePickSiteDeviceDriver.getMove() == 0 && paperTubePickSiteDeviceDriver.getAction() == 1 + if (paperTubePickSiteDeviceDriver.getAction() == 1 && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); } else { - message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足放货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() , paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey); } @@ -1107,11 +1108,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } catch (Exception e) { e.printStackTrace(); } - if (paperTubePickSiteDeviceDriver.getMove() == 1 && paperTubePickSiteDeviceDriver.getAction() == 1 + if (paperTubePickSiteDeviceDriver.getAction() == 1 && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + paperTubePickSiteDeviceDriver.setFlag(3); } else { - message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() , paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey); } @@ -1237,7 +1239,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } catch (Exception e) { e.printStackTrace(); } - if (paperTubePickSiteDeviceDriver.getMove() == 0) { + if (paperTubePickSiteDeviceDriver.getAction() == 1 + && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); } else { message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; @@ -1369,7 +1372,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } catch (Exception e) { e.printStackTrace(); } - if (paperTubePickSiteDeviceDriver.getMove() > 0) { + if (paperTubePickSiteDeviceDriver.getAction() == 1 + && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); } else { message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/RgvDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/RgvDeviceDriver.java index 8c19c8f4c..299e594be 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/RgvDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/RgvDeviceDriver.java @@ -183,18 +183,17 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr } catch (Exception var17) { var17.printStackTrace(); - feedMessage = var17.getMessage(); logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol)); } if (mode == 0) { this.setIsonline(false); - message = "未联机"; + message = "universal_off-line"; //有报警 } else if (error != 0) { this.setIserror(true); - message = "有报警"; + message = "universal_message3"; //无报警 } else { this.setIsonline(true); @@ -218,13 +217,13 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr remark = "universal_no"; } if (task != 0) { - remark = LangProcess.msg("universal_remark4"); + remark = "universal_remark4"; if (ObjectUtil.isNotEmpty(this.inst)) { this.inst = null; } } if (requireSucess) { - remark = LangProcess.msg("universal_remark5"); + remark = "universal_remark5"; } this.setFeedMessage(remark); //} @@ -261,7 +260,7 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr applyManipulatorActionRequest.setQzz_no(String.valueOf(barcode));//气涨轴编码 applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); Map map = new LinkedHashMap<>(); - if (applyManipulatorActionResponse.getCode() == 200) { + if (applyManipulatorActionResponse.getstatus() == 200) { Map data = applyManipulatorActionResponse.getData(); String point_code2 = data.get("point_code2");//目标站点 Device deviceByCode = deviceAppService.findDeviceByCode(point_code2); @@ -271,17 +270,20 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr map.put("to_target", address); map.put("to_sub_volume_no", material_code); map.put("to_command", "1"); - map.put("to_is_labeling",StrUtil.isNotEmpty(to_is_labeling)?"0":"1"); + if (StrUtil.equals("1",to_is_labeling)){ + map.put("to_is_labeling","1"); + }else { + map.put("to_is_labeling","0"); + } this.writing(map); logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务,返回参数:" + applyManipulatorActionResponse); - message = "申请行架任务成功"; + message = "universal_message12"; requireSucess = true; } else { - message = applyManipulatorActionResponse.getMessage(); map.put("to_command", 99); this.writing(map); requireSucess = true; - message = "申请行架任务失败"; + message = "universal_message13"; logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务反馈失败,返回参数:" + applyManipulatorActionResponse); } } @@ -363,10 +365,10 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr map.put("isOnline", this.getIsonline()); map.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); map.put("isError", this.getIserror()); - map.put("message", message); + map.put("message", LangProcess.msg(message)); /*jo.put("notCreateTaskMessage", notCreateTaskMessage); jo.put("notCreateInstMessage",notCreateInstMessage);*/ - map.put("feedMessage", feedMessage); + map.put("feedMessage", LangProcess.msg(feedMessage)); map.put("driver_type", "siemens_conveyor"); map.put("is_click", true); JSONObject jo = new JSONObject(map); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blank_manipulator/BlankManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blank_manipulator/BlankManipulatorDeviceDriver.java index e9387e190..5d630f8b9 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blank_manipulator/BlankManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blank_manipulator/BlankManipulatorDeviceDriver.java @@ -278,13 +278,13 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem feedMessage = "universal_feedMessage1"; } if (action != 5) { - feedMessage = feedMessage + "two_message4"; + feedMessage = "two_message4"; } if (move != 1) { - feedMessage = feedMessage + "universal_feedMessage7"; + feedMessage = "universal_feedMessage7"; } if (task == 0) { - feedMessage = feedMessage + "universal_feedMessage8"; + feedMessage = "universal_feedMessage8"; } } @@ -312,7 +312,6 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem } catch (Exception var17) { var17.printStackTrace(); - feedMessage = var17.getMessage(); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol)) @@ -350,21 +349,21 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem } else { if (mode == 2) { //if (!requireSucess) { - String remark = "未查找任务原因为:"; + String remark = "universal_remark1"; if (mode != 2) { - remark = remark + "工作模式(mode)不是待机状态"; + remark = "universal_remark2"; } if (move != 0) { - remark = remark + "光电信号(move)为有货状态"; + remark = "universal_remark3"; } if (task != 0) { - remark = remark + "当前上报任务号(task)应该为0"; + remark = "universal_remark4"; if (ObjectUtil.isNotEmpty(this.inst)) { this.inst = null; } } if (requireSucess) { - remark = remark + "右击该图标,将请求任务复位标记(requireSucess)改为否。"; + remark ="universal_remark5"; } this.setNotCreateTaskMessage(remark); //} @@ -420,10 +419,12 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem Device startDevice = deviceAppService.findDeviceByCode(startCode); Device nextDevice = deviceAppService.findDeviceByCode(nextCode); if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) { - throw new BadRequestException(LangProcess.msg("device_checkAdd", startDevice.getDevice_code())); + notCreateInstMessage = "universal_notCreateInstMessage1"; + throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!"); } if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) { - throw new BadRequestException(LangProcess.msg("device_checkAdd", nextDevice.getDevice_code())); + notCreateInstMessage = "universal_notCreateInstMessage1"; + throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); } String startAddr = startDevice.getExtraValue().get("address").toString(); String nextAddr = nextDevice.getExtraValue().get("address").toString(); @@ -438,17 +439,23 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem Device startDevice2 = deviceAppService.findDeviceByCode(startCode2); Device nextDevice2 = deviceAppService.findDeviceByCode(nextCode2); if (ObjectUtil.isEmpty(startDevice2.getExtraValue().get("address"))) { - throw new BadRequestException(LangProcess.msg("device_checkAdd", startDevice.getDevice_code())); + throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!"); } if (ObjectUtil.isEmpty(nextDevice2.getExtraValue().get("address"))) { - throw new BadRequestException(LangProcess.msg("device_checkAdd", nextDevice.getDevice_code())); + throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); } String start_addr2 = startDevice2.getExtraValue().get("address").toString(); String next_addr2 = nextDevice2.getExtraValue().get("address").toString(); map.put("to_onset2", start_addr2); map.put("to_target2", next_addr2); } - this.writing(map); + try { + this.writing(map); + } catch (Exception e) { + logServer.deviceExecuteLog(device_code, "", "", "当前设备:" + device_code + ",下发指令:" + + instruction.getInstruction_code() + ",指令起点:" + instruction.getStart_device_code() + + ",指令终点:" + instruction.getNext_device_code() + ",指令执行失败:" + e.getMessage()); + } this.setRequireSucess(true); return true; } else { @@ -500,33 +507,32 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem Device startDevice = deviceAppService.findDeviceByCode(instdto.getStart_device_code()); Device nextDevice = deviceAppService.findDeviceByCode(instdto.getNext_device_code()); if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) { - notCreateInstMessage = startDevice.getDevice_code() + LangProcess.msg("universal_notCreateInstMessage1"); + notCreateInstMessage ="universal_notCreateInstMessage1"; LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) - .content(startDevice.getDevice_code() + LangProcess.msg("universal_notCreateInstMessage1")) + .content(startDevice.getDevice_code() + "未设置电气调度号!") .build(); logDto.setLog_level(2); luceneExecuteLogService.deviceExecuteLog(logDto); - throw new BadRequestException(LangProcess.msg("device_checkAdd", startDevice.getDevice_code())); + throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!"); } if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) { - notCreateInstMessage = nextDevice.getDevice_code() + LangProcess.msg("universal_notCreateInstMessage1"); + notCreateInstMessage = "universal_notCreateInstMessage1"; LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) - .content(nextDevice.getDevice_code() + LangProcess.msg("universal_notCreateInstMessage1")) + .content(nextDevice.getDevice_code() + "未设置电气调度号!") .build(); logDto.setLog_level(2); luceneExecuteLogService.deviceExecuteLog(logDto); - throw new BadRequestException(LangProcess.msg("device_checkAdd", nextDevice.getDevice_code())); + throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); } try { instructionService.create(instdto); } catch (Exception e) { - notCreateInstMessage = e.getMessage(); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) - .content(LangProcess.msg("universal_message9") + e.getMessage()) + .content(device_code+"创建指令时出现异常:" + e.getMessage()) .build(); logDto.setLog_level(2); luceneExecuteLogService.deviceExecuteLog(logDto); @@ -549,10 +555,10 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem Device startDevice2 = deviceAppService.findDeviceByCode(startDeviceCode2); Device nextDevice2 = deviceAppService.findDeviceByCode(nextDeviceCode2); if (ObjectUtil.isEmpty(startDevice2.getExtraValue().get("address"))) { - throw new BadRequestException(LangProcess.msg("device_checkAdd", startDevice2.getDevice_code())); + throw new BadRequestException("设备:" + startDevice2.getDevice_code() + "未设置电气调度号!"); } if (ObjectUtil.isEmpty(nextDevice2.getExtraValue().get("address"))) { - throw new BadRequestException(LangProcess.msg("device_checkAdd", nextDevice2.getDevice_code())); + throw new BadRequestException("设备:" + nextDevice2.getDevice_code() + "未设置电气调度号!"); } String start_addr2 = startDevice2.getExtraValue().get("address").toString(); String next_addr2 = nextDevice2.getExtraValue().get("address").toString(); @@ -569,7 +575,7 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem notCreateInstMessage = ""; notCreateTaskMessage = ""; } else { - notCreateInstMessage = "未找到关联设备的任务,指令无法创建"; + notCreateInstMessage = "universal_notCreateInstMessage"; } return true; } @@ -689,8 +695,8 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); jo.put("isError", this.getIserror()); jo.put("message", LangProcess.msg(message)); - jo.put("notCreateTaskMessage", notCreateTaskMessage); - jo.put("notCreateInstMessage",notCreateInstMessage); + jo.put("notCreateTaskMessage", LangProcess.msg(notCreateTaskMessage)); + jo.put("notCreateInstMessage",LangProcess.msg(notCreateInstMessage)); jo.put("feedMessage", LangProcess.msg(feedMessage)); jo.put("driver_type", "siemens_conveyor"); jo.put("is_click", true); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blanking_button/BlankingButtonDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blanking_button/BlankingButtonDriver.java index fd0a0b86d..ed0063c96 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blanking_button/BlankingButtonDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blanking_button/BlankingButtonDriver.java @@ -2,6 +2,7 @@ package org.nl.acs.device_driver.two_conveyor.blanking_button; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpResponse; import com.alibaba.fastjson.JSONObject; import lombok.Data; import lombok.RequiredArgsConstructor; @@ -28,6 +29,7 @@ import org.nl.acs.monitor.DeviceStageMonitor; import org.nl.acs.opc.DeviceAppService; import org.nl.acs.route.service.RouteLineService; import org.nl.acs.task.service.TaskService; +import org.nl.acs.task.service.dto.TaskDto; import org.nl.config.SpringContextHolder; import org.nl.config.language.LangProcess; import org.nl.config.lucene.service.LuceneExecuteLogService; @@ -35,10 +37,7 @@ import org.nl.config.lucene.service.dto.LuceneLogDto; import org.nl.system.service.param.ISysParamService; import org.springframework.beans.factory.annotation.Autowired; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; /** * @author : TuQiang * @date : 2024/3/14 @@ -102,7 +101,7 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev Boolean iserror = false; - String deviceCode; + String device_code; String message = null; @@ -118,7 +117,7 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev @Override public void execute() { - deviceCode = this.getDeviceCode(); + device_code = this.getDeviceCode(); heartbeat = this.itemProtocol.getItem_heartbeat(); mode = this.itemProtocol.getItem_mode(); move = this.itemProtocol.getItem_move(); @@ -156,22 +155,31 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev case 3: log.debug("运行中"); break; - case 9: + case 10: // 表处下满料请求 if (!requireSucess) { - applyTakeFullVolume(); - } - break; - case 10: - //表处上空轴请求 - if (!requireSucess) { - applyTakeEmptyShaft(); + boolean b = applyTake(); + if (b) { + requireSucess = true; + } } break; case 11: + //表处上空轴请求 + if (!requireSucess) { + boolean b = applyTake(); + if (b) { + requireSucess = true; + } + } + break; + case 9: // 取消任务 if (!requireSucess) { - cancelTask(); + boolean b = cancelTake(); + if (b) { + requireSucess = true; + } } break; default: @@ -184,110 +192,134 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev lastMove = move; lastAction = action; lastError = error; - } - /** - * 表处下满料请求 - */ - public synchronized void applyTakeFullVolume() { + private boolean cancelTake() { + Date date = new Date(); + boolean flag = false; + if (date.getTime() - this.instructionRequireTime.getTime() + < (long) this.instructionRequireTimeOut) { + log.trace("触发时间因为小于{}毫秒,而被无视", this.instructionRequireTimeOut); + return false; + } else { + String deviceCode = device_code + "_X"; + //根据起点设备编号查询当前是否有就绪任务 + TaskDto taskDto = taskserver.findByStartCodeAndReady(deviceCode); + if (ObjectUtil.isNotEmpty(taskDto)){ + try { + taskserver.cancel(taskDto.getTask_id()); + Map map = new HashMap(); + map.put("to_command", 9); + try { + this.writing(map); + } catch (Exception e) { + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发信号报错" + map) + .build(); + logDto.setLog_level(3); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } catch (Exception e) { + e.printStackTrace(); + } + flag = true; + } + //根据终点设备编号查询当前是否有就绪任务 + TaskDto dto = taskserver.findByEndCodeAndReady(deviceCode); + if (ObjectUtil.isNotEmpty(dto)){ + try { + taskserver.cancel(dto.getTask_id()); + Map map = new HashMap(); + map.put("to_command", 9); + try { + this.writing(map); + } catch (Exception e) { + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发信号报错" + map) + .build(); + logDto.setLog_level(3); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } catch (Exception e) { + e.printStackTrace(); + } + flag = true; + } + } + if (!flag){ + Map map = new HashMap(); + map.put("to_command", 99); + try { + this.writing(map); + } catch (Exception e) { + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发信号报错" + map) + .build(); + logDto.setLog_level(3); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } + return flag; + } + + + private boolean applyTake() { Date date = new Date(); if (date.getTime() - this.instructionRequireTime.getTime() < (long) this.instructionRequireTimeOut) { log.trace("触发时间因为小于{}毫秒,而被无视", this.instructionRequireTimeOut); - return; + return false; } else { - this.instructionRequireTime = date; - if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), CommonFinalParam.ONE)) { - message = "two_message5"; - BlankingButtonRequest blankingButtonRequest = new BlankingButtonRequest(); - blankingButtonRequest.setDevice_code(deviceCode); - blankingButtonRequest.setType(CommonFinalParam.TYPE_ONE); - BlankingButtonResponse response = acsToWmsService.applyBlankButtonTask(blankingButtonRequest); - if (ObjectUtil.isEmpty(response)) { - message = "two_message6"; - } else { - if (response.getCode()== CommonFinalParam.STATUS_OPEN) { - this.writing("to_command","9"); - message = "two_message7"; - requireSucess = true; - } else { - requireSucess = false; - message = "two_message8"; - this.writing("to_command","99"); - } + JSONObject jo = new JSONObject(); + jo.put("device_code", this.getDevice_code()); + if (this.mode==10) { + jo.put("type",CommonFinalParam.TYPE_TWO); + } + if (this.mode==11) { + jo.put("type",CommonFinalParam.TYPE_THREE); + } + HttpResponse httpResponse = acsToWmsService.applyBlankButtonTask(jo); + JSONObject jsonObject = null; + if(ObjectUtil.isNotEmpty(httpResponse)){ + String body = httpResponse.body(); + jsonObject = JSONObject.parseObject(body); + } + if(ObjectUtil.isNotNull(jsonObject) && jsonObject.getInteger("status") == 200){ + Map map = new HashMap(); + //反馈表处下满料请求 + if (this.mode==10) { + map.put("to_command", 10); } + //反馈表处上空轴请求 + if (this.mode==11) { + map.put("to_command", 11); + } + try { + this.writing(map); + } catch (Exception e) { + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发信号报错" + map) + .build(); + logDto.setLog_level(3); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + return true; + }else{ + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("反馈LMS表处按钮任务失败" + httpResponse.body()) + .build(); + logDto.setLog_level(3); + luceneExecuteLogService.deviceExecuteLog(logDto); + return false; } } } - /** - * 取消任务 - */ - public synchronized void cancelTask() { - Date date = new Date(); - if (date.getTime() - this.instructionRequireTime.getTime() - < (long) this.instructionRequireTimeOut) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instructionRequireTimeOut); - return; - } else { - this.instructionRequireTime = date; - if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), CommonFinalParam.ONE)) { - message = "two_message9"; - BlankingButtonRequest blankingButtonRequest = new BlankingButtonRequest(); - blankingButtonRequest.setDevice_code(deviceCode); - blankingButtonRequest.setType(CommonFinalParam.TYPE_SIX); - BlankingButtonResponse response = acsToWmsService.applyBlankButtonTask(blankingButtonRequest); - if (ObjectUtil.isEmpty(response)) { - message = "two_message10"; - } else { - if (response.getCode()== CommonFinalParam.STATUS_OPEN) { - this.writing("to_command","10"); - message = "two_message11"; - requireSucess = true; - } else { - requireSucess = false; - message = "two_message12"; - this.writing("to_command","99"); - } - } - } - } - } - - /** - * 表处上空轴请求 - */ - public synchronized void applyTakeEmptyShaft() { - Date date = new Date(); - if (date.getTime() - this.instructionRequireTime.getTime() - < (long) this.instructionRequireTimeOut) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instructionRequireTimeOut); - return; - } else { - this.instructionRequireTime = date; - if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), CommonFinalParam.ONE)) { - message = "two_message13"; - BlankingButtonRequest blankingButtonRequest = new BlankingButtonRequest(); - blankingButtonRequest.setDevice_code(deviceCode); - blankingButtonRequest.setType(CommonFinalParam.TYPE_TWO); - BlankingButtonResponse response = acsToWmsService.applyBlankButtonTask(blankingButtonRequest); - if (ObjectUtil.isEmpty(response)) { - message = "two_message14"; - } else { - if (response.getCode()== CommonFinalParam.STATUS_OPEN) { - this.writing("to_command","10"); - message = "two_message15"; - requireSucess = true; - } else { - requireSucess = false; - message = "two_message16"; - this.writing("to_command","99"); - } - } - } - } - } public void writing(String param, String value) { @@ -298,9 +330,9 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev itemMap.put(to_param, Integer.parseInt(value)); this.control(itemMap); - logServer.deviceExecuteLog(deviceCode, "", "", "下发电气信号设备号:" + deviceCode + ",下发电气:" + to_param + ",下发电气值:" + value); + logServer.deviceExecuteLog(device_code, "", "", "下发电气信号设备号:" + device_code + ",下发电气:" + to_param + ",下发电气值:" + value); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) + .device_code(device_code) .content("下发多个电气信号" + itemMap) .build(); logDto.setLog_level(3); @@ -369,4 +401,28 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev public void setDeviceStatus(JSONObject data) { } + + public String getToParam() { + return this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + "."; + } + + public void writing(Map map) throws Exception { + DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl"); + Map itemMap = new LinkedHashMap<>(); + map.forEach((key, value) -> { + if (ObjectUtil.isNotEmpty(value)) { + itemMap.put(getToParam() + key, value); + } + }); + if (ObjectUtil.isNotEmpty(itemMap)) { + this.checkcontrol(itemMap); + logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + logDto.setLog_level(3); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/green_foil_machine_button/GreenFoilMachineButtonDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/green_foil_machine_button/GreenFoilMachineButtonDriver.java index b9b717957..62f911b1f 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/green_foil_machine_button/GreenFoilMachineButtonDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/green_foil_machine_button/GreenFoilMachineButtonDriver.java @@ -100,7 +100,7 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem Boolean iserror = false; - String deviceCode; + String device_code; String message = null; @@ -116,7 +116,7 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem @Override public void execute() { - deviceCode = this.getDeviceCode(); + device_code = this.getDeviceCode(); heartbeat = this.itemProtocol.getItem_heartbeat(); mode = this.itemProtocol.getItem_mode(); move = this.itemProtocol.getItem_move(); @@ -206,7 +206,7 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), CommonFinalParam.ONE)) { message = "two_message17"; ApplyGreenFoilButtonRequest applyGreenFoilButtonRequest = new ApplyGreenFoilButtonRequest(); - applyGreenFoilButtonRequest.setDevice_code(deviceCode); + applyGreenFoilButtonRequest.setDevice_code(device_code); applyGreenFoilButtonRequest.setType(String.valueOf(mode)); ApplyGreenFoilButtonResponse response = acsToWmsService.applyGreenFoilButtonTask(applyGreenFoilButtonRequest); if (ObjectUtil.isEmpty(response)) { @@ -242,9 +242,9 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem itemMap.put(to_param, Integer.parseInt(value)); this.control(itemMap); - logServer.deviceExecuteLog(deviceCode, "", "", "下发电气信号设备号:" + deviceCode + ",下发电气:" + to_param + ",下发电气值:" + value); + logServer.deviceExecuteLog(device_code, "", "", "下发电气信号设备号:" + device_code + ",下发电气:" + to_param + ",下发电气值:" + value); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) + .device_code(device_code) .content("下发多个电气信号" + itemMap) .build(); luceneExecuteLogService.deviceExecuteLog(logDto); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/inflatable_shaft_library/InflatableShaftLibraryDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/inflatable_shaft_library/InflatableShaftLibraryDeviceDriver.java index ccd83563d..df1e445fe 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/inflatable_shaft_library/InflatableShaftLibraryDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/inflatable_shaft_library/InflatableShaftLibraryDeviceDriver.java @@ -86,7 +86,7 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver Boolean iserror = false; - String deviceCode; + String device_code; String message = null; @@ -101,7 +101,7 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver @Override public void execute() { - deviceCode = this.getDeviceCode(); + device_code = this.getDeviceCode(); heartbeat = this.itemProtocol.getItem_heartbeat(); mode = this.itemProtocol.getItem_mode(); move = this.itemProtocol.getItem_move(); @@ -139,9 +139,9 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver } catch (Exception e) { e.printStackTrace(); } - logServer.deviceExecuteLog(deviceCode, "", "", "下发电气信号设备号:" + deviceCode + ",下发电气:" + to_param + ",下发电气值:" + value); + logServer.deviceExecuteLog(device_code, "", "", "下发电气信号设备号:" + device_code + ",下发电气:" + to_param + ",下发电气值:" + value); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(deviceCode) + .device_code(device_code) .content("下发多个电气信号" + itemMap) .build(); luceneExecuteLogService.deviceExecuteLog(logDto); @@ -163,7 +163,7 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver this.checkcontrol(itemMap); logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(this.deviceCode) + .device_code(this.device_code) .content("下发多个电气信号" + itemMap) .build(); logDto.setLog_level(3); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java index 30651b243..663811ffd 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java @@ -213,29 +213,26 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl if (mode == 0) { this.setIsonline(false); - message = LangProcess.msg("universal_off-line"); + message = "universal_off-line"; //有报警 } else if (error != 0) { this.setIserror(true); - message = LangProcess.msg("universal_message3"); + message ="universal_message3"; //无报警 } else { this.setIsonline(true); this.setIserror(false); message = ""; - if(requireSucess){ - message = LangProcess.msg("universal_actionMessage5"); - } //插拔轴机工位申请任务 switch (mode) { case 1: - log.debug(LangProcess.msg("universal_stand-alone")); + log.debug("设备运转模式:等待工作"); break; case 2: - log.info(LangProcess.msg("universal_standby")); + log.info("待机"); break; case 3: - log.info(LangProcess.msg("universal_operation")); + log.info("运行中"); break; case 4: if (!requireSucess) { @@ -307,6 +304,13 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); return; } else { + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(device_code+"当前mode值为:" + mode) + .build(); + logDto.setLog_level(2); + luceneExecuteLogService.deviceExecuteLog(logDto); + logServer.deviceExecuteLog(this.device_code, "", "", "当前mode值为:" + mode); ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest(); ApplyPlugPullSitResponse applyPlugPullSitResponse; applyPlugPullSiteRequest.setDevice_code(device_code); @@ -314,7 +318,13 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl //气涨轴尺寸 applyPlugPullSiteRequest.setSize(String.valueOf(size)); applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest); - if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) { + if (applyPlugPullSitResponse.getstatus() == CommonFinalParam.STATUS_OPEN) { + LuceneLogDto logDto2 = LuceneLogDto.builder() + .device_code(device_code) + .content("申请贴标成功:" + applyPlugPullSitResponse.getData()) + .build(); + logDto2.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto2); Map data = applyPlugPullSitResponse.getData(); String number = data.get("number"); String leftSize = data.get("leftSize"); @@ -370,6 +380,13 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); return; } else { + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(device_code+"当前mode值为:" + mode) + .build(); + logDto.setLog_level(2); + luceneExecuteLogService.deviceExecuteLog(logDto); + logServer.deviceExecuteLog(this.device_code, "", "", "当前mode值为:" + mode); ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest(); ApplyPlugPullSitResponse applyPlugPullSitResponse; applyPlugPullSiteRequest.setDevice_code(device_code); @@ -380,7 +397,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl applyPlugPullSiteRequest.setMaterial2(String.valueOf(material2)); applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_TWO); applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest); - if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) { + if (applyPlugPullSitResponse.getstatus() == CommonFinalParam.STATUS_OPEN) { this.writeSignal(mode); logServer.deviceExecuteLog(this.device_code, "", "", "反馈套管完成,返回参数:" + applyPlugPullSitResponse); message = "套管完成成功"; @@ -406,13 +423,20 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); return; } else { + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(device_code+"当前mode值为:" + mode) + .build(); + logDto.setLog_level(2); + luceneExecuteLogService.deviceExecuteLog(logDto); + logServer.deviceExecuteLog(this.device_code, "", "", "当前mode值为:" + mode); ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest(); ApplyPlugPullSitResponse applyPlugPullSitResponse; applyPlugPullSiteRequest.setDevice_code(device_code); applyPlugPullSiteRequest.setBarcode(String.valueOf(barcode)); applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_THREE); applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest); - if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) { + if (applyPlugPullSitResponse.getstatus() == CommonFinalParam.STATUS_OPEN) { Map map = new LinkedHashMap<>(); map.put("to_command", mode); this.writing(map); @@ -440,13 +464,20 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); return; } else { + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(device_code+"当前mode值为:" + mode) + .build(); + logDto.setLog_level(2); + luceneExecuteLogService.deviceExecuteLog(logDto); + logServer.deviceExecuteLog(this.device_code, "", "", "当前mode值为:" + mode); ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest(); ApplyPlugPullSitResponse applyPlugPullSitResponse; applyPlugPullSiteRequest.setDevice_code(device_code); applyPlugPullSiteRequest.setQzz_no(String.valueOf(barcode)); applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_FOUR); applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest); - if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) { + if (applyPlugPullSitResponse.getstatus() == CommonFinalParam.STATUS_OPEN) { Map data = applyPlugPullSitResponse.getData(); //拔管1物料 Object to_material3 = data.get("currentLeft"); @@ -502,13 +533,20 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); return; } else { + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(device_code+"当前mode值为:" + mode) + .build(); + logDto.setLog_level(2); + luceneExecuteLogService.deviceExecuteLog(logDto); + logServer.deviceExecuteLog(this.device_code, "", "", "当前mode值为:" + mode); ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest(); ApplyPlugPullSitResponse applyPlugPullSitResponse; applyPlugPullSiteRequest.setDevice_code(device_code); applyPlugPullSiteRequest.setSize(String.valueOf(size)); applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_FIVE); applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest); - if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) { + if (applyPlugPullSitResponse.getstatus() == CommonFinalParam.STATUS_OPEN) { Map map = new LinkedHashMap<>(); map.put("to_command", mode); this.writing(map); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java index 91fe480fe..7aecf053a 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java @@ -20,6 +20,7 @@ import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.device_driver.one_manipulator.box_storage_manipulator.InteractionJsonDTO; +import org.nl.acs.device_driver.two_conveyor.plug_pull_device_site.PlugPullDeviceSiteDeviceDriver; import org.nl.acs.device_driver.two_conveyor.pull_head_manipulator.ItemProtocol; import org.nl.acs.history.ErrorUtil; import org.nl.acs.history.service.DeviceErrorLogService; @@ -379,6 +380,14 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp } } if (!ObjectUtil.isEmpty(task)) { + String nextDeviceCode = task.getNext_device_code(); + Device device = deviceAppService.findDeviceByCode(nextDeviceCode); + PlugPullDeviceSiteDeviceDriver plugPullDeviceSiteDeviceDriver; + if (device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) { + plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) device.getDeviceDriver(); + if (plugPullDeviceSiteDeviceDriver.getMode() != 2 && plugPullDeviceSiteDeviceDriver.getMove() != 0) + return false; + } String taskId = task.getTask_id(); String taskCode = task.getTask_code(); String vehicleCode = task.getVehicle_code(); @@ -387,7 +396,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp String startDeviceCode = task.getStart_device_code(); String routePlanCode = task.getRoute_plan_code(); String nextPointCode = task.getNext_point_code(); - String nextDeviceCode = task.getNext_device_code(); + Instruction instdto = new Instruction(); instdto.setInstruction_id(IdUtil.simpleUUID()); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java index b9e35afda..7aff9d4c3 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java @@ -224,10 +224,10 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl remark = "universal_remark2"; } if (move1 != 0) { - remark = remark + "universal_remark6"; + remark = "universal_remark6"; } if (move2 != 0) { - remark = remark + "universal_remark7"; + remark = "universal_remark7"; } if (task != 0) { remark = "universal_remark4"; @@ -292,19 +292,19 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl feedMessage = "universal_feedMessage6"; } else { if (mode != 3) { - feedMessage += "universal_feedMessage1"; + feedMessage = "universal_feedMessage1"; } if (action != 9) { - feedMessage += "universal_feedMessage9"; + feedMessage = "universal_feedMessage9"; } if (move1 != 0) { - feedMessage += "universal_feedMessage10"; + feedMessage = "universal_feedMessage10"; } if (move2 != 0) { - feedMessage += "universal_feedMessage11"; + feedMessage = "universal_feedMessage11"; } if (task == 0) { - feedMessage += "universal_feedMessage4"; + feedMessage = "universal_feedMessage4"; } } } @@ -321,12 +321,14 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl } else { this.instruction_head_time = date; String link_device_code = String.valueOf(this.getDevice().getExtraValue().get("link_device_code")); - Device device = deviceAppservice.findDeviceByCode(link_device_code); + List extraDeviceCodes = getExtraDeviceCodes1(link_device_code); + String linkCode = extraDeviceCodes.get(0); + Device device = deviceAppservice.findDeviceByCode(linkCode); SlitTwoManipulatorDeviceDriver slitTwoManipulatorDeviceDriver; - if (device.getDeviceDriver()instanceof SlitTwoManipulatorDeviceDriver) { + if (device.getDeviceDriver() instanceof SlitTwoManipulatorDeviceDriver) { slitTwoManipulatorDeviceDriver = (SlitTwoManipulatorDeviceDriver) device.getDeviceDriver(); //如果禁用 - if (slitTwoManipulatorDeviceDriver.getIs_disable()==1){ + if (slitTwoManipulatorDeviceDriver.getIs_disable() == 1) { //就去走关联设备异常取放货工位的任务 任务生成成功返回true 就不会走下面正常生成任务的逻辑 try { flag = instruction_require2(); @@ -338,6 +340,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl } } } + //没有生成异常取放货工位的任务 就生成正常关联取放货工位的任务 //抓取工位 if (ObjectUtil.isEmpty(getDeviceCodeList)) { getDeviceCodeList = this.getExtraDeviceCodes("get_device_code"); @@ -396,6 +399,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl } else { this.instruction_head_time = date; //抓取工位 + if (ObjectUtil.isEmpty(getDeviceCodeList)) { getDeviceCodeList = this.getExtraDeviceCodes("error_get_device_code"); } @@ -426,7 +430,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl for (int j = 0; j < taskDtoList.size(); j++) { task = taskDtoList.get(j); - // 9 行架任务 + // 6 行架任务 if (ObjectUtil.isNotEmpty(task) && !StrUtil.equals(task.getTask_type(), "6")) { task = null; continue; @@ -717,6 +721,26 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl //将扩展表中的字符串数组数据转换成集合 + public List getExtraDeviceCodes1(String extraValue) { + if (StrUtil.isEmpty(extraValue)) { + return new ArrayList<>(); + } + String devicesString = extraValue.substring(1, extraValue.length() - 1); + List devicesList = new ArrayList<>(); + String[] devices = devicesString.split(","); + for (int i = 0; i < devices.length; i++) { + String s = devices[i].replace("\"", "").replace("\"", ""); + devicesList.add(s); + } + return devicesList; + } + + /** + * 将扩展表中的字符串数据转换成集合 + * + * @param extraName + * @return + */ @Override public List getExtraDeviceCodes(String extraName) { String extraValue = (String) this.getDevice().getExtraValue().get(extraName); @@ -839,7 +863,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl jo.put("message", message); jo.put("is_click", true); jo.put("driver_type", "slit_two_manipulator"); - jo.put("notCreateTaskMessage", notCreateTaskMessage); + jo.put("notCreateTaskMessage", LangProcess.msg(notCreateTaskMessage)); jo.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage)); jo.put("feedMessage", LangProcess.msg(feedMessage)); return jo; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java index 9265ed8b0..97c58156d 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java @@ -110,4 +110,12 @@ public class WmsToAcsController { return new ResponseEntity<>(wmstoacsService.putWeightAction(whereJson), HttpStatus.OK); } + @PostMapping("/getTubeMsg") + @Log("wms下发废箔重量") + @SaIgnore + public ResponseEntity getTubeMes(@RequestBody String whereJson) throws Exception { + return new ResponseEntity<>(wmstoacsService.getTubeMes(whereJson), HttpStatus.OK); + } + + } 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 f59592cae..a0f6d6f97 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 @@ -148,7 +148,7 @@ public interface AcsToWmsService { * @param param * @return */ - BlankingButtonResponse applyBlankButtonTask(BlankingButtonRequest param); + HttpResponse applyBlankButtonTask(JSONObject param); /** * 向lms申请反馈 diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java index b684c5951..44f38d9ec 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java @@ -117,4 +117,5 @@ public interface WmsToAcsService { */ Map putWeightAction(String jsonObject) throws Exception; + Map getTubeMes(String whereJson) throws Exception; } 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 e7c8231e6..5191dc687 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 @@ -381,8 +381,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { @Override public ApplyGreenFoilButtonResponse applyGreenFoilButtonTask(ApplyGreenFoilButtonRequest param) { - try { - MDC.put(log_file_type, log_type); ApplyGreenFoilButtonResponse applyGreenFoilButtonResponse = new ApplyGreenFoilButtonResponse(); if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue(); @@ -409,49 +407,46 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { luceneLogService.interfaceExecuteLog(luceneLogDto); } return applyGreenFoilButtonResponse; - } finally { - MDC.remove(log_file_type); - } } @Override - public BlankingButtonResponse applyBlankButtonTask(BlankingButtonRequest param) { + public HttpResponse applyBlankButtonTask(JSONObject param) { + HttpResponse result = null; try { - MDC.put(log_file_type, log_type); - BlankingButtonResponse blankingButtonResponse = new BlankingButtonResponse(); - if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { - String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue(); - AddressDto addressDto = addressService.findByCode("applyButtonTask"); - String methods_url = addressDto.getMethods_url(); - String url = wmsUrl + methods_url; - log.info("BlankingButtonRequest----请求参数{}", param); - try { -// String result = ""; - String result = HttpRequest.post(url) - .body(JSON.toJSONString(param)) - .execute().body(); - JSONObject jsonObject = JSONObject.parseObject(result); - log.info("BlankingButtonResponse----返回参数{}", result); - blankingButtonResponse = JSONObject.toJavaObject(jsonObject, BlankingButtonResponse.class); - } catch (Exception e) { - JSONObject map = new JSONObject(); - map.put("status", 400); - map.put("message", e.getMessage()); - return JSONObject.toJavaObject(map, BlankingButtonResponse.class); - } - LuceneLogDto luceneLogDto = new LuceneLogDto(4,"BlankingButtonRequest", String.valueOf(blankingButtonResponse.getCode()), - JSON.toJSONString(param), String.valueOf(blankingButtonResponse.getMessage()), "ACS向LMS申请表处下料位按钮任务"); + String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue(); + AddressDto addressDto = addressService.findByCode("applyButtonTask"); + String methods_url = addressDto.getMethods_url(); + String url = wmsUrl + methods_url; + log.info("applyBlankButtonTask----反馈表处按钮请求路径{}", url); + try { + result = HttpRequest.post(url) + .header("Authorization", token) + .body(String.valueOf(param)) + .execute(); + } catch (Exception e) { + String message = e.getMessage(); + log.info("applyBlankButtonTask----反馈表处按钮请求失败{}", message); + LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyBlankButtonTask", String.valueOf(result.getStatus()), + JSON.toJSONString(result), + String.valueOf(result.body()), "反馈下发表处任务报错"); luceneLogService.interfaceExecuteLog(luceneLogDto); } - return blankingButtonResponse; + log.info("applyBlankButtonTask - 反馈表处按钮{}", result.body()); + LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyBlankButtonTask", String.valueOf(result.getStatus()), + JSON.toJSONString(result.body()), + String.valueOf(result.body()), "反馈下发表处任务"); + luceneLogService.interfaceExecuteLog(luceneLogDto); + return result; } finally { MDC.remove(log_file_type); + } } @Override public ApplyPlugPullSitResponse applyPlugPullSiteRequest(ApplyPlugPullSiteRequest param) { log.info("向LMS申请反馈,请求参数{}",param); + String result = ""; try { MDC.put(log_file_type, log_type); ApplyPlugPullSitResponse applyPlugPullSitResponse = new ApplyPlugPullSitResponse(); @@ -462,19 +457,25 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { String url = wmsUrl + methods_url; log.info("ApplyPlugPullSiteRequest----请求参数:{}", JSONObject.toJSONString(param)); try { -// String result = ""; - String result = HttpRequest.post(url) +// + result = HttpRequest.post(url) .body(JSON.toJSONString(param)) .execute().body(); JSONObject jsonObject = JSONObject.parseObject(result); log.info("ApplyPlugPullSitResponse----返回参数{}", result); applyPlugPullSitResponse = JSONObject.toJavaObject(jsonObject, ApplyPlugPullSitResponse.class); - LuceneLogDto luceneLogDto = new LuceneLogDto(4,"ApplyPlugPullSiteRequest", String.valueOf(applyPlugPullSitResponse.getCode()), + LuceneLogDto luceneLogDto = new LuceneLogDto(4, "ApplyPlugPullSiteRequest", String.valueOf(applyPlugPullSitResponse.getstatus()), JSON.toJSONString(param), String.valueOf(result), "ACS向LMS申请" - + ("1".equals(param.getType()) ? "套轴": "2".equals(param.getType()) ? "套轴完成": "3".equals(param.getType()) ? "拔轴完成": - "4".equals(param.getType()) ? "拔轴": "缓存线已满,生成行架任务")); + + ("1".equals(param.getType()) ? "套轴" : "2".equals(param.getType()) ? "套轴完成" : "3".equals(param.getType()) ? "拔轴完成" : + "4".equals(param.getType()) ? "拔轴" : "缓存线已满,生成行架任务")); luceneLogService.interfaceExecuteLog(luceneLogDto); } catch (Exception e) { + JSONObject jsonObject = JSONObject.parseObject(result); + log.info("ApplyPlugPullSitResponse----返回参数{}", 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申请失败"); + luceneLogService.interfaceExecuteLog(luceneLogDto); JSONObject map = new JSONObject(); map.put("status", 400); map.put("message", e.getMessage()); @@ -490,46 +491,43 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { @Override public ApplyfeedbackSubVolumeWeightResponse applyfeedbackSubVolumeWeight(ApplyfeedbackSubVolumeWeightRequest param) { - log.info("向LMS申请反馈,请求参数{}",param); - try { - MDC.put(log_file_type, log_type); - ApplyfeedbackSubVolumeWeightResponse applyfeedbackSubVolumeWeightResponse = new ApplyfeedbackSubVolumeWeightResponse(); - if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { - String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue(); - AddressDto addressDto = addressService.findByCode("applyfeedbackSubVolumeWeightRequest"); - String methods_url = addressDto.getMethods_url(); - String url = wmsUrl + methods_url; - log.info("applyfeedbackSubVolumeWeightRequest----请求参数:{}", JSONObject.toJSONString(param)); - try { -// String result = ""; - String result = HttpRequest.post(url) - .body(JSON.toJSONString(param)) - .execute().body(); - JSONObject jsonObject = JSONObject.parseObject(result); - log.info("applyfeedbackSubVolumeWeightRequest----返回参数{}", result); - applyfeedbackSubVolumeWeightResponse = JSONObject.toJavaObject(jsonObject, ApplyfeedbackSubVolumeWeightResponse.class); - } catch (Exception e) { - JSONObject map = new JSONObject(); - map.put("status", 400); - map.put("message", e.getMessage()); - return JSONObject.toJavaObject(map, ApplyfeedbackSubVolumeWeightResponse.class); - } + log.info("向LMS申请反馈,请求参数{}", param); + String result = ""; + ApplyfeedbackSubVolumeWeightResponse applyfeedbackSubVolumeWeightResponse = new ApplyfeedbackSubVolumeWeightResponse(); + if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { + String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue(); + AddressDto addressDto = addressService.findByCode("applyfeedbackSubVolumeWeightRequest"); + String methods_url = addressDto.getMethods_url(); + String url = wmsUrl + methods_url; + log.info("applyfeedbackSubVolumeWeightRequest----请求参数:{}", JSONObject.toJSONString(param)); + try { +// + result = HttpRequest.post(url) + .body(JSON.toJSONString(param)) + .execute().body(); + JSONObject jsonObject = JSONObject.parseObject(result); + log.info("applyfeedbackSubVolumeWeightRequest----返回参数{}", result); + applyfeedbackSubVolumeWeightResponse = JSONObject.toJavaObject(jsonObject, ApplyfeedbackSubVolumeWeightResponse.class); + } catch (Exception e) { + JSONObject jsonObject = JSONObject.parseObject(result); + log.info("applyfeedbackSubVolumeWeightRequest----返回参数{}", result); + JSONObject map = new JSONObject(); + map.put("status", 400); + map.put("message", e.getMessage()); + return JSONObject.toJavaObject(map, ApplyfeedbackSubVolumeWeightResponse.class); + } LuceneLogDto luceneLogDto = new LuceneLogDto(4,"applyfeedbackSubVolumeWeightRequest", String.valueOf(applyfeedbackSubVolumeWeightResponse.getCode()), JSON.toJSONString(param), String.valueOf(applyfeedbackSubVolumeWeightResponse.getMessage()), "ACS反馈LMS子卷重量"); luceneLogService.interfaceExecuteLog(luceneLogDto); } return applyfeedbackSubVolumeWeightResponse; - } finally { - MDC.remove(log_file_type); - } } @Override public ApplyManipulatorActionResponse applyManipulatorActionRequest(ApplyManipulatorActionRequest param) { log.info("向LMS申请反馈,请求参数{}", param); - try { - MDC.put(log_file_type, log_type); - ApplyManipulatorActionResponse applyManipulatorActionResponse = new ApplyManipulatorActionResponse(); + String result = ""; + ApplyManipulatorActionResponse applyManipulatorActionResponse = new ApplyManipulatorActionResponse(); if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("applyManipulatorAction"); @@ -537,28 +535,29 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { String url = wmsUrl + methods_url; log.info("ApplyManipulatorActionRequest----请求参数:{}", JSONObject.toJSONString(param)); try { -// String result = ""; - String result = HttpRequest.post(url) + result = HttpRequest.post(url) .body(JSON.toJSONString(param)) .execute().body(); JSONObject jsonObject = JSONObject.parseObject(result); log.info("ApplyManipulatorActionResponse----返回参数{}", result); applyManipulatorActionResponse = JSONObject.toJavaObject(jsonObject, ApplyManipulatorActionResponse.class); } catch (Exception e) { + JSONObject jsonObject = JSONObject.parseObject(result); + log.info("ApplyManipulatorActionResponse----返回参数{}", 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申请反馈子卷重量失败"); + luceneLogService.interfaceExecuteLog(luceneLogDto); JSONObject map = new JSONObject(); map.put("status", 400); map.put("message", e.getMessage()); return JSONObject.toJavaObject(map, ApplyManipulatorActionResponse.class); } - LuceneLogDto luceneLogDto = new LuceneLogDto(4,"ApplyManipulatorActionRequest", String.valueOf(applyManipulatorActionResponse.getCode()), - JSON.toJSONString(param), String.valueOf(applyManipulatorActionResponse), "ACS向LMS申请反馈子卷重量"); + LuceneLogDto luceneLogDto = new LuceneLogDto(4, "ApplyManipulatorActionRequest", String.valueOf(applyManipulatorActionResponse.getCode()), + JSON.toJSONString(param), String.valueOf(applyManipulatorActionResponse), "ACS向LMS申请反馈子卷重量成功"); luceneLogService.interfaceExecuteLog(luceneLogDto); } return applyManipulatorActionResponse; - } finally { - MDC.remove(log_file_type); - - } } @Override 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 fcee9fdbf..23413ae31 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 @@ -22,6 +22,7 @@ import org.nl.acs.device_driver.one_conveyor.fold_disc_site.FoldDiscSiteDeviceDr import org.nl.acs.device_driver.one_manipulator.box_package_manipulator.BoxPackageManipulatorDeviceDriver; import org.nl.acs.device_driver.conveyor.box_palletizing_manipulator.BoxPalletizingManipulatorDeviceDriver; import org.nl.acs.device_driver.paper_tube_device2.PaperTubeConveyor2DeviceDriver; +import org.nl.acs.device_driver.paper_tube_pick_site.PaperTubePickSiteDeviceDriver; import org.nl.acs.device_driver.two_conveyor.blank_manipulator.BlankManipulatorDeviceDriver; import org.nl.acs.device_driver.two_conveyor.hongxiang_conveyor.HongXiangStationDeviceDriver; import org.nl.acs.device_driver.two_conveyor.hongxiang_device.HongXiangConveyorDeviceDriver; @@ -56,10 +57,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; @Service @RequiredArgsConstructor @@ -78,6 +76,9 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { @Autowired private InstructionService instructionService; + @Autowired + private LuceneExecuteLogService luceneLogService; + @Autowired private AcsToLiKuService acsToLiKuService; @@ -489,19 +490,20 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { @Override public PutActionResponse putAction(String jsonObject) throws Exception { - try { - MDC.put(log_file_type, log_type); - log.info("putAction--------------:输入参数" + jsonObject); - JSONArray datas = JSONArray.parseArray(jsonObject); - PutActionResponse response = new PutActionResponse(); - JSONArray errArr = new JSONArray(); - for (int i = 0; i < datas.size(); i++) { - String data = datas.get(i).toString(); - PutActionRequest request = JsonUtl.format(data, PutActionRequest.class); - String device_code = request.getDevice_code(); - String code = request.getCode(); - String value = request.getValue(); - Device device = deviceAppService.findDeviceByCode(device_code); + log.info("putAction--------------:输入参数" + jsonObject); + String date = new Date().toString(); + LuceneLogDto luceneLogDto = new LuceneLogDto(4, jsonObject, date+"LMS反馈ACS动作信号"); + luceneLogService.interfaceExecuteLog(luceneLogDto); + JSONArray datas = JSONArray.parseArray(jsonObject); + PutActionResponse response = new PutActionResponse(); + JSONArray errArr = new JSONArray(); + for (int i = 0; i < datas.size(); i++) { + String data = datas.get(i).toString(); + PutActionRequest request = JsonUtl.format(data, PutActionRequest.class); + String device_code = request.getDevice_code(); + String code = request.getCode(); + String value = request.getValue(); + Device device = deviceAppService.findDeviceByCode(device_code); if (ObjectUtil.isEmpty(device)) { throw new Exception("未找到对应设备:" + device_code); } @@ -547,78 +549,119 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { } } response.setStatus(200); - response.setMessage("success"); - LuceneLogDto luceneLogDto = new LuceneLogDto(4,"putAction", String.valueOf(response.getCode()), - jsonObject, String.valueOf(response), "LMS下发动作"); - luceneExecuteLogService.interfaceExecuteLog(luceneLogDto); - log.info("putAction--------------:输出参数:" + response); - return response; - } finally { - MDC.remove(log_file_type); - } + response.setMessage("success"); + LuceneLogDto luceneLogDto1 = new LuceneLogDto(4, "putAction", String.valueOf(response.getCode()), + jsonObject, String.valueOf(response), "LMS下发动作"); + luceneExecuteLogService.interfaceExecuteLog(luceneLogDto); + log.info("putAction--------------:输出参数:" + response); + return response; } @Override public Map putWeightAction(String jsonObject) throws Exception { - try { - MDC.put(log_file_type, log_type); - log.info("putWeightAction--------------:输入参数" + jsonObject); - JSONArray datas = JSONArray.parseArray(jsonObject); - JSONObject jo = new JSONObject(); - for (int i = 0; i < datas.size(); i++) { - JSONObject data = (JSONObject) datas.get(i); - String device_code = data.getString("device_code"); - String type = data.getString("type"); - Device device = deviceAppService.findDeviceByCode(device_code); - if (ObjectUtil.isEmpty(device)) { - throw new Exception("未找到对应设备:" + device_code); - } - WasteFoilWeighingStationDriver wasteFoilWeighingStationDriver; - if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) { - wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver(); - try { - //称重完成 - if (StrUtil.equals("1", type)) { - wasteFoilWeighingStationDriver.writing("to_command", "6"); - Thread.sleep(1000); //休眠1秒 - while (true) { - if (wasteFoilWeighingStationDriver.getMode()==6){ - jo.put("currentWeight", wasteFoilWeighingStationDriver.getWeight());//当前重量 - jo.put("lastWeight", wasteFoilWeighingStationDriver.getOld_weight());//上一次重量 - jo.put("weightGap", wasteFoilWeighingStationDriver.getGap_weight());//重量差 - break; - } + log.info("putWeightAction--------------:输入参数" + jsonObject); + String date = new Date().toString(); + LuceneLogDto luceneLogDto = new LuceneLogDto(4, jsonObject, date+"LMS反馈ACS废箔重量"); + luceneLogService.interfaceExecuteLog(luceneLogDto); + JSONArray datas = JSONArray.parseArray(jsonObject); + JSONObject jo = new JSONObject(); + for (int i = 0; i < datas.size(); i++) { + JSONObject data = (JSONObject) datas.get(i); + String device_code = data.getString("device_code"); + String type = data.getString("type"); + Device device = deviceAppService.findDeviceByCode(device_code); + if (ObjectUtil.isEmpty(device)) { + throw new Exception("未找到对应设备:" + device_code); + } + WasteFoilWeighingStationDriver wasteFoilWeighingStationDriver; + if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) { + wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver(); + try { + //称重完成 + if (StrUtil.equals("1", type)) { + wasteFoilWeighingStationDriver.writing("to_command", "6"); + Thread.sleep(1000); //休眠1秒 + while (true) { + if (wasteFoilWeighingStationDriver.getMode() == 6) { + jo.put("currentWeight", wasteFoilWeighingStationDriver.getWeight());//当前重量 + jo.put("lastWeight", wasteFoilWeighingStationDriver.getOld_weight());//上一次重量 + jo.put("weightGap", wasteFoilWeighingStationDriver.getGap_weight());//重量差 + break; } - wasteFoilWeighingStationDriver.writing("to_command", "0"); } - //称重确认信号 - else if (StrUtil.equals("2", type)) { - wasteFoilWeighingStationDriver.writing("to_command", "7"); - Thread.sleep(1000); //休眠1秒 - while (true) { - if (wasteFoilWeighingStationDriver.getMode()==7){ - jo.put("currentWeight", wasteFoilWeighingStationDriver.getWeight());//当前重量 - jo.put("lastWeight", wasteFoilWeighingStationDriver.getOld_weight());//上一次重量 - jo.put("weightGap", wasteFoilWeighingStationDriver.getGap_weight());//重量差 - break; - } - } - wasteFoilWeighingStationDriver.writing("to_command", "0"); - } - } catch (InterruptedException e) { - e.printStackTrace(); + wasteFoilWeighingStationDriver.writing("to_command", "0"); } + //称重确认信号 + else if (StrUtil.equals("2", type)) { + wasteFoilWeighingStationDriver.writing("to_command", "7"); + Thread.sleep(1000); //休眠1秒 + while (true) { + if (wasteFoilWeighingStationDriver.getMode() == 7) { + jo.put("currentWeight", wasteFoilWeighingStationDriver.getWeight());//当前重量 + jo.put("lastWeight", wasteFoilWeighingStationDriver.getOld_weight());//上一次重量 + jo.put("weightGap", wasteFoilWeighingStationDriver.getGap_weight());//重量差 + break; + } + } + wasteFoilWeighingStationDriver.writing("to_command", "0"); + } + } catch (InterruptedException e) { + e.printStackTrace(); } } - JSONObject resultJson = new JSONObject(); - resultJson.put("status", HttpStatus.OK.value()); - resultJson.put("message", "操作成功"); - resultJson.put("data", jo); - log.info("putWeightAction--------------:输出参数" + resultJson.toString()); - return resultJson; - } finally { - MDC.remove(log_file_type); } + JSONObject resultJson = new JSONObject(); + resultJson.put("status", HttpStatus.OK.value()); + resultJson.put("message", "操作成功"); + resultJson.put("data", jo); + log.info("putWeightAction--------------:输出参数" + resultJson.toString()); + return resultJson; + } + + @Override + public Map getTubeMes(String jsonObject) throws Exception { + log.info("getTubeMes--------------:输入参数" + jsonObject); + String date = new Date().toString(); + LuceneLogDto luceneLogDto = new LuceneLogDto(4, jsonObject, date+"获取管芯信息"); + luceneLogService.interfaceExecuteLog(luceneLogDto); + JSONArray datas = JSONArray.parseArray(jsonObject); + JSONObject jo = new JSONObject(); + 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) { + 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(); + } + } + } + JSONObject resultJson = new JSONObject(); + resultJson.put("status", HttpStatus.OK.value()); + resultJson.put("message", "操作成功"); + resultJson.put("data", jo); + log.info("putWeightAction--------------:输出参数" + resultJson.toString()); + return resultJson; } @Override diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/InstructionService.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/InstructionService.java index bf534eaa1..4a8087ef1 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/InstructionService.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/InstructionService.java @@ -7,6 +7,7 @@ import org.nl.acs.instruction.service.dto.InstructionQueryParam; import org.nl.acs.common.base.PageInfo; import org.nl.acs.common.base.CommonService; import org.nl.acs.instruction.domain.Instruction; +import org.nl.acs.task.service.dto.TaskDto; import org.springframework.data.domain.Pageable; import javax.servlet.http.HttpServletResponse; @@ -333,6 +334,22 @@ public interface InstructionService extends CommonService { */ Instruction findByDeviceCodeFromCache(String devicecode); + /** + * 根据起点设备编号查询当前是否有就绪指令 + * + * @param device_code + * @return + */ + Instruction findByStartCodeAndReady(String device_code); + + /** + * 根据终点设备编号查询当前是否有就绪指令 + * + * @param device_code + * @return + */ + Instruction findByEndCodeAndReady(String device_code); + /** * 根据终点查询指令 diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index 0bbc70bbd..560afb68a 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -1725,6 +1725,24 @@ public class InstructionServiceImpl extends CommonServiceImpl optionalInstruction = instructions.stream() + .filter(instruction -> StrUtil.equals(instruction.getStart_device_code(), device_code) + && StrUtil.equals(instruction.getInstruction_status(), InstructionStatusEnum.READY.getIndex())) + .findFirst(); + return optionalInstruction.orElse(null); + } + + @Override + public Instruction findByEndCodeAndReady(String device_code) { + Optional optionalInstruction = instructions.stream() + .filter(instruction -> StrUtil.equals(instruction.getNext_device_code(), device_code) + && StrUtil.equals(instruction.getInstruction_status(), InstructionStatusEnum.READY.getIndex())) + .findFirst(); + return optionalInstruction.orElse(null); + } + @Override public List findByDeviceCodes(Instruction instruction1, Boolean flay) { List instructionList = new ArrayList<>(); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/monitor/service/impl/DeviceStageMonitorServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/monitor/service/impl/DeviceStageMonitorServiceImpl.java index d29eef457..da528175e 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/monitor/service/impl/DeviceStageMonitorServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/monitor/service/impl/DeviceStageMonitorServiceImpl.java @@ -24,7 +24,8 @@ public class DeviceStageMonitorServiceImpl implements DeviceStageMonitorService @Override - public JSONArray getData(JSONArray jsonArray) throws Exception { + public JSONArray + getData(JSONArray jsonArray) throws Exception { JSONArray arr = new JSONArray(); for (int i = 0; i < jsonArray.size(); i++) { JSONObject obj = new JSONObject(); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/common/annotation/Query.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/common/annotation/Query.java index 2abca5a5a..e3a102959 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/common/annotation/Query.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/common/annotation/Query.java @@ -33,7 +33,7 @@ public @interface Query { // Dong ZhaoYang 2017/8/7 查询方式 Type type() default Type.EQUAL; - /** + /**r * 连接查询的属性名,如User类中的dept */ String joinName() default ""; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/service/dto/LuceneLogDto.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/service/dto/LuceneLogDto.java index dc3a78979..720eaa1cf 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/service/dto/LuceneLogDto.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/service/dto/LuceneLogDto.java @@ -92,13 +92,18 @@ public class LuceneLogDto { final String requestparam, final String responseparam, final String content) { super(); this.log_level = log_level; - this.method = method; - this.status_code = status; this.requestparam = requestparam; this.responseparam = responseparam; this.content = content; } + public LuceneLogDto(final Integer log_level, final String requestparam, final String content) { + super(); + this.log_level = log_level; + this.requestparam = requestparam; + this.content = content; + } + public LuceneLogDto(final String device_code, final String remark) { super(); this.device_code = device_code; diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml b/acs2/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml index e6a974ebe..8415b20de 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml @@ -10,7 +10,7 @@ spring: driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy # url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:stand_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true # url: jdbc:log4jdbc:mysql://${DB_HOST:47.111.78.178}:${DB_PORT:3306}/${DB_NAME:lzhl_two_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true - url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:lzhl_two_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true + url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.10.67}:${DB_PORT:3306}/${DB_NAME:lzhl_acs2}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true username: ${DB_USER:root} # password: ${DB_PWD:Root.123456} diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal.properties b/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal.properties index bb8240f31..5249d3352 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal.properties +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal.properties @@ -35,6 +35,8 @@ universal_message8=\u8BFB\u53D6\u4FE1\u53F7\u503C\u65F6\u51FA\u73B0\u5F02\u5E38: universal_message9=\u521B\u5EFA\u6307\u4EE4\u65F6\u51FA\u73B0\u5F02\u5E38: universal_message10=\u4E0B\u53D1\u591A\u4E2A\u7535\u6C14\u4FE1\u53F7: universal_message11=\u4FE1\u53F7\u8FDE\u63A5\u5F02\u5E38\uFF01 +universal_message12=\u7533\u8BF7\u884C\u67B6\u4EFB\u52A1\u6210\u529F\uFF01 +universal_message13=\u7533\u8BF7\u884C\u67B6\u4EFB\u52A1\u5931\u8D25\uFF01 universal_feedMessage1=\u5DE5\u4F5C\u6A21\u5F0F(mode)\u4E0D\u4E3A\u8FD0\u884C\u4E2D\u72B6\u6001 universal_feedMessage2=\u52A8\u4F5C\u4FE1\u53F7(action)\u4E0D\u4E3A\u653E\u8D27\u5B8C\u6210\u72B6\u6001 universal_feedMessage3=\u5149\u7535\u4FE1\u53F7(move)\u4E0D\u4E3A\u65E0\u8D27\u72B6\u6001 diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal_en_US.properties b/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal_en_US.properties index 23e6b11a5..b06e2d793 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal_en_US.properties +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal_en_US.properties @@ -33,6 +33,8 @@ universal_message8=An exception occurred when reading the signal value: universal_message9=An exception occurred while creating the directive universal_message10=Multiple electrical signals are issued universal_message11=The signal connection is abnormal! +universal_message12=Successfully applied for shelving task! +universal_message13=Application for shelving task failed! universal_feedMessage1=mode is not in the running state universal_feedMessage2=action signal (action signal) is not a release completed status universal_feedMessage3=Photoelectric signal (move) is not out of stock diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal_in_ID.properties b/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal_in_ID.properties index 757a7c99c..7f4707491 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal_in_ID.properties +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal_in_ID.properties @@ -32,6 +32,8 @@ universal_message7=Misi tercapai ... universal_message8=Pengecualian terjadi saat membaca nilai sinyal: universal_message9=Pengecualian terjadi saat membuat direktif universal_message10=Beberapa sinyal listrik dikeluarkan +universal_message12=Aplikasi untuk tugas perancah berhasil! +universal_message13=Gagal melamar tugas memeras! universal_message11=Koneksi sinyal tidak normal! universal_feedMessage1=Mode kerja tidak untuk mode dalam mode universal_feedMessage2=Sinyal aksi tidak lengkap untuk penempatan diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal_zh_CN.properties b/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal_zh_CN.properties index ca6a05aa7..83e651b28 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal_zh_CN.properties +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/language/monitor/universal/universal_zh_CN.properties @@ -33,6 +33,8 @@ universal_message8=\u8BFB\u53D6\u4FE1\u53F7\u503C\u65F6\u51FA\u73B0\u5F02\u5E38: universal_message9=\u521B\u5EFA\u6307\u4EE4\u65F6\u51FA\u73B0\u5F02\u5E38: universal_message10=\u4E0B\u53D1\u591A\u4E2A\u7535\u6C14\u4FE1\u53F7 universal_message11=\u4FE1\u53F7\u8FDE\u63A5\u5F02\u5E38\uFF01 +universal_message12=\u7533\u8BF7\u884C\u67B6\u4EFB\u52A1\u6210\u529F\uFF01 +universal_message13=\u7533\u8BF7\u884C\u67B6\u4EFB\u52A1\u5931\u8D25\uFF01 universal_feedMessage1=\u5DE5\u4F5C\u6A21\u5F0F(mode)\u4E0D\u4E3A\u8FD0\u884C\u4E2D\u72B6\u6001 universal_feedMessage2=\u52A8\u4F5C\u4FE1\u53F7(action)\u4E0D\u4E3A\u653E\u8D27\u5B8C\u6210\u72B6\u6001 universal_feedMessage3=\u5149\u7535\u4FE1\u53F7(move)\u4E0D\u4E3A\u65E0\u8D27\u72B6\u6001 diff --git a/acs2/nladmin-ui/src/i18n/langs/task/en.js b/acs2/nladmin-ui/src/i18n/langs/task/en.js index 5ff18b36a..5585ec735 100644 --- a/acs2/nladmin-ui/src/i18n/langs/task/en.js +++ b/acs2/nladmin-ui/src/i18n/langs/task/en.js @@ -27,6 +27,7 @@ export default { 'Starting_layer': 'Starting Layer', 'Destination': 'Destination', 'Destination2': 'Destination 2', + 'Interaction_json': 'Interaction Fields', 'Ending_column': 'Ending Column', 'Ending_layer': 'Ending Layer', 'Description': 'Description', diff --git a/acs2/nladmin-ui/src/i18n/langs/task/in.js b/acs2/nladmin-ui/src/i18n/langs/task/in.js index e6b066706..ff60c0e7e 100644 --- a/acs2/nladmin-ui/src/i18n/langs/task/in.js +++ b/acs2/nladmin-ui/src/i18n/langs/task/in.js @@ -27,6 +27,7 @@ export default { 'Starting_layer': 'Lapisan Awal', 'Destination': 'Tujuan', 'Destination2': 'Tujuan 2', + 'Interaction_json': 'Bidang Interaksi', 'Ending_column': 'Kolom Akhir', 'Ending_layer': 'Lapisan Akhir', 'Description': 'Deskripsi', diff --git a/acs2/nladmin-ui/src/i18n/langs/task/zh.js b/acs2/nladmin-ui/src/i18n/langs/task/zh.js index 243ed7fdb..045882c91 100644 --- a/acs2/nladmin-ui/src/i18n/langs/task/zh.js +++ b/acs2/nladmin-ui/src/i18n/langs/task/zh.js @@ -27,6 +27,7 @@ export default { 'Starting_layer': '起点-层', 'Destination': '终点', 'Destination2': '终点2', + 'Interaction_json': '交互字段', 'Ending_column': '终点-列', 'Ending_layer': '终点-层', 'Description': '描述信息', diff --git a/acs2/nladmin-ui/src/views/acs/history/taskRecord/index.vue b/acs2/nladmin-ui/src/views/acs/history/taskRecord/index.vue index e8a87b8a1..845149f9c 100644 --- a/acs2/nladmin-ui/src/views/acs/history/taskRecord/index.vue +++ b/acs2/nladmin-ui/src/views/acs/history/taskRecord/index.vue @@ -295,6 +295,7 @@ + @@ -329,6 +330,7 @@ const defaultForm = { start_point_code: null, start_device_code: null, next_point_code: null, + start_point_code: null, remark: null, material: null, route_plan_code: 'normal', diff --git a/acs2/nladmin-ui/src/views/acs/task/index.vue b/acs2/nladmin-ui/src/views/acs/task/index.vue index 5b01edc92..1c4575bbf 100644 --- a/acs2/nladmin-ui/src/views/acs/task/index.vue +++ b/acs2/nladmin-ui/src/views/acs/task/index.vue @@ -502,6 +502,7 @@ + @@ -671,6 +672,7 @@ export default { start_device_code2: null, next_point_code: null, next_point_code2: null, + interaction_json: null, remark: null, material: null, route_plan_code: 'normal', diff --git a/acs2/nladmin-ui/src/views/system/monitor/device/index.vue b/acs2/nladmin-ui/src/views/system/monitor/device/index.vue index 5f84af01f..6ad55d6a1 100644 --- a/acs2/nladmin-ui/src/views/system/monitor/device/index.vue +++ b/acs2/nladmin-ui/src/views/system/monitor/device/index.vue @@ -283,6 +283,7 @@ export default { dialogFormVisible10: false, Stages: [], stage_code: 'stage_code', + stage_name: '二楼监控', form: { device_code: '', hasGoodStatus: null, @@ -505,7 +506,7 @@ export default { this.arr = [] // 清空 if (item.device_code && item.data) { console.log('item', item) - /* let tempDeviceName = '' + let tempDeviceName = '' if (this.language === 'zh') { tempDeviceName = item.data.zh_device_name } @@ -514,7 +515,7 @@ export default { } if (this.language === 'in') { tempDeviceName = item.data.in_device_name - } */ + } this.arr = [ { name: i18n.t('monitor.click.equipment_number'), value: item.device_code }, { name: i18n.t('monitor.click.device_name'), value: item.device_name } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/st/service/impl/StructivtServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/st/service/impl/StructivtServiceImpl.java index 8f2d69d67..7b0d48823 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/st/service/impl/StructivtServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/st/service/impl/StructivtServiceImpl.java @@ -312,6 +312,7 @@ public class StructivtServiceImpl implements StructivtService { mp.put("净重", json.getString("net_weight")); mp.put("毛重", json.getString("box_weight")); mp.put("长度", json.getString("length")); + mp.put("接头数", json.getString("joint_type")); mp.put("计划外分切的子卷", json.getString("is_un_plan_production")); mp.put("子卷的物性值1", json.getString("un_plan_product_property1")); mp.put("子卷的物性值2", json.getString("un_plan_product_property2")); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/st/wql/QST_STRUCTIVT001.wql b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/st/wql/QST_STRUCTIVT001.wql index 12adc2f6a..c0b1e2cf6 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/st/wql/QST_STRUCTIVT001.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/st/wql/QST_STRUCTIVT001.wql @@ -90,7 +90,8 @@ WHEN DATEDIFF( NOW(), sub.date_of_production ) > '90' THEN '3' END END AS sub_type, - DATEDIFF( NOW(), sub.date_of_production ) AS stock_age + DATEDIFF( NOW(), sub.date_of_production ) AS stock_age, + sub.joint_type FROM ST_IVT_StructIvt ivt @@ -243,7 +244,8 @@ WHEN DATEDIFF( NOW(), sub.date_of_production ) <= '90' THEN '1' WHEN DATEDIFF( NOW(), sub.date_of_production ) > '90' THEN '3' END AS sub_type, - DATEDIFF( NOW(), ivt.instorage_time ) AS stock_age + DATEDIFF( NOW(), ivt.instorage_time ) AS stock_age, + sub.joint_type FROM ST_IVT_StructIvt ivt LEFT JOIN st_ivt_structattr attr ON ivt.struct_id = attr.struct_id diff --git a/lms/nladmin-ui/src/views/wms/basedata/st/ivt/index.vue b/lms/nladmin-ui/src/views/wms/basedata/st/ivt/index.vue index 329ee1879..ea1de6182 100644 --- a/lms/nladmin-ui/src/views/wms/basedata/st/ivt/index.vue +++ b/lms/nladmin-ui/src/views/wms/basedata/st/ivt/index.vue @@ -240,6 +240,7 @@ +