From 425019577975f5ed632216bc6d2f802cbebbce7a Mon Sep 17 00:00:00 2001 From: liyongde <1419499670@qq.com> Date: Thu, 26 Nov 2026 16:31:28 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=AE=A1=E8=8A=AF=E5=BA=93=E6=A1=81?= =?UTF-8?q?=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ShaftPushMachineDeviceDriver.java | 2 +- .../TubePushManipulatorDeviceDriver.java | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/deviceDriver/service/defination/opcDefination/two_floor/conveyor/shaft_push_machine/ShaftPushMachineDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/deviceDriver/service/defination/opcDefination/two_floor/conveyor/shaft_push_machine/ShaftPushMachineDeviceDriver.java index 92a671e..2964e17 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/deviceDriver/service/defination/opcDefination/two_floor/conveyor/shaft_push_machine/ShaftPushMachineDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/deviceDriver/service/defination/opcDefination/two_floor/conveyor/shaft_push_machine/ShaftPushMachineDeviceDriver.java @@ -286,7 +286,7 @@ public class ShaftPushMachineDeviceDriver extends AbstractOpcDeviceDriver implem public void sendSleeveData(SleeveDataReqVO request) { Map map = new LinkedHashMap<>(); putIfNotEmpty(map, "to_material1", request.getTubeCode()); - putIfNotEmpty(map, "to_qty1", request.getQty()); + putIfNotEmpty(map, "to_qty", request.getQty()); putIfNotEmpty(map, "to_size1", request.getTubeSize()); putIfNotEmpty(map, "to_qzz_type", request.getTubeSize()); putIfNotEmpty(map, "to_spec1", request.getTubeSpec()); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/deviceDriver/service/defination/opcDefination/two_floor/manipulator/tube_push_manipulator/TubePushManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/deviceDriver/service/defination/opcDefination/two_floor/manipulator/tube_push_manipulator/TubePushManipulatorDeviceDriver.java index 1d64ef5..61833d7 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/deviceDriver/service/defination/opcDefination/two_floor/manipulator/tube_push_manipulator/TubePushManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/deviceDriver/service/defination/opcDefination/two_floor/manipulator/tube_push_manipulator/TubePushManipulatorDeviceDriver.java @@ -1,5 +1,6 @@ package org.nl.acs.device.deviceDriver.service.defination.opcDefination.two_floor.manipulator.tube_push_manipulator; +import cn.hutool.core.util.ObjUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONObject; import com.google.common.util.concurrent.Uninterruptibles; @@ -169,8 +170,10 @@ public class TubePushManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp Instruction instruction = instructionService.findAllReady().stream() .filter(item -> getDeviceCodes.contains(item.getStart_device_code()) && putDeviceCodes.contains(item.getNext_device_code())) - .min(Comparator.comparing(Instruction::getCreate_time, - Comparator.nullsLast(Comparator.naturalOrder()))) + .min(Comparator.comparing( + (Instruction i) -> i.getPriority() == null ? Integer.MIN_VALUE : Integer.parseInt(i.getPriority()), + Comparator.reverseOrder()) + .thenComparing(Instruction::getCreate_time, Comparator.nullsLast(Comparator.naturalOrder()))) .orElse(null); if (instruction == null) { return; @@ -182,7 +185,7 @@ public class TubePushManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp Map signals = buildTaskSignals( getDeviceAddress(instruction.getStart_device_code()), getDeviceAddress(instruction.getNext_device_code()), - instruction.getInstruction_code(), JSONObject.parseObject(taskDto.getParam())); + instruction.getInstruction_code(), JSONObject.parseObject(taskDto.getParam()), taskDto); writing(signals); message = "已下发任务"; requireSuccess = true; @@ -228,7 +231,7 @@ public class TubePushManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp /** 任务参数使用协议点位名;尺寸兼容 tubeSize,是否套轴兼容 is_bushing。 */ static Map buildTaskSignals(int startAddress, int targetAddress, - String instructionCode, JSONObject params) { + String instructionCode, JSONObject params, TaskDto taskDto) { if (params == null) { throw new BadRequestException("管芯套轴任务参数不能为空!"); } @@ -237,10 +240,10 @@ public class TubePushManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp signals.put(ItemProtocol.TO_TARGET.getKey(), targetAddress); signals.put(ItemProtocol.TO_TASK.getKey(), Integer.parseInt(instructionCode)); signals.put(ItemProtocol.TO_SIZE.getKey(), params.getString("tubeSize")); - signals.put(ItemProtocol.TO_IS_BUSHING.getKey(), params.getString("isBushing")); - signals.put(ItemProtocol.TO_MATERIAL.getKey(), params.getString("tubeCode")); + signals.put(ItemProtocol.TO_IS_BUSHING.getKey(), ObjUtil.isEmpty(params.getString("isBushing"))?"0":params.getString("isBushing")); + signals.put(ItemProtocol.TO_MATERIAL.getKey(), ObjUtil.isEmpty(params.getString("tubeCode"))?taskDto.getVehicle_code() : params.getString("tubeCode")); // 管芯全长*外径*内径*厚处壁厚*薄处壁厚*阶梯长度*材质*重量(1纸管,2FRP管)。 - signals.put(ItemProtocol.TO_SPEC.getKey(), params.getString("tubeSpec")); + signals.put(ItemProtocol.TO_SPEC.getKey(), ObjUtil.isEmpty(params.getString("tubeSpec"))?params.getString("spec"):params.getString("tubeSpec")); signals.put(ItemProtocol.TO_COMMAND.getKey(), 1); return signals; }