|
@@ -247,10 +247,18 @@ public class MsgAlarmServiceImpl extends ServiceImpl<MsgAlarmMapper, MsgAlarm> i
|
|
|
|
|
|
// 创建返回结果的 map
|
|
|
Map<String, Integer> results = new HashMap<>();
|
|
|
- results.put("highAlarmCount", statistics.get("highAlarmCount"));
|
|
|
- results.put("puAlarmCount", statistics.get("puAlarmCount"));
|
|
|
- results.put("highUnresolvedCount", statistics.get("highUnresolvedCount"));
|
|
|
- results.put("puUnresolvedCount", statistics.get("puUnresolvedCount"));
|
|
|
+ if (statistics != null) {
|
|
|
+ results.put("highAlarmCount", statistics.get("highAlarmCount"));
|
|
|
+ results.put("puAlarmCount", statistics.get("puAlarmCount"));
|
|
|
+ results.put("highUnresolvedCount", statistics.get("highUnresolvedCount"));
|
|
|
+ results.put("puUnresolvedCount", statistics.get("puUnresolvedCount"));
|
|
|
+ } else {
|
|
|
+ // 处理statistics为空的情况,设置默认值或空值
|
|
|
+ results.put("highAlarmCount", 0);
|
|
|
+ results.put("puAlarmCount", 0);
|
|
|
+ results.put("highUnresolvedCount", 0);
|
|
|
+ results.put("puUnresolvedCount", 0);
|
|
|
+ }
|
|
|
|
|
|
return AjaxResult.success(results);
|
|
|
}
|