Просмотр исходного кода

规则引起 String类型数据逻辑更改

zhaoxian 4 лет назад
Родитель
Сommit
213a6602a3

+ 7 - 10
module-alarm/src/main/java/cn/com/ctop/alarm/modules/constant/MatchLogic.java

@@ -68,16 +68,13 @@ public class MatchLogic {
                         return value.equals(thresholds.get(0));
                     } else if ("not_equal".equals(condition)) {
                         return !value.equals(thresholds.get(0));
-                    }
-                    for (String thro : thresholds) {
-                        if ("contain".equals(condition)) {
-                            if (value.contains(thro)) {
-                                return true;
-                            }
-                        } else if ("no_contain".equals(condition)) {
-                            if (!value.contains(thro)) {
-                                return true;
-                            }
+                    } else if ("contain".equals(condition)) {
+                        if (thresholds.toString().contains(value)) {
+                            return true;
+                        }
+                    } else if ("no_contain".equals(condition)) {
+                        if (!thresholds.toString().contains(value)) {
+                            return true;
                         }
                     }
                 } else {