Przeglądaj źródła

告警统计和驾驶舱

王辉 6 dni temu
rodzic
commit
4bacd90537

+ 2 - 0
src/main/java/cn/chinaunicom/omniFlowNetCompute/pojo/AlarmListVO.java

@@ -1,5 +1,6 @@
 package cn.chinaunicom.omniFlowNetCompute.pojo;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 
 import java.time.LocalDateTime;
@@ -11,6 +12,7 @@ public class AlarmListVO {
     private String systemId;            // 系统ID
     private String systemName;          // 系统名称
     private String alarmStatus;         // 未处理/已处理
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime triggerTime;  // 触发时间
     private String category;           // 内容类/阈值类
 }

+ 4 - 4
src/main/resources/mapper/omni/DashboardMapper.xml

@@ -221,7 +221,7 @@
     <select id="getContentConfiguredSystems" resultType="java.lang.String">
         SELECT DISTINCT system_id
         FROM sec_system_metrics
-        WHERE metric_type = 'cus_db_monitor'
+        WHERE metric_code = 'cus_db_monitor'
     </select>
     
     <!-- 1.3 获取已配置内容类指标且7日内有发送数据的系统列表 -->
@@ -231,14 +231,14 @@
         WHERE trigger_time >= DATE_SUB(NOW(), INTERVAL 7 DAY)
           AND system_id IN (SELECT DISTINCT system_id
                             FROM sec_system_metrics
-                            WHERE metric_type = 'cus_db_monitor')
+                            WHERE metric_code = 'cus_db_monitor')
     </select>
     
     <!-- 1.4 获取配置了阈值类指标的系统列表 -->
     <select id="getThresholdConfiguredSystems" resultType="java.lang.String">
         SELECT DISTINCT system_id
         FROM sec_system_metrics
-        WHERE metric_type IN (
+        WHERE metric_code IN (
                               'sec_permission_monitor',
                               'cus_internal_connect_monitor',
                               'cus_ip_abnormal_monitor',
@@ -266,7 +266,7 @@
               WHERE trigger_time >= DATE_SUB(NOW(), INTERVAL 7 DAY)) t
         WHERE system_id IN (SELECT DISTINCT system_id
                             FROM sec_system_metrics
-                            WHERE metric_type IN (
+                            WHERE metric_code IN (
                                                   'sec_permission_monitor',
                                                   'cus_internal_connect_monitor',
                                                   'cus_ip_abnormal_monitor',