fix: 禁止出入库任务、暂停任务

This commit is contained in:
2024-05-10 19:19:15 +08:00
parent 9e45690cd0
commit d83f7c450b

View File

@@ -281,6 +281,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
*/
Boolean requireSucess = false;
/**
* 当前指令
*/
@@ -809,11 +810,17 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
// }
this.instruction_require_time = date;
//暂停任务
if (!stopReceiveTask){
this.notCreateInstMessage = "任务暂停";
return false;
}
//输入:指令类型多种\ 指令状态多种\
Instruction instruction1 = new Instruction();
instruction1.setInstruction_status("0");
List<Instruction> instructions = instructionService.findByDeviceCodes(instruction1, false);
if (CollUtil.isEmpty(instructions) || instructions.size() < 1) {
this.notCreateInstMessage = "未找到任务";
return false;
}
List<Instruction> instructionList = new ArrayList<>();
@@ -863,7 +870,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
List list = new ArrayList();
pakageCommand(list,"1", inst.getInstruction_code());
if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.conveyor.name())) {
if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.conveyor.name()) && !prohibitInWarehouse) {
if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("z"))) {
HashMap map4 = new HashMap();
map4.put("code", "to_x");
@@ -883,7 +890,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
list.add(map6);
}
}
if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.storage.name())) {
if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.storage.name()) && !prohibitOutWarehouse) {
pakagePlc(inst, list);
}
if (ObjectUtil.isNotEmpty(list)) {
@@ -1107,9 +1114,12 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
//监控大屏下发作业命令清警-5、召回-7、急停-8
Integer toCommand = data.getInteger("toCommand");
if (toCommand != null) {
Map<String, Object> map = new HashMap<>();
map.put("to_command", toCommand);
this.writing(map);
HashMap map1 = new HashMap();
List<Object> list = new ArrayList<>();
map1.put("code", "to_command");
map1.put("value", toCommand);
list.add(map1);
this.writing(map1);
}
//ACS监控大屏设置禁止入库、禁止出库、停止接收任务
Boolean prohibitInWarehouse = data.getBoolean("prohibitInWarehouse");