From 1181d4c192830a600becd37d797c12912e807da2 Mon Sep 17 00:00:00 2001 From: tuqiang <437016993@qq.com> Date: Thu, 9 Nov 2023 13:21:01 +0800 Subject: [PATCH 1/4] =?UTF-8?q?opt:=E5=86=85=E5=8C=85=E9=97=B4=E8=A1=8C?= =?UTF-8?q?=E6=9E=B6=E5=92=8C=E6=8F=92=E6=8B=94=E8=BD=B4=E6=9C=BA=E9=A9=B1?= =?UTF-8?q?=E5=8A=A8=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IndoorManipulatorDeviceDriver.java | 220 +++++++++++++++--- ...PluggingUnpluggingMachineDeviceDriver.java | 25 +- 2 files changed, 205 insertions(+), 40 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java index 69e69deee..17ca5758b 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java @@ -264,7 +264,8 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + "->" + move); } if (action != last_action) { - this.setFeedbackSucess(false); + this.setRequireSucess(false); + logServer.deviceItemValue(this.device_code, "action", String.valueOf(action)); logServer.deviceExecuteLog(this.device_code, "", "", "信号action:" + last_action + "->" + action); } @@ -444,6 +445,41 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple } } + ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); + ApplyManipulatorActionResponse applyManipulatorActionResponse; + //反馈尺寸 + if (action == 2) { + Instruction inst2 = checkInst(); + String task_code = inst2.getTask_code(); + TaskDto taskDto = taskserver.findByCode(task_code); + String truss_type = taskDto.getTruss_type(); + applyManipulatorActionRequest.setType(truss_type); + applyManipulatorActionRequest.setTask_code(task_code); + applyManipulatorActionRequest.setSize(String.valueOf(inflatable_shaft_size)); + applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); + if (applyManipulatorActionResponse.getstatus() == 200) { + requireSucess = true; + message = "反馈LMS成功..."; + logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); + String version = applyManipulatorActionResponse.getVersion(); + String bushing_num = applyManipulatorActionResponse.getBushing_num(); + String is_bushing = applyManipulatorActionResponse.getIs_bushing(); + String detail_type = applyManipulatorActionResponse.getDetail_type(); + String put_device_code = applyManipulatorActionResponse.getPut_device_code(); + Map map = new LinkedHashMap<>(); + map.put("to_command", "2"); + map.put("inflatableShaftVersion", version); + map.put("tube_num", bushing_num); + map.put("is_wrapped", is_bushing); + map.put("to_putpoint", put_device_code); + this.writing(map); + } else { + requireSucess = true; + message = "完成反馈LMS失败," + String.valueOf(applyManipulatorActionResponse); + logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); + } + } + //任务完成 if (action == 8) { Instruction inst2 = checkInst(); @@ -461,8 +497,8 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple if (mode != 3) { feedMessage = feedMessage + "工作模式(mode)不为运行中状态,"; } - if (action != 6) { - feedMessage = feedMessage + "动作信号(action)不为放货完成状态,"; + if (action != 8) { + feedMessage = feedMessage + "动作信号(action)不为完成状态,"; } if (move != 0) { feedMessage = feedMessage + "光电信号(move)不为无货状态,"; @@ -499,7 +535,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); ApplyManipulatorActionResponse applyManipulatorActionResponse; //反馈气胀轴尺寸 - if (mode == 3) { + if (action == 2) { Instruction inst2 = checkInst(); String task_code = inst2.getTask_code(); TaskDto taskDto = taskserver.findByCode(task_code); @@ -516,7 +552,6 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple map.put("to_command", "2"); map.put("to_task_type", "2"); this.writing(map); - this.setFeedbackSucess(true); } else { requireSucess = true; message = "完成反馈LMS失败," + String.valueOf(applyManipulatorActionResponse); @@ -539,7 +574,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple map.put("to_command", "3"); map.put("to_putpoint", put_device_code); this.writing(map); - this.setFeedbackSucess(true); + requireSucess = true; } //任务完成 @@ -559,8 +594,8 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple if (mode != 3) { feedMessage = feedMessage + "工作模式(mode)不为运行中状态,"; } - if (action != 6) { - feedMessage = feedMessage + "动作信号(action)不为放货完成状态,"; + if (action != 8) { + feedMessage = feedMessage + "动作信号(action)不为完成状态,"; } if (move != 0) { feedMessage = feedMessage + "光电信号(move)不为无货状态,"; @@ -594,7 +629,94 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple } } + //从拔轴机取货的新行架任务 + if (mode == 3 && action == 1 && move == 0 && task > 0) { + Instruction inst2 = checkInst(); + if (ObjectUtil.isNotEmpty(inst2)) { + String start_device_code = inst2.getStart_device_code(); + Device device = deviceAppService.findDeviceByCode(start_device_code); + PluggingUnpluggingMachineDeviceDriver pluggingUnpluggingMachineDeviceDriver; + if (device.getDeviceDriver() instanceof PluggingUnpluggingMachineDeviceDriver) { + pluggingUnpluggingMachineDeviceDriver = (PluggingUnpluggingMachineDeviceDriver) device.getDeviceDriver(); + int mode = pluggingUnpluggingMachineDeviceDriver.getMode(); + int error1 = pluggingUnpluggingMachineDeviceDriver.getError(); + int move = pluggingUnpluggingMachineDeviceDriver.getMove(); + if (mode == 2 && error1 == 0 && move == 1) { + Map map = new LinkedHashMap<>(); + map.put("to_command", "1"); + this.writing(map); + this.setFeedbackSucess(true); + } + } + } + } else { + feedMessage = "行架机械手:"; + if (mode != 3) { + feedMessage = feedMessage + "工作模式(mode)不为运行中状态,"; + } + if (action != 1) { + feedMessage = feedMessage + "动作信号(action)不为取货中状态,"; + } + if (move != 0) { + feedMessage = feedMessage + "光电信号(move)不为无货状态,"; + } + if (task == 0) { + feedMessage = feedMessage + "当前上报任务号(task)不应该为0。"; + } + } + ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); + ApplyManipulatorActionResponse applyManipulatorActionResponse; + //反馈尺寸 + if (action == 2) { + Instruction inst2 = checkInst(); + String task_code = inst2.getTask_code(); + TaskDto taskDto = taskserver.findByCode(task_code); + String truss_type = taskDto.getTruss_type(); + applyManipulatorActionRequest.setType(truss_type); + applyManipulatorActionRequest.setTask_code(task_code); + applyManipulatorActionRequest.setSize(String.valueOf(inflatable_shaft_size)); + applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); + if (applyManipulatorActionResponse.getstatus() == 200) { + requireSucess = true; + message = "反馈LMS成功..."; + logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); + String version = applyManipulatorActionResponse.getVersion(); + String bushing_num = applyManipulatorActionResponse.getBushing_num(); + String is_bushing = applyManipulatorActionResponse.getIs_bushing(); + String detail_type = applyManipulatorActionResponse.getDetail_type(); + String put_device_code = applyManipulatorActionResponse.getPut_device_code(); + Map map = new LinkedHashMap<>(); + map.put("to_command", "2"); + map.put("inflatableShaftVersion", version); + map.put("tube_num", bushing_num); + map.put("is_wrapped", is_bushing); + map.put("to_putpoint", put_device_code); + this.writing(map); + } else { + requireSucess = true; + message = "完成反馈LMS失败," + String.valueOf(applyManipulatorActionResponse); + logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); + } + } + + //申请放货点 + if (action == 3) { + Instruction inst2 = checkInst(); + String task_code = inst2.getTask_code(); + TaskDto taskDto = taskserver.findByCode(task_code); + String truss_type = taskDto.getTruss_type(); + applyManipulatorActionRequest.setType(truss_type); + applyManipulatorActionRequest.setTask_code(String.valueOf(task)); + applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); + String put_device_code = applyManipulatorActionResponse.getPut_device_code(); + String detail_type = applyManipulatorActionResponse.getDetail_type(); + Map map = new LinkedHashMap<>(); + map.put("to_command", "3"); + map.put("to_putpoint", put_device_code); + this.writing(map); + this.setFeedbackSucess(true); + } //任务完成 @@ -605,8 +727,8 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple String task_code = inst2.getTask_code(); TaskDto taskDto = taskserver.findByCode(task_code); String truss_type = taskDto.getTruss_type(); - finish_instruction(inst2); - this.writing("to_command", "8"); + finish_instruction(inst2); + this.writing("to_command", "8"); } catch (Exception e) { e.printStackTrace(); } @@ -618,7 +740,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple feedMessage = feedMessage + "工作模式(mode)不为运行中状态,"; } if (action != 8) { - feedMessage = feedMessage + "动作信号(action)不为放货完成状态,"; + feedMessage = feedMessage + "动作信号(action)不为完成状态,"; } if (move != 0) { feedMessage = feedMessage + "光电信号(move)不为无货状态,"; @@ -680,7 +802,6 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple map.put("is_wrapped", is_bushing); map.put("to_putpoint", put_device_code); this.writing(map); - this.setFeedbackSucess(true); } else { requireSucess = true; message = "完成反馈LMS失败," + String.valueOf(applyManipulatorActionResponse); @@ -688,6 +809,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple } } + //申请放货点 if (action == 3) { Instruction inst2 = checkInst(); String task_code = inst2.getTask_code(); @@ -705,33 +827,67 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple this.writing(map); this.setFeedbackSucess(true); } - if (mode == 3 && action == 4 && task > 0) { + + //申请新取货点 + if (action == 4) { applyManipulatorActionRequest.setType("4"); applyManipulatorActionRequest.setTask_code(String.valueOf(task)); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); - String get_device_code = applyManipulatorActionResponse.getGet_device_code(); - String put_device_code = applyManipulatorActionResponse.getPut_device_code(); - Map map = new LinkedHashMap<>(); - map.put("to_command", "4"); - map.put("to_new_getpoint", get_device_code); - map.put("to_putpoint", put_device_code); - this.writing(map); - this.setFeedbackSucess(true); + if (applyManipulatorActionResponse.getstatus() == 200) { + String get_device_code = applyManipulatorActionResponse.getGet_device_code(); + String put_device_code = applyManipulatorActionResponse.getPut_device_code(); + Map map = new LinkedHashMap<>(); + map.put("to_command", "4"); + map.put("to_new_getpoint", get_device_code); + map.put("to_putpoint", put_device_code); + this.writing(map); + requireSucess = true; + logServer.deviceExecuteLog(this.device_code, "", "", "申请新取货点,返回参数:" + applyManipulatorActionResponse); + message = "申请新取货点成功"; + } else { + requireSucess = true; + message = "申请失败"; + logServer.deviceExecuteLog(this.device_code, "", "", "申请失败,返回参数:" + applyManipulatorActionResponse); + } } + + //申请二次放货点 if (action == 5) { applyManipulatorActionRequest.setType("5"); applyManipulatorActionRequest.setTask_code(String.valueOf(task)); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); - String put_device_code2 = applyManipulatorActionResponse.getPut_device_code2(); - String detail_type = applyManipulatorActionResponse.getDetail_type(); - String get_device_code = applyManipulatorActionResponse.getGet_device_code(); + if (applyManipulatorActionResponse.getstatus() == 200) { + String put_device_code2 = applyManipulatorActionResponse.getPut_device_code2(); + String detail_type = applyManipulatorActionResponse.getDetail_type(); + String get_device_code = applyManipulatorActionResponse.getGet_device_code(); + Map map = new LinkedHashMap<>(); + map.put("to_command", "5"); + map.put("to_task_type", detail_type); + map.put("to_two_putpoint", put_device_code2); + map.put("to_new_getpoint", get_device_code); + this.writing(map); + requireSucess = true; + logServer.deviceExecuteLog(this.device_code, "", "", "申请二次放货点,返回参数:" + applyManipulatorActionResponse); + message = "申请二次放货点成功"; + } else { + requireSucess = true; + message = "申请失败"; + logServer.deviceExecuteLog(this.device_code, "", "", "申请失败,返回参数:" + applyManipulatorActionResponse); + } + } + + //缓存库取货完成 + if (action == 6) { Map map = new LinkedHashMap<>(); - map.put("to_command", "5"); - map.put("to_task_type", detail_type); - map.put("to_two_putpoint", put_device_code2); - map.put("to_new_getpoint", get_device_code); - this.writing(map); - this.setFeedbackSucess(true); + map.put("to_command", "6"); + requireSucess = true; + } + + //缓存库放货完成 + if (action == 7) { + Map map = new LinkedHashMap<>(); + map.put("to_command", "7"); + requireSucess = true; } @@ -743,8 +899,8 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple String task_code = inst2.getTask_code(); TaskDto taskDto = taskserver.findByCode(task_code); String truss_type = taskDto.getTruss_type(); - finish_instruction(inst2); - this.writing("to_command", "8"); + finish_instruction(inst2); + this.writing("to_command", "8"); } catch (Exception e) { e.printStackTrace(); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/PluggingUnpluggingMachineDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/PluggingUnpluggingMachineDeviceDriver.java index 2b2e081aa..584de33af 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/PluggingUnpluggingMachineDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/PluggingUnpluggingMachineDeviceDriver.java @@ -138,6 +138,9 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv feedback1(); } break; + default: + break; + } } @@ -153,14 +156,18 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv applyManipulatorActionRequest.setType("7"); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); if (applyManipulatorActionResponse.getstatus() == 200) { - Map map = new LinkedHashMap<>(); map.put("to_command", "5"); requireSucess = true; + logServer.deviceExecuteLog(this.device_code, "", "", "申请出纸管,返回参数:" + applyManipulatorActionResponse); + message = "套轴完成成功"; } else { + message = applyManipulatorActionResponse.getMessage(); + Map map = new LinkedHashMap<>(); + map.put("to_command", "99"); requireSucess = true; - message = "完成反馈LMS失败," + String.valueOf(applyManipulatorActionResponse); - logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); + message = "套轴失败"; + logServer.deviceExecuteLog(this.device_code, "", "", "申请出纸管,返回参数:" + applyManipulatorActionResponse); } } @@ -170,14 +177,18 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv applyManipulatorActionRequest.setType("6"); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); if (applyManipulatorActionResponse.getstatus() == 200) { - Map map = new LinkedHashMap<>(); map.put("to_command", "4"); requireSucess = true; + logServer.deviceExecuteLog(this.device_code, "", "", "申请出纸管,返回参数:" + applyManipulatorActionResponse); + message = "套轴申请成功"; } else { + message = applyManipulatorActionResponse.getMessage(); + Map map = new LinkedHashMap<>(); + map.put("to_command", "99"); requireSucess = true; - message = "完成反馈LMS失败," + String.valueOf(applyManipulatorActionResponse); - logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); + message = "申请失败"; + logServer.deviceExecuteLog(this.device_code, "", "", "申请出纸管,返回参数:" + applyManipulatorActionResponse); } } @@ -225,7 +236,6 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv } - @Override public JSONObject getDeviceStatusName() { JSONObject jo = new JSONObject(); @@ -276,5 +286,4 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv } - } From 7ec5df941cc7af0d5c5a5d60648af268c6f017f4 Mon Sep 17 00:00:00 2001 From: yanps Date: Thu, 9 Nov 2023 14:06:57 +0800 Subject: [PATCH 2/4] =?UTF-8?q?opt:=20=E7=BA=B8=E7=AE=A1=E5=BA=93,?= =?UTF-8?q?=E5=A5=97=E7=AE=A1=E5=B7=A5=E4=BD=8D=E9=A9=B1=E5=8A=A8=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device/device_driver/DriverTypeEnum.java | 4 ++++ .../java/org/nl/acs/device/wql/task_inst.xls | Bin 166912 -> 166912 bytes .../CasingStationConveyorDeviceDriver.java | 6 ++++++ .../PaperTubeConveyor2DeviceDriver.java | 7 +++++-- .../src/views/acs/device/config.vue | 4 ++++ 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java b/acs/nladmin-system/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java index 10ccaae96..8d4fd056c 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java @@ -55,6 +55,10 @@ public enum DriverTypeEnum { PAPER_TUBE_DEVICE(22, "paper_tube_conveyor", "纸管库设备", "conveyor"), + PAPER_TUBE_DEVICE2(26, "paper_tube_conveyor2", "纸管库2", "conveyor"), + + CASING_STATION(27, "casing_station", "套管工位", "conveyor"), + DEVICE_STATUS(23,"device_status","立库设备状态","conveyor"), INDOOR_MANIPULATOR(24,"indoor_manipulator","内包间-行架机械手","station"), diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device/wql/task_inst.xls b/acs/nladmin-system/src/main/java/org/nl/acs/device/wql/task_inst.xls index d3ad5b2062ee52af90529ef8869ffd929477c708..3d99fe3265b1cbaad741ea9e7f0b8510f4101a46 100644 GIT binary patch delta 53 zcmZpe!PPK>YeNnTt3ubLZI?C|vTSGNXJcUWVQ^*eWAJAP1LDbsT#3yyxY}oMF>as1 I#gx$q0Km`>y#N3J delta 49 zcmV-10M7q_mkg&=&!SJ1h)kT0ssMmZ8~3*K?+xsPzn-*m$#oGV diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/casing_station/CasingStationConveyorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/casing_station/CasingStationConveyorDeviceDriver.java index 0c7406519..c5a43c70e 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/casing_station/CasingStationConveyorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/casing_station/CasingStationConveyorDeviceDriver.java @@ -177,6 +177,7 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i param.put("device_type", "1"); param.put("product_area", paramService.findByCode("productArea").getValue()); acsToWmsService.sendDeviceStatus(param); + requireSucess = false; logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记:" + requireSucess); logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); } @@ -287,6 +288,11 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i applyPaperActionRequest.setMaterial1(material1); applyPaperActionRequest.setMaterial2(material2); ApplyPaperActionResponse applyPaperActionResponse = acsToWmsService.applyPaperActionRequest(applyPaperActionRequest); + if (ObjectUtil.isNull(applyPaperActionResponse)) { + message = "请求失败"; + requireSucess = false; + return; + } Map map = new HashMap(); if (applyPaperActionResponse.getstatus() == 200) { map.put("code", "to_command"); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paper_tube_device2/PaperTubeConveyor2DeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paper_tube_device2/PaperTubeConveyor2DeviceDriver.java index b522eb139..21d47bc2c 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paper_tube_device2/PaperTubeConveyor2DeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paper_tube_device2/PaperTubeConveyor2DeviceDriver.java @@ -293,6 +293,7 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl param.put("device_type", "1"); param.put("product_area", paramService.findByCode("productArea").getValue()); acsToWmsService.sendDeviceStatus(param); + requireSucess = false; logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记:" + requireSucess); logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); } @@ -572,7 +573,7 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl return false; } //判断当前任务号是否存在指令 - Instruction inst1 = instructionService.findByTaskcodeAndStatus(taskdto.getTask_code()); + //Instruction inst1 = instructionService.findByTaskcodeAndStatus(taskdto.getTask_code()); /*if(ObjectUtil.isNotNull(inst1)){ Device nextdevice = deviceAppservice.findDeviceByCode(inst1.getNext_device_code()); String next_addr = nextdevice.getExtraValue().get("address").toString(); @@ -625,7 +626,9 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl writeStatus(paperArray, map, 2); writeStatus(paperArray, map, 3); } - writeData(taskdto.getNext_device_code(), instdto, map); + Device nextdevice = deviceAppservice.findDeviceByCode(taskdto.getNext_device_code()); + String next_addr = nextdevice.getExtraValue().get("address").toString(); + writeData(next_addr, instdto, map); this.writing(map); requireSucess = true; return true; diff --git a/acs/nladmin-ui/src/views/acs/device/config.vue b/acs/nladmin-ui/src/views/acs/device/config.vue index 69bb4b800..f8ed9781a 100644 --- a/acs/nladmin-ui/src/views/acs/device/config.vue +++ b/acs/nladmin-ui/src/views/acs/device/config.vue @@ -100,6 +100,8 @@ import photoelectric_inspection_site from '@/views/acs/device/driver/photoelectr import standard_autodoor from '@/views/acs/device/driver/standard_autodoor' import lamp_three_color from '@/views/acs/device/driver/lamp_three_color' import paper_tube_conveyor from '@/views/acs/device/driver/paper_tube_conveyor' +import paper_tube_conveyor2 from '@/views/acs/device/driver/paper_tube_conveyor2' +import casing_station from '@/views/acs/device/driver/casing_station' import device_status from '@/views/acs/device/driver/device_status' import indoor_manipulator from '@/views/acs/device/driver/indoor_manipulator' import plugging_unplugging_machine from '@/views/acs/device/driver/plugging_unplugging_machine' @@ -134,6 +136,8 @@ export default { standard_autodoor, lamp_three_color, paper_tube_conveyor, + paper_tube_conveyor2, + casing_station, device_status, indoor_manipulator, plugging_unplugging_machine From c74ab66fdd9359d131d79557d13d89388a50a8ca Mon Sep 17 00:00:00 2001 From: tuqiang <437016993@qq.com> Date: Fri, 10 Nov 2023 10:38:27 +0800 Subject: [PATCH 3/4] =?UTF-8?q?opt:=E5=86=85=E5=8C=85=E9=97=B4=E8=A1=8C?= =?UTF-8?q?=E6=9E=B6=EF=BC=8C=E8=BE=93=E9=80=81=E7=BA=BF=E5=87=BA=E5=8F=A3?= =?UTF-8?q?=E4=BD=8D=E9=A9=B1=E5=8A=A8=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IndoorManipulatorDeviceDriver.java | 832 ++++++++---------- .../SiemensConveyorDeviceDriver.java | 20 +- .../acs/ext/wms/service/AcsToWmsService.java | 2 + .../wms/service/impl/AcsToWmsServiceImpl.java | 23 + .../acs/device/driver/siemens_conveyor.vue | 10 +- 5 files changed, 435 insertions(+), 452 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java index 17ca5758b..62f9cac42 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java @@ -5,27 +5,18 @@ import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import lombok.Data; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.nl.acs.AcsConfig; import org.nl.acs.device.service.DeviceService; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.FeedLmsRealFailed; import org.nl.acs.device_driver.RouteableDeviceDriver; -import org.nl.acs.device_driver.basedriver.hongxiang_device.HongXiangConveyorDeviceDriver; -import org.nl.acs.device_driver.basedriver.lamp_three_color.LampThreecolorDeviceDriver; -import org.nl.acs.device_driver.basedriver.photoelectric_inspection_site.PhotoelectricInspectionSiteDeviceDriver; import org.nl.acs.device_driver.basedriver.plugging_unplugging_machine.PluggingUnpluggingMachineDeviceDriver; import org.nl.acs.device_driver.basedriver.siemens_conveyor.SiemensConveyorDeviceDriver; -import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; -import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingRequest; -import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingResponse; import org.nl.acs.ext.wms.data.ApplyManipulatorActionRequest; import org.nl.acs.ext.wms.data.ApplyManipulatorActionResponse; import org.nl.acs.ext.wms.service.AcsToWmsService; @@ -36,7 +27,6 @@ import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.log.service.DeviceExecuteLogService; -import org.nl.acs.monitor.DeviceStageMonitor; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceAppService; import org.nl.acs.opc.DeviceAppServiceImpl; @@ -312,13 +302,13 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple logServer.deviceExecuteLog(this.device_code, "", "", "信号inflatable_shaft_size:" + last_inflatable_shaft_size + "->" + inflatable_shaft_size); } - if (task > 0 && getTo_task_type() == 1) { + if (task > 0 && getTo_task_type() == 1 && !requireSucess) { update_instruction_status(); - } else if (task > 0 && getTo_task_type() == 2) {// + } else if (task > 0 && getTo_task_type() == 2 && !requireSucess) { update_instruction_status2(); - } else if (task > 0 && getTo_task_type() == 6) { + } else if (task > 0 && getTo_task_type() == 6 && !requireSucess) { update_instruction_status3(); - } else if (task > 0 && getTo_task_type() == 7) { + } else if (task > 0 && getTo_task_type() == 7 && !requireSucess) { update_instruction_status4(); } @@ -426,503 +416,446 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple } private synchronized void update_instruction_status() { + ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); + ApplyManipulatorActionResponse applyManipulatorActionResponse; Date date = new Date(); - if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out); - - } else { - this.instruction_update_time = date; - //更改任务状态 - if (task > 0) { - //inst_message - Instruction inst1 = checkInst(); - if (inst1 != null) { - if (StrUtil.equals(inst1.getInstruction_status(), "0")) { - inst1.setInstruction_status("1"); - inst1.setExecute_device_code(this.device_code); - instructionService.update(inst1); + Instruction inst1 = checkInst(); + if (inst1 != null) { + if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) { + log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out); + } else { + this.instruction_update_time = date; + //更改任务状态 + if (task > 0) { + //inst_message + if (inst1 != null) { + if (StrUtil.equals(inst1.getInstruction_status(), "0")) { + inst1.setInstruction_status("1"); + inst1.setExecute_device_code(this.device_code); + instructionService.update(inst1); + } } } - } - - ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); - ApplyManipulatorActionResponse applyManipulatorActionResponse; - //反馈尺寸 - if (action == 2) { - Instruction inst2 = checkInst(); - String task_code = inst2.getTask_code(); - TaskDto taskDto = taskserver.findByCode(task_code); - String truss_type = taskDto.getTruss_type(); - applyManipulatorActionRequest.setType(truss_type); - applyManipulatorActionRequest.setTask_code(task_code); - applyManipulatorActionRequest.setSize(String.valueOf(inflatable_shaft_size)); - applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); - if (applyManipulatorActionResponse.getstatus() == 200) { - requireSucess = true; - message = "反馈LMS成功..."; - logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); - String version = applyManipulatorActionResponse.getVersion(); - String bushing_num = applyManipulatorActionResponse.getBushing_num(); - String is_bushing = applyManipulatorActionResponse.getIs_bushing(); - String detail_type = applyManipulatorActionResponse.getDetail_type(); - String put_device_code = applyManipulatorActionResponse.getPut_device_code(); - Map map = new LinkedHashMap<>(); - map.put("to_command", "2"); - map.put("inflatableShaftVersion", version); - map.put("tube_num", bushing_num); - map.put("is_wrapped", is_bushing); - map.put("to_putpoint", put_device_code); - this.writing(map); - } else { - requireSucess = true; - message = "完成反馈LMS失败," + String.valueOf(applyManipulatorActionResponse); - logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); + //反馈尺寸 + if (action == 2) { + String task_code = inst1.getTask_code(); + applyManipulatorActionRequest.setType("2"); + applyManipulatorActionRequest.setTask_code(task_code); + applyManipulatorActionRequest.setSize(String.valueOf(inflatable_shaft_size)); + applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); + if (applyManipulatorActionResponse.getstatus() == 200) { + requireSucess = true; + message = "反馈LMS成功..."; + logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); + Map map = new LinkedHashMap<>(); + map.put("to_command", "2"); + this.writing(map); + } else { + requireSucess = false; + message = "完成反馈LMS失败," + String.valueOf(applyManipulatorActionResponse); + logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); + } } - } - //任务完成 - if (action == 8) { - Instruction inst2 = checkInst(); - if (inst2 != null) { + //任务完成 + if (action == 8) { try { - finish_instruction(inst2); + finish_instruction(inst1); this.writing("to_command", "8"); + requireSucess = true; } catch (Exception e) { e.printStackTrace(); } feedMessage = ""; - } - } else { - feedMessage = "行架机械手:"; - if (mode != 3) { - feedMessage = feedMessage + "工作模式(mode)不为运行中状态,"; - } - if (action != 8) { - feedMessage = feedMessage + "动作信号(action)不为完成状态,"; - } - if (move != 0) { - feedMessage = feedMessage + "光电信号(move)不为无货状态,"; - } - if (task == 0) { - feedMessage = feedMessage + "当前上报任务号(task)不应该为0。"; + } else { + feedMessage = "行架机械手:"; + if (mode != 3) { + feedMessage = feedMessage + "工作模式(mode)不为运行中状态,"; + } + if (action != 8) { + feedMessage = feedMessage + "动作信号(action)不为完成状态,"; + } + if (move != 0) { + feedMessage = feedMessage + "光电信号(move)不为无货状态,"; + } + if (task == 0) { + feedMessage = feedMessage + "当前上报任务号(task)不应该为0。"; + } } } - - + } else { + feedMessage = ""; } } private synchronized void update_instruction_status2() { + ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); + ApplyManipulatorActionResponse applyManipulatorActionResponse; Date date = new Date(); - if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out); + Instruction inst1 = checkInst(); + if (inst1 != null) { + if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) { + log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out); - } else { - this.instruction_update_time = date; - //更改任务状态 - if (task > 0) { - //inst_message - Instruction inst1 = checkInst(); - if (inst1 != null) { - if (StrUtil.equals(inst1.getInstruction_status(), "0")) { - inst1.setInstruction_status("1"); - inst1.setExecute_device_code(this.device_code); - instructionService.update(inst1); - } - } - } - - ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); - ApplyManipulatorActionResponse applyManipulatorActionResponse; - //反馈气胀轴尺寸 - if (action == 2) { - Instruction inst2 = checkInst(); - String task_code = inst2.getTask_code(); - TaskDto taskDto = taskserver.findByCode(task_code); - String truss_type = taskDto.getTruss_type(); - applyManipulatorActionRequest.setType(truss_type); - applyManipulatorActionRequest.setTask_code(task_code); - applyManipulatorActionRequest.setSize(String.valueOf(inflatable_shaft_size)); - applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); - if (applyManipulatorActionResponse.getstatus() == 200) { - requireSucess = true; - message = "反馈LMS成功..."; - logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); - Map map = new LinkedHashMap<>(); - map.put("to_command", "2"); - map.put("to_task_type", "2"); - this.writing(map); - } else { - requireSucess = true; - message = "完成反馈LMS失败," + String.valueOf(applyManipulatorActionResponse); - logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); - } - } - - //申请放货点 - if (action == 3) { - Instruction inst2 = checkInst(); - String task_code = inst2.getTask_code(); - TaskDto taskDto = taskserver.findByCode(task_code); - String truss_type = taskDto.getTruss_type(); - applyManipulatorActionRequest.setType(truss_type); - applyManipulatorActionRequest.setTask_code(String.valueOf(task)); - applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); - String put_device_code = applyManipulatorActionResponse.getPut_device_code(); - String detail_type = applyManipulatorActionResponse.getDetail_type(); - Map map = new LinkedHashMap<>(); - map.put("to_command", "3"); - map.put("to_putpoint", put_device_code); - this.writing(map); - requireSucess = true; - } - - //任务完成 - if (action == 8) { - Instruction inst2 = checkInst(); - if (inst2 != null) { - try { - finish_instruction(inst2); - this.writing("to_command", "8"); - } catch (Exception e) { - e.printStackTrace(); - } - feedMessage = ""; - } } else { - feedMessage = "行架机械手:"; - if (mode != 3) { - feedMessage = feedMessage + "工作模式(mode)不为运行中状态,"; + this.instruction_update_time = date; + //更改任务状态 + if (task > 0) { + //inst_message + if (inst1 != null) { + if (StrUtil.equals(inst1.getInstruction_status(), "0")) { + inst1.setInstruction_status("1"); + inst1.setExecute_device_code(this.device_code); + instructionService.update(inst1); + } + } } - if (action != 8) { - feedMessage = feedMessage + "动作信号(action)不为完成状态,"; + + //反馈气胀轴尺寸 + if (action == 2) { + String task_code = inst1.getTask_code(); + applyManipulatorActionRequest.setType("2"); + applyManipulatorActionRequest.setTask_code(task_code); + applyManipulatorActionRequest.setSize(String.valueOf(inflatable_shaft_size)); + applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); + if (applyManipulatorActionResponse.getstatus() == 200) { + requireSucess = true; + message = "反馈LMS成功..."; + logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); + Map map = new LinkedHashMap<>(); + map.put("to_command", "2"); + map.put("to_task_type", "2"); + this.writing(map); + } else { + requireSucess = false; + message = "完成反馈LMS失败," + String.valueOf(applyManipulatorActionResponse); + logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); + } } - if (move != 0) { - feedMessage = feedMessage + "光电信号(move)不为无货状态,"; + + //申请放货点 + if (action == 3) { + String task_code = inst1.getTask_code(); + applyManipulatorActionRequest.setType("3"); + applyManipulatorActionRequest.setTask_code(task_code); + applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); + String put_device_code = applyManipulatorActionResponse.getPut_device_code(); + Map map = new LinkedHashMap<>(); + map.put("to_command", "3"); + map.put("to_putpoint", put_device_code); + this.writing(map); + requireSucess = true; } - if (task == 0) { - feedMessage = feedMessage + "当前上报任务号(task)不应该为0。"; + + //任务完成 + if (action == 8) { + if (inst1 != null) { + try { + requireSucess = true; + finish_instruction(inst1); + this.writing("to_command", "8"); + } catch (Exception e) { + e.printStackTrace(); + } + feedMessage = ""; + } + } else { + feedMessage = "行架机械手:"; + if (mode != 3) { + feedMessage = feedMessage + "工作模式(mode)不为运行中状态,"; + } + if (action != 8) { + feedMessage = feedMessage + "动作信号(action)不为完成状态,"; + } + if (move != 0) { + feedMessage = feedMessage + "光电信号(move)不为无货状态,"; + } + if (task == 0) { + feedMessage = feedMessage + "当前上报任务号(task)不应该为0。"; + } } } - - + } else { + feedMessage = ""; } } private synchronized void update_instruction_status3() { + ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); + ApplyManipulatorActionResponse applyManipulatorActionResponse; Date date = new Date(); - if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out); + Instruction inst1 = checkInst(); + if (inst1 != null) { + if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) { + log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out); - } else { - this.instruction_update_time = date; - //更改任务状态 - if (task > 0) { - //inst_message - Instruction inst1 = checkInst(); - if (inst1 != null) { - if (StrUtil.equals(inst1.getInstruction_status(), "0")) { - inst1.setInstruction_status("1"); - inst1.setExecute_device_code(this.device_code); - instructionService.update(inst1); - } - } - } - - //从拔轴机取货的新行架任务 - if (mode == 3 && action == 1 && move == 0 && task > 0) { - Instruction inst2 = checkInst(); - if (ObjectUtil.isNotEmpty(inst2)) { - String start_device_code = inst2.getStart_device_code(); - Device device = deviceAppService.findDeviceByCode(start_device_code); - PluggingUnpluggingMachineDeviceDriver pluggingUnpluggingMachineDeviceDriver; - if (device.getDeviceDriver() instanceof PluggingUnpluggingMachineDeviceDriver) { - pluggingUnpluggingMachineDeviceDriver = (PluggingUnpluggingMachineDeviceDriver) device.getDeviceDriver(); - int mode = pluggingUnpluggingMachineDeviceDriver.getMode(); - int error1 = pluggingUnpluggingMachineDeviceDriver.getError(); - int move = pluggingUnpluggingMachineDeviceDriver.getMove(); - if (mode == 2 && error1 == 0 && move == 1) { - Map map = new LinkedHashMap<>(); - map.put("to_command", "1"); - this.writing(map); - this.setFeedbackSucess(true); + } else { + this.instruction_update_time = date; + //更改任务状态 + if (task > 0) { + //inst_message + if (inst1 != null) { + if (StrUtil.equals(inst1.getInstruction_status(), "0")) { + inst1.setInstruction_status("1"); + inst1.setExecute_device_code(this.device_code); + instructionService.update(inst1); } } } - } else { - feedMessage = "行架机械手:"; - if (mode != 3) { - feedMessage = feedMessage + "工作模式(mode)不为运行中状态,"; - } - if (action != 1) { - feedMessage = feedMessage + "动作信号(action)不为取货中状态,"; - } - if (move != 0) { - feedMessage = feedMessage + "光电信号(move)不为无货状态,"; - } - if (task == 0) { - feedMessage = feedMessage + "当前上报任务号(task)不应该为0。"; - } - } - ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); - ApplyManipulatorActionResponse applyManipulatorActionResponse; - //反馈尺寸 - if (action == 2) { - Instruction inst2 = checkInst(); - String task_code = inst2.getTask_code(); - TaskDto taskDto = taskserver.findByCode(task_code); - String truss_type = taskDto.getTruss_type(); - applyManipulatorActionRequest.setType(truss_type); - applyManipulatorActionRequest.setTask_code(task_code); - applyManipulatorActionRequest.setSize(String.valueOf(inflatable_shaft_size)); - applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); - if (applyManipulatorActionResponse.getstatus() == 200) { - requireSucess = true; - message = "反馈LMS成功..."; - logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); - String version = applyManipulatorActionResponse.getVersion(); - String bushing_num = applyManipulatorActionResponse.getBushing_num(); - String is_bushing = applyManipulatorActionResponse.getIs_bushing(); - String detail_type = applyManipulatorActionResponse.getDetail_type(); + //反馈尺寸 + if (action == 2) { + String task_code = inst1.getTask_code(); + applyManipulatorActionRequest.setType("2"); + applyManipulatorActionRequest.setTask_code(task_code); + applyManipulatorActionRequest.setSize(String.valueOf(inflatable_shaft_size)); + applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); + if (applyManipulatorActionResponse.getstatus() == 200) { + requireSucess = true; + message = "反馈LMS成功..."; + logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); + Map map = new LinkedHashMap<>(); + map.put("to_command", "2"); + this.writing(map); + } else { + requireSucess = false; + message = "完成反馈LMS失败," + String.valueOf(applyManipulatorActionResponse); + logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); + } + } + + //从拔轴机取货的新行架任务 + if (mode == 3 && action == 1 && move == 0 && task > 0) { + if (ObjectUtil.isNotEmpty(inst1)) { + String start_device_code = inst1.getStart_device_code(); + Device device = deviceAppService.findDeviceByCode(start_device_code); + PluggingUnpluggingMachineDeviceDriver pluggingUnpluggingMachineDeviceDriver; + if (device.getDeviceDriver() instanceof PluggingUnpluggingMachineDeviceDriver) { + pluggingUnpluggingMachineDeviceDriver = (PluggingUnpluggingMachineDeviceDriver) device.getDeviceDriver(); + int mode = pluggingUnpluggingMachineDeviceDriver.getMode(); + int error1 = pluggingUnpluggingMachineDeviceDriver.getError(); + int move = pluggingUnpluggingMachineDeviceDriver.getMove(); + if (mode == 2 && error1 == 0 && move == 1) { + Map map = new LinkedHashMap<>(); + map.put("to_command", "1"); + this.writing(map); + requireSucess = true; + } + } + } + } else { + feedMessage = "行架机械手:"; + if (mode != 3) { + feedMessage = feedMessage + "工作模式(mode)不为运行中状态,"; + } + if (action != 1) { + feedMessage = feedMessage + "动作信号(action)不为取货中状态,"; + } + if (move != 0) { + feedMessage = feedMessage + "光电信号(move)不为无货状态,"; + } + if (task == 0) { + feedMessage = feedMessage + "当前上报任务号(task)不应该为0。"; + } + } + + + //申请放货点 + if (action == 3) { + String task_code = inst1.getTask_code(); + applyManipulatorActionRequest.setType("3"); + applyManipulatorActionRequest.setTask_code(task_code); + applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); String put_device_code = applyManipulatorActionResponse.getPut_device_code(); Map map = new LinkedHashMap<>(); - map.put("to_command", "2"); - map.put("inflatableShaftVersion", version); - map.put("tube_num", bushing_num); - map.put("is_wrapped", is_bushing); + map.put("to_command", "3"); map.put("to_putpoint", put_device_code); this.writing(map); - } else { requireSucess = true; - message = "完成反馈LMS失败," + String.valueOf(applyManipulatorActionResponse); - logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); } - } - - //申请放货点 - if (action == 3) { - Instruction inst2 = checkInst(); - String task_code = inst2.getTask_code(); - TaskDto taskDto = taskserver.findByCode(task_code); - String truss_type = taskDto.getTruss_type(); - applyManipulatorActionRequest.setType(truss_type); - applyManipulatorActionRequest.setTask_code(String.valueOf(task)); - applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); - String put_device_code = applyManipulatorActionResponse.getPut_device_code(); - String detail_type = applyManipulatorActionResponse.getDetail_type(); - Map map = new LinkedHashMap<>(); - map.put("to_command", "3"); - map.put("to_putpoint", put_device_code); - this.writing(map); - this.setFeedbackSucess(true); - } - //任务完成 - if (action == 8) { - Instruction inst2 = checkInst(); - if (inst2 != null) { + //任务完成 + if (action == 8) { try { - String task_code = inst2.getTask_code(); - TaskDto taskDto = taskserver.findByCode(task_code); - String truss_type = taskDto.getTruss_type(); - finish_instruction(inst2); + requireSucess = true; + finish_instruction(inst1); this.writing("to_command", "8"); } catch (Exception e) { e.printStackTrace(); } feedMessage = ""; - } - } else { - feedMessage = "行架机械手:"; - if (mode != 3) { - feedMessage = feedMessage + "工作模式(mode)不为运行中状态,"; - } - if (action != 8) { - feedMessage = feedMessage + "动作信号(action)不为完成状态,"; - } - if (move != 0) { - feedMessage = feedMessage + "光电信号(move)不为无货状态,"; - } - if (task == 0) { - feedMessage = feedMessage + "当前上报任务号(task)不应该为0。"; + } else { + feedMessage = "行架机械手:"; + if (mode != 3) { + feedMessage = feedMessage + "工作模式(mode)不为运行中状态,"; + } + if (action != 8) { + feedMessage = feedMessage + "动作信号(action)不为完成状态,"; + } + if (move != 0) { + feedMessage = feedMessage + "光电信号(move)不为无货状态,"; + } + if (task == 0) { + feedMessage = feedMessage + "当前上报任务号(task)不应该为0。"; + } } } - - + } else { + feedMessage = ""; } } private synchronized void update_instruction_status4() { + ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); + ApplyManipulatorActionResponse applyManipulatorActionResponse; Date date = new Date(); - if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out); + Instruction inst1 = checkInst(); + if (inst1 != null) { + if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) { + log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out); - } else { - this.instruction_update_time = date; - //更改任务状态 - if (task > 0) { - //inst_message - Instruction inst1 = checkInst(); - if (inst1 != null) { - if (StrUtil.equals(inst1.getInstruction_status(), "0")) { - inst1.setInstruction_status("1"); - inst1.setExecute_device_code(this.device_code); - instructionService.update(inst1); - } - } - } - - ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); - ApplyManipulatorActionResponse applyManipulatorActionResponse; - //反馈尺寸 - if (action == 2) { - Instruction inst2 = checkInst(); - String task_code = inst2.getTask_code(); - TaskDto taskDto = taskserver.findByCode(task_code); - String truss_type = taskDto.getTruss_type(); - applyManipulatorActionRequest.setType(truss_type); - applyManipulatorActionRequest.setTask_code(task_code); - applyManipulatorActionRequest.setSize(String.valueOf(inflatable_shaft_size)); - applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); - if (applyManipulatorActionResponse.getstatus() == 200) { - requireSucess = true; - message = "反馈LMS成功..."; - logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); - String version = applyManipulatorActionResponse.getVersion(); - String bushing_num = applyManipulatorActionResponse.getBushing_num(); - String is_bushing = applyManipulatorActionResponse.getIs_bushing(); - String detail_type = applyManipulatorActionResponse.getDetail_type(); - String put_device_code = applyManipulatorActionResponse.getPut_device_code(); - Map map = new LinkedHashMap<>(); - map.put("to_command", "2"); - map.put("inflatableShaftVersion", version); - map.put("tube_num", bushing_num); - map.put("is_wrapped", is_bushing); - map.put("to_putpoint", put_device_code); - this.writing(map); - } else { - requireSucess = true; - message = "完成反馈LMS失败," + String.valueOf(applyManipulatorActionResponse); - logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); - } - } - - //申请放货点 - if (action == 3) { - Instruction inst2 = checkInst(); - String task_code = inst2.getTask_code(); - TaskDto taskDto = taskserver.findByCode(task_code); - String truss_type = taskDto.getTruss_type(); - applyManipulatorActionRequest.setType(truss_type); - applyManipulatorActionRequest.setTask_code(String.valueOf(task)); - applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); - String put_device_code = applyManipulatorActionResponse.getPut_device_code(); - String detail_type = applyManipulatorActionResponse.getDetail_type(); - Map map = new LinkedHashMap<>(); - map.put("to_command", "3"); - map.put("to_task_type", detail_type); - map.put("to_putpoint", put_device_code); - this.writing(map); - this.setFeedbackSucess(true); - } - - //申请新取货点 - if (action == 4) { - applyManipulatorActionRequest.setType("4"); - applyManipulatorActionRequest.setTask_code(String.valueOf(task)); - applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); - if (applyManipulatorActionResponse.getstatus() == 200) { - String get_device_code = applyManipulatorActionResponse.getGet_device_code(); - String put_device_code = applyManipulatorActionResponse.getPut_device_code(); - Map map = new LinkedHashMap<>(); - map.put("to_command", "4"); - map.put("to_new_getpoint", get_device_code); - map.put("to_putpoint", put_device_code); - this.writing(map); - requireSucess = true; - logServer.deviceExecuteLog(this.device_code, "", "", "申请新取货点,返回参数:" + applyManipulatorActionResponse); - message = "申请新取货点成功"; - } else { - requireSucess = true; - message = "申请失败"; - logServer.deviceExecuteLog(this.device_code, "", "", "申请失败,返回参数:" + applyManipulatorActionResponse); - } - } - - //申请二次放货点 - if (action == 5) { - applyManipulatorActionRequest.setType("5"); - applyManipulatorActionRequest.setTask_code(String.valueOf(task)); - applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); - if (applyManipulatorActionResponse.getstatus() == 200) { - String put_device_code2 = applyManipulatorActionResponse.getPut_device_code2(); - String detail_type = applyManipulatorActionResponse.getDetail_type(); - String get_device_code = applyManipulatorActionResponse.getGet_device_code(); - Map map = new LinkedHashMap<>(); - map.put("to_command", "5"); - map.put("to_task_type", detail_type); - map.put("to_two_putpoint", put_device_code2); - map.put("to_new_getpoint", get_device_code); - this.writing(map); - requireSucess = true; - logServer.deviceExecuteLog(this.device_code, "", "", "申请二次放货点,返回参数:" + applyManipulatorActionResponse); - message = "申请二次放货点成功"; - } else { - requireSucess = true; - message = "申请失败"; - logServer.deviceExecuteLog(this.device_code, "", "", "申请失败,返回参数:" + applyManipulatorActionResponse); - } - } - - //缓存库取货完成 - if (action == 6) { - Map map = new LinkedHashMap<>(); - map.put("to_command", "6"); - requireSucess = true; - } - - //缓存库放货完成 - if (action == 7) { - Map map = new LinkedHashMap<>(); - map.put("to_command", "7"); - requireSucess = true; - } - - - //放货完成 - if (action == 8) { - Instruction inst2 = checkInst(); - if (inst2 != null) { - try { - String task_code = inst2.getTask_code(); - TaskDto taskDto = taskserver.findByCode(task_code); - String truss_type = taskDto.getTruss_type(); - finish_instruction(inst2); - this.writing("to_command", "8"); - } catch (Exception e) { - e.printStackTrace(); - } - feedMessage = ""; - } } else { - feedMessage = "行架机械手:"; - if (mode != 3) { - feedMessage = feedMessage + "工作模式(mode)不为运行中状态,"; + this.instruction_update_time = date; + //更改任务状态 + if (task > 0) { + //inst_message + if (inst1 != null) { + if (StrUtil.equals(inst1.getInstruction_status(), "0")) { + inst1.setInstruction_status("1"); + inst1.setExecute_device_code(this.device_code); + instructionService.update(inst1); + } + } } - if (action != 8) { - feedMessage = feedMessage + "动作信号(action)不为放货完成状态,"; + + + //反馈尺寸 + if (action == 2) { + String task_code = inst1.getTask_code(); + applyManipulatorActionRequest.setType("2"); + applyManipulatorActionRequest.setTask_code(task_code); + applyManipulatorActionRequest.setSize(String.valueOf(inflatable_shaft_size)); + applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); + if (applyManipulatorActionResponse.getstatus() == 200) { + requireSucess = true; + message = "反馈LMS成功..."; + logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); + Map map = new LinkedHashMap<>(); + map.put("to_command", "2"); + this.writing(map); + } else { + requireSucess = false; + message = "完成反馈LMS失败," + String.valueOf(applyManipulatorActionResponse); + logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); + } } - if (move != 0) { - feedMessage = feedMessage + "光电信号(move)不为无货状态,"; + + //申请放货点 + if (action == 3) { + String task_code = inst1.getTask_code(); + applyManipulatorActionRequest.setType("3"); + applyManipulatorActionRequest.setTask_code(task_code); + applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); + String put_device_code = applyManipulatorActionResponse.getPut_device_code(); + Map map = new LinkedHashMap<>(); + map.put("to_command", "3"); + map.put("to_putpoint", put_device_code); + this.writing(map); + requireSucess = true; } - if (task == 0) { - feedMessage = feedMessage + "当前上报任务号(task)不应该为0。"; + + //申请新取货点 + if (action == 4) { + String task_code = inst1.getTask_code(); + applyManipulatorActionRequest.setType("4"); + applyManipulatorActionRequest.setTask_code(task_code); + applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); + if (applyManipulatorActionResponse.getstatus() == 200) { + String get_device_code = applyManipulatorActionResponse.getGet_device_code(); + Map map = new LinkedHashMap<>(); + map.put("to_command", "4"); + map.put("to_new_getpoint", get_device_code); + this.writing(map); + requireSucess = true; + logServer.deviceExecuteLog(this.device_code, "", "", "申请新取货点,返回参数:" + applyManipulatorActionResponse); + message = "申请新取货点成功"; + } else { + requireSucess = false; + message = "申请失败"; + logServer.deviceExecuteLog(this.device_code, "", "", "申请失败,返回参数:" + applyManipulatorActionResponse); + } } + + //申请二次放货点 + if (action == 5) { + String task_code = inst1.getTask_code(); + applyManipulatorActionRequest.setType("5"); + applyManipulatorActionRequest.setTask_code(task_code); + applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); + if (applyManipulatorActionResponse.getstatus() == 200) { + String put_device_code2 = applyManipulatorActionResponse.getPut_device_code2(); + Map map = new LinkedHashMap<>(); + map.put("to_command", "5"); + map.put("to_two_putpoint", put_device_code2); + this.writing(map); + requireSucess = true; + logServer.deviceExecuteLog(this.device_code, "", "", "申请二次放货点,返回参数:" + applyManipulatorActionResponse); + message = "申请二次放货点成功"; + } else { + requireSucess = false; + message = "申请失败"; + logServer.deviceExecuteLog(this.device_code, "", "", "申请失败,返回参数:" + applyManipulatorActionResponse); + } + } + + //缓存库取货完成 + if (action == 6) { + Map map = new LinkedHashMap<>(); + map.put("to_command", "6"); + requireSucess = true; + } + + //缓存库放货完成 + if (action == 7) { + Map map = new LinkedHashMap<>(); + map.put("to_command", "7"); + requireSucess = true; + } + + + //放货完成 + if (action == 8) { + if (inst1 != null) { + try { + requireSucess = true; + finish_instruction(inst1); + this.writing("to_command", "8"); + } catch (Exception e) { + e.printStackTrace(); + } + feedMessage = ""; + } + } else { + feedMessage = "行架机械手:"; + if (mode != 3) { + feedMessage = feedMessage + "工作模式(mode)不为运行中状态,"; + } + if (action != 8) { + feedMessage = feedMessage + "动作信号(action)不为放货完成状态,"; + } + if (move != 0) { + feedMessage = feedMessage + "光电信号(move)不为无货状态,"; + } + if (task == 0) { + feedMessage = feedMessage + "当前上报任务号(task)不应该为0。"; + } + } + + } - - + } else { + feedMessage = ""; } } @@ -1086,7 +1019,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple taskDtoList = this.sortTask(taskDtoList); task = taskDtoList.get(j); // 9 行架任务 - if (!StrUtil.equals(task.getTruss_type(), "9")) { + if (!StrUtil.equals(task.getTask_type(), "9")) { task = null; continue; } @@ -1098,7 +1031,6 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple if (!ObjectUtil.isEmpty(task)) { Device nextdevice = deviceAppService.findDeviceByCode(task.getNext_device_code()); Device startdevice = deviceAppService.findDeviceByCode(task.getStart_device_code()); - StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; SiemensConveyorDeviceDriver siemensConveyorDeviceDriver; if (startdevice.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) { siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) startdevice.getDeviceDriver(); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java index a1e99d098..3d8aae307 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java @@ -303,8 +303,10 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme if (task != last_task) { logServer.deviceItemValue(this.device_code, "task", String.valueOf(task)); logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task); + if ("true".equals(this.device.getExtraValue().get("task_update"))) { + taskDeviceUpdate(); + } } - if (move != 0 && task > 0) { // logServer.deviceExecuteLog(device_code, "", "", "输送线任务开始反馈任务状态,指令号:" + task); //inst_message @@ -431,6 +433,22 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme } + private void taskDeviceUpdate() { + Instruction inst = checkInst(); + JSONObject param = new JSONObject() {{ + put("device_code", device_code); + put("task_code", inst.getTask_code()); + + }}; + logServer.deviceExecuteLog(this.device_code, "", "", "task变化请求LMS,参数:" + param); + HttpResponse response = acsToWmsService.taskDeviceUpdate(param); + if (response == null || response.getStatus() == 200) { + logServer.deviceExecuteLog(this.device_code, "", "", "task变化请求LMS,接口返回:" + response.body()); + } + } + + + public boolean exe_error() { if (this.error == 0) { return true; diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java index e7765a03e..d5039b06a 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java @@ -112,6 +112,8 @@ public interface AcsToWmsService { // 输送线有货变成无货时向lms请求 HttpResponse shipDeviceUpdate(JSONObject param); + HttpResponse taskDeviceUpdate(JSONObject param); + void sendDeviceStatus(JSONObject param); ApplyManipulatorActionResponse applyManipulatorActionRequest(ApplyManipulatorActionRequest param); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java index 1715b5d6a..451ae2399 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java @@ -608,6 +608,29 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { return null; } + @Override + public HttpResponse taskDeviceUpdate(JSONObject param) { + try { + MDC.put(log_file_type, log_type); +// log.info("shipDeviceUpdate-----输入参数{}", param); + if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { + String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue(); + AddressDto addressDto = addressService.findByCode("taskDeviceUpdate"); + String methods_url = addressDto.getMethods_url(); + String url = wmsUrl + methods_url; + return HttpRequest + .post(url) + .body(param.toString()) + .execute(); + } + } catch (Throwable ignored) { + + } finally { + MDC.remove(log_file_type); + } + return null; + } + @Override public void sendDeviceStatus(JSONObject param) { try { diff --git a/acs/nladmin-ui/src/views/acs/device/driver/siemens_conveyor.vue b/acs/nladmin-ui/src/views/acs/device/driver/siemens_conveyor.vue index 50e0323fa..1d3381c43 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/siemens_conveyor.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/siemens_conveyor.vue @@ -153,6 +153,13 @@ + + + + + + + @@ -326,7 +333,8 @@ export default { link_device_code: [], ship_device_update: true, special_flag: true, - sendDeviceStatus: true + sendDeviceStatus: true, + task_update: true }, rules: {} } From 247457d4a3fb52ce0936583fb29fbd1b4442ccfe Mon Sep 17 00:00:00 2001 From: tuqiang <437016993@qq.com> Date: Mon, 13 Nov 2023 19:35:53 +0800 Subject: [PATCH 4/4] =?UTF-8?q?opt:=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IndoorManipulatorDeviceDriver.java | 430 +++--------------- .../PaperTubeConveyor2DeviceDriver.java | 8 +- .../ItemProtocol.java | 14 +- .../PluggingUnpluggingMachineDefination.java | 3 +- ...PluggingUnpluggingMachineDeviceDriver.java | 60 ++- .../data/ApplyManipulatorActionRequest.java | 13 +- .../acs/ext/wms/data/CreateTaskRequest.java | 24 +- .../acs/ext/wms/rest/AcsToWmsController.java | 7 + .../acs/ext/wms/service/AcsToWmsService.java | 1 + .../wms/service/impl/AcsToWmsServiceImpl.java | 32 +- .../wms/service/impl/WmsToAcsServiceImpl.java | 97 +++- 11 files changed, 298 insertions(+), 391 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java index 62f9cac42..6b9c6bae0 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java @@ -254,8 +254,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + "->" + move); } if (action != last_action) { - this.setRequireSucess(false); - + this.setFeedbackSucess(false); logServer.deviceItemValue(this.device_code, "action", String.valueOf(action)); logServer.deviceExecuteLog(this.device_code, "", "", "信号action:" + last_action + "->" + action); } @@ -302,14 +301,9 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple logServer.deviceExecuteLog(this.device_code, "", "", "信号inflatable_shaft_size:" + last_inflatable_shaft_size + "->" + inflatable_shaft_size); } - if (task > 0 && getTo_task_type() == 1 && !requireSucess) { + + if (task > 0 && !feedbackSucess) { update_instruction_status(); - } else if (task > 0 && getTo_task_type() == 2 && !requireSucess) { - update_instruction_status2(); - } else if (task > 0 && getTo_task_type() == 6 && !requireSucess) { - update_instruction_status3(); - } else if (task > 0 && getTo_task_type() == 7 && !requireSucess) { - update_instruction_status4(); } @@ -416,297 +410,6 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple } private synchronized void update_instruction_status() { - ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); - ApplyManipulatorActionResponse applyManipulatorActionResponse; - Date date = new Date(); - Instruction inst1 = checkInst(); - if (inst1 != null) { - if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out); - } else { - this.instruction_update_time = date; - //更改任务状态 - if (task > 0) { - //inst_message - if (inst1 != null) { - if (StrUtil.equals(inst1.getInstruction_status(), "0")) { - inst1.setInstruction_status("1"); - inst1.setExecute_device_code(this.device_code); - instructionService.update(inst1); - } - } - } - //反馈尺寸 - if (action == 2) { - String task_code = inst1.getTask_code(); - applyManipulatorActionRequest.setType("2"); - applyManipulatorActionRequest.setTask_code(task_code); - applyManipulatorActionRequest.setSize(String.valueOf(inflatable_shaft_size)); - applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); - if (applyManipulatorActionResponse.getstatus() == 200) { - requireSucess = true; - message = "反馈LMS成功..."; - logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); - Map map = new LinkedHashMap<>(); - map.put("to_command", "2"); - this.writing(map); - } else { - requireSucess = false; - message = "完成反馈LMS失败," + String.valueOf(applyManipulatorActionResponse); - logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); - } - } - - //任务完成 - if (action == 8) { - try { - finish_instruction(inst1); - this.writing("to_command", "8"); - requireSucess = true; - } catch (Exception e) { - e.printStackTrace(); - } - feedMessage = ""; - } else { - feedMessage = "行架机械手:"; - if (mode != 3) { - feedMessage = feedMessage + "工作模式(mode)不为运行中状态,"; - } - if (action != 8) { - feedMessage = feedMessage + "动作信号(action)不为完成状态,"; - } - if (move != 0) { - feedMessage = feedMessage + "光电信号(move)不为无货状态,"; - } - if (task == 0) { - feedMessage = feedMessage + "当前上报任务号(task)不应该为0。"; - } - } - } - } else { - feedMessage = ""; - } - } - - private synchronized void update_instruction_status2() { - ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); - ApplyManipulatorActionResponse applyManipulatorActionResponse; - Date date = new Date(); - Instruction inst1 = checkInst(); - if (inst1 != null) { - if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out); - - } else { - this.instruction_update_time = date; - //更改任务状态 - if (task > 0) { - //inst_message - if (inst1 != null) { - if (StrUtil.equals(inst1.getInstruction_status(), "0")) { - inst1.setInstruction_status("1"); - inst1.setExecute_device_code(this.device_code); - instructionService.update(inst1); - } - } - } - - //反馈气胀轴尺寸 - if (action == 2) { - String task_code = inst1.getTask_code(); - applyManipulatorActionRequest.setType("2"); - applyManipulatorActionRequest.setTask_code(task_code); - applyManipulatorActionRequest.setSize(String.valueOf(inflatable_shaft_size)); - applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); - if (applyManipulatorActionResponse.getstatus() == 200) { - requireSucess = true; - message = "反馈LMS成功..."; - logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); - Map map = new LinkedHashMap<>(); - map.put("to_command", "2"); - map.put("to_task_type", "2"); - this.writing(map); - } else { - requireSucess = false; - message = "完成反馈LMS失败," + String.valueOf(applyManipulatorActionResponse); - logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); - } - } - - //申请放货点 - if (action == 3) { - String task_code = inst1.getTask_code(); - applyManipulatorActionRequest.setType("3"); - applyManipulatorActionRequest.setTask_code(task_code); - applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); - String put_device_code = applyManipulatorActionResponse.getPut_device_code(); - Map map = new LinkedHashMap<>(); - map.put("to_command", "3"); - map.put("to_putpoint", put_device_code); - this.writing(map); - requireSucess = true; - } - - //任务完成 - if (action == 8) { - if (inst1 != null) { - try { - requireSucess = true; - finish_instruction(inst1); - this.writing("to_command", "8"); - } catch (Exception e) { - e.printStackTrace(); - } - feedMessage = ""; - } - } else { - feedMessage = "行架机械手:"; - if (mode != 3) { - feedMessage = feedMessage + "工作模式(mode)不为运行中状态,"; - } - if (action != 8) { - feedMessage = feedMessage + "动作信号(action)不为完成状态,"; - } - if (move != 0) { - feedMessage = feedMessage + "光电信号(move)不为无货状态,"; - } - if (task == 0) { - feedMessage = feedMessage + "当前上报任务号(task)不应该为0。"; - } - } - } - } else { - feedMessage = ""; - } - } - - private synchronized void update_instruction_status3() { - ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); - ApplyManipulatorActionResponse applyManipulatorActionResponse; - Date date = new Date(); - Instruction inst1 = checkInst(); - if (inst1 != null) { - if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out); - - } else { - this.instruction_update_time = date; - //更改任务状态 - if (task > 0) { - //inst_message - if (inst1 != null) { - if (StrUtil.equals(inst1.getInstruction_status(), "0")) { - inst1.setInstruction_status("1"); - inst1.setExecute_device_code(this.device_code); - instructionService.update(inst1); - } - } - } - - //反馈尺寸 - if (action == 2) { - String task_code = inst1.getTask_code(); - applyManipulatorActionRequest.setType("2"); - applyManipulatorActionRequest.setTask_code(task_code); - applyManipulatorActionRequest.setSize(String.valueOf(inflatable_shaft_size)); - applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); - if (applyManipulatorActionResponse.getstatus() == 200) { - requireSucess = true; - message = "反馈LMS成功..."; - logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); - Map map = new LinkedHashMap<>(); - map.put("to_command", "2"); - this.writing(map); - } else { - requireSucess = false; - message = "完成反馈LMS失败," + String.valueOf(applyManipulatorActionResponse); - logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); - } - } - - //从拔轴机取货的新行架任务 - if (mode == 3 && action == 1 && move == 0 && task > 0) { - if (ObjectUtil.isNotEmpty(inst1)) { - String start_device_code = inst1.getStart_device_code(); - Device device = deviceAppService.findDeviceByCode(start_device_code); - PluggingUnpluggingMachineDeviceDriver pluggingUnpluggingMachineDeviceDriver; - if (device.getDeviceDriver() instanceof PluggingUnpluggingMachineDeviceDriver) { - pluggingUnpluggingMachineDeviceDriver = (PluggingUnpluggingMachineDeviceDriver) device.getDeviceDriver(); - int mode = pluggingUnpluggingMachineDeviceDriver.getMode(); - int error1 = pluggingUnpluggingMachineDeviceDriver.getError(); - int move = pluggingUnpluggingMachineDeviceDriver.getMove(); - if (mode == 2 && error1 == 0 && move == 1) { - Map map = new LinkedHashMap<>(); - map.put("to_command", "1"); - this.writing(map); - requireSucess = true; - } - } - } - } else { - feedMessage = "行架机械手:"; - if (mode != 3) { - feedMessage = feedMessage + "工作模式(mode)不为运行中状态,"; - } - if (action != 1) { - feedMessage = feedMessage + "动作信号(action)不为取货中状态,"; - } - if (move != 0) { - feedMessage = feedMessage + "光电信号(move)不为无货状态,"; - } - if (task == 0) { - feedMessage = feedMessage + "当前上报任务号(task)不应该为0。"; - } - } - - - //申请放货点 - if (action == 3) { - String task_code = inst1.getTask_code(); - applyManipulatorActionRequest.setType("3"); - applyManipulatorActionRequest.setTask_code(task_code); - applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); - String put_device_code = applyManipulatorActionResponse.getPut_device_code(); - Map map = new LinkedHashMap<>(); - map.put("to_command", "3"); - map.put("to_putpoint", put_device_code); - this.writing(map); - requireSucess = true; - } - - - //任务完成 - if (action == 8) { - try { - requireSucess = true; - finish_instruction(inst1); - this.writing("to_command", "8"); - } catch (Exception e) { - e.printStackTrace(); - } - feedMessage = ""; - } else { - feedMessage = "行架机械手:"; - if (mode != 3) { - feedMessage = feedMessage + "工作模式(mode)不为运行中状态,"; - } - if (action != 8) { - feedMessage = feedMessage + "动作信号(action)不为完成状态,"; - } - if (move != 0) { - feedMessage = feedMessage + "光电信号(move)不为无货状态,"; - } - if (task == 0) { - feedMessage = feedMessage + "当前上报任务号(task)不应该为0。"; - } - } - } - } else { - feedMessage = ""; - } - } - - private synchronized void update_instruction_status4() { ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); ApplyManipulatorActionResponse applyManipulatorActionResponse; Date date = new Date(); @@ -731,106 +434,131 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple //反馈尺寸 - if (action == 2) { + if (mode == 3 && action == 2) { String task_code = inst1.getTask_code(); + TaskDto task = taskserver.findByCode(task_code); applyManipulatorActionRequest.setType("2"); - applyManipulatorActionRequest.setTask_code(task_code); + applyManipulatorActionRequest.setTask_code1(task_code); applyManipulatorActionRequest.setSize(String.valueOf(inflatable_shaft_size)); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); if (applyManipulatorActionResponse.getstatus() == 200) { - requireSucess = true; + feedbackSucess = true; message = "反馈LMS成功..."; logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); + String is_bushing = task.getIs_bushing(); + String version = task.getVersion(); + String bushing_num = task.getBushing_num(); Map map = new LinkedHashMap<>(); - map.put("to_command", "2"); + map.put("inflatableShaftVersion", Integer.parseInt(version)); + map.put("tube_num", Integer.parseInt(bushing_num)); + map.put("is_wrapped", Integer.parseInt(is_bushing)); + map.put("to_command", 2); this.writing(map); } else { - requireSucess = false; + feedbackSucess = false; message = "完成反馈LMS失败," + String.valueOf(applyManipulatorActionResponse); logServer.deviceExecuteLog(this.device_code, "", "", "反馈完成请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); } } //申请放货点 - if (action == 3) { + if (mode == 3 && action == 3) { String task_code = inst1.getTask_code(); applyManipulatorActionRequest.setType("3"); - applyManipulatorActionRequest.setTask_code(task_code); + applyManipulatorActionRequest.setTask_code1(task_code); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); String put_device_code = applyManipulatorActionResponse.getPut_device_code(); + Device device = deviceAppService.findDeviceByCode(put_device_code); + String to_putpoint = device.getExtraValue().get("address").toString(); Map map = new LinkedHashMap<>(); - map.put("to_command", "3"); - map.put("to_putpoint", put_device_code); + map.put("to_command", 3); + map.put("to_putpoint", Integer.parseInt(to_putpoint)); this.writing(map); - requireSucess = true; + feedbackSucess = true; } //申请新取货点 - if (action == 4) { + if (mode == 3 && action == 4) { String task_code = inst1.getTask_code(); applyManipulatorActionRequest.setType("4"); - applyManipulatorActionRequest.setTask_code(task_code); + applyManipulatorActionRequest.setTask_code1(task_code); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); if (applyManipulatorActionResponse.getstatus() == 200) { String get_device_code = applyManipulatorActionResponse.getGet_device_code(); + Device device = deviceAppService.findDeviceByCode(get_device_code); + String to_new_getpoint = device.getExtraValue().get("address").toString(); Map map = new LinkedHashMap<>(); - map.put("to_command", "4"); - map.put("to_new_getpoint", get_device_code); + map.put("to_command", 4); + map.put("to_new_getpoint", Integer.parseInt(to_new_getpoint)); this.writing(map); - requireSucess = true; + feedbackSucess = true; logServer.deviceExecuteLog(this.device_code, "", "", "申请新取货点,返回参数:" + applyManipulatorActionResponse); message = "申请新取货点成功"; } else { - requireSucess = false; + feedbackSucess = false; message = "申请失败"; logServer.deviceExecuteLog(this.device_code, "", "", "申请失败,返回参数:" + applyManipulatorActionResponse); } } //申请二次放货点 - if (action == 5) { + if (mode == 3 && action == 5) { String task_code = inst1.getTask_code(); applyManipulatorActionRequest.setType("5"); - applyManipulatorActionRequest.setTask_code(task_code); + applyManipulatorActionRequest.setTask_code1(task_code); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); if (applyManipulatorActionResponse.getstatus() == 200) { String put_device_code2 = applyManipulatorActionResponse.getPut_device_code2(); + Device device = deviceAppService.findDeviceByCode(put_device_code2); + String to_two_putpoint = device.getExtraValue().get("address").toString(); Map map = new LinkedHashMap<>(); - map.put("to_command", "5"); - map.put("to_two_putpoint", put_device_code2); + map.put("to_command", 5); + map.put("to_two_putpoint", Integer.parseInt(to_two_putpoint)); this.writing(map); - requireSucess = true; + feedbackSucess = true; logServer.deviceExecuteLog(this.device_code, "", "", "申请二次放货点,返回参数:" + applyManipulatorActionResponse); message = "申请二次放货点成功"; } else { - requireSucess = false; + feedbackSucess = false; message = "申请失败"; logServer.deviceExecuteLog(this.device_code, "", "", "申请失败,返回参数:" + applyManipulatorActionResponse); } } //缓存库取货完成 - if (action == 6) { + if (mode == 3 && action == 6) { + String task_code = inst1.getTask_code(); + applyManipulatorActionRequest.setAction("1"); + applyManipulatorActionRequest.setTask_code1(task_code); + acsToWmsService.actionFinishRequest(applyManipulatorActionRequest); Map map = new LinkedHashMap<>(); - map.put("to_command", "6"); - requireSucess = true; + map.put("to_command", 6); + this.writing(map); + feedbackSucess = true; } //缓存库放货完成 - if (action == 7) { + if (mode == 3 && action == 7) { + String task_code = inst1.getTask_code(); + applyManipulatorActionRequest.setAction("2"); + applyManipulatorActionRequest.setTask_code1(task_code); + acsToWmsService.actionFinishRequest(applyManipulatorActionRequest); Map map = new LinkedHashMap<>(); - map.put("to_command", "7"); - requireSucess = true; + map.put("to_command", 7); + this.writing(map); + feedbackSucess = true; } //放货完成 - if (action == 8) { + if (mode == 3 && action == 8 && move == 0) { if (inst1 != null) { try { - requireSucess = true; + feedbackSucess = true; finish_instruction(inst1); - this.writing("to_command", "8"); + Map map = new LinkedHashMap<>(); + map.put("to_command", 8); + this.writing(map); } catch (Exception e) { e.printStackTrace(); } @@ -996,18 +724,14 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple String bushing_num = taskDto.getBushing_num(); Map map = new LinkedHashMap<>(); - map.put("to_command", "1"); - if (action == 2) { - map.put("inflatableShaftVersion", version); - map.put("tube_num", bushing_num); - map.put("is_wrapped", is_bushing); - } - if (taskDto.getTruss_type() == "1" || taskDto.getTruss_type() == "5") { - map.put("to_task_type", taskDto.getTruss_type()); - } - map.put("to_onset", start_addr); - map.put("to_task", instruction.getInstruction_code()); - map.put("to_target", next_addr); + map.put("to_command", 1); + map.put("inflatableShaftVersion", Integer.parseInt(version)); + map.put("tube_num", Integer.parseInt(bushing_num)); + map.put("is_wrapped", Integer.parseInt(is_bushing)); + map.put("to_task_type", Integer.parseInt(taskDto.getTruss_type())); + map.put("to_onset", Integer.parseInt(start_addr)); + map.put("to_task", Integer.parseInt(instruction.getInstruction_code())); + map.put("to_target", Integer.parseInt(next_addr)); this.writing(map); this.setRequireSucess(true); return true; @@ -1098,22 +822,12 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple logServer.deviceExecuteLog(device_code, "", "", "当前设备:" + device_code + ",下发指令:" + instdto.getInstruction_code() + ",指令起点:" + instdto.getStart_device_code() + ",指令终点:" + instdto.getNext_device_code()); - String is_bushing = task.getIs_bushing(); - String version = task.getVersion(); - String bushing_num = task.getBushing_num(); Map map = new LinkedHashMap<>(); - map.put("to_command", "1"); - if (action == 2) { - map.put("inflatableShaftVersion", version); - map.put("tube_num", bushing_num); - map.put("is_wrapped", is_bushing); - } - if (task.getTruss_type() == "1" || task.getTruss_type() == "5") { - map.put("to_task_type", task.getTruss_type()); - } - map.put("to_onset", start_addr); - map.put("to_task", instdto.getInstruction_code()); - map.put("to_target", next_addr); + map.put("to_command", 1); + map.put("to_task_type", Integer.parseInt(task.getTruss_type())); + map.put("to_onset", Integer.parseInt(start_addr)); + map.put("to_task", Integer.parseInt(instdto.getInstruction_code())); + map.put("to_target", Integer.parseInt(next_addr)); this.writing(map); this.setRequireSucess(true); notCreateInstMessage = ""; diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paper_tube_device2/PaperTubeConveyor2DeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paper_tube_device2/PaperTubeConveyor2DeviceDriver.java index 21d47bc2c..034fafd91 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paper_tube_device2/PaperTubeConveyor2DeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paper_tube_device2/PaperTubeConveyor2DeviceDriver.java @@ -659,9 +659,9 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl map.put("to_material" + status, paper.getMaterial_code()); map.put("to_out_qty" + status, paper.getQty()); map.put("to_seq" + status, status); - Device nextdevice = deviceAppservice.findDeviceByCode(paper.getDevice_code()); - String next_addr = nextdevice.getExtraValue().get("address").toString(); - map.put("to_position" + status, next_addr); +// Device nextdevice = deviceAppservice.findDeviceByCode(paper.getDevice_code()); +// String next_addr = nextdevice.getExtraValue().get("address").toString(); + map.put("to_position" + status, paper.getDevice_code()); } @@ -810,7 +810,7 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl if (item_qty12 != (last_item_qty12)) { logServer.deviceExecuteLog(this.device_code, "", "", "信号qty12:" + last_item_qty12 + "->" + item_qty12); } - if (item_material1.equals(last_item_material1)) { + if (!item_material1.equals(last_item_material1)) { logServer.deviceExecuteLog(this.device_code, "", "", "信号material1:" + last_item_material1 + "->" + item_material1); } if (!item_material2.equals(last_item_material2)) { diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/ItemProtocol.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/ItemProtocol.java index df30a3944..40483ef90 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/ItemProtocol.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/ItemProtocol.java @@ -15,7 +15,8 @@ public class ItemProtocol { public static String item_mode = "mode"; public static String item_move = "move"; public static String item_error = "error"; - public static String item_task = "task"; + public static String item_task1 = "task1"; + public static String item_task2 = "task2"; public static String item_to_command = "to_command"; private PluggingUnpluggingMachineDeviceDriver driver; @@ -40,8 +41,11 @@ public class ItemProtocol { return this.getOpcIntegerValue(item_error); } - public int getTask() { - return this.getOpcIntegerValue(item_task); + public int getTask1() { + return this.getOpcIntegerValue(item_task1); + } + public int getTask2() { + return this.getOpcIntegerValue(item_task2); } public int getToCommand() { @@ -75,7 +79,9 @@ public class ItemProtocol { list.add(new ItemDto(item_mode, "工作状态", "DB600.B2")); list.add(new ItemDto(item_move, "光电开关信号", "DB600.B3")); list.add(new ItemDto(item_error, "报警信号", "DB600.B5")); - list.add(new ItemDto(item_task, "任务号", "DB600.D6")); + list.add(new ItemDto(item_task1, "任务号1(行架任务号)", "DB600.D6")); + list.add(new ItemDto(item_task2, "任务号2(纸管任务号)", "DB600.D10")); + return list; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/PluggingUnpluggingMachineDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/PluggingUnpluggingMachineDefination.java index e38405519..563fc8e8f 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/PluggingUnpluggingMachineDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/PluggingUnpluggingMachineDefination.java @@ -2,7 +2,6 @@ package org.nl.acs.device_driver.basedriver.plugging_unplugging_machine; import org.nl.acs.device.device_driver.standard_inspect.ItemDto; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.basedriver.standard_inspect_site.ItemProtocol; import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceType; @@ -51,7 +50,7 @@ public class PluggingUnpluggingMachineDefination implements OpcDeviceDriverDefin @Override public List getReadableItemDtos() { - return org.nl.acs.device_driver.basedriver.standard_inspect_site.ItemProtocol.getReadableItemDtos(); + return ItemProtocol.getReadableItemDtos(); } @Override diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/PluggingUnpluggingMachineDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/PluggingUnpluggingMachineDeviceDriver.java index 584de33af..8ea99edbf 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/PluggingUnpluggingMachineDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/PluggingUnpluggingMachineDeviceDriver.java @@ -1,5 +1,6 @@ package org.nl.acs.device_driver.basedriver.plugging_unplugging_machine; +import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; @@ -60,17 +61,22 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv int mode = 0; int error = 0; int move = 0; - int task = 0; + int task1 = 0; + int task2 = 0; int last_mode = 0; int last_error = 0; int last_move = 0; - int last_task = 0; + int last_task1 = 0; + int last_task2 = 0; Boolean isonline = true; Boolean iserror = false; //行架机械手申请任务成功标识 boolean requireSucess = false; + //当前指令 + Instruction inst = null; + //1-执行任务;2-取货完成;3-放货完成; int flag; @@ -91,9 +97,11 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv mode = this.itemProtocol.getMode(); error = this.itemProtocol.getError(); move = this.itemProtocol.getMove(); - task = this.itemProtocol.getTask(); + task1 = this.itemProtocol.getTask1(); + task2 = this.itemProtocol.getTask2(); if (mode != last_mode) { + this.requireSucess=false; logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记"); } if (move != last_move) { @@ -129,13 +137,13 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv case 3: break; case 4: - if (!requireSucess) { - feedback(); + if ((task1 > 0 || task2 > 0) && !requireSucess) { + applyBushing(); } break; case 5: - if (!requireSucess) { - feedback1(); + if ((task1 > 0 || task2 > 0) && !requireSucess) { + bushingSucess(); } break; default: @@ -147,45 +155,61 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv last_mode = mode; last_error = error; last_move = move; - last_task = task; + last_task1 = task1; + last_task2 = task2; } - private synchronized void feedback1() { + + private synchronized void bushingSucess() { ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); ApplyManipulatorActionResponse applyManipulatorActionResponse; + Instruction inst1 = instructionService.findByCode(String.valueOf(task1)); + Instruction inst2 = instructionService.findByCode(String.valueOf(task2)); + String task_code1 = inst1.getTask_code(); + String task_code2 = inst2.getTask_code(); + applyManipulatorActionRequest.setDevice_code(device_code); + applyManipulatorActionRequest.setTask_code1(task_code1); + applyManipulatorActionRequest.setTask_code2(task_code2); applyManipulatorActionRequest.setType("7"); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); - if (applyManipulatorActionResponse.getstatus() == 200) { + if (applyManipulatorActionResponse.getstatus()==200) { Map map = new LinkedHashMap<>(); - map.put("to_command", "5"); + map.put("to_command", 5); requireSucess = true; logServer.deviceExecuteLog(this.device_code, "", "", "申请出纸管,返回参数:" + applyManipulatorActionResponse); message = "套轴完成成功"; - } else { + }else{ message = applyManipulatorActionResponse.getMessage(); Map map = new LinkedHashMap<>(); - map.put("to_command", "99"); + map.put("to_command", 99); requireSucess = true; message = "套轴失败"; logServer.deviceExecuteLog(this.device_code, "", "", "申请出纸管,返回参数:" + applyManipulatorActionResponse); } } - private synchronized void feedback() { + private synchronized void applyBushing() { ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); ApplyManipulatorActionResponse applyManipulatorActionResponse; + Instruction inst1 = instructionService.findByCode(String.valueOf(task1)); + Instruction inst2 = instructionService.findByCode(String.valueOf(task2)); + String task_code1 = inst1.getTask_code(); + String task_code2 = inst2.getTask_code(); + applyManipulatorActionRequest.setDevice_code(device_code); + applyManipulatorActionRequest.setTask_code1(task_code1); + applyManipulatorActionRequest.setTask_code2(task_code2); applyManipulatorActionRequest.setType("6"); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); - if (applyManipulatorActionResponse.getstatus() == 200) { + if (applyManipulatorActionResponse.getstatus()==200) { Map map = new LinkedHashMap<>(); - map.put("to_command", "4"); + map.put("to_command", 4); requireSucess = true; logServer.deviceExecuteLog(this.device_code, "", "", "申请出纸管,返回参数:" + applyManipulatorActionResponse); message = "套轴申请成功"; - } else { + }else { message = applyManipulatorActionResponse.getMessage(); Map map = new LinkedHashMap<>(); - map.put("to_command", "99"); + map.put("to_command", 99); requireSucess = true; message = "申请失败"; logServer.deviceExecuteLog(this.device_code, "", "", "申请出纸管,返回参数:" + applyManipulatorActionResponse); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/ApplyManipulatorActionRequest.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/ApplyManipulatorActionRequest.java index 4fec7dd92..ddcd86a25 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/ApplyManipulatorActionRequest.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/ApplyManipulatorActionRequest.java @@ -17,14 +17,23 @@ public class ApplyManipulatorActionRequest extends BaseRequest { private String type; /** - * 任务号 + * 行架任务号 */ - private String task_code; + private String task_code1; + /** + * 纸管任务号 + */ + private String task_code2; /** * 气胀轴尺寸 3/6寸 */ private String size; + /** + * 动作完成 + * 取货完成1 放货完成2 + */ + private String action; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java index 226fb0a07..9d559cfb8 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java @@ -1,5 +1,6 @@ package org.nl.acs.ext.wms.data; +import com.alibaba.fastjson.JSONArray; import lombok.Data; import org.nl.acs.device_driver.basedriver.paper_tube_device2.Paper; @@ -122,6 +123,27 @@ public class CreateTaskRequest extends BaseRequest { */ Map params; - private List paper_array; + /** + * 行架任务类型 + */ + private String truss_type; + + + /** + * 气胀轴代数 + */ + private String version; + + /** + * 是否套管 + */ + private String is_bushing; + + /** + * 套管数量 + */ + private String bushing_num; + + private String paper_array; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/AcsToWmsController.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/AcsToWmsController.java index 41b51958b..fa57630d6 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/AcsToWmsController.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/AcsToWmsController.java @@ -107,6 +107,13 @@ public class AcsToWmsController { return new ResponseEntity<>(acstowmsService.applyManipulatorActionRequest(param), HttpStatus.OK); } + @PostMapping("/actionFinishRequest") + @Log(value = "动作完成请求",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS) + @ApiOperation("动作完成请求") + public ResponseEntity actionFinishRequest(@RequestBody ApplyManipulatorActionRequest param) { + return new ResponseEntity<>(acstowmsService.actionFinishRequest(param), HttpStatus.OK); + } + @PostMapping("/liKuApplyTaskRequest") @Log(value = "立库申请任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS) @ApiOperation("立库申请任务") diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java index d5039b06a..a6ea893db 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java @@ -117,4 +117,5 @@ public interface AcsToWmsService { void sendDeviceStatus(JSONObject param); ApplyManipulatorActionResponse applyManipulatorActionRequest(ApplyManipulatorActionRequest param); + ApplyManipulatorActionResponse actionFinishRequest(ApplyManipulatorActionRequest param); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java index 451ae2399..a8b5c7019 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java @@ -444,8 +444,38 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } finally { MDC.remove(log_file_type); } + } - + @Override + public ApplyManipulatorActionResponse actionFinishRequest(ApplyManipulatorActionRequest param) { + try { + MDC.put(log_file_type, log_type); + ApplyManipulatorActionResponse actionFinishRequestResponse = new ApplyManipulatorActionResponse(); + if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { + String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue(); + AddressDto addressDto = addressService.findByCode("actionFinishRequest"); + String methods_url = addressDto.getMethods_url(); + String url = wmsUrl + methods_url; + log.info("ApplyManipulatorActionRequest----请求参数{}", param); + try { +// String result = ""; + String result = HttpRequest.post(url) + .body(JSON.toJSONString(param)) + .execute().body(); + JSONObject jsonObject = JSONObject.parseObject(result); + log.info("ApplyManipulatorActionResponse----返回参数{}", result); + actionFinishRequestResponse = JSONObject.toJavaObject(jsonObject, ApplyManipulatorActionResponse.class); + } catch (Exception e) { + JSONObject map = new JSONObject(); + map.put("status", 400); + map.put("message", e.getMessage()); + return JSONObject.toJavaObject(map, ApplyManipulatorActionResponse.class); + } + } + return actionFinishRequestResponse; + } finally { + MDC.remove(log_file_type); + } } @Override diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index 3ae28e74c..7c6469602 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -21,15 +21,19 @@ import org.nl.acs.device_driver.FeedLmsRealFailed; import org.nl.acs.device_driver.basedriver.agv.ndcone.AgvNdcOneDeviceDriver; import org.nl.acs.device_driver.basedriver.agv.ndctwo.AgvNdcTwoDeviceDriver; import org.nl.acs.device_driver.basedriver.cargo_lift_conveyor.CargoLiftConveyorDeviceDriver; +import org.nl.acs.device_driver.basedriver.casing_station.CasingStationConveyorDeviceDriver; import org.nl.acs.device_driver.basedriver.device_status.DeviceStatusDeviceDriver; import org.nl.acs.device_driver.basedriver.empty_vehicle_stacking_position.EmptyVehicleStackingPositionDeviceDriver; import org.nl.acs.device_driver.basedriver.hongxiang_conveyor.HongXiangStationDeviceDriver; import org.nl.acs.device_driver.basedriver.hongxiang_device.HongXiangConveyorDeviceDriver; +import org.nl.acs.device_driver.basedriver.indoor_manipulator.IndoorManipulatorDeviceDriver; import org.nl.acs.device_driver.basedriver.lamp_three_color.LampThreecolorDeviceDriver; import org.nl.acs.device_driver.basedriver.oven_manipulator.OvenGantryManipulatorDeviceDriver; import org.nl.acs.device_driver.basedriver.paper_tube_device.PaperTubeConveyorDeviceDriver; import org.nl.acs.device_driver.basedriver.paper_tube_device2.Paper; +import org.nl.acs.device_driver.basedriver.paper_tube_device2.PaperTubeConveyor2DeviceDriver; import org.nl.acs.device_driver.basedriver.plug_pull_device_site.PlugPullDeviceSiteDeviceDriver; +import org.nl.acs.device_driver.basedriver.plugging_unplugging_machine.PluggingUnpluggingMachineDeviceDriver; import org.nl.acs.device_driver.basedriver.siemens_conveyor.SiemensConveyorDeviceDriver; import org.nl.acs.device_driver.basedriver.siemens_conveyor_ckk.SiemensConveyorCkkDeviceDriver; import org.nl.acs.device_driver.basedriver.siemens_conveyor_labeling.SiemensConveyorLabelingDeviceDriver; @@ -238,8 +242,17 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { StandardCoveyorControlWithScannerDeviceDriver standardCoveyorControlWithScannerDeviceDriver; //纸管库 PaperTubeConveyorDeviceDriver paperTubeConveyorDeviceDriver; + //纸管库2 + PaperTubeConveyor2DeviceDriver paperTubeConveyor2DeviceDriver; //立库设备 DeviceStatusDeviceDriver deviceStatusDeviceDriver; + //插拔轴机 + PlugPullDeviceSiteDeviceDriver plugPullDeviceSiteDeviceDriver; + //内包间行架机械手 + IndoorManipulatorDeviceDriver indoorManipulatorDeviceDriver; + //套管工位 + CasingStationConveyorDeviceDriver casingStationConveyorDeviceDriver; + if (datas.size() == 0) { throw new BadRequestException("缺少输入参数!"); } @@ -291,6 +304,19 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { jo.put("action", standardCoveyorControlWithScannerDeviceDriver.getAction()); jo.put("error", standardCoveyorControlWithScannerDeviceDriver.getError()); + } else if (device.getDeviceDriver() instanceof CasingStationConveyorDeviceDriver) { + casingStationConveyorDeviceDriver = (CasingStationConveyorDeviceDriver) device.getDeviceDriver(); + jo.put("device_code", parent_device_code); + jo.put("mode", casingStationConveyorDeviceDriver.getMode()); + jo.put("move", casingStationConveyorDeviceDriver.getMove()); + jo.put("heartbeat", casingStationConveyorDeviceDriver.getHeartbeat()); + jo.put("carrier_direction", casingStationConveyorDeviceDriver.getCarrier_direction()); + jo.put("error", casingStationConveyorDeviceDriver.getError()); + jo.put("task", casingStationConveyorDeviceDriver.getTask()); + jo.put("material1", casingStationConveyorDeviceDriver.getMaterial1()); + jo.put("material2", casingStationConveyorDeviceDriver.getMaterial2()); + + } else if (device.getDeviceDriver() instanceof PaperTubeConveyorDeviceDriver) { paperTubeConveyorDeviceDriver = (PaperTubeConveyorDeviceDriver) device.getDeviceDriver(); jo.put("device_code", parent_device_code); @@ -356,6 +382,42 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { jo.put("y", driver.getY_position()); jo.put("error", driver.getError()); jo.put("error_msg", driver.getError() == 0 ? "" : ErrorUtil.getDictDetail("fqhj_error_type", String.valueOf(driver.getError()))); + }else if (device.getDeviceDriver() instanceof PaperTubeConveyor2DeviceDriver) { + paperTubeConveyor2DeviceDriver = (PaperTubeConveyor2DeviceDriver) device.getDeviceDriver(); + jo.put("device_code", parent_device_code); + jo.put("heartbeat",paperTubeConveyor2DeviceDriver.getHeartbeat()); + jo.put("mode",paperTubeConveyor2DeviceDriver.getMode()); + jo.put("move",paperTubeConveyor2DeviceDriver.getMove()); + jo.put("carrier_direction",paperTubeConveyor2DeviceDriver.getCarrier_direction()); + jo.put("error",paperTubeConveyor2DeviceDriver.getError()); + jo.put("task",paperTubeConveyor2DeviceDriver.getTask()); + jo.put("out_seq_arr",paperTubeConveyor2DeviceDriver.getItem_out_seq_arr()); + jo.put("out_qty_arr",paperTubeConveyor2DeviceDriver.getItem_out_qty_arr()); + jo.put("material1",paperTubeConveyor2DeviceDriver.getItem_material1()); + jo.put("qty1",paperTubeConveyor2DeviceDriver.getItem_qty1()); + jo.put("material2",paperTubeConveyor2DeviceDriver.getItem_material2()); + jo.put("qty2",paperTubeConveyor2DeviceDriver.getItem_qty2()); + jo.put("material3",paperTubeConveyor2DeviceDriver.getItem_material3()); + jo.put("qty3",paperTubeConveyor2DeviceDriver.getItem_qty3()); + jo.put("material4",paperTubeConveyor2DeviceDriver.getItem_material4()); + jo.put("qty4",paperTubeConveyor2DeviceDriver.getItem_qty4()); + jo.put("material5",paperTubeConveyor2DeviceDriver.getItem_material5()); + jo.put("qty5",paperTubeConveyor2DeviceDriver.getItem_qty5()); + jo.put("material6",paperTubeConveyor2DeviceDriver.getItem_material6()); + jo.put("qty6",paperTubeConveyor2DeviceDriver.getItem_qty6()); + jo.put("material7",paperTubeConveyor2DeviceDriver.getItem_material7()); + jo.put("qty7",paperTubeConveyor2DeviceDriver.getItem_qty7()); + jo.put("material8",paperTubeConveyor2DeviceDriver.getItem_material8()); + jo.put("qty8",paperTubeConveyor2DeviceDriver.getItem_qty8()); + jo.put("material9",paperTubeConveyor2DeviceDriver.getItem_material9()); + jo.put("qty9",paperTubeConveyor2DeviceDriver.getItem_qty9()); + jo.put("material10",paperTubeConveyor2DeviceDriver.getItem_material10()); + jo.put("qty10",paperTubeConveyor2DeviceDriver.getItem_qty10()); + jo.put("material11",paperTubeConveyor2DeviceDriver.getItem_material11()); + jo.put("qty11",paperTubeConveyor2DeviceDriver.getItem_qty11()); + jo.put("material12",paperTubeConveyor2DeviceDriver.getItem_material12()); + jo.put("qty12",paperTubeConveyor2DeviceDriver.getItem_qty12()); + } else if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) { SiemensConveyorDeviceDriver driver = (SiemensConveyorDeviceDriver) device.getDeviceDriver(); jo.put("device_code", driver.getDevice().getDevice_code()); @@ -384,6 +446,31 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { jo.put("status", Math.min(3, driver.getMode())); jo.put("error", driver.getError()); jo.put("error_msg", driver.getError() == 0 ? "" : ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(driver.getError()))); + } else if (device.getDeviceDriver() instanceof IndoorManipulatorDeviceDriver) { + IndoorManipulatorDeviceDriver driver = (IndoorManipulatorDeviceDriver) device.getDeviceDriver(); + jo.put("device_code", driver.getDevice().getDevice_code()); + jo.put("device_name", driver.getDevice().getDevice_name()); + jo.put("status", Math.min(3, driver.getMode())); + jo.put("mode", driver.getMode()); + jo.put("move", driver.getMove()); + jo.put("action", driver.getAction()); + jo.put("walk_y", driver.getWalk_y()); + jo.put("task", driver.getTask()); + jo.put("x_position", driver.getX_position()); + jo.put("y_position", driver.getY_position()); + jo.put("inflatable_shaft_size", driver.getInflatable_shaft_size()); + jo.put("error_msg", driver.getError() == 0 ? "" : ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(driver.getError()))); + }else if (device.getDeviceDriver() instanceof PluggingUnpluggingMachineDeviceDriver) { + PluggingUnpluggingMachineDeviceDriver driver = (PluggingUnpluggingMachineDeviceDriver) device.getDeviceDriver(); + jo.put("device_code", driver.getDevice().getDevice_code()); + jo.put("device_name", driver.getDevice().getDevice_name()); + jo.put("status", Math.min(3, driver.getMode())); + jo.put("mode", driver.getMode()); + jo.put("move", driver.getMove()); + jo.put("task1", driver.getTask1()); + jo.put("task2", driver.getTask2()); + jo.put("error", driver.getError()); + jo.put("error_msg", driver.getError() == 0 ? "" : ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(driver.getError()))); } else { jo.put("device_code", parent_device_code); } @@ -616,7 +703,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { for (int i = 0; i < datas.size(); i++) { String data = datas.get(i).toString(); CreateTaskRequest request = JsonUtl.format(data, CreateTaskRequest.class); - List paper_array = request.getPaper_array(); + String paper_array = request.getPaper_array(); String ext_task_id = request.getExt_task_id(); String task_code = request.getTask_code(); String start_device_code = request.getStart_device_code(); @@ -629,6 +716,10 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { String vehicle_type = request.getVehicle_type(); String route_plan_code = request.getRoute_plan_code(); String task_type = request.getTask_type(); + String truss_type = request.getTruss_type(); + String is_bushing = request.getIs_bushing(); + String version = request.getVersion(); + String bushing_num = request.getBushing_num(); String storage_task_type = request.getDtl_type(); String agv_system_type = request.getAgv_system_type(); String remark = request.getRemark(); @@ -827,6 +918,10 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { jo.put("params", params); jo.put("task_type", StrUtil.isEmpty(task_type) ? 1 : Integer.parseInt(task_type)); jo.put("paper_array", JSONUtil.toJsonStr(paper_array)); + jo.put("truss_type", JSONUtil.toJsonStr(truss_type)); + jo.put("is_bushing", JSONUtil.toJsonStr(is_bushing)); + jo.put("version", JSONUtil.toJsonStr(version)); + jo.put("bushing_num", JSONUtil.toJsonStr(bushing_num)); if (!StrUtil.isEmpty(ext_task_id)) {