Commit 00caab43 authored by chenzhao's avatar chenzhao

修改预警生成规则

parent b1f9ed9f
......@@ -162,8 +162,9 @@ public class HealthStatusIndicatorServiceImpl {
Double healthValueRisk = 0.0;
Double healthValueNotice = 0.0;
long healthValueDayCount = 0;
long healthValueHourCount = 0;
long healthValueWarnCount = 0;
long healthValueRiskCount = 0;
long healthValueNoticeCount = 0;
long healthValueMinCount = 0;
......@@ -171,15 +172,15 @@ public class HealthStatusIndicatorServiceImpl {
switch (e.getWarningName()){
case "警告":
healthValueWarn = Double.parseDouble(e.getWarningIf().substring(2));
healthValueMinCount =Long.parseLong(e.getWarningCycle());
healthValueWarnCount =Long.parseLong(e.getWarningCycle());
break;
case "危险":
healthValueRisk = Double.parseDouble(e.getWarningIf().substring(2));
healthValueMinCount =Long.parseLong(e.getWarningCycle());
healthValueRiskCount =Long.parseLong(e.getWarningCycle());
break;
case "注意":
healthValueNotice = Double.parseDouble(e.getWarningIf().substring(2));
healthValueMinCount =Long.parseLong(e.getWarningCycle());
healthValueNoticeCount =Long.parseLong(e.getWarningCycle());
break;
}
......@@ -195,19 +196,22 @@ public class HealthStatusIndicatorServiceImpl {
String level = "";
String content = "";
String num = "";
content = healthValueMinCount*10 + "分钟";
if (noticeNum >= healthValueMinCount ){
if (noticeNum >= healthValueNoticeCount ){
// redisUtils.set(gateWayId+"_"+address+"_health_notice_minute","notice");
level ="注意";
num = ""+healthValueNotice;
}else if (warnNum >= healthValueMinCount ){
content = healthValueNotice*10 + "分钟";
}else if (warnNum >= healthValueWarnCount ){
// redisUtils.set(gateWayId+"_"+address+"_health_warn_minute","warn");
level ="警告";
num = ""+healthValueWarn;
}else if (riskNum >= healthValueMinCount ){
content = healthValueWarnCount*10 + "分钟";
}else if (riskNum >= healthValueRiskCount ){
// redisUtils.set(gateWayId+"_"+address+"_health_risk_minute","risk");
level ="危险";
num = ""+healthValueRisk;
content = healthValueRiskCount*10 + "分钟";
}
//库里若已存在该测点预警 不生成重复的 若新生预警等级高于历史 则生成
LambdaQueryWrapper<IdxBizPvWarningRecord> query = new LambdaQueryWrapper<>();
......@@ -307,24 +311,26 @@ public class HealthStatusIndicatorServiceImpl {
Double healthValueRisk = 0.0;
Double healthValueNotice = 0.0;
long healthValueDayCount = 0;
long healthValueNoticeCount = 0;
long healthValueRiskCount = 0;
long healthValueWarnCount = 0;
long healthValueHourCount = 0;
long healthValueMinCount = 0;
for (IdxBizPvWarningRuleSet e : idxBizPvWarningRuleSets) {
switch (e.getWarningName()){
case "警告":
healthValueWarn = Double.parseDouble(e.getWarningIf().substring(2));
healthValueHourCount =Long.parseLong(e.getWarningCycle());
healthValueWarnCount =Long.parseLong(e.getWarningCycle());
break;
case "危险":
healthValueRisk = Double.parseDouble(e.getWarningIf().substring(2));
healthValueHourCount =Long.parseLong(e.getWarningCycle());
healthValueRiskCount =Long.parseLong(e.getWarningCycle());
break;
case "注意":
healthValueNotice = Double.parseDouble(e.getWarningIf().substring(2));
healthValueHourCount =Long.parseLong(e.getWarningCycle());
healthValueNoticeCount =Long.parseLong(e.getWarningCycle());
break;
}
......@@ -341,21 +347,19 @@ public class HealthStatusIndicatorServiceImpl {
String level = "";
String content = "";
String num = "";
content = healthValueHourCount + "小时";
if (noticeNum >= healthValueHourCount ){
if (noticeNum >= healthValueNoticeCount ){
level ="注意";
num = ""+healthValueNotice;
}else if (warnNum >= healthValueHourCount ){
content = healthValueNoticeCount + "小时";
}else if (warnNum >= healthValueWarnCount ){
level ="警告";
num = ""+healthValueWarn;
}else if (riskNum >= healthValueHourCount ){
content = healthValueWarnCount + "小时";
}else if (riskNum >= healthValueRiskCount ){
level ="危险";
num = ""+healthValueRisk;
content = healthValueRiskCount + "小时";
}
//库里若已存在该测点预警 不生成重复的 若新生预警等级高于历史 则生成
LambdaQueryWrapper<IdxBizPvWarningRecord> query = new LambdaQueryWrapper<>();
......@@ -453,23 +457,23 @@ public class HealthStatusIndicatorServiceImpl {
Double healthValueNotice = 0.0;
long healthValueDayCount = 0;
long healthValueHourCount = 0;
long healthValueMinCount = 0;
long healthValueNoticeCount = 0;
long healthValueRiskCount = 0;
long healthValueWarnCount = 0;
for (IdxBizPvWarningRuleSet e : idxBizPvWarningRuleSets) {
switch (e.getWarningName()){
case "警告":
healthValueWarn = Double.parseDouble(e.getWarningIf().substring(2));
healthValueDayCount =Long.parseLong(e.getWarningCycle());
healthValueWarnCount =Long.parseLong(e.getWarningCycle());
break;
case "危险":
healthValueRisk = Double.parseDouble(e.getWarningIf().substring(2));
healthValueDayCount =Long.parseLong(e.getWarningCycle());
healthValueRiskCount =Long.parseLong(e.getWarningCycle());
break;
case "注意":
healthValueNotice = Double.parseDouble(e.getWarningIf().substring(2));
healthValueDayCount =Long.parseLong(e.getWarningCycle());
healthValueNoticeCount =Long.parseLong(e.getWarningCycle());
break;
}
......@@ -485,19 +489,22 @@ public class HealthStatusIndicatorServiceImpl {
String level = "";
String content = "";
String num = "";
content = healthValueDayCount + "天";
if (noticeNum >= healthValueDayCount ){
if (noticeNum >= healthValueNoticeCount ){
// redisUtils.set(gateWayId+"_"+address+"_health_notice_day","notice");
level ="注意";
num = ""+healthValueNotice;
}else if (warnNum >= healthValueDayCount ){
content = healthValueNoticeCount + "天";
}else if (warnNum >= healthValueWarnCount ){
// redisUtils.set(gateWayId+"_"+address+"_health_warn_day","warn");
level ="警告";
num = ""+healthValueWarn;
}else if (riskNum >= healthValueDayCount ){
content = healthValueWarnCount + "天";
}else if (riskNum >= healthValueRiskCount ){
// redisUtils.set(gateWayId+"_"+address+"_health_risk_day","risk");
level ="危险";
num = ""+healthValueRisk;
content = healthValueRiskCount + "天";
}
//库里若已存在该测点预警 不生成重复的 若新生预警等级高于历史 则生成
LambdaQueryWrapper<IdxBizPvWarningRecord> query = new LambdaQueryWrapper<>();
......@@ -592,8 +599,9 @@ public class HealthStatusIndicatorServiceImpl {
Double healthValueRisk = 0.0;
Double healthValueNotice = 0.0;
long healthValueDayCount = 0;
long healthValueHourCount = 0;
long healthValueWarnCount = 0;
long healthValueRiskCount = 0;
long healthValueNoticeCount = 0;
long healthValueMinCount = 0;
......@@ -601,15 +609,15 @@ public class HealthStatusIndicatorServiceImpl {
switch (e.getWarningName()){
case "警告":
healthValueWarn = Double.parseDouble(e.getWarningIf().substring(2));
healthValueMinCount =Long.parseLong(e.getWarningCycle());
healthValueWarnCount =Long.parseLong(e.getWarningCycle());
break;
case "危险":
healthValueRisk = Double.parseDouble(e.getWarningIf().substring(2));
healthValueMinCount =Long.parseLong(e.getWarningCycle());
healthValueRiskCount =Long.parseLong(e.getWarningCycle());
break;
case "注意":
healthValueNotice = Double.parseDouble(e.getWarningIf().substring(2));
healthValueMinCount =Long.parseLong(e.getWarningCycle());
healthValueNoticeCount =Long.parseLong(e.getWarningCycle());
break;
}
......@@ -628,20 +636,22 @@ public class HealthStatusIndicatorServiceImpl {
String level = "";
String content = "";
String num = "";
content = healthValueMinCount*10 + "分钟";
if (noticeNum >= healthValueMinCount ){
if (noticeNum >= healthValueNoticeCount ){
// redisUtils.set(gateWayId+"_"+address+"_health_notice_day","notice");
level ="注意";
num = ""+healthValueNotice;
content = healthValueNoticeCount*10 + "分钟";
}
else if (warnNum >= healthValueMinCount ){
else if (warnNum >= healthValueWarnCount ){
// redisUtils.set(gateWayId+"_"+address+"_health_warn_day","warn");
level ="警告";
num = ""+healthValueWarn;
}else if (riskNum >= healthValueMinCount ){
content = healthValueWarnCount*10 + "分钟";
}else if (riskNum >= healthValueRiskCount ){
// redisUtils.set(gateWayId+"_"+address+"_health_risk_day","risk");
level ="危险";
num = ""+healthValueRisk;
content = healthValueRiskCount*10 + "分钟";
}
//库里若已存在该测点预警 不生成重复的 若新生预警等级高于历史 则生成
LambdaQueryWrapper<IdxBizFanWarningRecord> query = new LambdaQueryWrapper<>();
......@@ -740,24 +750,24 @@ public class HealthStatusIndicatorServiceImpl {
Double healthValueRisk = 0.0;
Double healthValueNotice = 0.0;
long healthValueDayCount = 0;
long healthValueHourCount = 0;
long healthValueMinCount = 0;
long healthValueNoticeCount = 0;
long healthValueRiskCount = 0;
long healthValueWarnCount = 0;
for (IdxBizFanWarningRuleSet e : idxBizPvWarningRuleSets) {
switch (e.getWarningName()){
case "警告":
healthValueWarn = Double.parseDouble(e.getWarningIf().substring(2));
healthValueHourCount =Long.parseLong(e.getWarningCycle());
healthValueWarnCount =Long.parseLong(e.getWarningCycle());
break;
case "危险":
healthValueRisk = Double.parseDouble(e.getWarningIf().substring(2));
healthValueHourCount =Long.parseLong(e.getWarningCycle());
healthValueRiskCount =Long.parseLong(e.getWarningCycle());
break;
case "注意":
healthValueNotice = Double.parseDouble(e.getWarningIf().substring(2));
healthValueHourCount =Long.parseLong(e.getWarningCycle());
healthValueNoticeCount =Long.parseLong(e.getWarningCycle());
break;
}
......@@ -775,17 +785,19 @@ public class HealthStatusIndicatorServiceImpl {
String level = "";
String content = "";
String num = "";
content = healthValueHourCount + "小时";
if(noticeNum >= healthValueHourCount ){
if (noticeNum >= healthValueNoticeCount ){
level ="注意";
num = ""+healthValueNotice;
}else if (warnNum >= healthValueHourCount ){
content = healthValueNoticeCount + "小时";
}else if (warnNum >= healthValueWarnCount ){
level ="警告";
num = ""+healthValueWarn;
}else if (riskNum >= healthValueHourCount ){
content = healthValueWarnCount + "小时";
}else if (riskNum >= healthValueRiskCount ){
level ="危险";
num = ""+healthValueRisk;
content = healthValueRiskCount + "小时";
}
LambdaQueryWrapper<IdxBizFanWarningRecord> query = new LambdaQueryWrapper<>();
query.eq(IdxBizFanWarningRecord::getAnalysisPointId,idxBizFanHealthIndices.get(0).getAnalysisObjSeq());
......@@ -882,23 +894,25 @@ public class HealthStatusIndicatorServiceImpl {
Double healthValueRisk = 0.0;
Double healthValueNotice = 0.0;
long healthValueDayCount = 0;
long healthValueNoticeCount = 0;
long healthValueWarnCount = 0;
long healthValueRiskCount = 0;
for (IdxBizFanWarningRuleSet e : idxBizPvWarningRuleSets) {
switch (e.getWarningName()){
case "警告":
healthValueWarn = Double.parseDouble(e.getWarningIf().substring(2));
healthValueDayCount =Long.parseLong(e.getWarningCycle());
healthValueWarnCount =Long.parseLong(e.getWarningCycle());
break;
case "危险":
healthValueRisk = Double.parseDouble(e.getWarningIf().substring(2));
healthValueDayCount =Long.parseLong(e.getWarningCycle());
healthValueRiskCount =Long.parseLong(e.getWarningCycle());
break;
case "注意":
healthValueNotice = Double.parseDouble(e.getWarningIf().substring(2));
healthValueDayCount =Long.parseLong(e.getWarningCycle());
healthValueNoticeCount =Long.parseLong(e.getWarningCycle());
break;
}
......@@ -917,20 +931,21 @@ public class HealthStatusIndicatorServiceImpl {
String level = "";
String content = "";
String num = "";
content = healthValueDayCount + "天";
if (noticeNum >= healthValueDayCount ){
if (noticeNum >= healthValueNoticeCount ){
// redisUtils.set(gateWayId+"_"+address+"_health_notice_day","notice");
level ="注意";
num = ""+healthValueNotice;
}
else if (warnNum >= healthValueDayCount ){
// redisUtils.set(gateWayId+"_"+address+"_health_warn_day","warn");
content = healthValueNoticeCount + "天";
}else if (warnNum >= healthValueWarnCount ){
// redisUtils.set(gateWayId+"_"+address+"_health_warn_day","warn");
level ="警告";
num = ""+healthValueWarn;
}else if (riskNum >= healthValueDayCount ){
content = healthValueWarnCount + "天";
}else if (riskNum >= healthValueRiskCount ){
// redisUtils.set(gateWayId+"_"+address+"_health_risk_day","risk");
level ="危险";
num = ""+healthValueRisk;
content = healthValueRiskCount + "天";
}
LambdaQueryWrapper<IdxBizFanWarningRecord> query = new LambdaQueryWrapper<>();
......
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