Commit a8f43ef4 authored by xukaiqiang's avatar xukaiqiang

sod值注释

parent 8a2f800e
......@@ -1258,6 +1258,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
equipCommunicationDao.save(list);
}
/**
* 设备告警触发fema的sod值
*/
private void notifyAlarm(FireEquipmentPoint fireEquipmentPoint, AlarmParam param) {
List<FmeaEquipmentPoint> fmeaEquipmentPoints = fmeaEquipmentPointMapper.listByEquipmentPointId(fireEquipmentPoint.getId());
Set<Long> fmeaIds = Sets.newHashSet();
......@@ -1490,6 +1493,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
if (fmea.getEvaluationOid() != null && fmea.getEvaluationSid() != null && fmea.getEvaluationDid() != null) {
List<FmeaEquipmentPoint> equipmentPoints = fmeaEquipmentPointMapper.listFmeaByFmeaId(fmeaId);
List<FmeaPointInputitem> pointInputitems = fmeaPointInputitemMapper.listFmeaByFmeaId(fmeaId);
//根据设备和巡检数据获取高的故障率
Double maxRate = getMaxRate(equipmentPoints, pointInputitems);
if (maxRate != null) {
List<EvaluationModel> oModels = iEvaluationModelDao.findAllByType("O");
......@@ -1510,6 +1514,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
fmeaMapper.updateRpn(fmea);
saveRpnLog(fmea.getRiskSourceId(), fmeaId, rpn, fmea.getRpni());
//影响风险点的sod值
this.notifyRiskSource(fmea.getRiskSourceId(), notifyType, jpushTarget);
}
}
......@@ -1631,11 +1636,16 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
riskSource.setRpni(rpni);
riskSource.setRiskLevelId(newRiskLevel.getId());
riskSourceMapper.updateRpn(riskSource);
//极光推送给手机客户端
jpushRiskSourceMessage("风险点告警", jpushTarget);
//规则告警
notifyRule(riskSourceId, rpn, rpni, oldRiskLevel.getLevel(), newRiskLevel.getLevel(), notifyType);
}
}
/**
* 极光推送
*/
private void jpushRiskSourceMessage(String content, String jpushTarget) {
if (StringUtils.isEmpty(jpushTarget)) {
return;
......@@ -1648,6 +1658,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
appMessagePushService.sendMessage(pushMsgParam);
}
/**
* 规则告警
*/
private void notifyRule(Long id, BigDecimal rpnr, BigDecimal rpni, Integer oldLevel, Integer newLevel, String notifyType) {
int level = oldLevel - newLevel;
String changeType;
......
......@@ -73,12 +73,16 @@ public class RsDataQueue {
String from = fmeaMessage.getNorifyFrom();
Long handId = fmeaMessage.getHandId();
if (from.equals("patrol")) {
//巡检不合格通知
riskSourceService.notifyFmeaFromAbnormal(handId, from);
} else if (from.equals("equipment")) {
//设备告警
riskSourceService.notifyFmeaFromAbnormal(handId, from);
} else if (from.equals("update")) {
//修改通知
riskSourceService.notifyFmeaFromUpdate(handId, from);
} else if (from.equals("delete")) {
//删除通知
riskSourceService.notifyRiskSource(handId, from, null);
}
}
......
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