Browse Source

Merge branch 'v2.0.0' of http://39.106.8.246:3003/apm/energy-alarm-service into v2.0.0

lixing 3 years ago
parent
commit
cb505a7c8f

+ 1 - 1
src/main/java/com/persagy/apm/alarmservice/project/alarmcondition/service/impl/AlarmConditionServiceImpl.java

@@ -518,7 +518,7 @@ public class AlarmConditionServiceImpl extends ServiceImpl<AlarmConditionMapper,
             return validate(displayFormula.toString(), infoCodes);
         }
 
-        return ResultHelper.failure(ResponseCode.C0134.getCode(), "公式不合法");
+        return ResultHelper.success();
     }
 
     public static boolean isNumeric(String str) {

+ 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);
         }