fix: bug修复
This commit is contained in:
@@ -372,7 +372,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
|
|
||||||
public void writing(int command) {
|
public void writing(int command) {
|
||||||
String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
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>();
|
Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||||
itemMap.put(to_command, command);
|
itemMap.put(to_command, command);
|
||||||
this.control(itemMap);
|
this.control(itemMap);
|
||||||
@@ -605,12 +605,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
} else {
|
} else {
|
||||||
next_point_code = next_device_code;
|
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;
|
BeltConveyorDeviceDriver beltConveyorDeviceDriver;
|
||||||
//异常位到叠盘位
|
//异常位到叠盘位
|
||||||
|
|||||||
@@ -202,6 +202,10 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
this.setIserror(true);
|
this.setIserror(true);
|
||||||
message = "有报警";
|
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));
|
Instruction instruction = instructionService.findByCode(String.valueOf(task));
|
||||||
//空箱出库开盖位,申请开盖
|
//空箱出库开盖位,申请开盖
|
||||||
|
|||||||
@@ -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();
|
Date date = new Date();
|
||||||
if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) {
|
if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) {
|
||||||
log.trace("触发时间因为小于{}毫秒,而被无视", 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();
|
Instruction instruction0 = checkInst();
|
||||||
if (ObjectUtil.isEmpty(instruction0)) {
|
if (ObjectUtil.isEmpty(instruction0)) {
|
||||||
message = "universal_message4";
|
message = "universal_message4";
|
||||||
}
|
}
|
||||||
instruction0.setExecute_message(string);
|
if (!StrUtil.equals(instruction0.getExecute_code(), excuteMessage)) {
|
||||||
instructionService.update(instruction0);
|
instruction0.setExecute_message(excuteMessage);
|
||||||
|
instructionService.update(instruction0);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -620,9 +622,12 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
message = "universal_message4";
|
message = "universal_message4";
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
instruction0.setExecute_code(toCommand);
|
if (!StrUtil.equals(instruction0.getExecute_code(), toCommand)) {
|
||||||
instructionService.update(instruction0);
|
instruction0.setExecute_code(toCommand);
|
||||||
return false;
|
instructionService.update(instruction0);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -490,4 +490,7 @@ public interface InstructionService extends CommonService<InstructionMybatis> {
|
|||||||
Boolean querySameNextDeviceCodeInstByOut(String nextDeviceCode);
|
Boolean querySameNextDeviceCodeInstByOut(String nextDeviceCode);
|
||||||
|
|
||||||
List<Instruction> findByCodeAndExcute(String nextDeviceCode);
|
List<Instruction> findByCodeAndExcute(String nextDeviceCode);
|
||||||
|
|
||||||
|
|
||||||
|
List<Instruction> findByNextCode(String nextDeviceCode);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1932,7 +1932,15 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Instruction> findByCodeAndExcute(String next_code) {
|
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;
|
return instructionList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -215,10 +215,10 @@ public class CreateDDJInst {
|
|||||||
List<Instruction> byDeviceCodes = instructionService.findByDeviceCodes(instruction, true);
|
List<Instruction> byDeviceCodes = instructionService.findByDeviceCodes(instruction, true);
|
||||||
Instruction instdto = new Instruction();
|
Instruction instdto = new Instruction();
|
||||||
if (CollUtil.isEmpty(byDeviceCodes)) {
|
if (CollUtil.isEmpty(byDeviceCodes)) {
|
||||||
//判断有没有DDJ对接位出入库的指令
|
//判断有没有DDJ对接位出入库的指令,只判断终点
|
||||||
List<Instruction> byCodeAndExcute = instructionService.findByCodeAndExcute(next_device_code);
|
List<Instruction> byCodeAndExcute = instructionService.findByNextCode(next_device_code);
|
||||||
if (CollUtil.isNotEmpty(byCodeAndExcute)){
|
if (CollUtil.isNotEmpty(byCodeAndExcute)){
|
||||||
((StandardStackerDeviceDriver) deviceByCode.getDeviceDriver()).setNotCreateInstMessage("有DDJ对接位出入库的指令");
|
((StandardStackerDeviceDriver) deviceByCode.getDeviceDriver()).setNotCreateInstMessage("有DDJ对接位为终点的指令");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
instdto.setInstruction_type(task_type);
|
instdto.setInstruction_type(task_type);
|
||||||
@@ -316,10 +316,10 @@ public class CreateDDJInst {
|
|||||||
String count = deviceByCode.getExtraValue().get("count").toString();
|
String count = deviceByCode.getExtraValue().get("count").toString();
|
||||||
if (StrUtil.isNotEmpty(count)) {
|
if (StrUtil.isNotEmpty(count)) {
|
||||||
if (max <= Integer.parseInt(count)) {
|
if (max <= Integer.parseInt(count)) {
|
||||||
//判断有没有DDJ对接位出入库的指令
|
//判断有没有DDJ对接位出入库的指令,只判断终点
|
||||||
List<Instruction> byCodeAndExcute = instructionService.findByCodeAndExcute(next_device_code);
|
List<Instruction> byCodeAndExcute = instructionService.findByNextCode(next_device_code);
|
||||||
if (CollUtil.isNotEmpty(byCodeAndExcute)){
|
if (CollUtil.isNotEmpty(byCodeAndExcute)){
|
||||||
((StandardStackerDeviceDriver) deviceByCode.getDeviceDriver()).setNotCreateInstMessage("有DDJ对接位出入库的指令");
|
((StandardStackerDeviceDriver) deviceByCode.getDeviceDriver()).setNotCreateInstMessage("有DDJ对接位为终点的指令");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
instdto.setInstruction_type(task_type);
|
instdto.setInstruction_type(task_type);
|
||||||
|
|||||||
Reference in New Issue
Block a user