|
|
@ -229,6 +229,10 @@ public class AlarmRecordsServiceImpl implements IAlarmRecordsService { |
|
|
|
AlarmRecords alarmRecords = new AlarmRecords(); |
|
|
|
AlarmRecords alarmRecords = new AlarmRecords(); |
|
|
|
BigDecimal curValue = collectionParamsManage.getCurValue(); |
|
|
|
BigDecimal curValue = collectionParamsManage.getCurValue(); |
|
|
|
Date curTime = collectionParamsManage.getCurTime(); |
|
|
|
Date curTime = collectionParamsManage.getCurTime(); |
|
|
|
|
|
|
|
// 判断时间是否是今天
|
|
|
|
|
|
|
|
if (!DateUtils.isSameDay(curTime, new Date())) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
// 阈值
|
|
|
|
// 阈值
|
|
|
|
String threshold1 = alarmRule.getThreshold1(); |
|
|
|
String threshold1 = alarmRule.getThreshold1(); |
|
|
|
String threshold2 = alarmRule.getThreshold2(); |
|
|
|
String threshold2 = alarmRule.getThreshold2(); |
|
|
@ -264,6 +268,9 @@ public class AlarmRecordsServiceImpl implements IAlarmRecordsService { |
|
|
|
if (compare) { |
|
|
|
if (compare) { |
|
|
|
handleAlarmRecord(alarmRule, alarmCode, curValue, threshold1, alarmRecords, collectionParamsManage, "#{setValue}", alarmRule.getCondition1() + threshold1); |
|
|
|
handleAlarmRecord(alarmRule, alarmCode, curValue, threshold1, alarmRecords, collectionParamsManage, "#{setValue}", alarmRule.getCondition1() + threshold1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (alarmRule.getCondition2() == null || threshold2.isEmpty()) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
boolean compare1 = BigDecimalUtils.compare(alarmRule.getCondition2(), curValue, new BigDecimal(threshold2)); |
|
|
|
boolean compare1 = BigDecimalUtils.compare(alarmRule.getCondition2(), curValue, new BigDecimal(threshold2)); |
|
|
|
if (compare1) { |
|
|
|
if (compare1) { |
|
|
|
handleAlarmRecord(alarmRule, alarmCode, curValue, threshold2, alarmRecords, collectionParamsManage, "#{setValue}", alarmRule.getCondition2() + threshold2); |
|
|
|
handleAlarmRecord(alarmRule, alarmCode, curValue, threshold2, alarmRecords, collectionParamsManage, "#{setValue}", alarmRule.getCondition2() + threshold2); |
|
|
|