Files

152 lines
5.5 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using SqlSugar;
using System;
namespace Model.Entity.Inspection
{
/// <summary>
/// 告警消息(消息告警模块核心表:所有模块的告警统一汇聚于此,支持确认/处理/关闭闭环)
/// </summary>
public class AlertMessageEntity : BaseEntity
{
#region 溯源信息
/// <summary>
/// 告警来源(规则引擎/自动巡检/看板/数采/手动等)
/// </summary>
[SugarColumn(ColumnDescription = "告警来源")]
public AlertSourceEnum Source { get; set; } = AlertSourceEnum.Manual;
/// <summary>
/// 关联告警规则Id(来源为规则引擎时填写,0表示无)
/// </summary>
[SugarColumn(ColumnDescription = "关联告警规则Id")]
public long RuleId { get; set; }
/// <summary>
/// 设备编号
/// </summary>
[SugarColumn(ColumnDescription = "设备编号", Length = 64, IsNullable = true)]
public string DeviceCode { get; set; }
/// <summary>
/// 设备名称
/// </summary>
[SugarColumn(ColumnDescription = "设备名称", Length = 128, IsNullable = true)]
public string DeviceName { get; set; }
/// <summary>
/// 设备类型(如 TemperatureBox,与规则引擎 DeviceType 对齐)
/// </summary>
[SugarColumn(ColumnDescription = "设备类型", Length = 64, IsNullable = true)]
public string DeviceType { get; set; }
/// <summary>
/// 测点/监测指标(如 Temperature、Humidity
/// </summary>
[SugarColumn(ColumnDescription = "测点指标", Length = 64, IsNullable = true)]
public string Metric { get; set; }
/// <summary>
/// 告警类型(超限/离线/通讯故障/巡检异常/自定义)
/// </summary>
[SugarColumn(ColumnDescription = "告警类型")]
public AlertTypeEnum AlertType { get; set; } = AlertTypeEnum.ThresholdExceed;
#endregion
#region 告警内容
/// <summary>
/// 告警级别(信息/警告/紧急,与规则引擎三级一致)
/// </summary>
[SugarColumn(ColumnDescription = "告警级别")]
public AlertLevelEnum AlertLevel { get; set; } = AlertLevelEnum.Info;
/// <summary>
/// 当前值(触发告警时的实际值)
/// </summary>
[SugarColumn(ColumnDescription = "当前值", IsNullable = true)]
public double? CurrentValue { get; set; }
/// <summary>
/// 阈值(规则阈值,可空)
/// </summary>
[SugarColumn(ColumnDescription = "阈值", IsNullable = true)]
public double? ThresholdValue { get; set; }
/// <summary>
/// 告警内容描述
/// </summary>
[SugarColumn(ColumnDescription = "告警内容", Length = 500, IsNullable = true)]
public string Content { get; set; }
/// <summary>
/// 通知模板编码(预留:对接通知模板模块,空表示使用内置模板)
/// </summary>
[SugarColumn(ColumnDescription = "通知模板编码", Length = 64, IsNullable = true)]
public string TemplateCode { get; set; }
#endregion
#region 聚合信息(去重合并窗口内累加)
/// <summary>
/// 触发次数(合并窗口内同设备同测点同类型告警的累计次数)
/// </summary>
[SugarColumn(ColumnDescription = "触发次数")]
public int TriggerCount { get; set; } = 1;
/// <summary>
/// 首次告警时间
/// </summary>
[SugarColumn(ColumnDescription = "首次告警时间")]
public DateTime FirstAlertTime { get; set; }
/// <summary>
/// 最近告警时间
/// </summary>
[SugarColumn(ColumnDescription = "最近告警时间")]
public DateTime LastAlertTime { get; set; }
#endregion
#region 闭环信息
/// <summary>
/// 告警状态(未确认/已确认/已处理/已关闭/已忽略/已转工单)
/// </summary>
[SugarColumn(ColumnDescription = "告警状态")]
public AlertStatusEnum AlertStatus { get; set; } = AlertStatusEnum.Unacknowledged;
/// <summary>
/// 确认人
/// </summary>
[SugarColumn(ColumnDescription = "确认人", Length = 50, IsNullable = true)]
public string AckBy { get; set; }
/// <summary>
/// 确认时间
/// </summary>
[SugarColumn(ColumnDescription = "确认时间", IsNullable = true)]
public DateTime? AckTime { get; set; }
/// <summary>
/// 处理人
/// </summary>
[SugarColumn(ColumnDescription = "处理人", Length = 50, IsNullable = true)]
public string HandleBy { get; set; }
/// <summary>
/// 处理时间
/// </summary>
[SugarColumn(ColumnDescription = "处理时间", IsNullable = true)]
public DateTime? HandleTime { get; set; }
/// <summary>
/// 处理备注
/// </summary>
[SugarColumn(ColumnDescription = "处理备注", Length = 500, IsNullable = true)]
public string HandleRemark { get; set; }
/// <summary>
/// 关联工单Id(预留二期运维工单模块,0表示未转工单)
/// </summary>
[SugarColumn(ColumnDescription = "关联工单Id")]
public long WorkOrderId { get; set; }
#endregion
}
}