AdoS8Dtos.cs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. namespace Admin.NET.Plugin.AiDOP.Dto.S8;
  2. public class AdoS8ExceptionQueryDto
  3. {
  4. public long TenantId { get; set; } = 1;
  5. public long FactoryId { get; set; } = 1;
  6. public string? Keyword { get; set; }
  7. public string? Status { get; set; }
  8. public string? StatusBucket { get; set; }
  9. public string? Severity { get; set; }
  10. public string? SceneCode { get; set; }
  11. /// <summary>模块码过滤(S1-S7),用于监控页下钻</summary>
  12. public string? ModuleCode { get; set; }
  13. public long? DeptId { get; set; }
  14. public bool? TimeoutFlag { get; set; }
  15. public string? ProcessNodeCode { get; set; }
  16. public string? RelatedObjectCode { get; set; }
  17. public DateTime? BeginTime { get; set; }
  18. public DateTime? EndTime { get; set; }
  19. /// <summary>是否包含 exception_type_code 为 NULL 的未分类历史异常;默认 false(隐藏)。</summary>
  20. public bool? IncludeUnclassified { get; set; }
  21. /// <summary>恢复状态筛选:RECOVERED / ACTIVE / 空=不限。</summary>
  22. public string? RecoveredStatus { get; set; }
  23. /// <summary>规则类型筛选:OUT_OF_RANGE / TIMEOUT / SHORTAGE / 空=不限;通过 source_rule_code join watch_rule.rule_type。</summary>
  24. public string? RuleType { get; set; }
  25. /// <summary>S8-DASHBOARD-DATA-ALIGN-S1S7-1:仅返回 module_code IN S1-S7 的异常;看板明细表传 true 与 KPI 口径对齐。
  26. /// 默认 false 以保证异常列表页(/aidop/s8/exceptions)行为不变。</summary>
  27. public bool? OnlyS1S7Modules { get; set; }
  28. public int Page { get; set; } = 1;
  29. public int PageSize { get; set; } = 20;
  30. }
  31. public class AdoS8ExceptionListItemDto
  32. {
  33. public long Id { get; set; }
  34. public long FactoryId { get; set; }
  35. public string ExceptionCode { get; set; } = string.Empty;
  36. public string Title { get; set; } = string.Empty;
  37. public string Status { get; set; } = string.Empty;
  38. public string? StatusLabel { get; set; }
  39. public string Severity { get; set; } = string.Empty;
  40. public string? SeverityLabel { get; set; }
  41. public decimal PriorityScore { get; set; }
  42. public string PriorityLevel { get; set; } = string.Empty;
  43. public string SceneCode { get; set; } = string.Empty;
  44. public string? SceneName { get; set; }
  45. public long ResponsibleDeptId { get; set; }
  46. public string? ResponsibleDeptName { get; set; }
  47. public long? AssigneeId { get; set; }
  48. public string? AssigneeName { get; set; }
  49. public DateTime? SlaDeadline { get; set; }
  50. public bool TimeoutFlag { get; set; }
  51. public DateTime CreatedAt { get; set; }
  52. public DateTime? ClosedAt { get; set; }
  53. public string? ExceptionTypeCode { get; set; }
  54. public DateTime? RecoveredAt { get; set; }
  55. public string? SourceRuleCode { get; set; }
  56. public string? SourceObjectType { get; set; }
  57. public string? SourceObjectId { get; set; }
  58. public string? DedupKey { get; set; }
  59. public DateTime? LastDetectedAt { get; set; }
  60. public string? RuleType { get; set; }
  61. }
  62. public class AdoS8ExceptionDetailDto : AdoS8ExceptionListItemDto
  63. {
  64. public string? Description { get; set; }
  65. public string SourceType { get; set; } = string.Empty;
  66. public long OccurrenceDeptId { get; set; }
  67. public string? OccurrenceDeptName { get; set; }
  68. public long? ResponsibleGroupId { get; set; }
  69. public long? ReporterId { get; set; }
  70. public string? ReporterName { get; set; }
  71. public DateTime? AssignedAt { get; set; }
  72. public DateTime? UpdatedAt { get; set; }
  73. public long? ActiveFlowInstanceId { get; set; }
  74. public string? ActiveFlowBizType { get; set; }
  75. public long? VerifierId { get; set; }
  76. public string? VerifierName { get; set; }
  77. public DateTime? VerificationAssignedAt { get; set; }
  78. public DateTime? VerifiedAt { get; set; }
  79. public string? VerificationResult { get; set; }
  80. public string? VerificationRemark { get; set; }
  81. public long? SourceRuleId { get; set; }
  82. public string? RelatedObjectCode { get; set; }
  83. }
  84. public class AdoS8ManualReportCreateDto
  85. {
  86. public long TenantId { get; set; } = 1;
  87. public long FactoryId { get; set; } = 1;
  88. public string Title { get; set; } = string.Empty;
  89. public string? Description { get; set; }
  90. public string SceneCode { get; set; } = string.Empty;
  91. public string Severity { get; set; } = "MEDIUM";
  92. public long OccurrenceDeptId { get; set; }
  93. public long ResponsibleDeptId { get; set; }
  94. public long? ReporterId { get; set; }
  95. }
  96. public class AdoS8ManualReportResultDto
  97. {
  98. public long ExceptionId { get; set; }
  99. public string ExceptionCode { get; set; } = string.Empty;
  100. public long TaskId { get; set; }
  101. }
  102. public class AdoS8TimelineItemDto
  103. {
  104. public long Id { get; set; }
  105. public string ActionCode { get; set; } = string.Empty;
  106. public string ActionLabel { get; set; } = string.Empty;
  107. public string? FromStatus { get; set; }
  108. public string? ToStatus { get; set; }
  109. public long? OperatorId { get; set; }
  110. public string? OperatorName { get; set; }
  111. public string? ActionRemark { get; set; }
  112. public DateTime CreatedAt { get; set; }
  113. }
  114. public class AdoS8DecisionItemDto
  115. {
  116. public long Id { get; set; }
  117. public string DecisionType { get; set; } = string.Empty;
  118. public long DecisionMakerId { get; set; }
  119. public string DecisionMakerName { get; set; } = string.Empty;
  120. public string? DecisionBasis { get; set; }
  121. public string? DecisionResult { get; set; }
  122. public string? DecisionRemark { get; set; }
  123. public DateTime DecisionTime { get; set; }
  124. }
  125. public class AdoS8EvidenceItemDto
  126. {
  127. public long Id { get; set; }
  128. public string EvidenceType { get; set; } = string.Empty;
  129. public string FileName { get; set; } = string.Empty;
  130. public string FileUrl { get; set; } = string.Empty;
  131. public string? SourceSystem { get; set; }
  132. public long? UploadedBy { get; set; }
  133. public DateTime UploadedAt { get; set; }
  134. }
  135. public class AdoS8CommentDto
  136. {
  137. public string? Remark { get; set; }
  138. }
  139. public class AdoS8TransferDto
  140. {
  141. public long AssigneeId { get; set; }
  142. public string? Remark { get; set; }
  143. }
  144. public class AdoS8AttachmentCreateDto
  145. {
  146. public string EvidenceType { get; set; } = "file";
  147. public string FileName { get; set; } = string.Empty;
  148. public string FileUrl { get; set; } = string.Empty;
  149. public string? SourceSystem { get; set; }
  150. public long? UploadedBy { get; set; }
  151. }
  152. // ── 监控汇总 DTO ─────────────────────────────────────────────────────────────
  153. public class AdoS8MonitoringSummaryQueryDto
  154. {
  155. public long TenantId { get; set; } = 1;
  156. public long FactoryId { get; set; } = 1;
  157. /// <summary>场景码过滤(不传 = 全部)</summary>
  158. public string? SceneCode { get; set; }
  159. /// <summary>模块码过滤(不传 = 全部)</summary>
  160. public string? ModuleCode { get; set; }
  161. public DateTime? BizDateFrom { get; set; }
  162. public DateTime? BizDateTo { get; set; }
  163. }
  164. /// <summary>单个模块的异常汇总行</summary>
  165. public class AdoS8ModuleSummaryItem
  166. {
  167. public string ModuleCode { get; set; } = string.Empty;
  168. public string ModuleLabel { get; set; } = string.Empty;
  169. public string SceneCode { get; set; } = string.Empty;
  170. public string SceneLabel { get; set; } = string.Empty;
  171. public int Total { get; set; }
  172. public int Red { get; set; }
  173. public int Yellow { get; set; }
  174. public int Green { get; set; }
  175. public int Timeout { get; set; }
  176. }
  177. /// <summary>监控汇总出参(综合全景页顶部 + 表格数据)</summary>
  178. public class AdoS8MonitoringSummaryDto
  179. {
  180. public int Total { get; set; }
  181. public int Red { get; set; }
  182. public int Yellow { get; set; }
  183. public int Green { get; set; }
  184. public int Timeout { get; set; }
  185. public List<AdoS8ModuleSummaryItem> ByModule { get; set; } = new();
  186. }
  187. // ── 9宫格 OrderGrid DTO ──────────────────────────────────────────────────────
  188. /// <summary>S1-S7 单个模块的订单健康分布(9宫格前7格)</summary>
  189. public class AdoS8ModuleOrderSummary
  190. {
  191. public string ModuleCode { get; set; } = string.Empty;
  192. public string ModuleLabel { get; set; } = string.Empty;
  193. /// <summary>绿色订单数(该阶段无未关闭异常)</summary>
  194. public int Green { get; set; }
  195. /// <summary>黄色订单数(有 MEDIUM 未关闭)</summary>
  196. public int Yellow { get; set; }
  197. /// <summary>红色订单数(有 CRITICAL/HIGH 未关闭,或黄色超时)</summary>
  198. public int Red { get; set; }
  199. public int Total { get; set; }
  200. /// <summary>异常发生频率(每百订单异常数)</summary>
  201. public double Frequency { get; set; }
  202. /// <summary>平均处理时效(小时)</summary>
  203. public double AvgProcessHours { get; set; }
  204. /// <summary>异常关闭百分比</summary>
  205. public double CloseRate { get; set; }
  206. }
  207. /// <summary>S8格:按业务类别汇总(第8格)</summary>
  208. public class AdoS8CategorySummary
  209. {
  210. public string Category { get; set; } = string.Empty;
  211. public int Total { get; set; }
  212. public double AvgProcessHours { get; set; }
  213. public double CloseRate { get; set; }
  214. }
  215. /// <summary>S9格:按责任部门汇总(第9格)</summary>
  216. public class AdoS8DeptSummary
  217. {
  218. public string DeptName { get; set; } = string.Empty;
  219. public int Total { get; set; }
  220. public double AvgProcessHours { get; set; }
  221. public double CloseRate { get; set; }
  222. }
  223. /// <summary>9宫格完整出参</summary>
  224. public class AdoS8OrderGridDto
  225. {
  226. public List<AdoS8ModuleOrderSummary> Modules { get; set; } = new();
  227. public List<AdoS8CategorySummary> ByCategory { get; set; } = new();
  228. public List<AdoS8DeptSummary> ByDept { get; set; } = new();
  229. }
  230. public class AdoS8SubmitVerificationDto
  231. {
  232. public long VerifierId { get; set; }
  233. public string? Remark { get; set; }
  234. }
  235. public class AdoS8ApproveVerificationDto
  236. {
  237. public string? Remark { get; set; }
  238. }
  239. public class AdoS8RejectVerificationDto
  240. {
  241. public string Remark { get; set; } = string.Empty;
  242. }