From 445510b81ad1f45a1a66bb58f00c97b48cdc6bba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=B1=9F=E7=8E=AE?= Date: Mon, 14 Aug 2023 17:57:45 +0800 Subject: [PATCH] fix --- .../StandardInspectSiteDeviceDriver.java | 5 ++--- .../fold_disc_site/FoldDiscSiteDeviceDriver.java | 13 +++++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_inspect_site/StandardInspectSiteDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_inspect_site/StandardInspectSiteDeviceDriver.java index c7b87f6..7239c5a 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_inspect_site/StandardInspectSiteDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_inspect_site/StandardInspectSiteDeviceDriver.java @@ -45,7 +45,7 @@ import java.util.Map; @Slf4j @Data @RequiredArgsConstructor -public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver , DeviceStageMonitor { +public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor { protected ItemProtocol itemProtocol = new ItemProtocol(this); @Autowired InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); @@ -133,7 +133,6 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp @Override public void execute() { - String message = null; try { devicecode = this.getDeviceCode(); mode = this.itemProtocol.getMode(); @@ -326,7 +325,7 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp dto.setCreate_time(now); WQLObject wo = WQLObject.getWQLObject("acs_task"); - JSONObject json = (JSONObject) JSONObject.toJSON(dto); + JSONObject json = (JSONObject) JSONObject.toJSON(dto); wo.insert(json); requireSucess = false; diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/fold_disc_site/FoldDiscSiteDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/fold_disc_site/FoldDiscSiteDeviceDriver.java index bbbff77..4eb1410 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/fold_disc_site/FoldDiscSiteDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/fold_disc_site/FoldDiscSiteDeviceDriver.java @@ -152,10 +152,15 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements break; case 2: if (!this.requireSucess) { - JSONObject param = new JSONObject(); - param.put("device_code", this.device_code); - param.put("is_have", this.number == 0 ? 0 : 1); - this.shipDeviceUpdate(param); + int max_emptypalletnum = Integer.parseInt(this.getDevice().getExtraValue().get("max_emptypalletnum").toString()); + if (number == 0 || number == max_emptypalletnum) { + JSONObject param = new JSONObject(); + param.put("device_code", this.device_code); + param.put("is_have", this.number == 0 ? 0 : 1); + this.shipDeviceUpdate(param); + } else { + this.requireSucess = true; + } } } }