From 9ae98c1d2580cd04c88e19c970bb5df1da26cd51 Mon Sep 17 00:00:00 2001 From: yanps Date: Thu, 28 Mar 2024 08:39:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=83=98=E7=AE=B1=E8=A1=8C=E6=9E=B6?= =?UTF-8?q?=E8=81=94=E8=B0=83=E9=97=AE=E9=A2=98=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HongXiangConveyorDefination.java | 2 +- .../OvenGantryManipulatorDeviceDriver.java | 61 ++++++++++++------- .../wms/service/impl/AcsToWmsServiceImpl.java | 10 +-- 3 files changed, 46 insertions(+), 27 deletions(-) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/HongXiangConveyorDefination.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/HongXiangConveyorDefination.java index eece99cad..0615adcd8 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/HongXiangConveyorDefination.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/HongXiangConveyorDefination.java @@ -43,7 +43,7 @@ public class HongXiangConveyorDefination implements OpcDeviceDriverDefination { @Override public List getFitDeviceTypes() { List types = new LinkedList(); - types.add(DeviceType.station); + types.add(DeviceType.conveyor); return types; } 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 8e979d905..391625cb2 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 @@ -406,15 +406,22 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i luceneExecuteLogService.deviceExecuteLog(logDto); List list = new ArrayList<>(); Map map = new HashMap(); - map.put("to_onset", start_addr); - map.put("to_target", next_addr); - map.put("to_task", instruction.getInstruction_code()); - map.put("to_command", "1"); - try { - this.writing(map); - } catch (Exception e) { - e.printStackTrace(); - } + map.put("code", "to_onset"); + map.put("value", StrUtil.isNotBlank(start_addr) ? start_addr : "0"); + Map map1 = new HashMap(); + map1.put("code", "to_target"); + map1.put("value", StrUtil.isNotBlank(next_addr) ? next_addr : "0"); + Map map2 = new HashMap(); + map2.put("code", "to_task"); + map2.put("value", instruction.getInstruction_code()); + Map map3 = new HashMap(); + map3.put("code", "to_command"); + map3.put("value", "1"); + list.add(map); + list.add(map1); + list.add(map2); + list.add(map3); + this.writing(list); if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver(); hongXiangConveyorDeviceDriver.writing("to_open_door", "1"); @@ -776,6 +783,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } else { this.instruction_update_time = date; + ArrayList list = new ArrayList(); Map map = new HashMap(); //更改任务状态 if (task > 0) { @@ -806,8 +814,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i int move = hongXiangConveyorDeviceDriver.getMove(); if (mode == 1 && door == 1 && action == 1 && error1 == 0 && move == 1) { if (this.getNow_steps_type() == 2) { - ArrayList list = new ArrayList(); - map.put("to_command", "2"); + map.put("code", "to_command"); + map.put("value", "2"); list.add(map); this.writing(list); this.setNow_steps_type(3); @@ -834,8 +842,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } } else { if (this.getNow_steps_type() == 2) { - ArrayList list = new ArrayList(); - map.put("to_command", "2"); + map.put("code", "to_command"); + map.put("value", "2"); list.add(map); this.writing(list); this.setNow_steps_type(3); @@ -873,8 +881,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i hongXiangConveyorDeviceDriver.writing(map); } if (this.getNow_steps_type() == 3) { - ArrayList list = new ArrayList(); - map.put("to_command", "3"); + map.put("code", "to_command"); + map.put("value", "3"); list.add(map); this.writing(list); this.setNow_steps_type(4); @@ -914,8 +922,10 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i int move = hongXiangConveyorDeviceDriver.getMove(); if (mode == 1 && door == 1 && action == 1 && error1 == 0 && move == 0) { if (this.getNow_steps_type() == 4) { - map.put("to_command", "4"); - this.writing(map); + map.put("code", "to_command"); + map.put("value", "4"); + list.add(map); + this.writing(list); this.setNow_steps_type(5); } else { feedMessage = "未反馈电气信号原因:当前步骤不为允许放货(now_steps_type!=4)"; @@ -942,8 +952,10 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } } else { if (this.getNow_steps_type() == 4) { - map.put("to_command", "4"); - this.writing(map); + map.put("code", "to_command"); + map.put("value", "4"); + list.add(map); + this.writing(list); this.setNow_steps_type(5); } } @@ -1012,8 +1024,10 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } } - map.put("to_command", "5"); - this.writing(map); + map.put("code", "to_command"); + map.put("value", "5"); + list.add(map); + this.writing(list); this.setNow_steps_type(6); this.setNow_steps_type(0); try { @@ -1151,6 +1165,11 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i itemMap.put(to_param, json.getString("value")); } } + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发电气信号:" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap); try { this.checkcontrol(itemMap); 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 bfe2862ca..be040d076 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 @@ -360,15 +360,15 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { String type = ""; - if (result2.getStatus() == 200) { + if (ObjectUtil.isNotEmpty(result2) && result2.getStatus() == 200) { type = "info"; + JSONObject jo = JSONObject.parseObject(result2.body()); + log.info("feedbackTaskStatusToWms-----输出参数{}", jo.toString()); + return result2; } else { type = "error"; } - - JSONObject jo = JSONObject.parseObject(result2.body()); - log.info("feedbackTaskStatusToWms-----输出参数{}", jo.toString()); - return result2; + return null; } finally { MDC.remove(log_file_type); }