From 9f5def77384464270c60c12d07d1ab65975f7495 Mon Sep 17 00:00:00 2001 From: "USER-20220102CG\\noblelift" <546428999@qq.com> Date: Fri, 3 Feb 2023 13:06:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SiemensConveyorDeviceDriver.java | 15 +++++++++++-- ...CoveyorControlWithScannerDeviceDriver.java | 3 +-- .../service/impl/InstructionServiceImpl.java | 22 +++++++++---------- .../org/nl/acs/task/TaskInstructionLock.java | 6 +++++ .../src/views/system/monitor/device/index.vue | 4 ++-- 5 files changed, 33 insertions(+), 17 deletions(-) create mode 100644 acs/nladmin-system/src/main/java/org/nl/acs/task/TaskInstructionLock.java 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 73b5caada..472a6df68 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 @@ -128,7 +128,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme String device_code; String vehicle_code; - + String last_vehicle_code; @Override public Device getDevice() { @@ -163,6 +163,9 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme inst_message = null; this.clearWrite(); } + if(move == 0 && last_move == 1 ){ + last_vehicle_code = vehicle_code; + } if (move == 0 && last_move == 1 && "06".equals(this.device.getRegion())) { this.requiresShipDeviceUpdate = false; } @@ -188,6 +191,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme inst = instructionService.findByCodeFromCache(String.valueOf(task)); if (inst != null) { inst_message = "当前指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code(); + vehicle_code = inst.getVehicle_code(); if (StrUtil.equals(inst.getInstruction_status(), "0") && StrUtil.equals(this.getDeviceCode(), inst.getStart_device_code())) { inst.setInstruction_status("1"); inst.setExecute_device_code(this.device_code); @@ -210,6 +214,8 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme } } else { // logServer.deviceExecuteLog(device_code, "", "", "输送线任务开始反馈任务状态,反馈失败,查询不到指令号:" + task); + message = "输送线任务反馈状态,查询不到指令号:" + task +"指令已完成"; + inst_message = null; } } @@ -237,7 +243,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme } else { this.setIsonline(true); this.setIserror(false); - message = ""; +// message = ""; Instruction instruction = null; List toInstructions; @@ -467,6 +473,9 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme jo.put("move", move); jo.put("carrier_direction", carrier_direction); jo.put("task", task); + jo.put("last_task", last_task); +// jo.put("barcode", barcode); +// jo.put("last_task", last_task); jo.put("inst_message", this.inst_message); jo.put("isOnline", this.getIsonline()); jo.put("error", this.getError()); @@ -554,6 +563,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme this.writing(list); if (task != Integer.parseInt(inst.getInstruction_code())) { this.writing(list); + message = "重新下发电气信号"; logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号"); } message = "下发电气任务号成功"; @@ -660,6 +670,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme this.writing(list); if (task != Integer.parseInt(inst.getInstruction_code())) { this.writing(list); + message = "重新下发电气信号"; logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号"); } } else { diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java index e8ea5a1b5..7277df9df 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java @@ -184,7 +184,6 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe @Override public void execute(){ - String message = null; try { device_code = this.getDeviceCode(); heartbeat = this.itemProtocol.getHeartbeat(); @@ -204,7 +203,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe } } if (move != last_move) { - if (move == 0 && mode == 2) { + if (move == 0) { message = null; inst_message = null; clearBarcode(); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index 2aa8540e3..a074104cd 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -575,17 +575,17 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu wo.update(json); - Iterator iterator = instructions.iterator(); - while (iterator.hasNext()) { - Instruction instruction = iterator.next(); - if (instruction.getInstruction_code().equals(dto.getInstruction_code())) { - iterator.remove(); - } - } - if (StrUtil.equals(dto.getInstruction_status(), "0") || StrUtil.equals(dto.getInstruction_status(), "1")) { - instructions.add(dto); - } - +// Iterator iterator = instructions.iterator(); +// while (iterator.hasNext()) { +// Instruction instruction = iterator.next(); +// if (instruction.getInstruction_code().equals(dto.getInstruction_code())) { +// iterator.remove(); +// } +// } +// if (StrUtil.equals(dto.getInstruction_status(), "0") || StrUtil.equals(dto.getInstruction_status(), "1")) { +// instructions.add(dto); +// } + this.reload(); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/task/TaskInstructionLock.java b/acs/nladmin-system/src/main/java/org/nl/acs/task/TaskInstructionLock.java new file mode 100644 index 000000000..fd1c749ed --- /dev/null +++ b/acs/nladmin-system/src/main/java/org/nl/acs/task/TaskInstructionLock.java @@ -0,0 +1,6 @@ +package org.nl.acs.task; + +public class TaskInstructionLock { + public TaskInstructionLock() { + } +} 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 d3d1d0b59..a2377ed6d 100644 --- a/acs/nladmin-ui/src/views/system/monitor/device/index.vue +++ b/acs/nladmin-ui/src/views/system/monitor/device/index.vue @@ -368,13 +368,13 @@ export default { } else if (val === 'number') { const obj = { name: '托盘数量', value: data[val] } this.arr.push(obj) - } else if (val === 'instruction_message') { + } else if (val === 'inst_message') { const obj = { name: '指令信息', value: data[val] } this.arr.push(obj) } else if (val === 'message') { const obj = { name: '备注信息', value: data[val] } this.arr.push(obj) - } else if (val === 'last_instruction_message') { + } else if (val === 'inst_message') { const obj = { name: '上次指令信息', value: data[val] } this.arr.push(obj) } else if (val === 'barcode') {