Commit 1fdcbd78 authored by maoying's avatar maoying

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

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