Commit c9b6b3a7 authored by KeYong's avatar KeYong

修改bug及绍兴现场问题

parent 380f3a60
...@@ -441,4 +441,34 @@ public class DataDictionaryController extends BaseController { ...@@ -441,4 +441,34 @@ public class DataDictionaryController extends BaseController {
List<DataDictionary> list = iDataDictionaryService.list(queryWrapper); List<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
return ResponseHelper.buildResponse(list); return ResponseHelper.buildResponse(list);
} }
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/job/list", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "按人员岗位类型统计", notes = "按人员岗位类型统计")
public ResponseModel<Object> getPeopleJobStatistic(HttpServletRequest request, String types) {
HashMap<Object, Object> objectObjectHashMap = new HashMap<>();
try {
String[] typest = types.split(",");
for (String type : typest) {
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", type);
queryWrapper.orderByAsc("sort_num");
if (redisUtils.hasKey(RedisKey.DATA_DICTIONARY_CODE_XIN + type)) {
Object obj = redisUtils.get(RedisKey.DATA_DICTIONARY_CODE_XIN + type);
objectObjectHashMap.put(type, obj);
} else {
Collection<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
List<MenuFrom> menus = null;
menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getCode", 0, "getName",
"getParent", null);
redisUtils.set(RedisKey.DATA_DICTIONARY_CODE_XIN + type, JSON.toJSON(menus), time);
objectObjectHashMap.put(type, menus);
}
}
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("系统异常!");
}
return ResponseHelper.buildResponse(objectObjectHashMap);
}
} }
...@@ -1352,12 +1352,12 @@ LEFT JOIN ( ...@@ -1352,12 +1352,12 @@ LEFT JOIN (
LEFT JOIN ( LEFT JOIN (
SELECT SELECT
v.`instance_id`, v.`instance_id`,
max( CASE v.field_code WHEN 'fireManagementPostCode' THEN IFNULL( v.field_value_label, v.field_value ) END ) fireManagementPostCode, max(CASE v.field_code WHEN 'fireManagementPostCode' THEN IFNULL(v.field_value_label, v.field_value) END) fireManagementPostCode,
max( CASE v.field_code WHEN 'fireManagementPostCode' THEN v.field_value END ) fireManagementPost, max(CASE v.field_code WHEN 'fireManagementPostCode' THEN v.field_value END) fireManagementPost,
max( CASE v.field_code WHEN 'fireManagementPostCode' THEN v.field_value_label END ) fireManagementPostName, max(CASE v.field_code WHEN 'fireManagementPostCode' THEN v.field_value_label END) fireManagementPostName,
max( CASE v.field_code WHEN 'positionType' THEN IFNULL( v.field_value, v.field_value_label ) END ) positionType, max(CASE v.field_code WHEN 'positionType' THEN IFNULL( v.field_value, v.field_value_label ) END) positionType,
max( CASE v.field_code WHEN 'positionType' THEN v.field_value_label END ) positionTypeName, max(CASE v.field_code WHEN 'positionType' THEN v.field_value_label END) positionTypeName,
max( CASE v.field_code WHEN 'peopleType' THEN v.field_value END ) peopleType max(CASE v.field_code WHEN 'peopleType' THEN v.field_value END) peopleType
FROM FROM
`cb_dynamic_form_instance` v `cb_dynamic_form_instance` v
WHERE WHERE
...@@ -1403,9 +1403,9 @@ LEFT JOIN ( ...@@ -1403,9 +1403,9 @@ LEFT JOIN (
LEFT JOIN ( LEFT JOIN (
SELECT SELECT
v.`instance_id`, v.`instance_id`,
max( CASE v.field_code WHEN 'positionType' THEN v.field_value END ) positionType, max(CASE v.field_code WHEN 'positionType' THEN v.field_value END) positionType,
max( CASE v.field_code WHEN 'positionType' THEN v.field_value_label END ) positionTypeName, max(CASE v.field_code WHEN 'positionType' THEN v.field_value_label END) positionTypeName,
max( CASE v.field_code WHEN 'peopleType' THEN v.field_value END ) peopleType max(CASE v.field_code WHEN 'peopleType' THEN v.field_value END) peopleType
FROM FROM
`cb_dynamic_form_instance` v `cb_dynamic_form_instance` v
WHERE WHERE
......
...@@ -34,5 +34,7 @@ public class EquipmentExportVO { ...@@ -34,5 +34,7 @@ public class EquipmentExportVO {
private String classification = ""; private String classification = "";
@ExcelProperty(value = "所属系统", index = 11) @ExcelProperty(value = "所属系统", index = 11)
private String systemName = ""; private String systemName = "";
@ExcelProperty(value = "所属单位", index = 12)
private String bizOrgName = "";
} }
...@@ -12,24 +12,26 @@ import java.io.Serializable; ...@@ -12,24 +12,26 @@ import java.io.Serializable;
@Data @Data
public class EquipmentAlarmDownloadVO implements Serializable { public class EquipmentAlarmDownloadVO implements Serializable {
@ExcelProperty(value = "所属单位", index = 0)
private String bizOrgName = "";
@ExcelProperty(value = "告警类型", index = 0) @ExcelProperty(value = "告警类型", index = 1)
private String alarmType = ""; private String alarmType = "";
@ExcelProperty(value = "告警设备", index = 1) @ExcelProperty(value = "告警设备", index = 2)
private String equipName = ""; private String equipName = "";
@ExcelProperty(value = "告警内容", index = 2) @ExcelProperty(value = "告警内容", index = 3)
private String alarmContent = ""; private String alarmContent = "";
@ExcelProperty(value = "设备编号", index = 3) @ExcelProperty(value = "设备编号", index = 4)
private String equipCode = ""; private String equipCode = "";
@ExcelProperty(value = "告警位置", index = 4) @ExcelProperty(value = "告警位置", index = 5)
private String alarmPosition = ""; private String alarmPosition = "";
@ExcelProperty(value = "保护对象", index = 5) // @ExcelProperty(value = "保护对象", index = 5)
private String protectObj = ""; // private String protectObj = "";
@ExcelProperty(value = "告警时间", index = 6) @ExcelProperty(value = "告警时间", index = 6)
private String alarmTime = ""; private String alarmTime = "";
......
...@@ -47,6 +47,7 @@ public class EquipmentIndexCacheRunner implements CommandLineRunner { ...@@ -47,6 +47,7 @@ public class EquipmentIndexCacheRunner implements CommandLineRunner {
redisUtils.hmset(RedisKey.EQUIP_INDEX_ADDRESS, equipmentIndexVOMap); redisUtils.hmset(RedisKey.EQUIP_INDEX_ADDRESS, equipmentIndexVOMap);
redisUtils.hmset(RedisKey.EQUIP_INDEX_ADDRESS_KEY, equipmentIndexKeyMap); redisUtils.hmset(RedisKey.EQUIP_INDEX_ADDRESS_KEY, equipmentIndexKeyMap);
// log.info("Redis存入数据key==equip_index_address_key_station: {}", equipmentIndexEventMap);
redisUtils.hmset(RedisKey.EQUIP_INDEX_ADDRESS_KEY_STATION, equipmentIndexEventMap); redisUtils.hmset(RedisKey.EQUIP_INDEX_ADDRESS_KEY_STATION, equipmentIndexEventMap);
} }
} }
\ No newline at end of file
...@@ -139,13 +139,13 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -139,13 +139,13 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
ids.forEach(id -> { ids.forEach(id -> {
EquipmentAlarmDownloadVO alarmDownloadVO = new EquipmentAlarmDownloadVO(); EquipmentAlarmDownloadVO alarmDownloadVO = new EquipmentAlarmDownloadVO();
if ((alarm.get("id").toString()).equals(id.toString())) { if ((alarm.get("id").toString()).equals(id.toString())) {
// alarmDownloadVO.setId((Long) alarm.get("id")); alarmDownloadVO.setBizOrgName(StringUtil.isNotEmpty(alarm.get("bizOrgName")) ? alarm.get("bizOrgName").toString() : "");
alarmDownloadVO.setAlarmType(signalClassifyService.getTypeNameByCode(alarm.get("type").toString()).getTypeName()); alarmDownloadVO.setAlarmType(signalClassifyService.getTypeNameByCode(alarm.get("type").toString()).getTypeName());
alarmDownloadVO.setEquipName(alarm.get("fireEquipmentName").toString()); alarmDownloadVO.setEquipName(alarm.get("fireEquipmentName").toString());
alarmDownloadVO.setAlarmContent(alarm.get("alarmContent").toString()); alarmDownloadVO.setAlarmContent(alarm.get("alarmContent").toString());
alarmDownloadVO.setEquipCode(StringUtil.isNotEmpty(alarm.get("fireEquipmentCode")) ? alarm.get("fireEquipmentCode").toString() : ""); alarmDownloadVO.setEquipCode(StringUtil.isNotEmpty(alarm.get("fireEquipmentCode")) ? alarm.get("fireEquipmentCode").toString() : "");
alarmDownloadVO.setAlarmPosition(StringUtil.isNotEmpty(alarm.get("warehouseStructureName")) ? alarm.get("warehouseStructureName").toString() : ""); alarmDownloadVO.setAlarmPosition(StringUtil.isNotEmpty(alarm.get("warehouseStructureName")) ? alarm.get("warehouseStructureName").toString() : "");
alarmDownloadVO.setProtectObj(StringUtil.isNotEmpty(alarm.get("equipmentName")) ? alarm.get("equipmentName").toString() : ""); // alarmDownloadVO.setProtectObj(StringUtil.isNotEmpty(alarm.get("equipmentName")) ? alarm.get("equipmentName").toString() : "");
alarmDownloadVO.setAlarmTime(StringUtil.isNotEmpty(alarm.get("createDate")) ? alarm.get("createDate").toString().replace("T", " ") : ""); alarmDownloadVO.setAlarmTime(StringUtil.isNotEmpty(alarm.get("createDate")) ? alarm.get("createDate").toString().replace("T", " ") : "");
alarmDownloadVO.setCleanStatus(alarm.get("cleanStatus").toString()); alarmDownloadVO.setCleanStatus(alarm.get("cleanStatus").toString());
// 处理状态、处理类型无业务字段,后期业务功能实现之后需在此处返回相应字段 // 处理状态、处理类型无业务字段,后期业务功能实现之后需在此处返回相应字段
...@@ -170,13 +170,13 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -170,13 +170,13 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
if (0 < list.size()) { if (0 < list.size()) {
list.forEach(alarm -> { list.forEach(alarm -> {
EquipmentAlarmDownloadVO alarmDownloadVO = new EquipmentAlarmDownloadVO(); EquipmentAlarmDownloadVO alarmDownloadVO = new EquipmentAlarmDownloadVO();
// alarmDownloadVO.setId((Long) alarm.get("id")); alarmDownloadVO.setBizOrgName(StringUtil.isNotEmpty(alarm.get("bizOrgName")) ? alarm.get("bizOrgName").toString() : "");
alarmDownloadVO.setAlarmType(signalClassifyService.getTypeNameByCode(alarm.get("type").toString()).getTypeName()); alarmDownloadVO.setAlarmType(signalClassifyService.getTypeNameByCode(alarm.get("type").toString()).getTypeName());
alarmDownloadVO.setEquipName(alarm.get("fireEquipmentName").toString()); alarmDownloadVO.setEquipName(alarm.get("fireEquipmentName").toString());
alarmDownloadVO.setAlarmContent(alarm.get("alarmContent").toString()); alarmDownloadVO.setAlarmContent(alarm.get("alarmContent").toString());
alarmDownloadVO.setEquipCode(StringUtil.isNotEmpty(alarm.get("fireEquipmentCode")) ? alarm.get("fireEquipmentCode").toString() : ""); alarmDownloadVO.setEquipCode(StringUtil.isNotEmpty(alarm.get("fireEquipmentCode")) ? alarm.get("fireEquipmentCode").toString() : "");
alarmDownloadVO.setAlarmPosition(StringUtil.isNotEmpty(alarm.get("warehouseStructureName")) ? alarm.get("warehouseStructureName").toString() : ""); alarmDownloadVO.setAlarmPosition(StringUtil.isNotEmpty(alarm.get("warehouseStructureName")) ? alarm.get("warehouseStructureName").toString() : "");
alarmDownloadVO.setProtectObj(StringUtil.isNotEmpty(alarm.get("equipmentName")) ? alarm.get("equipmentName").toString() : ""); // alarmDownloadVO.setProtectObj(StringUtil.isNotEmpty(alarm.get("equipmentName")) ? alarm.get("equipmentName").toString() : "");
alarmDownloadVO.setAlarmTime(StringUtil.isNotEmpty(alarm.get("createDate")) ? alarm.get("createDate").toString().replace("T", " ") : ""); alarmDownloadVO.setAlarmTime(StringUtil.isNotEmpty(alarm.get("createDate")) ? alarm.get("createDate").toString().replace("T", " ") : "");
alarmDownloadVO.setCleanStatus(alarm.get("cleanStatus").toString()); alarmDownloadVO.setCleanStatus(alarm.get("cleanStatus").toString());
// 处理状态、处理类型无业务字段,后期业务功能实现之后需在此处返回相应字段 // 处理状态、处理类型无业务字段,后期业务功能实现之后需在此处返回相应字段
......
...@@ -436,7 +436,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -436,7 +436,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Async("equipAsyncExecutor") @Async("equipAsyncExecutor")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void handlerMqttRomaMessage(String topic, String message) { public void handlerMqttRomaMessage(String topic, String message) {
log.info("接收到换流站Kafka消息: {}", message);
TopicEntityVo topicEntity = new TopicEntityVo(); TopicEntityVo topicEntity = new TopicEntityVo();
topicEntity.setTopic(topic); topicEntity.setTopic(topic);
topicEntity.setMessage(message); topicEntity.setMessage(message);
...@@ -445,9 +444,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -445,9 +444,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
List<EquipmentSpecificIndex> equipmentSpecificIndexList = new ArrayList<>(); List<EquipmentSpecificIndex> equipmentSpecificIndexList = new ArrayList<>();
List<EquipmentSpecificAlarm> equipmentSpecificAlarms = new ArrayList<>(); List<EquipmentSpecificAlarm> equipmentSpecificAlarms = new ArrayList<>();
List<IndexStateVo> indexStateList = new ArrayList<>(); List<IndexStateVo> indexStateList = new ArrayList<>();
JSONObject jsonObject = JSONObject.parseObject(message);
StationMessage stationMessage = JSON.parseObject(String.valueOf(message), StationMessage.class); StationMessage stationMessage = JSON.parseObject(String.valueOf(message), StationMessage.class);
log.info("接收到换流站Kafka消息: {}", stationMessage);
String indexAddress = null, value = null, timeStamp = null, quality = null, dataType = null; String indexAddress = null, value = null, timeStamp = null, quality = null, dataType = null;
if (stationMessage != null) { if (stationMessage != null) {
dataType = stationMessage.getDataType(); dataType = stationMessage.getDataType();
...@@ -726,10 +725,19 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -726,10 +725,19 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
List<EquipmentSpecificIndex> equipmentSpecificIndexList = new ArrayList<>(); List<EquipmentSpecificIndex> equipmentSpecificIndexList = new ArrayList<>();
List<EquipmentSpecificAlarm> equipmentSpecificAlarms = new ArrayList<>(); List<EquipmentSpecificAlarm> equipmentSpecificAlarms = new ArrayList<>();
List<IndexStateVo> indexStateList = new ArrayList<>(); List<IndexStateVo> indexStateList = new ArrayList<>();
JSONObject messageObj = JSONObject.parseObject(message);
JSONObject data = messageObj.getJSONObject("data");
if (!ObjectUtils.isEmpty(data)) {
message = JSON.toJSONString(data);
// log.info("Kafka消息取data数据: {}", data);
}
SShanStationMessage sShanStationMessage = JSON.parseObject(String.valueOf(message), SShanStationMessage.class); // message = "{\"timeStamp\":\"2024-05-15 15:29:01.883\",\"warns\":[{\"deviceId\":\"sxxfb30000001112967078\",\"eventstatus\":\"出现\",\"pointId\":\"LS.S2.RCS9794-ZKL.-.绍兴消防泵.2号稳压泵运行\",\"time\":\"2024-05-15 15:29:01.883\"}]}";
SShanStationMessage sShanStationMessage = JSON.parseObject(message, SShanStationMessage.class);
log.info("转换message数据: {}", sShanStationMessage);
Map<Object, Object> equipmentIndexKeyMap = redisUtils.hmget(RedisKey.EQUIP_INDEX_ADDRESS_KEY_STATION); Map<Object, Object> equipmentIndexKeyMap = redisUtils.hmget(RedisKey.EQUIP_INDEX_ADDRESS_KEY_STATION);
sShanStationMessage.getWarns().forEach(m -> { // log.info("Redis取数据key==equip_index_address_key_station: {}", equipmentIndexKeyMap);
for (SShanMessage m : sShanStationMessage.getWarns()) {
String value; String value;
if (message.contains("eventtextL1")) { if (message.contains("eventtextL1")) {
// 此通道目前专供韶山告警消息value赋值,没必要用配置文件多字段进行逐个判断,所以暂时不修改 // 此通道目前专供韶山告警消息value赋值,没必要用配置文件多字段进行逐个判断,所以暂时不修改
...@@ -740,6 +748,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -740,6 +748,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
if (equipmentIndexKeyMap.get(m.getPointId()) != null) { if (equipmentIndexKeyMap.get(m.getPointId()) != null) {
EquipmentSpecificIndex equipmentSpeIndex = equipmentSpecificIndexService.getEquipmentSpeIndexByAddress(null, m.getPointId(), null); EquipmentSpecificIndex equipmentSpeIndex = equipmentSpecificIndexService.getEquipmentSpeIndexByAddress(null, m.getPointId(), null);
// log.info("查询equip_specific_index数据=======:", JSON.toJSONString(equipmentSpeIndex.toString()));
if (equipmentSpeIndex == null) { if (equipmentSpeIndex == null) {
return; return;
} }
...@@ -868,9 +877,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -868,9 +877,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
} else { } else {
try { try {
emqKeeper.getMqttClient().publish("emq.xf.created", jsonObjectXf.toString().getBytes(), 1, false); emqKeeper.getMqttClient().publish("emq.xf.created", jsonObjectXf.toString().getBytes(), 1, false);
log.info("遥测遥信数据推送云端kafka成功"); log.info("告警事件数据推送云端kafka成功");
} catch (MqttException e) { } catch (MqttException e) {
log.error("遥测遥信数据推送云端kafka失败=====>" + e.getMessage()); log.error("告警事件数据推送云端kafka失败=====>" + e.getMessage());
e.printStackTrace(); e.printStackTrace();
} }
} }
...@@ -980,7 +989,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -980,7 +989,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
} }
}); });
} }
}); }
} }
......
package com.yeejoin.equipmanage.service.impl; package com.yeejoin.equipmanage.service.impl;
import com.alibaba.fastjson.JSON;
import com.yeejoin.equipmanage.common.vo.SShanStationMessage;
import com.yeejoin.equipmanage.utils.ClassToJsonUtil; import com.yeejoin.equipmanage.utils.ClassToJsonUtil;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...@@ -232,6 +234,19 @@ public class StatisticsServiceImpl implements IStatisticsService { ...@@ -232,6 +234,19 @@ public class StatisticsServiceImpl implements IStatisticsService {
String s = "{\"code\":2000,\"id\":1,\"body\":{\"warns\":[{\"systemid\":\"2\",\"pointId\":\"73811\",\"level\":\"3\",\"time\":\"2024-04-08 09:17:56.226\",\"type\":\"遥信变位\",\"deviceId\":\"\",\"content\":\"火灾报警主机_主控楼二层1#蓄电池室可燃气体火警屏蔽状态 消失\"}]}}"; String s = "{\"code\":2000,\"id\":1,\"body\":{\"warns\":[{\"systemid\":\"2\",\"pointId\":\"73811\",\"level\":\"3\",\"time\":\"2024-04-08 09:17:56.226\",\"type\":\"遥信变位\",\"deviceId\":\"\",\"content\":\"火灾报警主机_主控楼二层1#蓄电池室可燃气体火警屏蔽状态 消失\"}]}}";
String s1 = "{\"data_class\":\"realdata\",\"data_type\":\"alarm\",\"op_type\":\"subscribe_emergency\",\"condition\":{\"station_psr_id\":\"50edcb6c1b8a811030493c80a2014950ed9d4f59e8\",\"station_name\":\"中州换流站\",\"alarm_type\":\"yx_bw\"},\"data\":[{\"psrId\":\"D017020000000000000000999\",\"astId\":\"D017020000000000000000999\",\"equipType\":\"ASTType_0000111\",\"eventType\":\"OtherSignal\",\"alarmSource\":\"OWS\",\"alarmLevel\":\"3\",\"description\":\"2024-03-11 09:06:17::585 S2WCL12A E3.C01软水器再生结束信号 出现\",\"dateTime\":\"2024-03-11 09:06:17.585\"}]}"; String s1 = "{\"data_class\":\"realdata\",\"data_type\":\"alarm\",\"op_type\":\"subscribe_emergency\",\"condition\":{\"station_psr_id\":\"50edcb6c1b8a811030493c80a2014950ed9d4f59e8\",\"station_name\":\"中州换流站\",\"alarm_type\":\"yx_bw\"},\"data\":[{\"psrId\":\"D017020000000000000000999\",\"astId\":\"D017020000000000000000999\",\"equipType\":\"ASTType_0000111\",\"eventType\":\"OtherSignal\",\"alarmSource\":\"OWS\",\"alarmLevel\":\"3\",\"description\":\"2024-03-11 09:06:17::585 S2WCL12A E3.C01软水器再生结束信号 出现\",\"dateTime\":\"2024-03-11 09:06:17.585\"}]}";
String s2 = "{\"code\":2000,\"id\":1,\"body\":{\"time_stamp\":\"2024-04-07 16:42:52.616\",\"datatype\":\"analog\",\"name\":\"直流接地极电流IDEE\",\"value\":12.969970703125,\"key\":\"0000YC00010100409C\",\"quality\":0,”code”:1001}}"; String s2 = "{\"code\":2000,\"id\":1,\"body\":{\"time_stamp\":\"2024-04-07 16:42:52.616\",\"datatype\":\"analog\",\"name\":\"直流接地极电流IDEE\",\"value\":12.969970703125,\"key\":\"0000YC00010100409C\",\"quality\":0,”code”:1001}}";
String s3 = "{\n" +
" \"timeStamp\": \"2024-05-15 15:29:01.883\",\n" +
" \"warns\": [\n" +
" {\n" +
" \"deviceId\": \"sxxfb30000001112967078\",\n" +
" \"eventstatus\": \"出现\",\n" +
" \"pointId\": \"LS.S2.RCS9794-ZKL.-.绍兴消防泵.2号稳压泵运行\",\n" +
" \"time\": \"2024-05-15 15:29:01.883\"\n" +
" }\n" +
" ]\n" +
" }";
// SShanStationMessage sShanStationMessage = JSON.parseObject(s3, SShanStationMessage.class);
// return String.valueOf(sShanStationMessage);
return ClassToJsonUtil.class2json(s1, commonMessage, "k1"); return ClassToJsonUtil.class2json(s1, commonMessage, "k1");
} }
......
...@@ -443,32 +443,7 @@ ...@@ -443,32 +443,7 @@
</select> </select>
<select id="selectGasExtinguishing" resultType="java.util.Map"> <select id="selectGasExtinguishing" resultType="java.util.Map">
SELECT SELECT
wes.id,
(SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi ON wei.id = wesi.equipment_index_id WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level,
wes.code as code ,
wes.name,
IFNULL(wes.realtime_iot_index_name, '暂无信号') AS status,
CASE
WHEN (SELECT is_alarm FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key ) = 1 AND wes.realtime_iot_index_value = 'true' THEN 1
ELSE 0
END AS alarm
FROM
wl_equipment_specific wes
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE
(
wes.equipment_code LIKE concat( '92044300', '%')
OR wes.equipment_code LIKE concat( '92040100', '%')
)
<if test="code != null and code!='' ">
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code})
</if>
AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%')
</select>
<select id="selectPressureFlow" resultType="java.util.Map">
SELECT
wes.id, wes.id,
'1' as type, '1' as type,
(SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi ON wei.id = wesi.equipment_index_id WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level, (SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi ON wei.id = wesi.equipment_index_id WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level,
...@@ -476,22 +451,22 @@ ...@@ -476,22 +451,22 @@
wes.name, wes.name,
IFNULL(wes.realtime_iot_index_name, '暂无信号') AS status, IFNULL(wes.realtime_iot_index_name, '暂无信号') AS status,
CASE CASE
WHEN (SELECT is_alarm FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key ) = 1 AND wes.realtime_iot_index_value = 'true' THEN 1 WHEN (SELECT is_alarm FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key ) = 1 AND wes.realtime_iot_index_value = 'true' THEN 1
ELSE 0 ELSE 0
END AS alarm END AS alarm
FROM FROM
wl_equipment_specific wes wl_equipment_specific wes
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE WHERE
wes.equipment_code LIKE concat( '310403', '%') wes.equipment_code LIKE concat( '310403', '%')
<if test="code != null and code!='' "> <if test="code != null and code!='' ">
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code}) AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code})
</if> </if>
AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%') AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%')
UNION UNION
SELECT SELECT
wes.id, wes.id,
'2' as type, '2' as type,
(SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi ON wei.id = wesi.equipment_index_id WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level, (SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi ON wei.id = wesi.equipment_index_id WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level,
...@@ -499,22 +474,22 @@ ...@@ -499,22 +474,22 @@
wes.name, wes.name,
IFNULL(wes.realtime_iot_index_name, '暂无信号') AS status, IFNULL(wes.realtime_iot_index_name, '暂无信号') AS status,
CASE CASE
WHEN (SELECT is_alarm FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key ) = 1 AND wes.realtime_iot_index_value = 'true' THEN 1 WHEN (SELECT is_alarm FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key ) = 1 AND wes.realtime_iot_index_value = 'true' THEN 1
ELSE 0 ELSE 0
END AS alarm END AS alarm
FROM FROM
wl_equipment_specific wes wl_equipment_specific wes
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE WHERE
wes.equipment_code LIKE concat( '310404', '%') wes.equipment_code LIKE concat( '310404', '%')
<if test="code != null and code!='' "> <if test="code != null and code!='' ">
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code}) AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code})
</if> </if>
AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%') AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%')
UNION UNION
SELECT SELECT
wes.id, wes.id,
'3' as type, '3' as type,
(SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi ON wei.id = wesi.equipment_index_id WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level, (SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi ON wei.id = wesi.equipment_index_id WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level,
...@@ -522,22 +497,22 @@ ...@@ -522,22 +497,22 @@
wes.name, wes.name,
IFNULL(wes.realtime_iot_index_name, '暂无信号') AS status, IFNULL(wes.realtime_iot_index_name, '暂无信号') AS status,
CASE CASE
WHEN ( SELECT is_alarm FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key ) = 1 AND wes.realtime_iot_index_value = 'true' THEN 1 WHEN ( SELECT is_alarm FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key ) = 1 AND wes.realtime_iot_index_value = 'true' THEN 1
ELSE 0 ELSE 0
END AS alarm END AS alarm
FROM FROM
wl_equipment_specific wes wl_equipment_specific wes
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE WHERE
wes.equipment_code LIKE concat( '92070', '%' ) wes.equipment_code LIKE concat( '92070', '%' )
<if test="code != null and code!='' "> <if test="code != null and code!='' ">
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code}) AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code})
</if> </if>
AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%') AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%')
UNION UNION
SELECT SELECT
wes.id, wes.id,
'4' as type, '4' as type,
(SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi ON wei.id = wesi.equipment_index_id WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level, (SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi ON wei.id = wesi.equipment_index_id WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level,
...@@ -545,13 +520,13 @@ ...@@ -545,13 +520,13 @@
wes.name, wes.name,
IFNULL(wes.realtime_iot_index_name, '暂无信号') AS status, IFNULL(wes.realtime_iot_index_name, '暂无信号') AS status,
CASE CASE
WHEN ( SELECT is_alarm FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key ) = 1 AND wes.realtime_iot_index_value = 'true' THEN 1 WHEN ( SELECT is_alarm FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key ) = 1 AND wes.realtime_iot_index_value = 'true' THEN 1
ELSE 0 ELSE 0
END AS alarm END AS alarm
FROM FROM
wl_equipment_specific wes wl_equipment_specific wes
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE WHERE
wes.equipment_code LIKE concat( '92371', '%' ) wes.equipment_code LIKE concat( '92371', '%' )
<if test="code != null and code!='' "> <if test="code != null and code!='' ">
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code}) AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code})
......
...@@ -467,7 +467,7 @@ ...@@ -467,7 +467,7 @@
wlesal.equipment_specific_id AS fireEquipmentId, wlesal.equipment_specific_id AS fireEquipmentId,
wles.equipment_detail_id AS equipDetailId, wles.equipment_detail_id AS equipDetailId,
wles.`code` AS fireEquipmentCode, wles.`code` AS fireEquipmentCode,
wlesal.biz_org_name AS bizOrgName,
IF ( IF (
wles.`code` IS NULL, wles.`code` IS NULL,
wlesal.equipment_specific_name, wlesal.equipment_specific_name,
......
...@@ -329,6 +329,7 @@ ...@@ -329,6 +329,7 @@
si.create_date, si.create_date,
si.update_date, si.update_date,
si.index_address, si.index_address,
si.event_address AS eventAddress,
si.gateway_id, si.gateway_id,
si.data_type, si.data_type,
si.equipment_specific_name, si.equipment_specific_name,
......
...@@ -3104,7 +3104,8 @@ ...@@ -3104,7 +3104,8 @@
`f_fire_fighting_system` fem `f_fire_fighting_system` fem
WHERE WHERE
find_in_set(fem.id, wesp.system_id) find_in_set(fem.id, wesp.system_id)
) AS system_name ) AS system_name,
wesp.biz_org_name AS bizOrgName
FROM FROM
wl_equipment_specific wesp wl_equipment_specific wesp
LEFT JOIN wl_equipment_detail ed ON ed.id = wesp.equipment_detail_id LEFT JOIN wl_equipment_detail ed ON ed.id = wesp.equipment_detail_id
......
[ [
{ {
"kafkaTopic": "T_DC_MQ_REALDATA__guanggu", "kafkaTopic": "T_DC_MQ_REALDATA",
"mqTopic": "romaSite/data/transmit", "mqTopic": "romaSite/data/transmit",
"data": { "data": {
"dataType": "body.datatype", "dataType": "body.datatype",
...@@ -14,17 +14,16 @@ ...@@ -14,17 +14,16 @@
} }
}, },
{ {
"kafkaTopic": "T_DC_MQ_ALARM__guanggu", "kafkaTopic": "T_DC_MQ_ALARM",
"mqTopic": "romaSite/data/eventAlarm", "mqTopic": "romaSite/data/eventAlarm",
"data": { "data": {
"timeStamp": "body.warns.time", "timeStamp": "body.warns.time",
"warns": [ "warns": [
{ {
"eventTextL1": "body.warns.systemid",
"pointId": "body.warns.pointId", "pointId": "body.warns.pointId",
"time": "body.warns.type", "time": "body.warns.time",
"deviceId": "deviceId", "deviceId": "body.warns.deviceId",
"eventstatus": "body.warns.content" "eventstatus": "body.warns.eventstatus"
} }
] ]
} }
......
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