fix: 指令未满足条件,变成执行中

This commit is contained in:
yanps
2023-12-20 10:58:01 +08:00
parent 6560d294f8
commit 0a6ccbf76b

View File

@@ -895,9 +895,9 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
Device startdevice = deviceAppService.findDeviceByCode(start_device_code);
SiemensConveyorDeviceDriver siemensConveyorDeviceDriver;
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
instruction.setInstruction_status("1");
/*instruction.setInstruction_status("1");
instruction.setUpdate_time(DateUtil.now());
instructionService.update(instruction);
instructionService.update(instruction);*/
Device startDevice = deviceAppService.findDeviceByCode(start_device_code);
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) {
@@ -924,7 +924,12 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
map.put("to_onset", Integer.parseInt(start_addr));
map.put("to_task", Integer.parseInt(instruction.getInstruction_code()));
map.put("to_target", Integer.parseInt(next_addr));
this.writing(map);
try {
this.writing(map);
}catch (Exception e) {
logServer.deviceExecuteLog(device_code, "", "", "下发指令:" + instruction.getInstruction_code() + ",指令起点:" + instruction.getStart_device_code()
+ ",指令终点:" + instruction.getNext_device_code() + ",指令执行失败:"+e.getMessage());
}
this.setRequireSucess(true);
return true;
} else {
@@ -1020,7 +1025,12 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
map.put("to_onset", Integer.parseInt(start_addr));
map.put("to_task", Integer.parseInt(instdto.getInstruction_code()));
map.put("to_target", Integer.parseInt(next_addr));
this.writing(map);
try {
this.writing(map);
}catch (Exception e) {
logServer.deviceExecuteLog(device_code, "", "", "下发指令:" + instdto.getInstruction_code() + ",指令起点:" + instdto.getStart_device_code()
+ ",指令终点:" + instdto.getNext_device_code() + ",指令执行失败:"+e.getMessage());
}
this.setRequireSucess(true);
notCreateInstMessage = "";
notCreateTaskMessage = "";