add:盘点任务类型下发

This commit is contained in:
miguannan
2026-08-01 09:49:36 +07:00
parent 10bc3e63cd
commit d23281103f
2 changed files with 10 additions and 4 deletions

View File

@@ -537,11 +537,13 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
String interactionJson = handCodeTaskDto.getInteraction_json();
InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class);
String containerType = "0";
String type = "0";
if (ObjectUtil.isNotEmpty(interactionJsonDTO)) {
containerType = interactionJsonDTO.getContainerType();
type = interactionJsonDTO.getType();
}
List<String> keys = new ArrayList<>(Arrays.asList(ItemProtocol.TO_TARGET.getKey(), ItemProtocol.TO_TASK.getKey(), ItemProtocol.TO_CONTAINER_TYPE.getKey(), ItemProtocol.TO_COMMAND.getKey()));
List<Object> values = new ArrayList<>(Arrays.asList(getTargetAddress(nextDevice), Integer.parseInt(instDto.getInstruction_code()), Integer.parseInt(containerType), ToCommandEnum.COMMAND_ONE.getSignalNum()));
List<String> keys = new ArrayList<>(Arrays.asList(ItemProtocol.TO_BACK_UP_1.getKey(),ItemProtocol.TO_TARGET.getKey(), ItemProtocol.TO_TASK.getKey(), ItemProtocol.TO_CONTAINER_TYPE.getKey(), ItemProtocol.TO_COMMAND.getKey()));
List<Object> values = new ArrayList<>(Arrays.asList(type,getTargetAddress(nextDevice), Integer.parseInt(instDto.getInstruction_code()), Integer.parseInt(containerType), ToCommandEnum.COMMAND_ONE.getSignalNum()));
this.writing(keys, values);
this.requireSuccess = true;
return;
@@ -591,11 +593,13 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
String interactionJson = taskDto.getInteraction_json();
InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class);
String containerType = "0";
String type = "0";
if (ObjectUtil.isNotEmpty(interactionJsonDTO)) {
containerType = interactionJsonDTO.getContainerType();
type = interactionJsonDTO.getType();
}
List<String> keys = new ArrayList<>(Arrays.asList(ItemProtocol.TO_TARGET.getKey(), ItemProtocol.TO_TASK.getKey(), ItemProtocol.TO_CONTAINER_TYPE.getKey(), ItemProtocol.TO_COMMAND.getKey()));
List<Object> values = new ArrayList<>(Arrays.asList(getTargetAddress(nextDevice), Integer.parseInt(instDto.getInstruction_code()), Integer.parseInt(containerType), ToCommandEnum.COMMAND_ONE.getSignalNum()));
List<String> keys = new ArrayList<>(Arrays.asList(ItemProtocol.TO_BACK_UP_1.getKey(),ItemProtocol.TO_TARGET.getKey(), ItemProtocol.TO_TASK.getKey(), ItemProtocol.TO_CONTAINER_TYPE.getKey(), ItemProtocol.TO_COMMAND.getKey()));
List<Object> values = new ArrayList<>(Arrays.asList(type,getTargetAddress(nextDevice), Integer.parseInt(instDto.getInstruction_code()), Integer.parseInt(containerType), ToCommandEnum.COMMAND_ONE.getSignalNum()));
this.writing(keys, values);
this.requireSuccess = true;
}

View File

@@ -41,4 +41,6 @@ public class InteractionJsonDTO {
* 高度等级
*/
private String heightLevel;
private String type;
}