rev:检验行架任务类型

This commit is contained in:
2024-09-08 12:50:15 +08:00
parent fd7c519713
commit b98f4ea401
2 changed files with 4 additions and 4 deletions

View File

@@ -467,7 +467,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
} else {
this.instruction_require_time = date;
//查找有没有对应的指令
Instruction inst = instructionService.findByDeviceCodeFromCache(this.device_code);
Instruction inst = instructionService.findByStartCodeAndReady(this.device_code);
if (ObjectUtil.isNotNull(inst)) {
List<RouteLineDto> routeLineDtos = routeLineService.selectDeviceCodeList(this.device_code);
if (routeLineDtos.size() < 1) {

View File

@@ -527,7 +527,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
// Socket s = new Socket();
// s.connect(socketAddress, 2 * 1000);
// if (ObjectUtil.isNotEmpty(s)&&s.isConnected()==true) {
ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(), dto);
ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(), dto);
// } else {
// log.error("agv连接出现异常:服务端被关闭");
// }
@@ -1669,7 +1669,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
Iterator<Instruction> it = instructions.iterator();
while (it.hasNext()) {
Instruction inst = it.next();
if (StrUtil.equals(devicecode, inst.getNext_device_code()) && Integer.parseInt(inst.getInstruction_status()) <= Integer.parseInt(InstructionStatusEnum.BUSY.getIndex()) && !inst.getInstruction_type().equals(TaskTypeEnum.Truss_Task.getIndex()) ) {
if (StrUtil.equals(devicecode, inst.getNext_device_code()) && Integer.parseInt(inst.getInstruction_status()) <= Integer.parseInt(InstructionStatusEnum.BUSY.getIndex()) && !inst.getInstruction_type().equals(TaskTypeEnum.Truss_Task.getIndex())) {
return inst;
}
}
@@ -1869,7 +1869,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
public Instruction findByStartCodeAndReady(String device_code) {
Optional<Instruction> optionalInstruction = instructions.stream()
.filter(instruction -> StrUtil.equals(instruction.getStart_device_code(), device_code)
&& StrUtil.equals(instruction.getInstruction_status(), InstructionStatusEnum.READY.getIndex()))
&& StrUtil.equals(instruction.getInstruction_status(), InstructionStatusEnum.READY.getIndex()) && !instruction.getInstruction_type().equals(TaskTypeEnum.Truss_Task.getIndex()))
.findFirst();
return optionalInstruction.orElse(null);
}