|
@@ -43,6 +43,7 @@ import javax.validation.Valid;
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
+import java.util.concurrent.atomic.AtomicBoolean;
|
|
|
import java.util.regex.Matcher;
|
|
import java.util.regex.Matcher;
|
|
|
import java.util.regex.Pattern;
|
|
import java.util.regex.Pattern;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
@@ -78,6 +79,12 @@ public class IotDeviceGroupController {
|
|
|
@Resource
|
|
@Resource
|
|
|
private IotDeviceRunLogMapper iotDeviceRunLogMapper;
|
|
private IotDeviceRunLogMapper iotDeviceRunLogMapper;
|
|
|
|
|
|
|
|
|
|
+ private static final String[] ZYJ_PARAMS = {"一级排气温度", "二级排气温度", "三级排气温度", "四级排气温度1", "四级排气温度2", "四级排气温度3",
|
|
|
|
|
+ "五级排气温度", "最终排气温度", "一级排气压力", "二级排气压力", "三级排气压力", "四级排气压力",
|
|
|
|
|
+ "五级排气压力", "冷却水温度", "冷却水进口压力", "冷却水出口压力", "润滑油压力", "润滑油温度",
|
|
|
|
|
+ "轴瓦温度1", "轴瓦温度2", "轴瓦温度3", "轴瓦温度4", "轴瓦温度5", "轴瓦温度6",
|
|
|
|
|
+ "氮气纯度", "瞬时流量", "累计流量", "油压", "套压", "表套", "二套", "振动", "无油1#", "无油2#", "曲轴油位", "油泵状态", "风机状态", "急停状态"};
|
|
|
|
|
+
|
|
|
@PostMapping("/create")
|
|
@PostMapping("/create")
|
|
|
@Operation(summary = "创建PMS成套")
|
|
@Operation(summary = "创建PMS成套")
|
|
|
@PreAuthorize("@ss.hasPermission('rq:iot-device-group:create')")
|
|
@PreAuthorize("@ss.hasPermission('rq:iot-device-group:create')")
|
|
@@ -176,6 +183,7 @@ public class IotDeviceGroupController {
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
Set<Long> groupDeptIds = new HashSet<>();
|
|
Set<Long> groupDeptIds = new HashSet<>();
|
|
|
Set<Long> deviceIds = new HashSet<>();
|
|
Set<Long> deviceIds = new HashSet<>();
|
|
|
|
|
+ AtomicBoolean nodata = new AtomicBoolean(false);
|
|
|
details.forEach(e ->{
|
|
details.forEach(e ->{
|
|
|
IotDeviceDO iotDevice = iotDeviceService.getIotDevice(e.getDeviceId());
|
|
IotDeviceDO iotDevice = iotDeviceService.getIotDevice(e.getDeviceId());
|
|
|
if (ObjUtil.isNotEmpty(iotDevice.getYfDeviceId())) {
|
|
if (ObjUtil.isNotEmpty(iotDevice.getYfDeviceId())) {
|
|
@@ -430,6 +438,176 @@ public class IotDeviceGroupController {
|
|
|
}
|
|
}
|
|
|
resultMap.put("液驱机", monitors);
|
|
resultMap.put("液驱机", monitors);
|
|
|
}
|
|
}
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // yanfan 接口异常 返回空数据
|
|
|
|
|
+ nodata.set(true);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 设备没有 yanfan deviceId
|
|
|
|
|
+ nodata.set(true);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (nodata.get()) {
|
|
|
|
|
+ if ("空气处理撬".equals(iotDevice.getDeviceName())) {
|
|
|
|
|
+ List<IotDeviceGroupMonitorVO> monitors = new ArrayList<>();
|
|
|
|
|
+ // 没有返回数据 填充空值
|
|
|
|
|
+ IotDeviceGroupMonitorVO enterTemp = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ enterTemp.setModelName("进口温度");
|
|
|
|
|
+ enterTemp.setValue("");
|
|
|
|
|
+ monitors.add(enterTemp);
|
|
|
|
|
+ IotDeviceGroupMonitorVO outTemp = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ outTemp.setModelName("出口温度");
|
|
|
|
|
+ outTemp.setValue("");
|
|
|
|
|
+ monitors.add(outTemp);
|
|
|
|
|
+ IotDeviceGroupMonitorVO outPress = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ outPress.setModelName("空气处理撬出口压力");
|
|
|
|
|
+ outPress.setValue("");
|
|
|
|
|
+ monitors.add(outPress);
|
|
|
|
|
+ IotDeviceGroupMonitorVO status = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ status.setModelName("冷干机运行状态");
|
|
|
|
|
+ status.setValue("");
|
|
|
|
|
+ monitors.add(status);
|
|
|
|
|
+ IotDeviceGroupMonitorVO windStatus = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ windStatus.setModelName("风机运行状态");
|
|
|
|
|
+ windStatus.setValue("");
|
|
|
|
|
+ monitors.add(windStatus);
|
|
|
|
|
+ resultMap.put("空气处理撬", monitors);
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("液驱机".equals(iotDevice.getDeviceName())) {
|
|
|
|
|
+ List<IotDeviceGroupMonitorVO> monitors = new ArrayList<>();
|
|
|
|
|
+ // 没有返回数据 填充空值
|
|
|
|
|
+ IotDeviceGroupMonitorVO enterPressure = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ enterPressure.setModelName("液驱入口压力");
|
|
|
|
|
+ enterPressure.setValue("");
|
|
|
|
|
+ monitors.add(enterPressure);
|
|
|
|
|
+ IotDeviceGroupMonitorVO onePressure = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ onePressure.setModelName("液驱一级入口压力");
|
|
|
|
|
+ onePressure.setValue("");
|
|
|
|
|
+ monitors.add(onePressure);
|
|
|
|
|
+ IotDeviceGroupMonitorVO aOneOutTemp = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ aOneOutTemp.setModelName("液驱A缸一级出口温度");
|
|
|
|
|
+ aOneOutTemp.setValue("");
|
|
|
|
|
+ monitors.add(aOneOutTemp);
|
|
|
|
|
+ IotDeviceGroupMonitorVO aOneColdTemp = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ aOneColdTemp.setModelName("液驱A缸一级冷却后温度");
|
|
|
|
|
+ aOneColdTemp.setValue("");
|
|
|
|
|
+ monitors.add(aOneColdTemp);
|
|
|
|
|
+ IotDeviceGroupMonitorVO aTwoEnterPressure = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ aTwoEnterPressure.setModelName("A缸二级入口压力");
|
|
|
|
|
+ aTwoEnterPressure.setValue("");
|
|
|
|
|
+ monitors.add(aTwoEnterPressure);
|
|
|
|
|
+
|
|
|
|
|
+ IotDeviceGroupMonitorVO aTwoOutTemp = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ aTwoOutTemp.setModelName("A缸二级出口温度");
|
|
|
|
|
+ aTwoOutTemp.setValue("");
|
|
|
|
|
+ monitors.add(aTwoOutTemp);
|
|
|
|
|
+ IotDeviceGroupMonitorVO aTwoColdTemp = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ aTwoColdTemp.setModelName("A缸二级冷却后温度");
|
|
|
|
|
+ aTwoColdTemp.setValue("");
|
|
|
|
|
+ monitors.add(aTwoColdTemp);
|
|
|
|
|
+ IotDeviceGroupMonitorVO aThreeEnterPress = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ aThreeEnterPress.setModelName("A缸三级入口压力");
|
|
|
|
|
+ aThreeEnterPress.setValue("");
|
|
|
|
|
+ monitors.add(aThreeEnterPress);
|
|
|
|
|
+ IotDeviceGroupMonitorVO bOneOutTemp = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ bOneOutTemp.setModelName("B缸一级出口温度");
|
|
|
|
|
+ bOneOutTemp.setValue("");
|
|
|
|
|
+ monitors.add(bOneOutTemp);
|
|
|
|
|
+ IotDeviceGroupMonitorVO bOneColdTemp = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ bOneColdTemp.setModelName("B缸一级冷却后温度");
|
|
|
|
|
+ bOneColdTemp.setValue("");
|
|
|
|
|
+ monitors.add(bOneColdTemp);
|
|
|
|
|
+
|
|
|
|
|
+ IotDeviceGroupMonitorVO bTwoEnterPress = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ bTwoEnterPress.setModelName("B缸二级入口压力");
|
|
|
|
|
+ bTwoEnterPress.setValue("");
|
|
|
|
|
+ monitors.add(bTwoEnterPress);
|
|
|
|
|
+ IotDeviceGroupMonitorVO bTwoOutTemp = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ bTwoOutTemp.setModelName("B缸二级出口温度");
|
|
|
|
|
+ bTwoOutTemp.setValue("");
|
|
|
|
|
+ monitors.add(bTwoOutTemp);
|
|
|
|
|
+ IotDeviceGroupMonitorVO bTwoColdTemp = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ bTwoColdTemp.setModelName("B缸二级冷却后温度");
|
|
|
|
|
+ bTwoColdTemp.setValue("");
|
|
|
|
|
+ monitors.add(bTwoColdTemp);
|
|
|
|
|
+ IotDeviceGroupMonitorVO bThreeEnterPress = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ bThreeEnterPress.setModelName("B缸三级入口压力");
|
|
|
|
|
+ bThreeEnterPress.setValue("");
|
|
|
|
|
+ monitors.add(bThreeEnterPress);
|
|
|
|
|
+ IotDeviceGroupMonitorVO threeOutTemp = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ threeOutTemp.setModelName("三级出口温度");
|
|
|
|
|
+ threeOutTemp.setValue("");
|
|
|
|
|
+ monitors.add(threeOutTemp);
|
|
|
|
|
+ IotDeviceGroupMonitorVO totalOutTemp = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ totalOutTemp.setModelName("总出口温度");
|
|
|
|
|
+ totalOutTemp.setValue("");
|
|
|
|
|
+ monitors.add(totalOutTemp);
|
|
|
|
|
+ IotDeviceGroupMonitorVO totalOutPress = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ totalOutPress.setModelName("总出口压力");
|
|
|
|
|
+ totalOutPress.setValue("");
|
|
|
|
|
+ monitors.add(totalOutPress);
|
|
|
|
|
+ resultMap.put("液驱机", monitors);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (iotDevice.getDeviceName().contains("中压")) {
|
|
|
|
|
+ List<IotDeviceGroupMonitorVO> monitors = new ArrayList<>();
|
|
|
|
|
+ // 没有返回数据 填充空值
|
|
|
|
|
+ IotDeviceGroupMonitorVO outPress = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ outPress.setModelName("中压排气压力");
|
|
|
|
|
+ outPress.setValue("");
|
|
|
|
|
+ monitors.add(outPress);
|
|
|
|
|
+ IotDeviceGroupMonitorVO outTemp = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ outTemp.setModelName("中压排气温度");
|
|
|
|
|
+ outTemp.setValue("");
|
|
|
|
|
+ monitors.add(outTemp);
|
|
|
|
|
+ IotDeviceGroupMonitorVO sysPress = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ sysPress.setModelName("中压系统压力");
|
|
|
|
|
+ sysPress.setValue("");
|
|
|
|
|
+ monitors.add(sysPress);
|
|
|
|
|
+ IotDeviceGroupMonitorVO backTemp = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ backTemp.setModelName("中压后轴承温度");
|
|
|
|
|
+ backTemp.setValue("");
|
|
|
|
|
+ monitors.add(backTemp);
|
|
|
|
|
+ IotDeviceGroupMonitorVO totalTime = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ totalTime.setModelName("中压总运行时间");
|
|
|
|
|
+ totalTime.setValue("");
|
|
|
|
|
+ monitors.add(totalTime);
|
|
|
|
|
+ IotDeviceGroupMonitorVO totalPower = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ totalPower.setModelName("总用电能");
|
|
|
|
|
+ totalPower.setValue("");
|
|
|
|
|
+ monitors.add(totalPower);
|
|
|
|
|
+ IotDeviceGroupMonitorVO status = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ status.setModelName("设备状态");
|
|
|
|
|
+ status.setValue("");
|
|
|
|
|
+ monitors.add(status);
|
|
|
|
|
+ resultMap.put("中压机", monitors);
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("提纯撬".equals(iotDevice.getDeviceName())) {
|
|
|
|
|
+ List<IotDeviceGroupMonitorVO> monitors = new ArrayList<>();
|
|
|
|
|
+ // 没有返回数据 填充空值
|
|
|
|
|
+ IotDeviceGroupMonitorVO pure = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ pure.setModelName("PSA氮气纯度");
|
|
|
|
|
+ pure.setValue("");
|
|
|
|
|
+ monitors.add(pure);
|
|
|
|
|
+ IotDeviceGroupMonitorVO pressure = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ pressure.setModelName("PSA氮气压力");
|
|
|
|
|
+ pressure.setValue("");
|
|
|
|
|
+ monitors.add(pressure);
|
|
|
|
|
+ IotDeviceGroupMonitorVO instantFlow = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ instantFlow.setModelName("PSA氮气瞬时流量");
|
|
|
|
|
+ instantFlow.setValue("");
|
|
|
|
|
+ monitors.add(instantFlow);
|
|
|
|
|
+ IotDeviceGroupMonitorVO totalFlow = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ totalFlow.setModelName("PSA累计流量");
|
|
|
|
|
+ totalFlow.setValue("");
|
|
|
|
|
+ monitors.add(totalFlow);
|
|
|
|
|
+ IotDeviceGroupMonitorVO status = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ status.setModelName("PSA运行状态");
|
|
|
|
|
+ status.setValue("");
|
|
|
|
|
+ monitors.add(status);
|
|
|
|
|
+ resultMap.put("PSA", monitors);
|
|
|
|
|
+ }
|
|
|
|
|
+ if ("增压机".equals(iotDevice.getDeviceName())) {
|
|
|
|
|
+ List<IotDeviceGroupMonitorVO> zyjParams = createDefaultMonitors(ZYJ_PARAMS);
|
|
|
|
|
+ resultMap.put("PS增压机", zyjParams);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
groupDeptIds.add(iotDevice.getDeptId());
|
|
groupDeptIds.add(iotDevice.getDeptId());
|
|
@@ -489,6 +667,22 @@ public class IotDeviceGroupController {
|
|
|
return success(resultMap);
|
|
return success(resultMap);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 创建默认监控对象列表(值为空)
|
|
|
|
|
+ * @param params 参数名称数组
|
|
|
|
|
+ * @return 监控对象列表
|
|
|
|
|
+ */
|
|
|
|
|
+ private List<IotDeviceGroupMonitorVO> createDefaultMonitors(String[] params) {
|
|
|
|
|
+ return Arrays.stream(params)
|
|
|
|
|
+ .map(param -> {
|
|
|
|
|
+ IotDeviceGroupMonitorVO monitor = new IotDeviceGroupMonitorVO();
|
|
|
|
|
+ monitor.setModelName(param);
|
|
|
|
|
+ monitor.setValue(""); // 值留空
|
|
|
|
|
+ return monitor;
|
|
|
|
|
+ })
|
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Java8风格:仅基于“空压”截取字符串,不依赖任何其他分隔符
|
|
* Java8风格:仅基于“空压”截取字符串,不依赖任何其他分隔符
|
|
|
* @param input 原始字符串
|
|
* @param input 原始字符串
|