diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java index 4e1267bd1..283793348 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java @@ -372,7 +372,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements public void writing(int command) { String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + org.nl.acs.device_driver.conveyor.standard_conveyor_control_with_scanner.ItemProtocol.item_to_command; + + "." + org.nl.acs.device_driver.conveyor.belt_conveyor.ItemProtocol.item_to_command; Map itemMap = new HashMap(); itemMap.put(to_command, command); this.control(itemMap); @@ -605,12 +605,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements } else { next_point_code = next_device_code; } - //判断是否存在终点到达ddj对接位的指令(包含货架到达ddj对接位的指令、输送线到对接位的指令) - Instruction byNextDeviceCodeDDJ = instructionService.findByNextDeviceCodeFromCache(next_device_code); - if (ObjectUtil.isNotEmpty(byNextDeviceCodeDDJ)) { - this.setNotCreateInstMessage("universal_notCreateInstMessage5"); - return false; - } + //判断下一个输送线点位是否有货 BeltConveyorDeviceDriver beltConveyorDeviceDriver; //异常位到叠盘位 diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/un_box_lable_conveyor/UnBoxLableConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/un_box_lable_conveyor/UnBoxLableConveyorDeviceDriver.java index 6871d552f..63259bcdd 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/un_box_lable_conveyor/UnBoxLableConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/un_box_lable_conveyor/UnBoxLableConveyorDeviceDriver.java @@ -202,6 +202,10 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl this.setIserror(true); message = "有报警"; } + inst = checkInst(); + if (inst != null) { + inst_message = "当前指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code(); + } Instruction instruction = instructionService.findByCode(String.valueOf(task)); //空箱出库开盖位,申请开盖 diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/StandardStackerDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/StandardStackerDeviceDriver.java index ff26602fd..2fa014db7 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/StandardStackerDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/StandardStackerDeviceDriver.java @@ -333,7 +333,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme // 更新指令状态 - if (mode == 3 && task > 0 && command == 1) { + if (mode == 3 && task > 0 && command == 1 && error == 0) { Date date = new Date(); if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) { log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out); @@ -583,13 +583,15 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme } - private void updateEXcuteMessage(String string) { + private void updateEXcuteMessage(String excuteMessage) { Instruction instruction0 = checkInst(); if (ObjectUtil.isEmpty(instruction0)) { message = "universal_message4"; } - instruction0.setExecute_message(string); - instructionService.update(instruction0); + if (!StrUtil.equals(instruction0.getExecute_code(), excuteMessage)) { + instruction0.setExecute_message(excuteMessage); + instructionService.update(instruction0); + } } @@ -620,9 +622,12 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme message = "universal_message4"; return true; } - instruction0.setExecute_code(toCommand); - instructionService.update(instruction0); - return false; + if (!StrUtil.equals(instruction0.getExecute_code(), toCommand)) { + instruction0.setExecute_code(toCommand); + instructionService.update(instruction0); + return false; + } + return true; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/InstructionService.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/InstructionService.java index 11ff78c0a..a26f11e73 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/InstructionService.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/InstructionService.java @@ -490,4 +490,7 @@ public interface InstructionService extends CommonService { Boolean querySameNextDeviceCodeInstByOut(String nextDeviceCode); List findByCodeAndExcute(String nextDeviceCode); + + + List findByNextCode(String nextDeviceCode); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index bddbcc1d5..d5f91606d 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -1932,7 +1932,15 @@ public class InstructionServiceImpl extends CommonServiceImpl findByCodeAndExcute(String next_code) { - List instructionList = instructions.stream().filter(item -> item.getNext_device_code().equals(next_code)).collect(Collectors.toList()); + List instructionList = instructions.stream().filter(item -> item.getNext_device_code().equals(next_code) || item.getStart_device_code().equals(next_code)).collect(Collectors.toList()); + + return instructionList; + } + + + @Override + public List findByNextCode(String next_code) { + List instructionList = instructions.stream().filter(item -> item.getNext_device_code().equals(next_code) ).collect(Collectors.toList()); return instructionList; } 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 7f1daef29..eaa04365c 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 @@ -215,10 +215,10 @@ public class CreateDDJInst { List byDeviceCodes = instructionService.findByDeviceCodes(instruction, true); Instruction instdto = new Instruction(); if (CollUtil.isEmpty(byDeviceCodes)) { - //判断有没有DDJ对接位出入库的指令 - List byCodeAndExcute = instructionService.findByCodeAndExcute(next_device_code); + //判断有没有DDJ对接位出入库的指令,只判断终点 + List byCodeAndExcute = instructionService.findByNextCode(next_device_code); if (CollUtil.isNotEmpty(byCodeAndExcute)){ - ((StandardStackerDeviceDriver) deviceByCode.getDeviceDriver()).setNotCreateInstMessage("有DDJ对接位出入库的指令"); + ((StandardStackerDeviceDriver) deviceByCode.getDeviceDriver()).setNotCreateInstMessage("有DDJ对接位为终点的指令"); continue; } instdto.setInstruction_type(task_type); @@ -316,10 +316,10 @@ public class CreateDDJInst { String count = deviceByCode.getExtraValue().get("count").toString(); if (StrUtil.isNotEmpty(count)) { if (max <= Integer.parseInt(count)) { - //判断有没有DDJ对接位出入库的指令 - List byCodeAndExcute = instructionService.findByCodeAndExcute(next_device_code); + //判断有没有DDJ对接位出入库的指令,只判断终点 + List byCodeAndExcute = instructionService.findByNextCode(next_device_code); if (CollUtil.isNotEmpty(byCodeAndExcute)){ - ((StandardStackerDeviceDriver) deviceByCode.getDeviceDriver()).setNotCreateInstMessage("有DDJ对接位出入库的指令"); + ((StandardStackerDeviceDriver) deviceByCode.getDeviceDriver()).setNotCreateInstMessage("有DDJ对接位为终点的指令"); continue; } instdto.setInstruction_type(task_type);