Commit 1fdcbd78 authored by maoying's avatar maoying

修改三维报警列表及设备状态推送

parent f2771e3f
...@@ -139,30 +139,27 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService { ...@@ -139,30 +139,27 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
log.info("========data==========: " + JSON.toJSONString(data)); log.info("========data==========: " + JSON.toJSONString(data));
EquipmentSpecificIndexVo equipmentSpecificIndex = JSONObject.parseObject(topicEntity.getMessage(), EquipmentSpecificIndexVo.class); EquipmentSpecificIndexVo equipmentSpecificIndex = JSONObject.parseObject(topicEntity.getMessage(), EquipmentSpecificIndexVo.class);
long eqSpecId = equipmentSpecificIndex.getEquipmentSpecificId(); long eqSpecId = equipmentSpecificIndex.getEquipmentSpecificId();
String nameKey = equipmentSpecificIndex.getNameKey();
// if(topicEntity.getSimulationDate().equals("false") && !indexStateIsChange(equipmentSpecificIndex)){
// log.info("指标值没有发生变化: " + equipmentSpecificIndex.getIotCode()+"-"+equipmentSpecificIndex.getNameKey()+":"+equipmentSpecificIndex.getValue());
// return;
// }
EquipmentSpecificForRiskVo equipmentSpecific = equipmentSpecificMapper.getOneById(eqSpecId); EquipmentSpecificForRiskVo equipmentSpecific = equipmentSpecificMapper.getOneById(eqSpecId);
// 三维屏指标状态推送 log.info("========equipmentSpecific==========: " + JSON.toJSONString(equipmentSpecific));
if(ObjectUtils.isEmpty(equipmentSpecific)){
return;
}
String specificIndexType = equipmentSpecificIndex.getType(); String specificIndexType = equipmentSpecificIndex.getType();
String typeCode = equipmentSpecificIndex.getTypeCode(); String typeCode = equipmentSpecificIndex.getTypeCode();
if (nameKey !=null && nameKeys.contains(nameKey)) { if(topicEntity.getSimulationDate().equals("false") && nameKeys.contains(typeCode) && indexStateIsChange(equipmentSpecificIndex)){
if (equipmentSpecific != null) { log.info("指标值没有发生变化: " + equipmentSpecificIndex.getIotCode()+"-"+equipmentSpecificIndex.getNameKey()+":"+equipmentSpecificIndex.getValue());
// 三维屏指标状态推送
equipmentSpecificIndex.setId(equipmentSpecific.getId()); equipmentSpecificIndex.setId(equipmentSpecific.getId());
equipmentSpecificIndex.setName(equipmentSpecific.getName()); equipmentSpecificIndex.setName(equipmentSpecific.getName());
equipmentSpecificIndex.setCode(equipmentSpecific.getCode()); equipmentSpecificIndex.setCode(equipmentSpecific.getCode());
} equipmentSpecificIndex.setType("equip");
equipmentSpecificIndex.setType("equip"); String title = String.format("/%s/%s", serviceName, "data/refresh/indexStatus");
String title = String.format("/%s/%s", serviceName, "data/refresh/indexStatus"); webMqttComponent.publish(title, JSON.toJSONString(equipmentSpecificIndex));
webMqttComponent.publish(title, JSON.toJSONString(equipmentSpecificIndex));
} }
Equipment equipment = topicEntity.getEquipment()==null?impAndFireEquipMapper.queryImpEqumtByFireEquipmt(eqSpecId):topicEntity.getEquipment(); Equipment equipment = topicEntity.getEquipment()==null?impAndFireEquipMapper.queryImpEqumtByFireEquipmt(eqSpecId):topicEntity.getEquipment();
Toke toke = remoteSecurityService.getServerToken(); Toke toke = remoteSecurityService.getServerToken();
AlarmParam deviceData = new AlarmParam(); AlarmParam deviceData = new AlarmParam();
log.info("========equipmentSpecific==========: " + JSON.toJSONString(equipmentSpecific));
deviceData.setMonitor(equipment != null ? equipment.getName() : ""); deviceData.setMonitor(equipment != null ? equipment.getName() : "");
deviceData.setId(String.valueOf(equipmentSpecific.getId())); deviceData.setId(String.valueOf(equipmentSpecific.getId()));
deviceData.setCode(equipmentSpecific.getCode()); deviceData.setCode(equipmentSpecific.getCode());
......
...@@ -11,6 +11,11 @@ public class ContingencyPlanParamVo { ...@@ -11,6 +11,11 @@ public class ContingencyPlanParamVo {
public String riskType; public String riskType;
public String userName; public String userName;
public String userId; public String userId;
/**
* 触发方式automatic(自动)manual(手动)
*/
public String triggerMode = "manual";
public String getPlanId() { public String getPlanId() {
return planId; return planId;
} }
......
...@@ -496,26 +496,36 @@ ...@@ -496,26 +496,36 @@
'(', '(',
ala.equipment_specific_name, ala.equipment_specific_name,
')', ')',
IF IF (
( (
( ISNULL( ws.full_name ) AND ISNULL( sd.description ) ), ISNULL(ws.full_name)
'', AND ISNULL(sd.description)
CONCAT( '【', IFNULL( ws.full_name, '' ), ' ', IFNULL( sd.description, '' ), '】' ) ),
'',
CONCAT(
'【',
IFNULL(ws.full_name, ''),
' ',
IFNULL(sd.description, ''),
'】'
) )
)
) AS label, ) AS label,
ala.create_date AS changeDate ala.update_date AS changeDate
FROM FROM
wl_equipment_specific_alarm_log AS ala wl_equipment_specific_alarm AS ala
LEFT JOIN wl_equipment_specific AS spe ON ala.equipment_specific_id = spe.id LEFT JOIN wl_equipment_specific AS spe ON ala.equipment_specific_id = spe.id
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = spe.id LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = spe.id
LEFT JOIN wl_warehouse_structure ws ON ws.id = sd.warehouse_structure_id LEFT JOIN wl_warehouse_structure ws ON ws.id = sd.warehouse_structure_id
WHERE WHERE
ala.equipment_specific_index_value = 'true' ala.`status` = 1
AND ala.org_code = 10 AND (
AND ( ala.type = 'FIREALARM' OR ala.type = 'BREAKDOWN' ) ala.type = 'FIREALARM'
OR ala.type = 'BREAKDOWN'
)
ORDER BY ORDER BY
ala.create_date DESC ala.update_date DESC
LIMIT 0,5 LIMIT 0,5
</select> </select>
<select id="getEquipStatusTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo"> <select id="getEquipStatusTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo">
......
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