AdoS8OrderFlowDtos.cs 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. namespace Admin.NET.Plugin.AiDOP.Dto.S8.OrderFlow;
  2. /// <summary>
  3. /// ORDER-FLOW-S8-INTEGRATED-DOMAIN-RESET-1 t3a:S8 订单执行链路 DTO 契约。
  4. /// 仅定义类型,不携带业务常量 / 不引用 Entity / 不接 service 逻辑。
  5. /// 后续 t3b/t3c 切片负责 service + controller 把 DTO 接到 ado_s8_order_flow_* 与 ado_s8_exception 实时聚合。
  6. /// </summary>
  7. #region 订单档案
  8. public class AdoS8OrderFlowOrderQueryDto
  9. {
  10. public long? TenantId { get; set; }
  11. public long? FactoryId { get; set; }
  12. public string? Keyword { get; set; }
  13. public string? CurrentFlowCode { get; set; }
  14. public string? CustomerCode { get; set; }
  15. public string? ProductLine { get; set; }
  16. public string? Region { get; set; }
  17. public string? WorkflowStatus { get; set; }
  18. public string? ScenarioCode { get; set; }
  19. }
  20. public class AdoS8OrderFlowOrderListItemDto
  21. {
  22. public string OrderCode { get; set; } = string.Empty;
  23. public string ProductName { get; set; } = string.Empty;
  24. public string ProductLine { get; set; } = string.Empty;
  25. public string CustomerCode { get; set; } = string.Empty;
  26. public string CustomerName { get; set; } = string.Empty;
  27. public string CustomerType { get; set; } = string.Empty;
  28. public string Region { get; set; } = string.Empty;
  29. public string Priority { get; set; } = string.Empty;
  30. public string WorkflowStatus { get; set; } = string.Empty;
  31. public string CurrentOrderFlowCode { get; set; } = string.Empty;
  32. public string CurrentOrderFlowName { get; set; } = string.Empty;
  33. public string CurrentStatus { get; set; } = string.Empty;
  34. public DateTime ReleaseAt { get; set; }
  35. public decimal TargetCycleDays { get; set; }
  36. public decimal? ActualCycleDays { get; set; }
  37. public decimal? CurrentCycleDays { get; set; }
  38. public decimal? NodeVarianceDays { get; set; }
  39. public decimal? CumulativeVarianceDays { get; set; }
  40. /// <summary>来自 ado_s8_exception 实时聚合(order 主档表无 exception_count 列)。</summary>
  41. public int ExceptionCount { get; set; }
  42. public string ExceptionStatus { get; set; } = string.Empty;
  43. public int? ResponseMinutes { get; set; }
  44. public int? ProcessingMinutes { get; set; }
  45. public int? TotalLossMinutes { get; set; }
  46. public string ScenarioCode { get; set; } = string.Empty;
  47. public string DataSource { get; set; } = string.Empty;
  48. }
  49. public class AdoS8OrderFlowOrderDetailDto : AdoS8OrderFlowOrderListItemDto
  50. {
  51. public List<AdoS8OrderFlowStageDto> Lifecycle { get; set; } = new();
  52. }
  53. #endregion
  54. #region 阶段 / L2 / L3
  55. public class AdoS8OrderFlowStageDto
  56. {
  57. public string OrderFlowCode { get; set; } = string.Empty;
  58. public string OrderFlowName { get; set; } = string.Empty;
  59. public string? OwnerDept { get; set; }
  60. public int SortNo { get; set; }
  61. public decimal PlannedDays { get; set; }
  62. public decimal? ActualDays { get; set; }
  63. public DateTime TargetAt { get; set; }
  64. public DateTime? ActualStartAt { get; set; }
  65. public DateTime? ActualEndAt { get; set; }
  66. public string Status { get; set; } = string.Empty;
  67. public decimal? NodeVarianceDays { get; set; }
  68. public decimal? CumulativeVarianceDays { get; set; }
  69. public List<AdoS8OrderFlowSubstepDto> Substeps { get; set; } = new();
  70. }
  71. public class AdoS8OrderFlowSubstepDto
  72. {
  73. public string SubstepCode { get; set; } = string.Empty;
  74. public string SubstepName { get; set; } = string.Empty;
  75. public decimal PiHours { get; set; }
  76. public decimal? ActualHours { get; set; }
  77. public string Status { get; set; } = string.Empty;
  78. public int SortNo { get; set; }
  79. public List<AdoS8OrderFlowSubstepUnitDto> Units { get; set; } = new();
  80. }
  81. public class AdoS8OrderFlowSubstepUnitDto
  82. {
  83. public string UnitCode { get; set; } = string.Empty;
  84. public string UnitName { get; set; } = string.Empty;
  85. public decimal PiHours { get; set; }
  86. public decimal? ActualHours { get; set; }
  87. public string Status { get; set; } = string.Empty;
  88. public int SortNo { get; set; }
  89. }
  90. #endregion
  91. #region 订单 + 采购透视组合
  92. public class AdoS8OrderFlowChainDto
  93. {
  94. public AdoS8OrderFlowOrderDetailDto Order { get; set; } = new();
  95. public AdoS8OrderFlowProcurementPivotDto? ProcurementPivot { get; set; }
  96. }
  97. #endregion
  98. #region 聚合 / Baseline
  99. public class AdoS8OrderFlowAggregateQueryDto
  100. {
  101. public long? TenantId { get; set; }
  102. public long? FactoryId { get; set; }
  103. public string Scope { get; set; } = string.Empty;
  104. public List<string>? OrderCodes { get; set; }
  105. }
  106. public class AdoS8OrderFlowAggregateDto
  107. {
  108. public string Scope { get; set; } = string.Empty;
  109. public int TotalOrders { get; set; }
  110. public int TotalCustomers { get; set; }
  111. public decimal AvgResponseMinutes { get; set; }
  112. public decimal AvgProcessingMinutes { get; set; }
  113. public decimal AvgLossMinutes { get; set; }
  114. public List<AdoS8OrderFlowStageAggregateDto> StageAggregates { get; set; } = new();
  115. }
  116. public class AdoS8OrderFlowStageAggregateDto
  117. {
  118. public string OrderFlowCode { get; set; } = string.Empty;
  119. public string OrderFlowName { get; set; } = string.Empty;
  120. public decimal KpiAvgDays { get; set; }
  121. public decimal ActualAvgDays { get; set; }
  122. /// <summary>整数百分比(例如 59 / 96 / 85 / 89 / 96),不是 0.59 小数。</summary>
  123. public int OnTimeRate { get; set; }
  124. public int Green { get; set; }
  125. public int Yellow { get; set; }
  126. public int Red { get; set; }
  127. public int Pending { get; set; }
  128. }
  129. #endregion
  130. #region 采购透视
  131. public class AdoS8OrderFlowProcurementPivotQueryDto
  132. {
  133. public long? TenantId { get; set; }
  134. public long? FactoryId { get; set; }
  135. public string Scope { get; set; } = string.Empty;
  136. public List<string>? OrderCodes { get; set; }
  137. }
  138. public class AdoS8OrderFlowProcurementPivotDto
  139. {
  140. public string Scope { get; set; } = string.Empty;
  141. public List<AdoS8OrderFlowKeyMaterialDto> KeyMaterials { get; set; } = new();
  142. public List<AdoS8OrderFlowSupplierBreakdownDto> SupplierBreakdown { get; set; } = new();
  143. public List<AdoS8OrderFlowSpecBreakdownDto> SpecBreakdown { get; set; } = new();
  144. public Dictionary<string, List<AdoS8OrderFlowProcurementMatrixRowDto>> MatrixByMaterial { get; set; } = new();
  145. }
  146. public class AdoS8OrderFlowKeyMaterialDto
  147. {
  148. public string MaterialCode { get; set; } = string.Empty;
  149. public decimal AvgCycleDays { get; set; }
  150. public string CycleStatus { get; set; } = string.Empty;
  151. public int? ImpactCount { get; set; }
  152. public decimal? KitRate { get; set; }
  153. public string ResultStatus { get; set; } = string.Empty;
  154. }
  155. public class AdoS8OrderFlowSupplierBreakdownDto
  156. {
  157. public string MaterialCode { get; set; } = string.Empty;
  158. public string SupplierCode { get; set; } = string.Empty;
  159. public decimal AvgCycleDays { get; set; }
  160. public string Status { get; set; } = string.Empty;
  161. }
  162. public class AdoS8OrderFlowSpecBreakdownDto
  163. {
  164. public string MaterialCode { get; set; } = string.Empty;
  165. public string SpecCode { get; set; } = string.Empty;
  166. public decimal AvgCycleDays { get; set; }
  167. public string Status { get; set; } = string.Empty;
  168. }
  169. public class AdoS8OrderFlowProcurementMatrixRowDto
  170. {
  171. public string SupplierCode { get; set; } = string.Empty;
  172. public Dictionary<string, AdoS8OrderFlowProcurementMatrixCellDto> Cells { get; set; } = new();
  173. }
  174. public class AdoS8OrderFlowProcurementMatrixCellDto
  175. {
  176. public decimal CycleDays { get; set; }
  177. public string Status { get; set; } = string.Empty;
  178. }
  179. #endregion
  180. #region 关联异常
  181. public class AdoS8OrderFlowRelatedExceptionQueryDto
  182. {
  183. public long? TenantId { get; set; }
  184. public long? FactoryId { get; set; }
  185. public string OrderCode { get; set; } = string.Empty;
  186. public string? OrderFlowCode { get; set; }
  187. }
  188. #endregion