From b38e1152ac40eda3f0f31f0437748ee17cf0d605 Mon Sep 17 00:00:00 2001 From: tuqiang <437016993@qq.com> Date: Tue, 9 Jul 2024 10:29:46 +0800 Subject: [PATCH] =?UTF-8?q?add:=E6=96=B0=E5=A2=9Eagv=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agv/ndctwo/AgvNdcTwoDeviceDriver.java | 267 ++++++++++++++---- .../BeltConveyorDeviceDriver.java | 2 +- .../PaperTubePickSiteDeviceDriver.java | 29 +- .../device_driver/rgv/RgvDeviceDriver.java | 28 +- .../HongXiangConveyorDeviceDriver.java | 8 +- .../InflatableShaftLibraryDeviceDriver.java | 1 + .../ToCommandControl.java | 13 + .../OvenGantryManipulatorDeviceDriver.java | 2 +- .../PlugPullDeviceSiteDeviceDriver.java | 164 +++++++---- .../PullTailManipulatorDeviceDriver.java | 28 +- .../wms/service/impl/AcsToWmsServiceImpl.java | 28 +- 11 files changed, 421 insertions(+), 149 deletions(-) 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 6d5a361e0..0a6972572 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 @@ -547,20 +547,18 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic luceneExecuteLogService.deviceExecuteLog(logDto); } String task_code = inst.getTask_code(); - EXECUTOR.submit(() -> { - if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("feedbackToLms")) - && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("task_code", task_code); - LuceneLogDto logDto1 = LuceneLogDto.builder() - .device_code(standardOrdinarySiteDeviceDriver.getDevice_code()) - .content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + standardOrdinarySiteDeviceDriver.getDeviceCode()) - .build(); - logDto1.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto1); - acsToWmsService.actionFinishRequest2(jsonObject); - } - }); + if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("feedbackToLms")) + && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("task_code", task_code); + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(standardOrdinarySiteDeviceDriver.getDevice_code()) + .content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + standardOrdinarySiteDeviceDriver.getDeviceCode()) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); + acsToWmsService.actionFinishRequest2(jsonObject); + } this.setPhase(phase); } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); @@ -577,20 +575,18 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); String task_code = inst.getTask_code(); - EXECUTOR.submit(() -> { - if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms")) - && StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("task_code", task_code); - LuceneLogDto logDto1 = LuceneLogDto.builder() - .device_code(manipulatorAgvStationDeviceDriver.getDevice_code()) - .content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + manipulatorAgvStationDeviceDriver.getDeviceCode()) - .build(); - logDto1.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto1); - acsToWmsService.actionFinishRequest2(jsonObject); - } - }); + if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms")) + && StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("task_code", task_code); + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(manipulatorAgvStationDeviceDriver.getDevice_code()) + .content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + manipulatorAgvStationDeviceDriver.getDeviceCode()) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); + acsToWmsService.actionFinishRequest2(jsonObject); + } } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); try { @@ -950,7 +946,169 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic luceneExecuteLogService.deviceExecuteLog(logDto); } + } else if (phase == 0x77) { + if (agvaddr == 0) { + agvaddr = agvaddr_copy; + } + if (agvaddr < 1) { + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agv地址参数有误,phase:" + phase) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + return; + } + if (agvaddr != 0) { + CommonFinalParam commonFinalParam = new CommonFinalParam(); + old_device_code = deviceService.queryDeviceCodeByAddress(agvaddr); + if (StrUtil.contains(old_device_code, commonFinalParam.getBARRE())) { + String[] point = old_device_code.split(commonFinalParam.getBARRE()); + device_code = point[0]; + } else if (StrUtil.contains(old_device_code, commonFinalParam.getPOINT())) { + String[] point = old_device_code.split("\\."); + device_code = point[0]; + emptyNum = point[1]; + } else { + device_code = old_device_code; + } + } + + device = deviceAppService.findDeviceByCode(device_code); + if (ObjectUtil.isEmpty(device_code)) { + log.info(agvaddr + "对应设备号为空!"); + return; + } + if (ObjectUtil.isEmpty(inst)) { + log.info("未找到指令号{}对应的指令", ikey); + return; + } + + String start_device_code = inst.getStart_device_code(); + String next_device_code = inst.getNext_device_code(); + String start_device_code2 = inst.getStart_device_code2(); + String next_device_code2 = inst.getNext_device_code2(); + + if (ObjectUtil.isNotEmpty(start_device_code) && StrUtil.equals(device_code, start_device_code)) { + if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { + manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); + + try { + manipulatorAgvStationDeviceDriver.writing(2); + } catch (Exception e) { + e.printStackTrace(); + } + if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } else if (ObjectUtil.isNotEmpty(start_device_code) && StrUtil.equals(device_code, next_device_code)) { + if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { + manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); + + try { + manipulatorAgvStationDeviceDriver.writing(4); + } catch (Exception e) { + e.printStackTrace(); + } + if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } + } else if (ObjectUtil.isNotEmpty(start_device_code) && StrUtil.equals(device_code, start_device_code2)) { + if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { + manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); + + try { + manipulatorAgvStationDeviceDriver.writing(4); + } catch (Exception e) { + e.printStackTrace(); + } + if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } + } else if (ObjectUtil.isNotEmpty(start_device_code) && StrUtil.equals(device_code, next_device_code2)) { + if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { + manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); + + try { + manipulatorAgvStationDeviceDriver.writing(2); + } catch (Exception e) { + e.printStackTrace(); + } + if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } + } +// else { +// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); +// LuceneLogDto logDto = LuceneLogDto.builder() +// .device_code(this.getDeviceCode()) +// .content("agvphase:" + phase + "反馈:" + data) +// .build(); +// logDto.setLog_level(4); +// luceneExecuteLogService.deviceExecuteLog(logDto); +// } + } } + // 取货完毕 //(Itype=1、3,需要WCS反馈) else if (phase == 0x0A) { @@ -1016,20 +1174,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); String task_code = inst.getTask_code(); - EXECUTOR.submit(() -> { - if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("feedbackToLms")) - && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("task_code", task_code); - LuceneLogDto logDto1 = LuceneLogDto.builder() - .device_code(standardOrdinarySiteDeviceDriver.getDevice_code()) - .content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + standardOrdinarySiteDeviceDriver.getDeviceCode()) - .build(); - logDto1.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto1); - acsToWmsService.actionFinishRequest2(jsonObject); - } - }); + if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("feedbackToLms")) + && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("task_code", task_code); + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(standardOrdinarySiteDeviceDriver.getDevice_code()) + .content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + standardOrdinarySiteDeviceDriver.getDeviceCode()) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); + acsToWmsService.actionFinishRequest2(jsonObject); + } + } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); try { @@ -1069,20 +1226,18 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); String task_code = inst.getTask_code(); - EXECUTOR.submit(() -> { - if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms")) - && StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("task_code", task_code); - LuceneLogDto logDto1 = LuceneLogDto.builder() - .device_code(manipulatorAgvStationDeviceDriver.getDevice_code()) - .content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + manipulatorAgvStationDeviceDriver.getDeviceCode()) - .build(); - logDto1.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto1); - acsToWmsService.actionFinishRequest2(jsonObject); - } - }); + if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms")) + && StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("task_code", task_code); + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(manipulatorAgvStationDeviceDriver.getDevice_code()) + .content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + manipulatorAgvStationDeviceDriver.getDeviceCode()) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); + acsToWmsService.actionFinishRequest2(jsonObject); + } } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); try { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java index 1d724b87e..48d455a21 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java @@ -777,7 +777,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements .device_code(device_code) .content("下发多个电气信号" + itemMap) .build(); - logDto.setLog_level(3); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/paper_tube_pick_site/PaperTubePickSiteDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/paper_tube_pick_site/PaperTubePickSiteDeviceDriver.java index b360affef..17e576700 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/paper_tube_pick_site/PaperTubePickSiteDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/paper_tube_pick_site/PaperTubePickSiteDeviceDriver.java @@ -231,6 +231,13 @@ public class PaperTubePickSiteDeviceDriver extends AbstractOpcDeviceDriver imple jo.put("device_code",this.getDevice_code()); jo.put("row_num",this.getPaper_location()); jo.put("material_code",this.getPaper_code()); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("反馈管芯抓取位,请求参数:" + jo) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + logServer.deviceExecuteLog(this.device_code, "", "", "反馈管芯抓取位,参数:" + jo); HttpResponse httpResponse = acsToWmsService.feedbackDies(jo); JSONObject jsonObject = null; if(ObjectUtil.isNotEmpty(httpResponse)){ @@ -242,22 +249,28 @@ public class PaperTubePickSiteDeviceDriver extends AbstractOpcDeviceDriver imple map.put("to_command", 6); try { this.writing(map); - } catch (Exception e) { - LuceneLogDto logDto = LuceneLogDto.builder() + LuceneLogDto logDto1 = LuceneLogDto.builder() .device_code(device_code) - .content("下发信号报错" + map) + .content("反馈管芯抓取位,返回参数" + jsonObject) .build(); - logDto.setLog_level(3); - luceneExecuteLogService.deviceExecuteLog(logDto); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); + } catch (Exception e) { + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(device_code) + .content("反馈管芯抓取位" + map) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); } return true; }else{ - LuceneLogDto logDto = LuceneLogDto.builder() + LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) .content("反馈LMS管芯失败" + httpResponse.body()) .build(); - logDto.setLog_level(3); - luceneExecuteLogService.deviceExecuteLog(logDto); + logDto2.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto2); return false; } } 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 299e594be..7a56ad856 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 @@ -258,10 +258,28 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr applyManipulatorActionRequest.setDevice_code(device_code); applyManipulatorActionRequest.setDirection(direction);//rgv申请位置 applyManipulatorActionRequest.setQzz_no(String.valueOf(barcode));//气涨轴编码 + JSONObject param = new JSONObject(); + param.put("device_code", device_code); + param.put("type", CommonFinalParam.TYPE_FOUR); + param.put("barcode", String.valueOf(barcode)); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("RGV工位上有货申请行架任务,请求参数" + param) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + logServer.deviceExecuteLog(this.device_code, "", "", "RGV工位上有货申请行架任务,请求参数:" + param); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); Map map = new LinkedHashMap<>(); if (applyManipulatorActionResponse.getstatus() == 200) { Map data = applyManipulatorActionResponse.getData(); + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(device_code) + .content("RGV工位上有货申请行架任务,返回参数" + data) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); + logServer.deviceExecuteLog(this.device_code, "", "", "RGV工位上有货申请行架任务,返回参数:" + data); String point_code2 = data.get("point_code2");//目标站点 Device deviceByCode = deviceAppService.findDeviceByCode(point_code2); String address = deviceByCode.getExtraValue().get("address").toString(); @@ -276,7 +294,7 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr map.put("to_is_labeling","0"); } this.writing(map); - logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务,返回参数:" + applyManipulatorActionResponse); + logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务,返回参数:" + data); message = "universal_message12"; requireSucess = true; } else { @@ -284,7 +302,13 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr this.writing(map); requireSucess = true; message = "universal_message13"; - logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务反馈失败,返回参数:" + applyManipulatorActionResponse); + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(device_code) + .content("RGV工位上有货申请行架任务,返回参数" + applyManipulatorActionResponse.getData()) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); + logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务反馈失败,返回参数:" + applyManipulatorActionResponse.getData()); } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/HongXiangConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/HongXiangConveyorDeviceDriver.java index f7590d4e4..3234ae286 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/HongXiangConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/HongXiangConveyorDeviceDriver.java @@ -252,7 +252,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple .device_code(device_code) .content("下发多个电气信号" + itemMap) .build(); - logDto.setLog_level(3); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } @@ -280,7 +280,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple .device_code(device_code) .content("下发多个电气信号" + itemMap) .build(); - logDto.setLog_level(3); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } } @@ -301,7 +301,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple .device_code(device_code) .content("下发电气信号:" + itemMap) .build(); - logDto.setLog_level(3); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap); try { @@ -352,7 +352,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple .device_code(device_code) .content("下发多个电气信号" + itemMap) .build(); - logDto.setLog_level(3); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/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 74fd1b629..9363ec78d 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 @@ -144,6 +144,7 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver .device_code(device_code) .content("下发多个电气信号" + itemMap) .build(); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ToCommandControl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ToCommandControl.java index 92567876c..989812f8c 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ToCommandControl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ToCommandControl.java @@ -6,6 +6,10 @@ import com.alibaba.fastjson.JSONObject; import org.nl.acs.device_driver.driver.ItemValue; import org.nl.acs.device_driver.stacker.standard_stacker.ItemProtocol; import org.nl.acs.device_driver.stacker.standard_stacker.StandardStackerDeviceDriver; +import org.nl.config.SpringContextHolder; +import org.nl.config.lucene.service.LuceneExecuteLogService; +import org.nl.config.lucene.service.dto.LuceneLogDto; +import org.springframework.beans.factory.annotation.Autowired; import java.util.HashMap; import java.util.Map; @@ -18,6 +22,9 @@ public class ToCommandControl { this.driver = driver; } + @Autowired + LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class); + public void control(int command) throws Exception { // ItemValue[] itemValues = new ItemValue[]{new ItemValue(this.driver.getItem(ItemProtocol.item_to_command), command)}; Map itemMap = new HashMap(); @@ -26,6 +33,12 @@ public class ToCommandControl { Object obj = command; itemMap.put(to_param, obj); this.driver.checkcontrol(itemMap); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.driver.getDevice().getDevice_code()) + .content("下发多个电气信号" + itemMap) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java index 1e5da9b03..c7bca193b 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java @@ -1236,7 +1236,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i .device_code(device_code) .content("下发电气信号:" + itemMap) .build(); - logDto.setLog_level(3); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap); try { 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 4b5450d17..cf10cf5f3 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 @@ -305,13 +305,6 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl return; } else { logServer.deviceExecuteLog(this.device_code,"","","申请套管"); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(device_code + "当前mode值为:" + mode) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - logServer.deviceExecuteLog(this.device_code, "", "", "当前mode值为:" + mode); ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest(); ApplyPlugPullSitResponse applyPlugPullSitResponse; applyPlugPullSiteRequest.setDevice_code(device_code); @@ -322,7 +315,13 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl param.put("device_code", device_code); param.put("type", CommonFinalParam.TYPE_ONE); param.put("size", String.valueOf(size)); - logServer.deviceExecuteLog(this.device_code, "", "", "申请套轴请求,参数:" + param); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("申请套管任务,请求参数::" + param) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + logServer.deviceExecuteLog(this.device_code, "", "", "申请套轴任务,请求参数:" + param); applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest); if (applyPlugPullSitResponse.getstatus() == CommonFinalParam.STATUS_OPEN) { LuceneLogDto logDto2 = LuceneLogDto.builder() @@ -365,7 +364,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl map.put("to_qty1", number); this.writing(map); requireSucess = true; - logServer.deviceExecuteLog(this.device_code, "", "", "申请套管,返回参数:" + applyPlugPullSitResponse); + logServer.deviceExecuteLog(this.device_code, "", "", "申请套管成功,返回参数:" + applyPlugPullSitResponse.getData()); message = "申请套管成功"; } if (StrUtil.equals("2", is_bushing)){ @@ -374,7 +373,13 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl this.writing(map); requireSucess = true; message = "不套管,送空气轴"; - logServer.deviceExecuteLog(this.device_code, "", "", "不申请套管反馈,返回参数:" + applyPlugPullSitResponse); + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(device_code) + .content("不套管,送空气轴,下发电气信号to_command:97") + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); + logServer.deviceExecuteLog(this.device_code, "", "", message); } if (StrUtil.equals("0", is_bushing)){ Map map = new LinkedHashMap<>(); @@ -382,7 +387,13 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl this.writing(map); requireSucess = true; message = "缺少纸管,人工确认"; - logServer.deviceExecuteLog(this.device_code, "", "", "不申请套管反馈,返回参数:" + applyPlugPullSitResponse); + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(device_code) + .content("缺少纸管,人工确认,下发电气信号to_command:98") + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); + logServer.deviceExecuteLog(this.device_code, "", "", message); } } else { message = applyPlugPullSitResponse.getMessage(); @@ -391,6 +402,12 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl this.writing(map); requireSucess = true; message = "申请套管失败"; + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(device_code) + .content("申请套管反馈失败,返回参数:"+applyPlugPullSitResponse) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); logServer.deviceExecuteLog(this.device_code, "", "", "申请套管反馈失败,返回参数:" + applyPlugPullSitResponse); } } @@ -405,14 +422,6 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); return; } else { - logServer.deviceExecuteLog(this.device_code,"","","套管完成"); - 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); @@ -429,17 +438,23 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl param.put("material1", String.valueOf(material1)); param.put("weight1", String.valueOf(weight1)); param.put("material1", String.valueOf(material1)); - logServer.deviceExecuteLog(this.device_code, "", "", "套管完成请求,参数:" + param); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("申请套管完成任务,请求参数:" + param) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + logServer.deviceExecuteLog(this.device_code, "", "", "套管完成任务,请求参数:" + param); applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest); if (applyPlugPullSitResponse.getstatus() == CommonFinalParam.STATUS_OPEN) { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) - .content("申请套管成功:" + applyPlugPullSitResponse.getData()) + .content("套管完成成功,返回参数:" + applyPlugPullSitResponse.getData()) .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); this.writeSignal(mode); - logServer.deviceExecuteLog(this.device_code, "", "", "反馈套管完成,返回参数:" + applyPlugPullSitResponse); + logServer.deviceExecuteLog(this.device_code, "", "", "反馈套管完成,返回参数:" + applyPlugPullSitResponse.getData()); message = "套管完成成功"; } else { message = applyPlugPullSitResponse.getMessage(); @@ -448,7 +463,13 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl this.writing(map); requireSucess = true; message = "套管完成失败"; - logServer.deviceExecuteLog(this.device_code, "", "", "反馈套管完成失败,返回参数:" + applyPlugPullSitResponse); + LuceneLogDto logDto2 = LuceneLogDto.builder() + .device_code(device_code) + .content("反馈套管完成失败,返回参数:" + applyPlugPullSitResponse.getData()) + .build(); + logDto2.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto2); + logServer.deviceExecuteLog(this.device_code, "", "", "反馈套管完成失败,返回参数:" + applyPlugPullSitResponse.getData()); } } @@ -464,13 +485,6 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl return; } else { logServer.deviceExecuteLog(this.device_code,"","","拔轴完成"); - 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); @@ -480,14 +494,26 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl param.put("device_code", device_code); param.put("type", CommonFinalParam.TYPE_THREE); param.put("barcode", String.valueOf(barcode)); - logServer.deviceExecuteLog(this.device_code, "", "", "拔轴完成请求,参数:" + param); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("申请拔轴完成任务,请求参数:" + param) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴完成任务,请求参数:" + param); applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest); if (applyPlugPullSitResponse.getstatus() == CommonFinalParam.STATUS_OPEN) { Map map = new LinkedHashMap<>(); map.put("to_command", mode); this.writing(map); requireSucess = true; - logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴完成,返回参数:" + applyPlugPullSitResponse); + logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴完成任务,返回参数:" + applyPlugPullSitResponse.getData()); + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(device_code) + .content("申请拔轴完成,返回参数:"+applyPlugPullSitResponse.getData()) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); message = "拔轴完成成功"; } else { message = applyPlugPullSitResponse.getMessage(); @@ -496,7 +522,13 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl this.writing(map); requireSucess = true; message = "拔轴完成失败"; - logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴完成反馈失败,返回参数:" + applyPlugPullSitResponse); + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(device_code) + .content("拔轴完成反馈失败,返回参数:"+applyPlugPullSitResponse.getData()) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); + logServer.deviceExecuteLog(this.device_code, "", "", "拔轴完成反馈失败,返回参数:" + applyPlugPullSitResponse.getData()); } } } @@ -511,13 +543,6 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl return; } else { logServer.deviceExecuteLog(this.device_code,"","","申请拔轴"); - 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); @@ -527,7 +552,13 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl param.put("device_code", device_code); param.put("type", CommonFinalParam.TYPE_FOUR); param.put("barcode", String.valueOf(barcode)); - logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴请求,参数:" + param); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("申请拔轴任务,请求参数:" + param) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴任务,请求参数:" + param); applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest); if (applyPlugPullSitResponse.getstatus() == CommonFinalParam.STATUS_OPEN) { Map data = applyPlugPullSitResponse.getData(); @@ -562,8 +593,14 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl map.put("to_command", mode); this.writing(map); requireSucess = true; - logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse); + logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse.getData()); message = "申请拔轴成功"; + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(device_code) + .content("申请拔轴任务,返回参数:"+applyPlugPullSitResponse.getData()) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); } else { message = applyPlugPullSitResponse.getMessage(); Map map = new LinkedHashMap<>(); @@ -571,7 +608,13 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl this.writing(map); requireSucess = true; message = "申请拔轴失败"; - logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse); + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(device_code) + .content("申请拔轴反馈失败,返回参数:"+applyPlugPullSitResponse.getData()) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); + logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse.getData()); } } } @@ -586,13 +629,6 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl return; } else { logServer.deviceExecuteLog(this.device_code,"","","缓存线已满,生成行架任务"); - 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); @@ -602,20 +638,38 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl param.put("device_code", device_code); param.put("type", CommonFinalParam.TYPE_FIVE); param.put("size", String.valueOf(size)); - logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务,参数:" + param); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("申请行架任务,请求参数:" + param) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务,请求参数:" + param); applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest); if (applyPlugPullSitResponse.getstatus() == CommonFinalParam.STATUS_OPEN) { Map map = new LinkedHashMap<>(); map.put("to_command", mode); this.writing(map); - logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务,返回参数:" + applyPlugPullSitResponse); + logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务,返回参数:" + applyPlugPullSitResponse.getData()); message = "生成行架任务成功"; + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(device_code) + .content("申请行架任务,返回参数:" + applyPlugPullSitResponse.getData()) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); requireSucess = true; } else { message = applyPlugPullSitResponse.getMessage(); requireSucess = true; message = "申请行架任务失败"; - logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务失败,返回参数:" + applyPlugPullSitResponse); + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(device_code) + .content("申请行架任务失败,返回参数:" + applyPlugPullSitResponse.getData()) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); + logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务失败,返回参数:" + applyPlugPullSitResponse.getData()); } } } @@ -656,7 +710,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl .device_code(device_code) .content("下发多个电气信号" + itemMap) .build(); - logDto.setLog_level(3); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); this.control(itemMap); } @@ -676,7 +730,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl .device_code(device_code) .content("下发多个电气信号" + itemMap) .build(); - logDto.setLog_level(3); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_tail_manipulator/PullTailManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_tail_manipulator/PullTailManipulatorDeviceDriver.java index 23361c30a..f43d0b5fc 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_tail_manipulator/PullTailManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_tail_manipulator/PullTailManipulatorDeviceDriver.java @@ -217,29 +217,41 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp if (mode == 3 && action == 5 && move == 0 && StrUtil.isNotEmpty(sub_volume_no) && !requireSucess) { logServer.deviceExecuteLog(this.device_code,"","","反馈重量"); ApplyfeedbackSubVolumeWeightRequest applyfeedbackSubVolumeWeightRequest = new ApplyfeedbackSubVolumeWeightRequest(); - ApplyfeedbackSubVolumeWeightResponse applyPlugPullSitResponse; + ApplyfeedbackSubVolumeWeightResponse applyfeedbackSubVolumeWeightResponse; applyfeedbackSubVolumeWeightRequest.setSub_volume(sub_volume_no); applyfeedbackSubVolumeWeightRequest.setWeight1(weight); JSONObject param = new JSONObject(); param.put("device_code", device_code); param.put("sub_volume", sub_volume_no); param.put("weight1", weight); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("反馈LMS子卷重量,请求参数:" + param) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); logServer.deviceExecuteLog(this.device_code, "", "", "反馈重量,参数:" + param); - applyPlugPullSitResponse = acsToWmsService.applyfeedbackSubVolumeWeight(applyfeedbackSubVolumeWeightRequest); - if(applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN){ + applyfeedbackSubVolumeWeightResponse = acsToWmsService.applyfeedbackSubVolumeWeight(applyfeedbackSubVolumeWeightRequest); + if(applyfeedbackSubVolumeWeightResponse.getCode() == CommonFinalParam.STATUS_OPEN){ Map map = new LinkedHashMap<>(); //todo:反馈重量 map.put("to_command", "5"); this.writing(map); + LuceneLogDto logDto2 = LuceneLogDto.builder() + .device_code(device_code) + .content("反馈LMS子卷重量,返回参数:" + applyfeedbackSubVolumeWeightResponse.getData()) + .build(); + logDto2.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto2); this.requireSucess = true; }else{ - LuceneLogDto logDto = LuceneLogDto.builder() + LuceneLogDto logDto1 = LuceneLogDto.builder() .device_code(device_code) - .content("反馈LMS子卷重量失败:"+ applyPlugPullSitResponse.getMessage()) + .content("反馈LMS子卷重量失败:"+ applyfeedbackSubVolumeWeightResponse.getData()) .build(); - logDto.setLog_level(4); - message = "反馈LMS子卷重量失败:"+ applyPlugPullSitResponse.getMessage(); - luceneExecuteLogService.deviceExecuteLog(logDto); + logDto1.setLog_level(4); + message = "反馈LMS子卷重量失败:"+ applyfeedbackSubVolumeWeightResponse.getMessage(); + luceneExecuteLogService.deviceExecuteLog(logDto1); } } else if(mode == 3){ feedMessage = "行架机械手:"; 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 4b87df945..8a9911daf 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 @@ -185,7 +185,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { type = "error"; } log.info("applyTaskToWms-----输出参数{}", result2.body()); - LuceneLogDto luceneLogDto = new LuceneLogDto(4,"applyTaskToWms", String.valueOf(result2.getStatus()), + LuceneLogDto luceneLogDto = new LuceneLogDto(4,"applyTwo", String.valueOf(result2.getStatus()), JSON.toJSONString(param), String.valueOf(result2.body()), "二期入库申请任务"); luceneLogService.interfaceExecuteLog(luceneLogDto); return result2.body(); @@ -349,7 +349,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { .header("Authorization", token).body(String.valueOf(data)) .execute(); // //System.out.println(result2); - LuceneLogDto luceneLogDto = new LuceneLogDto(4,"feedbackTaskStatusToWms", String.valueOf(result2.getStatus()), + LuceneLogDto luceneLogDto = new LuceneLogDto(4,"feedTaskStatus", String.valueOf(result2.getStatus()), String.valueOf(data), String.valueOf(result2.body()), "ACS向WMS反馈任务状态"); luceneLogService.interfaceExecuteLog(luceneLogDto); } catch (Exception e) { @@ -369,7 +369,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { type = "info"; JSONObject jo = JSONObject.parseObject(result2.body()); log.info("feedbackTaskStatusToWms-----输出参数{}", jo.toString()); - LuceneLogDto luceneLogDto = new LuceneLogDto(4,"feedbackTaskStatusToWms", String.valueOf(result2.getStatus()), + LuceneLogDto luceneLogDto = new LuceneLogDto(4,"feedTaskStatus", String.valueOf(result2.getStatus()), String.valueOf(data), String.valueOf(result2.body()), "ACS向WMS反馈任务状态"); luceneLogService.interfaceExecuteLog(luceneLogDto); return result2; @@ -410,7 +410,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { map.put("message", e.getMessage()); return JSONObject.toJavaObject(map, ApplyGreenFoilButtonResponse.class); } - LuceneLogDto luceneLogDto = new LuceneLogDto(4,"ApplyGreenFoilButtonRequest", String.valueOf(applyGreenFoilButtonResponse.getCode()), + LuceneLogDto luceneLogDto = new LuceneLogDto(4,"applyGreenFoilButtonTask", String.valueOf(applyGreenFoilButtonResponse.getCode()), JSON.toJSONString(param), String.valueOf(applyGreenFoilButtonResponse.getMessage()), "ACS向LMS申请生箔按钮任务"); luceneLogService.interfaceExecuteLog(luceneLogDto); } @@ -434,13 +434,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } catch (Exception e) { String message = e.getMessage(); log.info("applyBlankButtonTask----反馈表处按钮请求失败{}", message); - LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyBlankButtonTask", String.valueOf(result.getStatus()), + LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyButtonTask", String.valueOf(result.getStatus()), JSON.toJSONString(result), String.valueOf(result.body()), "反馈下发表处任务报错"); luceneLogService.interfaceExecuteLog(luceneLogDto); } log.info("applyBlankButtonTask - 反馈表处按钮{}", result.body()); - LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyBlankButtonTask", String.valueOf(result.getStatus()), + LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyButtonTask", String.valueOf(result.getStatus()), JSON.toJSONString(result.body()), String.valueOf(result.body()), "反馈下发表处任务"); luceneLogService.interfaceExecuteLog(luceneLogDto); @@ -473,7 +473,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { log.info("向lms申请套管工位请求----返回参数{}", ("1".equals(param.getType()) ? "套轴" : "2".equals(param.getType()) ? "套轴完成" : "3".equals(param.getType()) ? "拔轴完成" : "4".equals(param.getType()) ? "拔轴" : "缓存线已满,生成行架任务")); applyPlugPullSitResponse = JSONObject.toJavaObject(jsonObject, ApplyPlugPullSitResponse.class); - LuceneLogDto luceneLogDto = new LuceneLogDto(4, "ApplyPlugPullSiteRequest", String.valueOf(applyPlugPullSitResponse.getstatus()), + 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()) ? "拔轴" : "缓存线已满,生成行架任务")); @@ -482,7 +482,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { JSONObject jsonObject = JSONObject.parseObject(result); log.info("向lms申请套管工位请求----返回参数{}", result); applyPlugPullSitResponse = JSONObject.toJavaObject(jsonObject, ApplyPlugPullSitResponse.class); - LuceneLogDto luceneLogDto = new LuceneLogDto(4, "ApplyPlugPullSiteRequest", String.valueOf(applyPlugPullSitResponse.getstatus()), + 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(); @@ -554,15 +554,15 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { JSONObject jsonObject = JSONObject.parseObject(result); log.info("RGV工位上有货申请行架任务----返回参数{}", result); applyManipulatorActionResponse = JSONObject.toJavaObject(jsonObject, ApplyManipulatorActionResponse.class); - LuceneLogDto luceneLogDto = new LuceneLogDto(4, "ApplyManipulatorActionRequest", String.valueOf(applyManipulatorActionResponse.getCode()), - JSON.toJSONString(param), String.valueOf(applyManipulatorActionResponse), "ACS向LMS申请反馈子卷重量失败"); + LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyManipulatorAction", String.valueOf(applyManipulatorActionResponse.getCode()), + JSON.toJSONString(param), String.valueOf(applyManipulatorActionResponse), "RGV工位上有货申请行架任务失败"); luceneLogService.interfaceExecuteLog(luceneLogDto); JSONObject map = new JSONObject(); map.put("status", 400); map.put("message", e.getMessage()); return JSONObject.toJavaObject(map, ApplyManipulatorActionResponse.class); } - LuceneLogDto luceneLogDto = new LuceneLogDto(4, "ApplyManipulatorActionRequest", String.valueOf(applyManipulatorActionResponse.getCode()), + LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyManipulatorAction", String.valueOf(applyManipulatorActionResponse.getCode()), JSON.toJSONString(param), String.valueOf(applyManipulatorActionResponse), "RGV工位上有货申请行架任务"); luceneLogService.interfaceExecuteLog(luceneLogDto); } @@ -595,7 +595,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { map.put("message", e.getMessage()); return JSONObject.toJavaObject(map, GetWasteFoilWeightResponse.class); } - LuceneLogDto luceneLogDto = new LuceneLogDto(4,"GetWasteFoilWeightRequest", String.valueOf(getWasteFoilWeightResponse.getCode()), + LuceneLogDto luceneLogDto = new LuceneLogDto(4,"feedbackWeight", String.valueOf(getWasteFoilWeightResponse.getCode()), JSON.toJSONString(param), String.valueOf(getWasteFoilWeightResponse), "ACS向LMS申请反馈"); luceneLogService.interfaceExecuteLog(luceneLogDto); } @@ -792,7 +792,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { .body(param.toString()) .execute(); log.info("sendDeviceStatus - 返回参数 {}", response.body()); - LuceneLogDto luceneLogDto = new LuceneLogDto(4,"feedbackDie", String.valueOf(response.getStatus()), + LuceneLogDto luceneLogDto = new LuceneLogDto(4,"sendDeviceStatus", String.valueOf(response.getStatus()), String.valueOf(param), String.valueOf(response.body()), "向LMS发送设备状态"); luceneLogService.interfaceExecuteLog(luceneLogDto); @@ -834,7 +834,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { type = "error"; } log.info("applyUpdatePointCode-----输出参数{}", result2.body()); - LuceneLogDto luceneLogDto = new LuceneLogDto(4,"applyUpdatePointCode", String.valueOf(result2.getStatus()), + LuceneLogDto luceneLogDto = new LuceneLogDto(4,"deviceApplyExceptional", String.valueOf(result2.getStatus()), JSON.toJSONString(param), String.valueOf(result2.body()), "申请更新点位"); luceneLogService.interfaceExecuteLog(luceneLogDto); return result2.body();