FaultInfo.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Text.Json.Serialization;
  6. using System.Threading.Tasks;
  7. namespace NEIntelligentControl2.Models.Alarm
  8. {
  9. /// <summary>
  10. /// 故障信息
  11. /// </summary>
  12. public class FaultInfo
  13. {
  14. /// <summary>
  15. /// 故障信息ID
  16. /// </summary>
  17. public long Id { get; set; }
  18. /// <summary>
  19. /// 报警时间
  20. /// </summary>
  21. public DateTime? FaultTime { get; set; }
  22. /// <summary>
  23. /// 对象类型
  24. /// </summary>
  25. public int MessageType { get; set; }
  26. /// <summary>
  27. /// 发送缺陷单使用 这个表的FaultSnap.id
  28. /// </summary>
  29. public long SnapID { get; set; }
  30. /// <summary>
  31. /// 确认类型
  32. /// </summary>
  33. public int ConfirmType { get; set; }
  34. /// <summary>
  35. /// 确认时间
  36. /// </summary>
  37. public DateTime? ConfirmTime { get; set; }
  38. /// <summary>
  39. /// 确认人
  40. /// </summary>
  41. public string ConfirmPerson { get; set; }
  42. /// <summary>
  43. /// 场站ID
  44. /// </summary>
  45. public string StationId { get; set; }
  46. /// <summary>
  47. /// ProjectID
  48. /// </summary>
  49. public string ProjectId { get; set; }
  50. /// <summary>
  51. /// LineID
  52. /// </summary>
  53. public string LineId { get; set; }
  54. /// <summary>
  55. /// 风机ID
  56. /// </summary>
  57. public string WindturbineId { get; set; }
  58. /// <summary>
  59. /// 报警对应故障编码
  60. /// </summary>
  61. public long AlertValue { get; set; }
  62. /// <summary>
  63. /// 报警级别
  64. /// </summary>
  65. public string Rank { get; set; }
  66. /// <summary>
  67. /// 类型1
  68. /// </summary>
  69. public string Category1 { get; set; }
  70. /// <summary>
  71. /// 类型2
  72. /// </summary>
  73. public string Category2 { get; set; }
  74. /// <summary>
  75. /// 类型3
  76. /// </summary>
  77. public string Category3 { get; set; }
  78. /// <summary>
  79. /// 是否活跃
  80. /// </summary>
  81. [JsonPropertyName("opened")]
  82. public bool IsOpened { get; set; }
  83. /// <summary>
  84. /// 最新更新时间
  85. /// </summary>
  86. public DateTime? LastUpdateTime { get; set; }
  87. /// <summary>
  88. /// 最新更新人
  89. /// </summary>
  90. public string LastUpdatePerson { get; set; }
  91. /// <summary>
  92. /// 场站名称
  93. /// </summary>
  94. public string StationName { get; set; }
  95. /// <summary>
  96. /// ProjectName
  97. /// </summary>
  98. public string ProjectName { get; set; }
  99. /// <summary>
  100. /// LineName
  101. /// </summary>
  102. public string LineName { get; set; }
  103. /// <summary>
  104. /// 风机名称
  105. /// </summary>
  106. public string WindturbineName { get; set; }
  107. /// <summary>
  108. /// 报警信息
  109. /// </summary>
  110. public string AlertText { get; set; }
  111. /// <summary>
  112. /// 风机类型ID
  113. /// </summary>
  114. public string ModelId { get; set; }
  115. /// <summary>
  116. /// 报警设备名称
  117. /// </summary>
  118. public string ObjectName { get; set; }
  119. /// <summary>
  120. /// 报警设备id
  121. /// </summary>
  122. public string ObjectId { get; set; }
  123. /// <summary>
  124. /// 报警设备类型名称
  125. /// </summary>
  126. public string CategoryName { get; set; }
  127. /// <summary>
  128. /// 解除触发
  129. /// </summary>
  130. public string MessageTypeString { get; set; }
  131. /// <summary>
  132. /// 是否可以复位
  133. /// </summary>
  134. public bool IsAllowReset { get; set; }
  135. public string LatestUpdateTimeString
  136. {
  137. get
  138. {
  139. if (FaultTime != null)
  140. {
  141. return FaultTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  142. }
  143. return LastUpdateTime?.ToString("yyyy-MM-dd HH:mm:ss");
  144. }
  145. }
  146. private string objectName;
  147. public string ObjectNameString
  148. {
  149. set => objectName = value;
  150. get
  151. {
  152. if (objectName != null) return objectName;
  153. if (Category1 == "SYZ" || Category1 == "STATION" || Category1 == "GF")
  154. {
  155. return StationName;
  156. }
  157. return WindturbineName;
  158. }
  159. }
  160. }
  161. }