AdoS8Dtos.cs 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  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. /// <summary>S8-EXCEPTION-MODULE-DISPLAY-1:业务展示主口径(S1-S7)。SceneCode/SceneName 保留兼容期。</summary>
  46. public string? ModuleCode { get; set; }
  47. public string? ModuleName { get; set; }
  48. public long ResponsibleDeptId { get; set; }
  49. public string? ResponsibleDeptName { get; set; }
  50. public long OccurrenceDeptId { get; set; }
  51. public string? OccurrenceDeptName { get; set; }
  52. public long? AssigneeId { get; set; }
  53. public string? AssigneeName { get; set; }
  54. public DateTime? SlaDeadline { get; set; }
  55. public bool TimeoutFlag { get; set; }
  56. public DateTime CreatedAt { get; set; }
  57. public DateTime? ClosedAt { get; set; }
  58. public string? ExceptionTypeCode { get; set; }
  59. public DateTime? RecoveredAt { get; set; }
  60. public string? SourceRuleCode { get; set; }
  61. public string? SourceObjectType { get; set; }
  62. public string? SourceObjectId { get; set; }
  63. public string? DedupKey { get; set; }
  64. public DateTime? LastDetectedAt { get; set; }
  65. public string? RuleType { get; set; }
  66. }
  67. public class AdoS8ExceptionDetailDto : AdoS8ExceptionListItemDto
  68. {
  69. public string? Description { get; set; }
  70. public string SourceType { get; set; } = string.Empty;
  71. public long? ResponsibleGroupId { get; set; }
  72. public long? ReporterId { get; set; }
  73. public string? ReporterName { get; set; }
  74. public DateTime? AssignedAt { get; set; }
  75. public DateTime? UpdatedAt { get; set; }
  76. public long? ActiveFlowInstanceId { get; set; }
  77. public string? ActiveFlowBizType { get; set; }
  78. public long? VerifierId { get; set; }
  79. public string? VerifierName { get; set; }
  80. public DateTime? VerificationAssignedAt { get; set; }
  81. public DateTime? VerifiedAt { get; set; }
  82. public string? VerificationResult { get; set; }
  83. public string? VerificationRemark { get; set; }
  84. public long? SourceRuleId { get; set; }
  85. public string? RelatedObjectCode { get; set; }
  86. }
  87. public class AdoS8ManualReportCreateDto
  88. {
  89. public long TenantId { get; set; } = 1;
  90. public long FactoryId { get; set; } = 1;
  91. public string Title { get; set; } = string.Empty;
  92. public string? Description { get; set; }
  93. public string SceneCode { get; set; } = string.Empty;
  94. public string Severity { get; set; } = "FOLLOW";
  95. public long OccurrenceDeptId { get; set; }
  96. public long ResponsibleDeptId { get; set; }
  97. public long? ReporterId { get; set; }
  98. /// <summary>关联对象编码:当前按订单项 / 类订单项对象理解,允许重复,可为空。最长 64 字符(与 ado_s8_exception.related_object_code 一致)。</summary>
  99. public string? RelatedObjectCode { get; set; }
  100. }
  101. public class AdoS8ManualReportResultDto
  102. {
  103. public long ExceptionId { get; set; }
  104. public string ExceptionCode { get; set; } = string.Empty;
  105. public long TaskId { get; set; }
  106. }
  107. public class AdoS8TimelineItemDto
  108. {
  109. public long Id { get; set; }
  110. public string ActionCode { get; set; } = string.Empty;
  111. public string ActionLabel { get; set; } = string.Empty;
  112. public string? FromStatus { get; set; }
  113. public string? ToStatus { get; set; }
  114. public long? OperatorId { get; set; }
  115. public string? OperatorName { get; set; }
  116. public string? ActionRemark { get; set; }
  117. public DateTime CreatedAt { get; set; }
  118. }
  119. public class AdoS8DecisionItemDto
  120. {
  121. public long Id { get; set; }
  122. public string DecisionType { get; set; } = string.Empty;
  123. public long DecisionMakerId { get; set; }
  124. public string DecisionMakerName { get; set; } = string.Empty;
  125. public string? DecisionBasis { get; set; }
  126. public string? DecisionResult { get; set; }
  127. public string? DecisionRemark { get; set; }
  128. public DateTime DecisionTime { get; set; }
  129. }
  130. public class AdoS8EvidenceItemDto
  131. {
  132. public long Id { get; set; }
  133. public string EvidenceType { get; set; } = string.Empty;
  134. public string FileName { get; set; } = string.Empty;
  135. public string FileUrl { get; set; } = string.Empty;
  136. public string? SourceSystem { get; set; }
  137. public long? UploadedBy { get; set; }
  138. public DateTime UploadedAt { get; set; }
  139. }
  140. public class AdoS8CommentDto
  141. {
  142. public string? Remark { get; set; }
  143. }
  144. public class AdoS8TransferDto
  145. {
  146. public long AssigneeId { get; set; }
  147. public string? Remark { get; set; }
  148. }
  149. public class AdoS8AttachmentCreateDto
  150. {
  151. public string EvidenceType { get; set; } = "file";
  152. public string FileName { get; set; } = string.Empty;
  153. public string FileUrl { get; set; } = string.Empty;
  154. public string? SourceSystem { get; set; }
  155. public long? UploadedBy { get; set; }
  156. }
  157. // ── 监控汇总 DTO ─────────────────────────────────────────────────────────────
  158. public class AdoS8MonitoringSummaryQueryDto
  159. {
  160. public long TenantId { get; set; } = 1;
  161. public long FactoryId { get; set; } = 1;
  162. /// <summary>场景码过滤(不传 = 全部)</summary>
  163. public string? SceneCode { get; set; }
  164. /// <summary>模块码过滤(不传 = 全部)</summary>
  165. public string? ModuleCode { get; set; }
  166. public DateTime? BizDateFrom { get; set; }
  167. public DateTime? BizDateTo { get; set; }
  168. /// <summary>统一时间筛选:today / this_week / this_month。BizDateFrom/BizDateTo 已传时优先于 Period。</summary>
  169. public string? Period { get; set; }
  170. }
  171. /// <summary>单个模块的异常汇总行</summary>
  172. public class AdoS8ModuleSummaryItem
  173. {
  174. public string ModuleCode { get; set; } = string.Empty;
  175. public string ModuleLabel { get; set; } = string.Empty;
  176. public string SceneCode { get; set; } = string.Empty;
  177. public string SceneLabel { get; set; } = string.Empty;
  178. public int Total { get; set; }
  179. public int Red { get; set; }
  180. public int Yellow { get; set; }
  181. public int Green { get; set; }
  182. public int Timeout { get; set; }
  183. }
  184. /// <summary>监控汇总出参(综合全景页顶部 + 表格数据)</summary>
  185. public class AdoS8MonitoringSummaryDto
  186. {
  187. public int Total { get; set; }
  188. public int Red { get; set; }
  189. public int Yellow { get; set; }
  190. public int Green { get; set; }
  191. public int Timeout { get; set; }
  192. public List<AdoS8ModuleSummaryItem> ByModule { get; set; } = new();
  193. }
  194. // ── 9宫格 OrderGrid DTO ──────────────────────────────────────────────────────
  195. /// <summary>S1-S7 单个模块的订单健康分布(9宫格前7格)</summary>
  196. public class AdoS8ModuleOrderSummary
  197. {
  198. public string ModuleCode { get; set; } = string.Empty;
  199. public string ModuleLabel { get; set; } = string.Empty;
  200. /// <summary>绿色订单数(来自订单主数据,不从异常 severity 推导)。</summary>
  201. public int Green { get; set; }
  202. /// <summary>黄色订单数(FOLLOW 关注)。</summary>
  203. public int Yellow { get; set; }
  204. /// <summary>红色订单数(SERIOUS 严重,或黄色超时)。</summary>
  205. public int Red { get; set; }
  206. public int Total { get; set; }
  207. /// <summary>异常发生频率(每百订单异常数)</summary>
  208. public double Frequency { get; set; }
  209. /// <summary>平均处理时效(小时)</summary>
  210. public double AvgProcessHours { get; set; }
  211. /// <summary>异常关闭百分比</summary>
  212. public double CloseRate { get; set; }
  213. }
  214. /// <summary>S8格:按业务类别汇总(第8格)</summary>
  215. public class AdoS8CategorySummary
  216. {
  217. public string Category { get; set; } = string.Empty;
  218. public int Total { get; set; }
  219. public double AvgProcessHours { get; set; }
  220. public double CloseRate { get; set; }
  221. }
  222. /// <summary>S9格:按责任部门汇总(第9格)</summary>
  223. public class AdoS8DeptSummary
  224. {
  225. public string DeptName { get; set; } = string.Empty;
  226. public int Total { get; set; }
  227. public double AvgProcessHours { get; set; }
  228. public double CloseRate { get; set; }
  229. }
  230. /// <summary>9宫格完整出参</summary>
  231. public class AdoS8OrderGridDto
  232. {
  233. public List<AdoS8ModuleOrderSummary> Modules { get; set; } = new();
  234. public List<AdoS8CategorySummary> ByCategory { get; set; } = new();
  235. public List<AdoS8DeptSummary> ByDept { get; set; } = new();
  236. }
  237. /// <summary>S8-DELIVERY-TREND-CHART-REPLACE-DUPLICATE-SECTION-1:Delivery 页近 N 日交付异常趋势出参。</summary>
  238. public class AdoS8DeliveryTrendDto
  239. {
  240. public List<AdoS8DeliveryTrendDayDto> Days { get; set; } = new();
  241. public AdoS8DeliveryTrendSummaryDto Summary { get; set; } = new();
  242. }
  243. public class AdoS8DeliveryTrendDayDto
  244. {
  245. /// <summary>日期短格式 MM/dd(图表 X 轴)</summary>
  246. public string Date { get; set; } = string.Empty;
  247. /// <summary>原始日期 yyyy-MM-dd</summary>
  248. public string RawDate { get; set; } = string.Empty;
  249. public int OrderChange { get; set; }
  250. public int DeliveryDelay { get; set; }
  251. public int PendingShipment { get; set; }
  252. public int Total { get; set; }
  253. }
  254. public class AdoS8DeliveryTrendSummaryDto
  255. {
  256. public int PeakValue { get; set; }
  257. public string? PeakDate { get; set; }
  258. public double AvgValue { get; set; }
  259. public int TodayValue { get; set; }
  260. /// <summary>今日相对昨日变化率(%);昨日为 0 时返回 null。</summary>
  261. public double? TodayChangeRate { get; set; }
  262. }
  263. /// <summary>S8-PROD-SUPPLY-TREND-CHART-REPLACE-DUPLICATE-SECTION-1:Production 页近 N 日生产异常趋势出参。</summary>
  264. public class AdoS8ProductionTrendDto
  265. {
  266. public List<AdoS8ProductionTrendDayDto> Days { get; set; } = new();
  267. public AdoS8DeliveryTrendSummaryDto Summary { get; set; } = new();
  268. }
  269. public class AdoS8ProductionTrendDayDto
  270. {
  271. public string Date { get; set; } = string.Empty;
  272. public string RawDate { get; set; } = string.Empty;
  273. public int EquipmentFault { get; set; }
  274. public int MaterialFault { get; set; }
  275. public int QualityFault { get; set; }
  276. public int Total { get; set; }
  277. }
  278. /// <summary>S8-PROD-SUPPLY-TREND-CHART-REPLACE-DUPLICATE-SECTION-1:Supply 页近 N 日供应异常趋势出参。</summary>
  279. public class AdoS8SupplyTrendDto
  280. {
  281. public List<AdoS8SupplyTrendDayDto> Days { get; set; } = new();
  282. public AdoS8DeliveryTrendSummaryDto Summary { get; set; } = new();
  283. }
  284. public class AdoS8SupplyTrendDayDto
  285. {
  286. public string Date { get; set; } = string.Empty;
  287. public string RawDate { get; set; } = string.Empty;
  288. public int SupplierEtaIssue { get; set; }
  289. public int SupplierShipIssue { get; set; }
  290. public int WarehouseReceiptAbnormal { get; set; }
  291. public int IqcIssue { get; set; }
  292. public int WarehousePutawayIssue { get; set; }
  293. public int WorkOrderKittingAbnormal { get; set; }
  294. public int WorkOrderIssueAbnormal { get; set; }
  295. public int Total { get; set; }
  296. }
  297. /// <summary>
  298. /// S8-SIDEBAR-TYPE-CARD-WINDOW-TOGGLE-1:右侧异常类型卡按时间窗口切片(LAST_24H / LAST_7D)出参。
  299. /// 同一窗口内 total / open / closed / avgProcessHours / closeRate 共用同一分母,避免跨窗口拼接误读。
  300. /// </summary>
  301. public class AdoS8DomainTypeMetricsDto
  302. {
  303. public string Domain { get; set; } = string.Empty;
  304. public string Window { get; set; } = string.Empty;
  305. public int Total { get; set; }
  306. public List<AdoS8DomainTypeMetricItemDto> Items { get; set; } = new();
  307. }
  308. public class AdoS8DomainTypeMetricItemDto
  309. {
  310. public string Key { get; set; } = string.Empty;
  311. public string Label { get; set; } = string.Empty;
  312. public string TypeCode { get; set; } = string.Empty;
  313. public int Total { get; set; }
  314. public int OpenCount { get; set; }
  315. public int ClosedCount { get; set; }
  316. /// <summary>已关闭样本均时(小时);无 closed 样本时 null,前端展示 --。</summary>
  317. public double? AvgProcessHours { get; set; }
  318. /// <summary>关闭率 %;total=0 时 null,前端展示 --。</summary>
  319. public double? CloseRate { get; set; }
  320. }
  321. public class AdoS8SubmitVerificationDto
  322. {
  323. public long VerifierId { get; set; }
  324. public string? Remark { get; set; }
  325. }
  326. public class AdoS8ApproveVerificationDto
  327. {
  328. public string? Remark { get; set; }
  329. }
  330. public class AdoS8RejectVerificationDto
  331. {
  332. public string Remark { get; set; } = string.Empty;
  333. }