Commit db3cdd14 authored by suhuiguang's avatar suhuiguang

Merge branch 'develop' into feture-xkq

parents 1d4b419d 1a1a91d2
...@@ -1258,6 +1258,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -1258,6 +1258,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
equipCommunicationDao.save(list); equipCommunicationDao.save(list);
} }
/**
* 设备告警触发fema的sod值
*/
private void notifyAlarm(FireEquipmentPoint fireEquipmentPoint, AlarmParam param) { private void notifyAlarm(FireEquipmentPoint fireEquipmentPoint, AlarmParam param) {
List<FmeaEquipmentPoint> fmeaEquipmentPoints = fmeaEquipmentPointMapper.listByEquipmentPointId(fireEquipmentPoint.getId()); List<FmeaEquipmentPoint> fmeaEquipmentPoints = fmeaEquipmentPointMapper.listByEquipmentPointId(fireEquipmentPoint.getId());
Set<Long> fmeaIds = Sets.newHashSet(); Set<Long> fmeaIds = Sets.newHashSet();
...@@ -1490,6 +1493,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -1490,6 +1493,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
if (fmea.getEvaluationOid() != null && fmea.getEvaluationSid() != null && fmea.getEvaluationDid() != null) { if (fmea.getEvaluationOid() != null && fmea.getEvaluationSid() != null && fmea.getEvaluationDid() != null) {
List<FmeaEquipmentPoint> equipmentPoints = fmeaEquipmentPointMapper.listFmeaByFmeaId(fmeaId); List<FmeaEquipmentPoint> equipmentPoints = fmeaEquipmentPointMapper.listFmeaByFmeaId(fmeaId);
List<FmeaPointInputitem> pointInputitems = fmeaPointInputitemMapper.listFmeaByFmeaId(fmeaId); List<FmeaPointInputitem> pointInputitems = fmeaPointInputitemMapper.listFmeaByFmeaId(fmeaId);
//根据设备和巡检数据获取高的故障率
Double maxRate = getMaxRate(equipmentPoints, pointInputitems); Double maxRate = getMaxRate(equipmentPoints, pointInputitems);
if (maxRate != null) { if (maxRate != null) {
List<EvaluationModel> oModels = iEvaluationModelDao.findAllByType("O"); List<EvaluationModel> oModels = iEvaluationModelDao.findAllByType("O");
...@@ -1510,6 +1514,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -1510,6 +1514,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
} }
fmeaMapper.updateRpn(fmea); fmeaMapper.updateRpn(fmea);
saveRpnLog(fmea.getRiskSourceId(), fmeaId, rpn, fmea.getRpni()); saveRpnLog(fmea.getRiskSourceId(), fmeaId, rpn, fmea.getRpni());
//影响风险点的sod值
this.notifyRiskSource(fmea.getRiskSourceId(), notifyType, jpushTarget); this.notifyRiskSource(fmea.getRiskSourceId(), notifyType, jpushTarget);
} }
} }
...@@ -1631,11 +1636,16 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -1631,11 +1636,16 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
riskSource.setRpni(rpni); riskSource.setRpni(rpni);
riskSource.setRiskLevelId(newRiskLevel.getId()); riskSource.setRiskLevelId(newRiskLevel.getId());
riskSourceMapper.updateRpn(riskSource); riskSourceMapper.updateRpn(riskSource);
//极光推送给手机客户端
jpushRiskSourceMessage("风险点告警", jpushTarget); jpushRiskSourceMessage("风险点告警", jpushTarget);
//规则告警
notifyRule(riskSourceId, rpn, rpni, oldRiskLevel.getLevel(), newRiskLevel.getLevel(), notifyType); notifyRule(riskSourceId, rpn, rpni, oldRiskLevel.getLevel(), newRiskLevel.getLevel(), notifyType);
} }
} }
/**
* 极光推送
*/
private void jpushRiskSourceMessage(String content, String jpushTarget) { private void jpushRiskSourceMessage(String content, String jpushTarget) {
if (StringUtils.isEmpty(jpushTarget)) { if (StringUtils.isEmpty(jpushTarget)) {
return; return;
...@@ -1648,6 +1658,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -1648,6 +1658,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
appMessagePushService.sendMessage(pushMsgParam); appMessagePushService.sendMessage(pushMsgParam);
} }
/**
* 规则告警
*/
private void notifyRule(Long id, BigDecimal rpnr, BigDecimal rpni, Integer oldLevel, Integer newLevel, String notifyType) { private void notifyRule(Long id, BigDecimal rpnr, BigDecimal rpni, Integer oldLevel, Integer newLevel, String notifyType) {
int level = oldLevel - newLevel; int level = oldLevel - newLevel;
String changeType; String changeType;
......
...@@ -73,12 +73,16 @@ public class RsDataQueue { ...@@ -73,12 +73,16 @@ public class RsDataQueue {
String from = fmeaMessage.getNorifyFrom(); String from = fmeaMessage.getNorifyFrom();
Long handId = fmeaMessage.getHandId(); Long handId = fmeaMessage.getHandId();
if (from.equals("patrol")) { if (from.equals("patrol")) {
//巡检不合格通知
riskSourceService.notifyFmeaFromAbnormal(handId, from); riskSourceService.notifyFmeaFromAbnormal(handId, from);
} else if (from.equals("equipment")) { } else if (from.equals("equipment")) {
//设备告警
riskSourceService.notifyFmeaFromAbnormal(handId, from); riskSourceService.notifyFmeaFromAbnormal(handId, from);
} else if (from.equals("update")) { } else if (from.equals("update")) {
//修改通知
riskSourceService.notifyFmeaFromUpdate(handId, from); riskSourceService.notifyFmeaFromUpdate(handId, from);
} else if (from.equals("delete")) { } else if (from.equals("delete")) {
//删除通知
riskSourceService.notifyRiskSource(handId, from, null); riskSourceService.notifyRiskSource(handId, from, null);
} }
} }
......
...@@ -119,7 +119,8 @@ ...@@ -119,7 +119,8 @@
null data_level, null data_level,
fe.`code` data_code, fe.`code` data_code,
(select GROUP_CONCAT(cast(eq.`name` as char(50)) SEPARATOR ',') from f_equipment_fire_equipment fre join f_equipment eq on fre.equipment_id = eq.id where fre.fire_equipment_id = fe.id) protect_obj_name, (select GROUP_CONCAT(cast(eq.`name` as char(50)) SEPARATOR ',') from f_equipment_fire_equipment fre join f_equipment eq on fre.equipment_id = eq.id where fre.fire_equipment_id = fe.id) protect_obj_name,
null route_name null route_name,
0 frequency
from f_fire_equipment fe from f_fire_equipment fe
where where
<choose> <choose>
...@@ -249,7 +250,8 @@ ...@@ -249,7 +250,8 @@
null data_level, null data_level,
e.`code` data_code, e.`code` data_code,
null protect_obj_name, null protect_obj_name,
null route_name null route_name,
0 frequency
from f_equipment e from f_equipment e
where where
<choose> <choose>
...@@ -346,7 +348,8 @@ ...@@ -346,7 +348,8 @@
null data_level, null data_level,
fc.car_num data_code, fc.car_num data_code,
null protect_obj_name, null protect_obj_name,
null route_name null route_name,
0 frequency
from f_fire_car fc from f_fire_car fc
where where
...@@ -445,7 +448,8 @@ ...@@ -445,7 +448,8 @@
null data_level, null data_level,
fs.`code` data_code, fs.`code` data_code,
null protect_obj_name, null protect_obj_name,
null route_name null route_name ,
0 frequency
from f_fire_station fs from f_fire_station fs
where where
<choose> <choose>
...@@ -544,7 +548,8 @@ ...@@ -544,7 +548,8 @@
null data_level, null data_level,
wr.`code` data_code, wr.`code` data_code,
null protect_obj_name, null protect_obj_name,
null route_name null route_name ,
0 frequency
from f_water_resource wr from f_water_resource wr
where where
<choose> <choose>
......
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