Browse Source

告警、自动恢复、重复告警插入处理历史表,自动区分

master
review512jwy@163.com 2 weeks ago
parent
commit
75ffcf3d74
  1. 12
      src/main/java/com/techsor/datacenter/sender/dao/DashboardAlertDao.java

12
src/main/java/com/techsor/datacenter/sender/dao/DashboardAlertDao.java

@ -170,8 +170,8 @@ public class DashboardAlertDao {
if (!latestList.isEmpty() && latestList.get(0).getMergeAlarmFlag() == 1) {
AlertHistoryDTO latest = latestList.get(0);
String insertHandleSql = "INSERT INTO alert_handle_history (" +
"alert_history_id, device_id, alert_status, handle_at, detail_title, detail_content" +
") VALUES (?, ?, 0, ?, ?, ?)";
"alert_history_id, device_id, alert_status, handle_at, detail_title, detail_content, data_type" +
") VALUES (?, ?, 0, ?, ?, ?, 3)";
jdbcTemplate.update(insertHandleSql,
latest.getId(),
deviceId,
@ -228,8 +228,8 @@ public class DashboardAlertDao {
// 20260702需求,告警发生的时候,这里也要记录一条告警发报记录
String insertHandleSql = "INSERT INTO alert_handle_history (" +
"alert_history_id, device_id, handle_at" +
") VALUES (?, ?, ?)";
"alert_history_id, device_id, handle_at, data_type" +
") VALUES (?, ?, ?, 2)";
jdbcTemplate.update(insertHandleSql,
alertHistoryId,
entity.getDeviceId(),
@ -274,8 +274,8 @@ public class DashboardAlertDao {
// 20260630需求,自动恢复的要插入一条到处理历史
long now = System.currentTimeMillis();
String insertHandleSql = "INSERT INTO alert_handle_history (" +
"alert_history_id, device_id, alert_status, status, handle_at, detail_title, detail_content" +
") VALUES (?, ?, 1, 4, ?, ?, ?)";
"alert_history_id, device_id, alert_status, status, handle_at, detail_title, detail_content, data_type" +
") VALUES (?, ?, 1, 4, ?, ?, ?, 1)";
jdbcTemplate.update(insertHandleSql,
alertHistoryId,
entity.getDeviceId(),

Loading…
Cancel
Save