feat: 管芯库桁架
This commit is contained in:
@@ -286,7 +286,7 @@ public class ShaftPushMachineDeviceDriver extends AbstractOpcDeviceDriver implem
|
||||
public void sendSleeveData(SleeveDataReqVO request) {
|
||||
Map<String, Object> 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());
|
||||
|
||||
@@ -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<String, Object> 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<String, Object> 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user