diff --git a/internal/domain/task/device_threshold_check_task.go b/internal/domain/task/device_threshold_check_task.go index 4e62fb8..a175e28 100644 --- a/internal/domain/task/device_threshold_check_task.go +++ b/internal/domain/task/device_threshold_check_task.go @@ -90,7 +90,7 @@ func (d *DeviceThresholdCheckTask) Execute(ctx context.Context) error { if isExceeded { // 状态一:检查未通过,确保告警开启 - summary := fmt.Sprintf("设备 %d(%s) 不满足阈值条件 (%s %.2f)", d.params.DeviceID, d.params.SensorType, d.params.Operator, d.params.Thresholds) + summary := fmt.Sprintf("设备 %d(%s) 触发阈值告警条件 (%s %.2f)", d.params.DeviceID, d.params.SensorType, d.params.Operator, d.params.Thresholds) details := fmt.Sprintf("当前检测值: %.2f", currentValue) logger.Infof("任务 %v: %s。%s", d.taskLog.TaskID, summary, details) @@ -111,7 +111,7 @@ func (d *DeviceThresholdCheckTask) Execute(ctx context.Context) error { } else { // 状态二:检查已通过,确保告警关闭 resolveMethod := "系统自动解决:阈值恢复正常" - logger.Infof("任务 %v: 设备 %d 的 %s 阈值已恢复正常,正在尝试关闭告警。", d.taskLog.TaskID, d.params.DeviceID, d.params.SensorType) + logger.Infof("任务 %v: 设备 %d 的 %s 已恢复正常,正在尝试关闭告警。", d.taskLog.TaskID, d.params.DeviceID, d.params.SensorType) if err := d.alarmService.CloseAlarm(taskCtx, models.AlarmSourceTypeDevice, d.params.DeviceID, alarmCode, resolveMethod, nil); err != nil { logger.Errorf("任务 %v: 关闭告警失败: %v", d.taskLog.TaskID, err)