From 423839edc4cbcbe01c07004cd8736ae82c2f9cab Mon Sep 17 00:00:00 2001 From: ls <1793460677@qq.com> Date: Mon, 15 Dec 2025 17:24:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=90=8C=E6=8E=92=E7=A7=BB=E5=BA=93?= =?UTF-8?q?=E6=8C=87=E4=BB=A4bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/quartz/task/CreateDDJInst.java | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/CreateDDJInst.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/CreateDDJInst.java index c9e0a8241..54f96a23b 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/CreateDDJInst.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/CreateDDJInst.java @@ -230,8 +230,21 @@ public class CreateDDJInst { Instruction instruction = new Instruction(); instruction.setInstruction_status(CommonFinalParam.ONE); List byDeviceCodes = instructionService.findByDeviceCodes(instruction, true); + //筛选出库指令 + List insts = new ArrayList<>(); + for (Instruction byDeviceCode : byDeviceCodes) { + String nextDeviceCode = byDeviceCode.getNext_device_code(); + Device nextdevice = appService.findDeviceByCode(nextDeviceCode); + String startDeviceCode = byDeviceCode.getStart_device_code(); + Device startDevice1 = appService.findDeviceByCode(startDeviceCode); + if (startDevice1.getDevice_type().equals(DeviceType.storage.name()) && + (nextdevice.getDevice_type().equals(DeviceType.conveyor.name()) || nextdevice.getDevice_type().equals(DeviceType.storage.name()))) { + insts.add(byDeviceCode); + } + } + Instruction instdto = new Instruction(); - if (CollUtil.isEmpty(byDeviceCodes)) { + if (CollUtil.isEmpty(insts)) { //判断有没有DDJ对接位出入库的指令,只判断终点 List byCodeAndExcute = instructionService.findByNextCode(next_device_code); if (CollUtil.isNotEmpty(byCodeAndExcute)) { @@ -292,17 +305,6 @@ public class CreateDDJInst { taskDto.setTask_status(TaskStatusEnum.BUSY.getIndex()); taskserver.update(taskDto); } else { - List insts = new ArrayList<>(); - for (Instruction byDeviceCode : byDeviceCodes) { - String nextDeviceCode = byDeviceCode.getNext_device_code(); - Device nextdevice = appService.findDeviceByCode(nextDeviceCode); - String startDeviceCode = byDeviceCode.getStart_device_code(); - Device startDevice1 = appService.findDeviceByCode(startDeviceCode); - if (startDevice1.getDevice_type().equals(DeviceType.storage.name()) && - (nextdevice.getDevice_type().equals(DeviceType.conveyor.name()) || nextdevice.getDevice_type().equals(DeviceType.storage.name()))) { - insts.add(byDeviceCode); - } - } int max = 0; //非同排的路径 for (Instruction inst : insts) {