From 85993d42d7d9198ebdd3f12a141632495a444561 Mon Sep 17 00:00:00 2001 From: gengby <858962040@qq.com> Date: Wed, 28 Aug 2024 14:51:41 +0800 Subject: [PATCH] =?UTF-8?q?rev=EF=BC=9A=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StandardCoveyorControlDeviceDriver.java | 13 +++++++++++-- .../service/impl/InstructionServiceImpl.java | 10 ++++++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/StandardCoveyorControlDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/StandardCoveyorControlDeviceDriver.java index 612ab06..8464a57 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/StandardCoveyorControlDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/StandardCoveyorControlDeviceDriver.java @@ -179,6 +179,10 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver this.setRequireSucess(false); } + if (task != last_task){ + this.execute_log.setResource(this.device_code, this.device_code); + this.execute_log.log("设备:" + device_code + ",last_task -> task:" + last_task + "->" + task); + } if (error != last_error) { this.execute_log.setResource(this.device_code, this.device_code); this.execute_log.log("设备:" + device_code + ",last_error -> error:" + last_error + "->" + error); @@ -212,7 +216,7 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver } } } catch (Exception var17) { - return; + this.execute_log.log("设备:" + device_code + Arrays.toString(var17.getStackTrace())); } // if (!this.itemProtocol.getIsonline()) { @@ -433,11 +437,16 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver Map itemMap = new HashMap(); if (type == 1) { itemMap.put(to_command, command); + this.execute_log.setResource(this.device_code, device_code); + this.execute_log.log("设备:{},下发作业命令:{}", device_code, command); } else if (type == 2) { itemMap.put(to_target, command); - + this.execute_log.setResource(this.device_code, device_code); + this.execute_log.log("设备:{},下发作业命令:{}", device_code, command); } else if (type == 3) { itemMap.put(to_task, command); + this.execute_log.setResource(this.device_code, device_code); + this.execute_log.log("设备:{},下发作业命令:{}", device_code, command); } ReadUtil.write(itemMap, server); diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index 77c370e..76b5d82 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -1100,10 +1100,14 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu //如果此站点为1002,并且指令创建锁是打开的话,则不需要再次创建 if (ObjectUtil.isNotEmpty(apply_task) && apply_task.equals("true") && !scannerDeviceDriver.getCreateLock()) { - obj.setRequest_again("1"); + // obj.setRequest_again("1"); } } + entity.setInstruction_status("2"); + wo.update(json); + removeByCodeFromCache(entity.getInstruction_code()); + // =0 则不用再次请求 if (StrUtil.equals(obj.getRequest_again(), "0")) { if (StrUtil.equals(obj.getNext_device_code(), instnextdevice)) { @@ -1115,8 +1119,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu finishAndCreateNextInstJM(entity); } } - entity.setInstruction_status("2"); - wo.update(json); + //将指令条码写入终点设备中去 if (ObjectUtil.isNotEmpty(entity.getVehicle_code())) { @@ -1137,7 +1140,6 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu lampThreecolorDeviceDriver.writing(0); } } - removeByCodeFromCache(entity.getInstruction_code()); } @Override