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) {