Commit 8f4e558e authored by 张森's avatar 张森

水池液位等添加预警详情信息

parent a2eaa4fe
...@@ -20,4 +20,14 @@ public class TableContentVo { ...@@ -20,4 +20,14 @@ public class TableContentVo {
private Object value; private Object value;
private String type; private String type;
public TableContentVo() {
}
public TableContentVo(String label, String type, Object value, String key) {
this.label = label;
this.type = type;
this.value = value;
this.key = key;
}
} }
package com.yeejoin.equipmanage.service.impl; package com.yeejoin.equipmanage.service.impl;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
...@@ -27,6 +28,7 @@ import com.yeejoin.equipmanage.common.utils.UUIDUtils; ...@@ -27,6 +28,7 @@ import com.yeejoin.equipmanage.common.utils.UUIDUtils;
import com.yeejoin.equipmanage.common.vo.*; import com.yeejoin.equipmanage.common.vo.*;
import com.yeejoin.equipmanage.common.vo.BizMessage; import com.yeejoin.equipmanage.common.vo.BizMessage;
import com.yeejoin.equipmanage.common.vo.CustomizeItems; import com.yeejoin.equipmanage.common.vo.CustomizeItems;
import com.yeejoin.equipmanage.dto.TabContent;
import com.yeejoin.equipmanage.fegin.IotFeign; import com.yeejoin.equipmanage.fegin.IotFeign;
import com.yeejoin.equipmanage.fegin.SystemctlFeign; import com.yeejoin.equipmanage.fegin.SystemctlFeign;
import com.yeejoin.equipmanage.mapper.*; import com.yeejoin.equipmanage.mapper.*;
...@@ -1377,6 +1379,12 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -1377,6 +1379,12 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
extra.put("problemReception", "station"); extra.put("problemReception", "station");
extra.put("bussId", String.valueOf(equipmentSpecificIndex.getEquipmentSpecificId())); extra.put("bussId", String.valueOf(equipmentSpecificIndex.getEquipmentSpecificId()));
extra.put("clearUniqueCode", "equip-level"); extra.put("clearUniqueCode", "equip-level");
TableContentVo tableContentVo = new TableContentVo("报警类型", "text", "液位超出阈值", "1");
TableContentVo tableContentVo1 = new TableContentVo("报警部位", "text", equipmentSpecificIndex.getLocation(), "2");
TableContentVo tableContentVo2 = new TableContentVo("报警时间", "text", DateUtil.now(), "3");
TableContentVo tableContentVo3 = new TableContentVo("报警对象", "text", equipmentSpecificIndex.getEquipmentSpecificName(), "4");
List<TableContentVo> tableContentVos = Arrays.asList(tableContentVo, tableContentVo1, tableContentVo2, tableContentVo3);
handleWarning(minValue, handleWarning(minValue,
maxValue, maxValue,
nowValue, nowValue,
...@@ -1385,7 +1393,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -1385,7 +1393,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
"fireIot/data/analysis", "fireIot/data/analysis",
indexKey, indexKey,
extra, extra,
"cafsWaterLevelOver"); "cafsWaterLevelOver",
tableContentVos);
if (nowValue.compareTo(minValue) < 0 || nowValue.compareTo(maxValue) > 0) { if (nowValue.compareTo(minValue) < 0 || nowValue.compareTo(maxValue) > 0) {
String body = ""; String body = "";
...@@ -1470,6 +1479,12 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -1470,6 +1479,12 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
extra.put("problemReception", "station"); extra.put("problemReception", "station");
extra.put("bussId", map.get("id").toString()); extra.put("bussId", map.get("id").toString());
extra.put("clearUniqueCode", "water-resource"); extra.put("clearUniqueCode", "water-resource");
TableContentVo tableContentVo = new TableContentVo("报警类型", "text", "液位超出阈值", "1");
TableContentVo tableContentVo1 = new TableContentVo("报警部位", "text", equipmentSpecificIndex.getLocation(), "2");
TableContentVo tableContentVo2 = new TableContentVo("报警时间", "text", DateUtil.now(), "3");
TableContentVo tableContentVo3 = new TableContentVo("报警对象", "text", map.getOrDefault("name", "").toString(), "4");
List<TableContentVo> tableContentVos = Arrays.asList(tableContentVo, tableContentVo1, tableContentVo2, tableContentVo3);
//预警业务 消防水池和消防水箱 //预警业务 消防水池和消防水箱
handleWarning(minValue, handleWarning(minValue,
maxValue, maxValue,
...@@ -1479,7 +1494,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -1479,7 +1494,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
"fireIot/data/analysis", "fireIot/data/analysis",
"WATER_POOL_LEVEL", "WATER_POOL_LEVEL",
extra, extra,
"waterLevelOver"); "waterLevelOver",
tableContentVos);
} }
if (nowValue.compareTo(minValue) < 0 || nowValue.compareTo(maxValue) > 0) { if (nowValue.compareTo(minValue) < 0 || nowValue.compareTo(maxValue) > 0) {
...@@ -1528,7 +1544,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -1528,7 +1544,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
String topic, String topic,
String indexKey, String indexKey,
Object extra, Object extra,
String source) { String source,
List<TableContentVo> tableContentVos) {
if (minValue.compareTo(new BigDecimal(0)) > 0 if (minValue.compareTo(new BigDecimal(0)) > 0
&& maxValue.compareTo(new BigDecimal(0)) > 0) { && maxValue.compareTo(new BigDecimal(0)) > 0) {
BigDecimal divide = new BigDecimal(0); BigDecimal divide = new BigDecimal(0);
...@@ -1542,6 +1559,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -1542,6 +1559,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
bizMessage.setIndexKey(indexKey); bizMessage.setIndexKey(indexKey);
bizMessage.setIndexValue(String.valueOf(divide)); bizMessage.setIndexValue(String.valueOf(divide));
RiskBizInfoVo riskBizInfoVo = fetchData(equipmentSpecificIndex, extra, source); RiskBizInfoVo riskBizInfoVo = fetchData(equipmentSpecificIndex, extra, source);
riskBizInfoVo.getDynamicDetails().get(0).setTabContent(tableContentVos);
bizMessage.setBizInfo(riskBizInfoVo); bizMessage.setBizInfo(riskBizInfoVo);
bizMessage.setTraceId(businessId); bizMessage.setTraceId(businessId);
try { try {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment