Browse Source

修改项目报警模糊查询问题

xujiaheng 3 years ago
parent
commit
df02159e79

+ 6 - 2
src/main/java/com/persagy/apm/alarmservice/project/alarmrule/controller/ProjectAlarmRuleController.java

@@ -146,9 +146,11 @@ public class ProjectAlarmRuleController {
                             && projectAlarmRuleObjRel.getObjName().contains(equipName)
                             && projectAlarmRuleObjRel.getOpen() == 1) {
                         projectAlarmRuleListItemVO.setRelListItemList(query);
-                        result.add(projectAlarmRuleListItemVO);
+
                     }
                 }
+                if (null != projectAlarmRuleListItemVO.getRelListItemList())
+                    result.add(projectAlarmRuleListItemVO);
             } else {
                 projectAlarmRuleListItemVO.setRelListItemList(query);
                 result.add(projectAlarmRuleListItemVO);
@@ -171,7 +173,9 @@ public class ProjectAlarmRuleController {
         for (ProjectAlarmRule projectAlarmRule : projectAlarmRuleList) {
             ProjectAlarmRuleWithObjsAndInfoCodes projectAlarmRuleWithObjsAndInfoCodes =
                     convert2ProjectAlarmRuleWithObjsAndInfoCodes(projectAlarmRule);
-            if (projectAlarmRuleWithObjsAndInfoCodes == null) {continue;}
+            if (projectAlarmRuleWithObjsAndInfoCodes == null) {
+                continue;
+            }
 
             resultList.add(projectAlarmRuleWithObjsAndInfoCodes);
         }