From c3d0d9948f5e91b148bdd80d2b6bfdd0a3150ffe Mon Sep 17 00:00:00 2001 From: zhanghan11 Date: Fri, 27 Sep 2024 09:25:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8A=A5=E8=AD=A6=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/inspur/ipc/utils/IpcUtil.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/utils/IpcUtil.java b/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/utils/IpcUtil.java index 12a8fad..68c4f66 100644 --- a/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/utils/IpcUtil.java +++ b/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/utils/IpcUtil.java @@ -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 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());