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 b487bf3ae..d2a29cd2c 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 @@ -428,7 +428,8 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i jo.put("move", move); jo.put("inventory_qty", qty); jo.put("out_finish", out_finish); - jo.put("material", material1); + jo.put("material1", material1); + jo.put("material2", material2); jo.put("isOnline", this.getIsonline()); return jo; diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paper_tube_device2/ItemProtocol.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paper_tube_device2/ItemProtocol.java index 1a4592ff4..ed0b63e7b 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paper_tube_device2/ItemProtocol.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paper_tube_device2/ItemProtocol.java @@ -188,8 +188,8 @@ public class ItemProtocol { return this.getOpcArrayValue1(item_out_seq_arr); } - public int[] getItem_out_qty_arr() { - return this.getOpcArrayValue(item_out_qty_arr); + public String getItem_out_qty_arr() { + return this.getOpcStringValue(item_out_qty_arr); } 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 e4e1be924..38cfd313b 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 @@ -115,8 +115,8 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl String item_out_seq_arr = null; String last_item_out_seq_arr = null; //出库数量数组 - int[] item_out_qty_arr = null; - int[] last_item_out_qty_arr = null; + String item_out_qty_arr = null; + String last_item_out_qty_arr = null; String item_material1 = null; @@ -469,7 +469,7 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl } - public synchronized void request_for_shipment(String mode, String item_out_seq_arr, int[] item_out_qty_arr) { + public synchronized void request_for_shipment(String mode, String item_out_seq_arr, String item_out_qty_arr) { Date date = new Date(); if (date.getTime() - this.require_apply_strangulation_time.getTime() < (long) this.instruction_require_time_out) { log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); @@ -486,17 +486,26 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl if (contains) { String[] split = item_out_seq_arr.split(","); applyPaperActionRequest.setMaterial1(split[0]); - applyPaperActionRequest.setMaterial1(split[1]); + applyPaperActionRequest.setMaterial2(split[1]); } else if (contains1) { String[] split = item_out_seq_arr.split(","); applyPaperActionRequest.setMaterial1(split[0]); - applyPaperActionRequest.setMaterial1(split[1]); + applyPaperActionRequest.setMaterial2(split[1]); } else { applyPaperActionRequest.setMaterial1(item_out_seq_arr); } - if (item_out_qty_arr.length >= 1 && item_out_qty_arr.length < 4) { - applyPaperActionRequest.setQty1(String.valueOf(item_out_qty_arr[0])); - applyPaperActionRequest.setQty2(String.valueOf(item_out_qty_arr[1])); + boolean contains2 = item_out_qty_arr.contains(","); + boolean contains3 = item_out_qty_arr.contains(","); + if (contains2) { + String[] split = item_out_qty_arr.split(","); + applyPaperActionRequest.setQty1(split[0]); + applyPaperActionRequest.setQty2(split[1]); + } else if (contains3) { + String[] split = item_out_qty_arr.split(","); + applyPaperActionRequest.setQty1(split[0]); + applyPaperActionRequest.setQty2(split[1]); + } else { + applyPaperActionRequest.setQty1(item_out_qty_arr); } ApplyPaperActionResponse applyPaperActionResponse = acsToWmsService.applyPaperActionRequest(applyPaperActionRequest); if (ObjectUtil.isNull(applyPaperActionResponse)) { @@ -609,7 +618,7 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl instructionService.create(instdto); } catch (Exception e) { e.printStackTrace(); - log.error("指令创建失败!", e.getMessage()); + log.error("指令创建失败!{}", e.getMessage()); return false; } taskdto.setTask_status("1"); @@ -744,6 +753,8 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl map.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError()))); map.put("move", move); map.put("isOnline", this.getIsonline()); + map.put("out_seq_arr", this.getItem_out_seq_arr()); + map.put("out_qty_arr", this.getItem_out_qty_arr()); map.put("material1", this.getItem_material1()); map.put("z_qty1", this.getItem_qty1()); map.put("material2", this.getItem_material2()); @@ -769,6 +780,7 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl map.put("material12", this.getItem_material12()); map.put("z_qty12", this.getItem_qty12()); + JSONObject jo = new JSONObject(map); return jo; } @@ -833,8 +845,8 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl if (!item_out_seq_arr.equals(last_item_out_seq_arr)) { logServer.deviceExecuteLog(this.device_code, "", "", "信号item_out_seq_arr:" + last_item_out_seq_arr + "->" + item_out_seq_arr); } - if (!arrayEquals(item_out_qty_arr, last_item_out_qty_arr)) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号item_out_qty_arr:" + Arrays.toString(last_item_out_qty_arr) + "->" + Arrays.toString(item_out_qty_arr)); + if (!item_out_qty_arr.equals(last_item_out_qty_arr)) { + logServer.deviceExecuteLog(this.device_code, "", "", "信号item_out_qty_arr:" + last_item_out_qty_arr + "->" + item_out_qty_arr); } if (item_qty1 != (last_item_qty1)) { logServer.deviceExecuteLog(this.device_code, "", "", "信号qty1:" + last_item_qty1 + "->" + item_qty1); diff --git a/acs/nladmin-ui/src/views/system/monitor/device/index.vue b/acs/nladmin-ui/src/views/system/monitor/device/index.vue index 024e7917a..6fd7d664b 100644 --- a/acs/nladmin-ui/src/views/system/monitor/device/index.vue +++ b/acs/nladmin-ui/src/views/system/monitor/device/index.vue @@ -721,6 +721,12 @@ export default { } else if (val === 'z_qty12') { const obj = { name: '数量12', value: data[val] } this.arr.push(obj) + } else if (val === 'out_seq_arr') { + const obj = { name: '出库顺序', value: data[val] } + this.arr.push(obj) + } else if (val === 'out_qty_arr') { + const obj = { name: '出库数量', value: data[val] } + this.arr.push(obj) } } }