fix: bug修复

This commit is contained in:
2024-06-30 09:31:54 +08:00
parent 43d7236761
commit 0750e6c16f
6 changed files with 36 additions and 21 deletions

View File

@@ -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<String, Object> itemMap = new HashMap<String, Object>();
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;
//异常位到叠盘位

View File

@@ -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));
//空箱出库开盖位,申请开盖

View File

@@ -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;
}

View File

@@ -490,4 +490,7 @@ public interface InstructionService extends CommonService<InstructionMybatis> {
Boolean querySameNextDeviceCodeInstByOut(String nextDeviceCode);
List<Instruction> findByCodeAndExcute(String nextDeviceCode);
List<Instruction> findByNextCode(String nextDeviceCode);
}

View File

@@ -1932,7 +1932,15 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
@Override
public List<Instruction> findByCodeAndExcute(String next_code) {
List<Instruction> instructionList = instructions.stream().filter(item -> item.getNext_device_code().equals(next_code)).collect(Collectors.toList());
List<Instruction> 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<Instruction> findByNextCode(String next_code) {
List<Instruction> instructionList = instructions.stream().filter(item -> item.getNext_device_code().equals(next_code) ).collect(Collectors.toList());
return instructionList;
}

View File

@@ -215,10 +215,10 @@ public class CreateDDJInst {
List<Instruction> byDeviceCodes = instructionService.findByDeviceCodes(instruction, true);
Instruction instdto = new Instruction();
if (CollUtil.isEmpty(byDeviceCodes)) {
//判断有没有DDJ对接位出入库的指令
List<Instruction> byCodeAndExcute = instructionService.findByCodeAndExcute(next_device_code);
//判断有没有DDJ对接位出入库的指令,只判断终点
List<Instruction> 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<Instruction> byCodeAndExcute = instructionService.findByCodeAndExcute(next_device_code);
//判断有没有DDJ对接位出入库的指令,只判断终点
List<Instruction> 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);