|
|
|
@ -258,13 +258,26 @@ public class DashboardAlertDao { |
|
|
|
|
|
|
|
Long alertHistoryId = alertHistoryDTO.getId(); |
|
|
|
|
|
|
|
// 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, ?, ?, ?)"; |
|
|
|
jdbcTemplate.update(insertHandleSql, |
|
|
|
alertHistoryId, |
|
|
|
entity.getDeviceId(), |
|
|
|
now, |
|
|
|
"自動復旧", |
|
|
|
"自動復旧" |
|
|
|
); |
|
|
|
|
|
|
|
// 更新 alert_history
|
|
|
|
String updateAlertHistorySql = "UPDATE alert_history SET handle_status = 4, alert_status = 1 WHERE id = ? and handle_status != 3 "; |
|
|
|
jdbcTemplate.update(updateAlertHistorySql, alertHistoryId); |
|
|
|
String updateAlertHistorySql = "UPDATE alert_history SET handle_status = 4, alert_status = 1, alarm_duration = ? - receive_ts WHERE id = ? and handle_status != 3 "; |
|
|
|
jdbcTemplate.update(updateAlertHistorySql, now, alertHistoryId); |
|
|
|
|
|
|
|
// 更新 alert_handle_history
|
|
|
|
// status值不能是完成status != 3
|
|
|
|
String updateHandleHistorySql = "UPDATE alert_handle_history SET status = 4, alert_status = 1 WHERE alert_history_id = ? and status != 3"; |
|
|
|
jdbcTemplate.update(updateHandleHistorySql, alertHistoryId); |
|
|
|
// String updateHandleHistorySql = "UPDATE alert_handle_history SET status = 4, alert_status = 1 WHERE alert_history_id = ? and status != 3";
|
|
|
|
// jdbcTemplate.update(updateHandleHistorySql, alertHistoryId);
|
|
|
|
} |
|
|
|
} |
|
|
|
|