فهرست منبع

添加空异常判断

miaolijing 3 سال پیش
والد
کامیت
1700dcfec9

+ 3 - 1
src/main/java/com/persagy/apm/diagnose/indicatorrecord/service/impl/MonitorIndicatorRecordServiceImpl.java

@@ -351,7 +351,9 @@ public class MonitorIndicatorRecordServiceImpl implements IMonitorIndicatorRecor
         }
         //根据报警规则,获取对象id_报警类型及设备监控点位list
         Map<String, List<String>> objIdAlarmItemCodeAndInfoCodes = getObjIdAlarmItemCodeAndInfoCodes(projectAlarmRules);
-
+        if (CollectionUtils.isEmpty(objIdAlarmItemCodeAndInfoCodes) || objIdAlarmItemCodeAndInfoCodes.size() == 0){
+            return;
+        }
         for (Map.Entry<String, List<String>> entry : objIdAlarmItemCodeAndInfoCodes.entrySet()) {
             String objIdAndAlarmItemCode = entry.getKey();
 

+ 3 - 1
src/main/java/com/persagy/apm/diagnose/maintenance/service/impl/ProjectDataRecordServiceImpl.java

@@ -276,7 +276,9 @@ public class ProjectDataRecordServiceImpl implements IProjectDataRecordService {
         }
         //根据报警规则,获取对象id_报警类型及设备监控点位list
         Map<String, List<String>> objIdAlarmItemCodeAndInfoCodes = getObjIdAlarmItemCodeAndInfoCodes(projectAlarmRules);
-
+        if (CollectionUtils.isEmpty(objIdAlarmItemCodeAndInfoCodes) || objIdAlarmItemCodeAndInfoCodes.size() == 0){
+            return;
+        }
         for (Map.Entry<String, List<String>> entry : objIdAlarmItemCodeAndInfoCodes.entrySet()) {
             String objIdAndAlarmItemCode = entry.getKey();