From dc8774c640376fb09103dd153d7f68e98ab21833 Mon Sep 17 00:00:00 2001 From: loujf Date: Tue, 19 Jul 2022 19:37:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=81=E7=BE=8E=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StandardCoveyorControlDeviceDriver.java | 4 +- ...CoveyorControlWithScannerDeviceDriver.java | 16 +++---- .../task/service/impl/TaskServiceImpl.java | 45 ++++++++++--------- 3 files changed, 33 insertions(+), 32 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 07d95cd..0222e2d 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 @@ -236,10 +236,10 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver // instruction_apply(); // } //申请任务 - if (hasGoods > 0 && error == 0 && !StrUtil.isEmpty(container) && height > 0 && !requireSucess) { + if (hasGoods > 0 && error == 0 && !StrUtil.isEmpty(container) && !requireSucess) { instruction_require(container); } - if (hasGoods > 0 && error == 0 && !StrUtil.isEmpty(container) && height > 0 && !applySucess) { + if (hasGoods > 0 && error == 0 && !StrUtil.isEmpty(container) && !applySucess) { instruction_apply(container); } break; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java index 625cced..fcd5883 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java @@ -253,7 +253,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe } } //查询agv指令,类型为3(输送入库)的数量 - if (instructionService.queryAgvInstByThree().size() >= 3) { + if (instructionService.queryAgvInstByThree().size() >= 2) { createLock = true; } //查询输送指令数量 @@ -262,13 +262,13 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe } //如果输送线无指令,则输送线解锁(输送线锁定状态时,1005与1008生成指令比例为1:1,反之则为1:3) - if (instructionService.queryConveyorInstByThree().size() == 0) { - conveyLock = false; - } - //如果输送线指令数量大于4,则输送线锁定 - if (instructionService.queryConveyorInstByThree().size() >= 4) { - conveyLock = true; - } +// if (instructionService.queryConveyorInstByThree().size() == 0) { +// conveyLock = false; +// } +// //如果输送线指令数量大于4,则输送线锁定 +// if (instructionService.queryConveyorInstByThree().size() >= 4) { +// conveyLock = true; +// } if (getBarcode() != null) { diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java index 8ce21e9..a58d341 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java @@ -1218,31 +1218,32 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { continue; } - Boolean conveyLock = false; - Device deviceByCode = deviceAppService.findDeviceByCode(device_code); - StandardCoveyorControlWithScannerDeviceDriver scannerDeviceDriver; - if (deviceByCode.getDeviceDriver() instanceof StandardCoveyorControlWithScannerDeviceDriver) { - scannerDeviceDriver = (StandardCoveyorControlWithScannerDeviceDriver) deviceByCode.getDeviceDriver(); - conveyLock = scannerDeviceDriver.getConveyLock(); - } +// Boolean conveyLock = false; +// Device deviceByCode = deviceAppService.findDeviceByCode(device_code); +// StandardCoveyorControlWithScannerDeviceDriver scannerDeviceDriver; +// if (deviceByCode.getDeviceDriver() instanceof StandardCoveyorControlWithScannerDeviceDriver) { +// scannerDeviceDriver = (StandardCoveyorControlWithScannerDeviceDriver) deviceByCode.getDeviceDriver(); +// conveyLock = scannerDeviceDriver.getConveyLock(); +// } - if (!conveyLock) { - //查询所有的关联设备 - List list1 = deviceService.queryLinkDeviceByCode(this_device_code); - int count = 0; - for (int z = 0; z < list1.size(); z++) { - String code = list1.get(i); - Device device = deviceAppService.findDeviceByCode(code); - StandardCoveyorControlDeviceDriver standardCoveyorControlDeviceDriver; - if (device.getDeviceDriver() instanceof StandardCoveyorControlDeviceDriver) { - standardCoveyorControlDeviceDriver = (StandardCoveyorControlDeviceDriver) device.getDeviceDriver(); - if (standardCoveyorControlDeviceDriver.getMove() != 0) count += 1; - } - } - if (count != 0) { - break; +// if (!conveyLock) { + //查询所有的关联设备 + List list1 = deviceService.queryLinkDeviceByCode(this_device_code); + int count = 0; + for (int z = 0; z < list1.size(); z++) { + String code = list1.get(i); + Device device = deviceAppService.findDeviceByCode(code); + StandardCoveyorControlDeviceDriver standardCoveyorControlDeviceDriver; + if (device.getDeviceDriver() instanceof StandardCoveyorControlDeviceDriver) { + standardCoveyorControlDeviceDriver = (StandardCoveyorControlDeviceDriver) device.getDeviceDriver(); + if (standardCoveyorControlDeviceDriver.getMove() != 0) count += 1; } } + //如果当前关联的设备中都有货的话,就返回 + if (count != 0 && count >= list.size()) { + break; + } +// } if (j == 0) { flag1 = num;