using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.Json.Serialization; using System.Threading.Tasks; namespace NEIntelligentControl2.Models.Alarm { /// /// 故障信息 /// public class FaultInfo { /// /// 故障信息ID /// public long Id { get; set; } /// /// 报警时间 /// public DateTime? FaultTime { get; set; } /// /// 对象类型 /// public int MessageType { get; set; } /// /// 发送缺陷单使用 这个表的FaultSnap.id /// public long SnapID { get; set; } /// /// 确认类型 /// public int ConfirmType { get; set; } /// /// 确认时间 /// public DateTime? ConfirmTime { get; set; } /// /// 确认人 /// public string ConfirmPerson { get; set; } /// /// 场站ID /// public string StationId { get; set; } /// /// ProjectID /// public string ProjectId { get; set; } /// /// LineID /// public string LineId { get; set; } /// /// 风机ID /// public string WindturbineId { get; set; } /// /// 报警对应故障编码 /// public long AlertValue { get; set; } /// /// 报警级别 /// public string Rank { get; set; } /// /// 类型1 /// public string Category1 { get; set; } /// /// 类型2 /// public string Category2 { get; set; } /// /// 类型3 /// public string Category3 { get; set; } /// /// 是否活跃 /// [JsonPropertyName("opened")] public bool IsOpened { get; set; } /// /// 最新更新时间 /// public DateTime? LastUpdateTime { get; set; } /// /// 最新更新人 /// public string LastUpdatePerson { get; set; } /// /// 场站名称 /// public string StationName { get; set; } /// /// ProjectName /// public string ProjectName { get; set; } /// /// LineName /// public string LineName { get; set; } /// /// 风机名称 /// public string WindturbineName { get; set; } /// /// 报警信息 /// public string AlertText { get; set; } /// /// 风机类型ID /// public string ModelId { get; set; } /// /// 报警设备名称 /// public string ObjectName { get; set; } /// /// 报警设备id /// public string ObjectId { get; set; } /// /// 报警设备类型名称 /// public string CategoryName { get; set; } /// /// 解除触发 /// public string MessageTypeString { get; set; } /// /// 是否可以复位 /// public bool IsAllowReset { get; set; } public string LatestUpdateTimeString { get { if (FaultTime != null) { return FaultTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); } return LastUpdateTime?.ToString("yyyy-MM-dd HH:mm:ss"); } } private string objectName; public string ObjectNameString { set => objectName = value; get { if (objectName != null) return objectName; if (Category1 == "SYZ" || Category1 == "STATION" || Category1 == "GF") { return StationName; } return WindturbineName; } } } }