优化报警判断
This commit is contained in:
parent
40e3a31414
commit
c3d0d9948f
@ -52,9 +52,9 @@ public class IpcUtil {
|
||||
flag = realValue.compareTo(referenceValue1) <= 0;
|
||||
} else if (IpcConstant.EQUAL.equals(referenceCon)) {
|
||||
flag = realValue.compareTo(referenceValue1) == 0;
|
||||
} else if (IpcConstant.WIDTHIN_INTERVAL.equals(referenceCon)) {
|
||||
flag = realValue.compareTo(referenceValue1) >= 0 && realValue.compareTo(referenceValue2) <= 0;
|
||||
} else if (IpcConstant.OUTSIDE_INTERVAL.equals(referenceCon)) {
|
||||
flag = realValue.compareTo(referenceValue1) >= 0 && realValue.compareTo(referenceValue2) <= 0;
|
||||
} else if (IpcConstant.WIDTHIN_INTERVAL.equals(referenceCon)) {
|
||||
flag = realValue.compareTo(referenceValue1) <= 0 || realValue.compareTo(referenceValue2) >= 0;
|
||||
} else {
|
||||
flag = true;
|
||||
@ -69,7 +69,7 @@ public class IpcUtil {
|
||||
List<IpcAlarmRecord> returnList = new ArrayList<>();
|
||||
String isAlarm = "0";
|
||||
for (IpcAlarmRules rulesConfig : rulesConfigList) {
|
||||
if (judgeAlarm(map.get(rulesConfig.getAlarmNameKey()), rulesConfig.getAlertLowerBound(), rulesConfig.getAlertLowerBound(), rulesConfig.getReferenceCon())) {
|
||||
if (judgeAlarm(map.get(rulesConfig.getAlarmNameKey()), rulesConfig.getAlertUpperBound(), rulesConfig.getAlertLowerBound(), rulesConfig.getReferenceCon())) {
|
||||
// 报警数据
|
||||
isAlarm = "1";
|
||||
IpcAlarmRecord ipcAlarmRecord = new IpcAlarmRecord(IdUtils.fastSimpleUUID(), rulesConfig.getEquipId(), rulesConfig.getEquipName(), rulesConfig.getAlarmNameKey(), rulesConfig.getAlarmName(), String.valueOf(map.get(rulesConfig.getAlarmNameKey())), rulesConfig.getAlarmInfoUnit(), rulesConfig.getAlarmLevel(), rulesConfig.getReferenceName(), rulesConfig.getDescription(), rulesConfig.getId());
|
||||
|
Loading…
Reference in New Issue
Block a user