AdoS8OrderFlowDtos.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540
  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 string? Keyword { get; set; }
  11. public string? CurrentFlowCode { get; set; }
  12. public string? CustomerCode { get; set; }
  13. public string? ProductLine { get; set; }
  14. public string? Region { get; set; }
  15. public string? WorkflowStatus { get; set; }
  16. public string? ScenarioCode { get; set; }
  17. }
  18. public class AdoS8OrderFlowOrderListItemDto
  19. {
  20. // ── REAL runtime(mdp_std_so)新增字段 ─────────────────────────────────────────────
  21. // SEED 路径(ado_s8_order_flow_*)不填这些,保持 null;REAL 路径不填 SEED 的周期/偏差字段。
  22. // 两条路径互不混用:靠 DataSource 区分(SEED / MDP_STD_SO)。
  23. /// <summary>
  24. /// 真实销售订单头 Id = <c>mdp_std_so.order_id</c> = <c>crm_seorder.Id</c>。
  25. /// <b>REAL runtime 的唯一订单身份</b>;SEED 路径为 null。
  26. /// 前端必须用它定位订单,禁止再用订单号文本或字符串拼接构造 id。
  27. /// </summary>
  28. public long? SalesOrderId { get; set; }
  29. /// <summary>真实销售订单号 = <c>mdp_std_so.order_no</c>。**仅展示 / 搜索**,不作主键。</summary>
  30. public string? OrderNo { get; set; }
  31. /// <summary>客户 Id(Header Authority)。</summary>
  32. public long? CustomerId { get; set; }
  33. /// <summary>下单日期(Header Authority)。</summary>
  34. public DateTime? OrderDate { get; set; }
  35. /// <summary>订单类型(Header Authority,源端为 int 域)。</summary>
  36. public int? OrderType { get; set; }
  37. /// <summary>订单状态 OPEN/CLOSED(Header Authority)。</summary>
  38. public string? OrderStatus { get; set; }
  39. /// <summary>流程状态(Header Authority)。</summary>
  40. public string? FlowState { get; set; }
  41. // ── 既有字段 ─────────────────────────────────────────────────────────────────────
  42. public string OrderCode { get; set; } = string.Empty;
  43. public string ProductName { get; set; } = string.Empty;
  44. public string ProductLine { get; set; } = string.Empty;
  45. public string CustomerCode { get; set; } = string.Empty;
  46. public string CustomerName { get; set; } = string.Empty;
  47. public string CustomerType { get; set; } = string.Empty;
  48. public string Region { get; set; } = string.Empty;
  49. public string Priority { get; set; } = string.Empty;
  50. public string WorkflowStatus { get; set; } = string.Empty;
  51. public string CurrentOrderFlowCode { get; set; } = string.Empty;
  52. public string CurrentOrderFlowName { get; set; } = string.Empty;
  53. public string CurrentStatus { get; set; } = string.Empty;
  54. /// <summary>SEED 的下达时间。REAL runtime 无对应 Authority → null(改用 <see cref="OrderDate"/>)。</summary>
  55. public DateTime? ReleaseAt { get; set; }
  56. /// <summary>SEED 的目标周期。**REAL runtime 必须为 null** —— 真实订单没有目标周期 Authority,不得回落 SEED。</summary>
  57. public decimal? TargetCycleDays { get; set; }
  58. public decimal? ActualCycleDays { get; set; }
  59. public decimal? CurrentCycleDays { get; set; }
  60. public decimal? NodeVarianceDays { get; set; }
  61. public decimal? CumulativeVarianceDays { get; set; }
  62. /// <summary>来自 ado_s8_exception 实时聚合(order 主档表无 exception_count 列)。</summary>
  63. public int ExceptionCount { get; set; }
  64. public string ExceptionStatus { get; set; } = string.Empty;
  65. public int? ResponseMinutes { get; set; }
  66. public int? ProcessingMinutes { get; set; }
  67. public int? TotalLossMinutes { get; set; }
  68. public string ScenarioCode { get; set; } = string.Empty;
  69. public string DataSource { get; set; } = string.Empty;
  70. }
  71. public class AdoS8OrderFlowOrderDetailDto : AdoS8OrderFlowOrderListItemDto
  72. {
  73. public List<AdoS8OrderFlowStageDto> Lifecycle { get; set; } = new();
  74. }
  75. #endregion
  76. #region 阶段 / L2 / L3
  77. public class AdoS8OrderFlowStageDto
  78. {
  79. public string OrderFlowCode { get; set; } = string.Empty;
  80. public string OrderFlowName { get; set; } = string.Empty;
  81. public string? OwnerDept { get; set; }
  82. public int SortNo { get; set; }
  83. /// <summary>SEED 的计划天数。REAL runtime 无 Authority → null。</summary>
  84. public decimal? PlannedDays { get; set; }
  85. /// <summary>SEED 的实际天数。REAL runtime 无 Authority → null。**不得把小时塞进这里**(它已被 KPI 反推逻辑占用)。</summary>
  86. public decimal? ActualDays { get; set; }
  87. /// <summary>SEED 的目标时间。REAL runtime 无 Authority → null。</summary>
  88. public DateTime? TargetAt { get; set; }
  89. public DateTime? ActualStartAt { get; set; }
  90. public DateTime? ActualEndAt { get; set; }
  91. /// <summary>
  92. /// 阶段实际耗时(小时)。REAL runtime 下 ORDER_REVIEW 取
  93. /// <c>dwd_order_review_kpi.actual_hours</c>;其余阶段与 SEED 路径为 null。
  94. /// <b>独立字段,绝不复用 <see cref="ActualDays"/></b>(单位与语义都不同)。
  95. /// </summary>
  96. public decimal? ActualHours { get; set; }
  97. /// <summary>
  98. /// Stage-1 KPI 计算状态:OK / NO_START / IN_PROGRESS / INVALID / INVALID_TIME_SEQUENCE。
  99. /// 仅 REAL runtime 的 ORDER_REVIEW 有值。
  100. /// </summary>
  101. public string? CalculationStatus { get; set; }
  102. public string Status { get; set; } = string.Empty;
  103. public decimal? NodeVarianceDays { get; set; }
  104. public decimal? CumulativeVarianceDays { get; set; }
  105. public List<AdoS8OrderFlowSubstepDto> Substeps { get; set; } = new();
  106. }
  107. public class AdoS8OrderFlowSubstepDto
  108. {
  109. public string SubstepCode { get; set; } = string.Empty;
  110. public string SubstepName { get; set; } = string.Empty;
  111. public decimal PiHours { get; set; }
  112. public decimal? ActualHours { get; set; }
  113. public string Status { get; set; } = string.Empty;
  114. public int SortNo { get; set; }
  115. public List<AdoS8OrderFlowSubstepUnitDto> Units { get; set; } = new();
  116. }
  117. public class AdoS8OrderFlowSubstepUnitDto
  118. {
  119. public string UnitCode { get; set; } = string.Empty;
  120. public string UnitName { get; set; } = string.Empty;
  121. public decimal PiHours { get; set; }
  122. public decimal? ActualHours { get; set; }
  123. public string Status { get; set; } = string.Empty;
  124. public int SortNo { get; set; }
  125. }
  126. #endregion
  127. #region 订单 + 采购透视组合
  128. public class AdoS8OrderFlowChainDto
  129. {
  130. public AdoS8OrderFlowOrderDetailDto Order { get; set; } = new();
  131. public AdoS8OrderFlowProcurementPivotDto? ProcurementPivot { get; set; }
  132. }
  133. #endregion
  134. #region 聚合 / Baseline
  135. public class AdoS8OrderFlowAggregateQueryDto
  136. {
  137. public string Scope { get; set; } = string.Empty;
  138. /// <summary>
  139. /// S8-STEP5B-P2-FILTER-SUBSET-CERT-1:订单编码 CSV,与 procurement / manufacturing /
  140. /// final-assembly / drawings 四个 pivot DTO 的 OrderCodes 口径统一(服务侧走 ParseOrderCodesCsv)。
  141. /// 原类型是 <c>List&lt;string&gt;?</c>——aggregate 是唯一没跟上该约定的端点。实测:
  142. /// <c>orderCodes=SO-001,SO-002</c> 被默认集合绑定器绑成 **单元素** <c>["SO-001,SO-002"]</c>,
  143. /// 与任何 order_code 都不相等 → totalOrders=0(静默返回空聚合,而非报错);
  144. /// <c>orderCodes[]=X</c> 则整体绑不上 → 静默退回全量。两种失败都不会暴露为 4xx/5xx。
  145. /// </summary>
  146. public string? OrderCodes { get; set; }
  147. }
  148. public class AdoS8OrderFlowAggregateDto
  149. {
  150. public string Scope { get; set; } = string.Empty;
  151. public int TotalOrders { get; set; }
  152. public int TotalCustomers { get; set; }
  153. public decimal AvgResponseMinutes { get; set; }
  154. public decimal AvgProcessingMinutes { get; set; }
  155. public decimal AvgLossMinutes { get; set; }
  156. public List<AdoS8OrderFlowStageAggregateDto> StageAggregates { get; set; } = new();
  157. /// <summary>
  158. /// FINAL_ASSEMBLY_DELIVERY 末端协同聚合摘要(基线 / 当前两条路径均填充)。
  159. /// 派生自 ado_s8_exception 现有异常类型,不新增业务表 / 不新增异常类型 / 不读 S0|S4 业务表。
  160. /// 字段全 nullable,老调用方无感知。
  161. /// </summary>
  162. public AdoS8FinalAssemblyCollabSummaryDto? FinalAssemblyCollabSummary { get; set; }
  163. }
  164. public class AdoS8FinalAssemblyCollabSummaryDto
  165. {
  166. /// <summary>主门禁(GATE)—— key 为前端固定 object_code(如 GOODS_HANDOVER / SHIPMENT_CONFIRMATION)。无映射的门禁不出现在字典中。</summary>
  167. public Dictionary<string, AdoS8FinalAssemblyObjectStatDto> Gates { get; set; } = new();
  168. /// <summary>并行准备(PARALLEL)—— key 为前端固定 object_code(如 SHIPPING_PLAN)。无映射的准备项不出现在字典中。</summary>
  169. public Dictionary<string, AdoS8FinalAssemblyObjectStatDto> Parallels { get; set; } = new();
  170. }
  171. public class AdoS8FinalAssemblyObjectStatDto
  172. {
  173. /// <summary>主门禁口径下的"影响订单"数 = 命中候选异常类型的去重 RelatedObjectCode 数;并行准备口径下保持 null。</summary>
  174. public int? ImpactedOrderCount { get; set; }
  175. /// <summary>并行准备口径下的"风险订单"数 = 命中候选异常类型的去重 RelatedObjectCode 数;主门禁口径下保持 null。</summary>
  176. public int? RiskOrderCount { get; set; }
  177. /// <summary>主要风险标题:候选异常中按 Severity(SERIOUS 优先) → CreatedAt(降序) 取首条 Title。无命中保持 null。</summary>
  178. public string? TopRiskTitle { get; set; }
  179. /// <summary>主要风险严重度:与 TopRiskTitle 来自同一条异常。无命中保持 null。</summary>
  180. public string? TopRiskSeverity { get; set; }
  181. }
  182. public class AdoS8OrderFlowStageAggregateDto
  183. {
  184. public string OrderFlowCode { get; set; } = string.Empty;
  185. public string OrderFlowName { get; set; } = string.Empty;
  186. public decimal KpiAvgDays { get; set; }
  187. public decimal ActualAvgDays { get; set; }
  188. /// <summary>整数百分比(例如 59 / 96 / 85 / 89 / 96),不是 0.59 小数。</summary>
  189. public int OnTimeRate { get; set; }
  190. public int Green { get; set; }
  191. public int Yellow { get; set; }
  192. public int Red { get; set; }
  193. public int Pending { get; set; }
  194. }
  195. #endregion
  196. #region 采购透视
  197. public class AdoS8OrderFlowProcurementPivotQueryDto
  198. {
  199. public string Scope { get; set; } = string.Empty;
  200. /// <summary>
  201. /// 订单编码 CSV(与产品设计 drawings API 对齐)。
  202. /// 例如:单订单 "SO-2026-001";多订单 "SO-2026-001,SO-2026-002,SO-2026-006"。
  203. /// 与 axios 默认 brackets 序列化不兼容,统一用 CSV 字符串避免 ASP.NET Core List 绑定二义性。
  204. /// </summary>
  205. public string? OrderCodes { get; set; }
  206. }
  207. public class AdoS8OrderFlowProcurementPivotDto
  208. {
  209. public string Scope { get; set; } = string.Empty;
  210. public List<AdoS8OrderFlowKeyMaterialDto> KeyMaterials { get; set; } = new();
  211. public List<AdoS8OrderFlowSupplierBreakdownDto> SupplierBreakdown { get; set; } = new();
  212. public List<AdoS8OrderFlowSpecBreakdownDto> SpecBreakdown { get; set; } = new();
  213. public Dictionary<string, List<AdoS8OrderFlowProcurementMatrixRowDto>> MatrixByMaterial { get; set; } = new();
  214. }
  215. public class AdoS8OrderFlowKeyMaterialDto
  216. {
  217. public string MaterialCode { get; set; } = string.Empty;
  218. public decimal AvgCycleDays { get; set; }
  219. public string CycleStatus { get; set; } = string.Empty;
  220. public int? ImpactCount { get; set; }
  221. public decimal? KitRate { get; set; }
  222. public string ResultStatus { get; set; } = string.Empty;
  223. }
  224. public class AdoS8OrderFlowSupplierBreakdownDto
  225. {
  226. public string MaterialCode { get; set; } = string.Empty;
  227. public string SupplierCode { get; set; } = string.Empty;
  228. public decimal AvgCycleDays { get; set; }
  229. public string Status { get; set; } = string.Empty;
  230. }
  231. public class AdoS8OrderFlowSpecBreakdownDto
  232. {
  233. public string MaterialCode { get; set; } = string.Empty;
  234. public string SpecCode { get; set; } = string.Empty;
  235. public decimal AvgCycleDays { get; set; }
  236. public string Status { get; set; } = string.Empty;
  237. }
  238. public class AdoS8OrderFlowProcurementMatrixRowDto
  239. {
  240. public string SupplierCode { get; set; } = string.Empty;
  241. public Dictionary<string, AdoS8OrderFlowProcurementMatrixCellDto> Cells { get; set; } = new();
  242. }
  243. public class AdoS8OrderFlowProcurementMatrixCellDto
  244. {
  245. public decimal CycleDays { get; set; }
  246. public string Status { get; set; } = string.Empty;
  247. }
  248. #endregion
  249. #region 关联异常
  250. public class AdoS8OrderFlowRelatedExceptionQueryDto
  251. {
  252. public string OrderCode { get; set; } = string.Empty;
  253. public string? OrderFlowCode { get; set; }
  254. }
  255. #endregion
  256. #region 产品设计图号
  257. /// <summary>
  258. /// S8-ORDER-CHAIN-PRODUCT-DESIGN-DRAWING-PERSIST-1:产品设计图号查询入参。
  259. /// orderCodes 为空 → 默认聚合全 20 单(scope=BASELINE_PPT);
  260. /// orderCodes 非空 → 仅命中订单范围聚合(scope=CURRENT_FILTERED)。
  261. /// productType 仅过滤 drawings 列表,不改变 summary.categories 的"常规/非标/合计"三档结构。
  262. /// </summary>
  263. public class AdoS8OrderFlowProductDesignDrawingsQueryDto
  264. {
  265. /// <summary>逗号分隔订单号;为空时默认全 20 单。</summary>
  266. public string? OrderCodes { get; set; }
  267. /// <summary>STANDARD / NON_STANDARD;为空时返回全量并保留三档汇总。</summary>
  268. public string? ProductType { get; set; }
  269. }
  270. /// <summary>查询条件回显,便于前端固定下钻状态。</summary>
  271. public class AdoS8OrderFlowProductDesignFilterDto
  272. {
  273. public List<string> OrderCodes { get; set; } = new();
  274. public string? ProductType { get; set; }
  275. }
  276. public class AdoS8OrderFlowProductDesignDrawingItemDto
  277. {
  278. public string OrderCode { get; set; } = string.Empty;
  279. public string DrawingNo { get; set; } = string.Empty;
  280. /// <summary>STANDARD / NON_STANDARD。</summary>
  281. public string ProductType { get; set; } = string.Empty;
  282. /// <summary>责任单位/岗位(研发中心 / 结构设计组 / 电气设计组 / 工艺设计组 / 设计审核组)。</summary>
  283. public string ResponsiblePerson { get; set; } = string.Empty;
  284. public DateTime PlannedStartDate { get; set; }
  285. public DateTime PlannedEndDate { get; set; }
  286. public DateTime? ActualStartDate { get; set; }
  287. public DateTime? ActualEndDate { get; set; }
  288. public decimal KpiDays { get; set; }
  289. public decimal? ActualDays { get; set; }
  290. public bool IsAchieved { get; set; }
  291. /// <summary>green / yellow / red / pending。</summary>
  292. public string Status { get; set; } = string.Empty;
  293. /// <summary>该图号对应台数;台数/占比/加权达成率三种口径的唯一来源。</summary>
  294. public int ProductQuantity { get; set; }
  295. }
  296. public class AdoS8OrderFlowProductDesignOverallSummaryDto
  297. {
  298. public int DrawingCount { get; set; }
  299. public int TotalQuantity { get; set; }
  300. public decimal KpiDays { get; set; }
  301. /// <summary>图号 actual_days 算术平均(非加权),保留小数原值,由前端格式化为 2 位。</summary>
  302. public decimal AvgActualDays { get; set; }
  303. /// <summary>按 product_quantity 加权达标率,小数 0~1,由前端格式化为整数百分比。</summary>
  304. public decimal AchievementRate { get; set; }
  305. }
  306. public class AdoS8OrderFlowProductDesignCategorySummaryDto
  307. {
  308. /// <summary>STANDARD / NON_STANDARD / TOTAL。</summary>
  309. public string ProductType { get; set; } = string.Empty;
  310. public string Name { get; set; } = string.Empty;
  311. public int DrawingCount { get; set; }
  312. public int TotalQuantity { get; set; }
  313. /// <summary>product_quantity 占合计比例,小数 0~1,由前端格式化为 1 位百分比。</summary>
  314. public decimal Ratio { get; set; }
  315. /// <summary>S8-ORDER-CHAIN-PRODUCT-DESIGN-PPT-STATIC-AND-SINGLE-ORDER-ALIGN-1:常规/合计返回 null,前端展示 --;非标返回真实平均设计周期。</summary>
  316. public decimal? AvgActualDays { get; set; }
  317. /// <summary>常规/合计返回 null,前端展示 --;非标返回 3 天 PRODUCT_DESIGN 阶段 KPI。</summary>
  318. public decimal? KpiDays { get; set; }
  319. /// <summary>常规/合计返回 null,前端展示 --;非标返回加权达成率。</summary>
  320. public decimal? AchievementRate { get; set; }
  321. /// <summary>green / yellow / red / ''(空 = 无数据,前端展示 --)。由 achievement_rate 分档得出,不再二次判定。</summary>
  322. public string Status { get; set; } = string.Empty;
  323. }
  324. public class AdoS8OrderFlowProductDesignSummaryDto
  325. {
  326. public AdoS8OrderFlowProductDesignOverallSummaryDto Overall { get; set; } = new();
  327. public List<AdoS8OrderFlowProductDesignCategorySummaryDto> Categories { get; set; } = new();
  328. }
  329. public class AdoS8OrderFlowProductDesignDrawingsDto
  330. {
  331. /// <summary>BASELINE_PPT(默认全 20 单)/ CURRENT_FILTERED(命中订单子集)。</summary>
  332. public string Scope { get; set; } = string.Empty;
  333. public AdoS8OrderFlowProductDesignFilterDto Filter { get; set; } = new();
  334. public AdoS8OrderFlowProductDesignSummaryDto Summary { get; set; } = new();
  335. public List<AdoS8OrderFlowProductDesignDrawingItemDto> Drawings { get; set; } = new();
  336. }
  337. #endregion
  338. #region 本体生产(设备制造) — S8-ORDER-CHAIN-BODY-PRODUCTION-ORDER-LEVEL-SEED-FIX-1
  339. /// <summary>
  340. /// 本体生产「工序明细 / 损失因素 / 操作员表现」三表透视查询入参。
  341. /// orderCodes CSV:与产品设计 drawings API、采购透视 API 对齐,避免 axios brackets 与 ASP.NET Core List 绑定二义性。
  342. /// scope=BASELINE_PPT 时 orderCodes 忽略;scope=CURRENT_FILTERED 时 orderCodes 为空返回空骨架(不静默 fallback baseline)。
  343. /// </summary>
  344. public class AdoS8OrderFlowManufacturingPivotQueryDto
  345. {
  346. /// <summary>BASELINE_PPT | CURRENT_FILTERED</summary>
  347. public string Scope { get; set; } = string.Empty;
  348. /// <summary>逗号分隔订单号;scope=CURRENT_FILTERED 时使用。</summary>
  349. public string? OrderCodes { get; set; }
  350. }
  351. /// <summary>
  352. /// 工序明细行:P10 / P20 / P30 / P40 / TOTAL。
  353. /// pi_days / actual_days 保留 decimal(6,3) 精度;plan_qty 在 TOTAL 行为 null。
  354. /// achievement_rate 在 TOTAL 行 baseline 来自 fixture(0.9000)、订单级按 plan_qty 加权平均;其它行 baseline 复用。
  355. /// </summary>
  356. public class AdoS8OrderFlowManufacturingProcessDto
  357. {
  358. public string ProcessCode { get; set; } = string.Empty;
  359. public string ProcessName { get; set; } = string.Empty;
  360. public decimal PiDays { get; set; }
  361. public decimal ActualDays { get; set; }
  362. public string CycleStatus { get; set; } = string.Empty;
  363. public int? PlanQty { get; set; }
  364. public decimal? AchievementRate { get; set; }
  365. public string AchievementStatus { get; set; } = string.Empty;
  366. public int SortNo { get; set; }
  367. }
  368. /// <summary>损失因素行:MATERIAL / EQUIPMENT / QUALITY / EFFICIENCY / SUBTOTAL。</summary>
  369. public class AdoS8OrderFlowManufacturingLossFactorDto
  370. {
  371. public string FactorCode { get; set; } = string.Empty;
  372. public string FactorName { get; set; } = string.Empty;
  373. public int? CountValue { get; set; }
  374. public decimal? RatioPct { get; set; }
  375. public decimal? LossHours { get; set; }
  376. public int SortNo { get; set; }
  377. }
  378. /// <summary>操作员表现行:OP_ZHANG / OP_LI / OP_WANG。</summary>
  379. public class AdoS8OrderFlowManufacturingOperatorDto
  380. {
  381. public string OperatorCode { get; set; } = string.Empty;
  382. public string OperatorName { get; set; } = string.Empty;
  383. public decimal AvgHours { get; set; }
  384. public string Status { get; set; } = string.Empty;
  385. public int SortNo { get; set; }
  386. }
  387. /// <summary>本体生产透视聚合结果:scope + 工序 / 损失 / 操作员 三组。</summary>
  388. public class AdoS8OrderFlowManufacturingPivotDto
  389. {
  390. /// <summary>BASELINE_PPT | CURRENT_FILTERED</summary>
  391. public string Scope { get; set; } = string.Empty;
  392. public List<AdoS8OrderFlowManufacturingProcessDto> Processes { get; set; } = new();
  393. public List<AdoS8OrderFlowManufacturingLossFactorDto> LossFactors { get; set; } = new();
  394. public List<AdoS8OrderFlowManufacturingOperatorDto> Operators { get; set; } = new();
  395. }
  396. #endregion
  397. #region 总装发货 — S8-ORDER-CHAIN-ASSEMBLY-DELIVERY-DATA-LINEAGE-AUDIT-1
  398. /// <summary>
  399. /// 总装发货「主门禁里程碑 / 并行准备」透视查询入参。
  400. /// orderCodes CSV:与本体生产 / 产品设计 / 采购透视 API 对齐,规避 axios brackets 与 ASP.NET Core List 绑定二义性。
  401. /// scope=BASELINE_PPT 时 orderCodes 忽略;scope=CURRENT_FILTERED 时 orderCodes 为空返回空骨架(不静默 fallback baseline)。
  402. /// 与既有 aggregate.finalAssemblyCollabSummary 通道独立:本 API 提供门禁 KPI / 实际 / 偏差 / 齐套率,
  403. /// aggregate 仍保留异常派生通道作为补充。
  404. /// </summary>
  405. public class AdoS8FinalAssemblyPivotQueryDto
  406. {
  407. /// <summary>BASELINE_PPT | CURRENT_FILTERED</summary>
  408. public string Scope { get; set; } = string.Empty;
  409. /// <summary>逗号分隔订单号;scope=CURRENT_FILTERED 时使用。</summary>
  410. public string? OrderCodes { get; set; }
  411. }
  412. /// <summary>
  413. /// 主门禁里程碑行:ASSEMBLY_COMPLETION / QUALITY_RELEASE / PACKAGING_COMPLETION / GOODS_HANDOVER / SHIPMENT_CONFIRMATION。
  414. /// planned_offset_days 为累计里程碑(0.6/1.2/1.8/2.4/3.0);末位 SHIPMENT_CONFIRMATION.actual_offset_days 守恒为 stage.actual_days。
  415. /// pending 单不进入聚合结果。
  416. /// </summary>
  417. public class AdoS8FinalAssemblyGateDto
  418. {
  419. public string GateCode { get; set; } = string.Empty;
  420. public string GateName { get; set; } = string.Empty;
  421. public decimal PlannedOffsetDays { get; set; }
  422. public decimal? ActualOffsetDays { get; set; }
  423. public decimal? VarianceDays { get; set; }
  424. public string Status { get; set; } = string.Empty;
  425. public int? ImpactedOrderCount { get; set; }
  426. public int? RiskOrderCount { get; set; }
  427. public string? TopRiskType { get; set; }
  428. public string? TopRiskLabel { get; set; }
  429. public string? OwnerSideText { get; set; }
  430. public int SortNo { get; set; }
  431. }
  432. /// <summary>
  433. /// 并行准备行:PACKAGING_MATERIAL_PREP / LABEL_DOC_PREP / SHIPPING_PLAN / SHIPPING_DOC_PREP。
  434. /// kitting_rate 取值 0.0000~1.0000;status 按 ≥0.95 green / ≥0.85 yellow / 否则 red 派生(seed 时固化,运行期不重判)。
  435. /// </summary>
  436. public class AdoS8FinalAssemblyParallelDto
  437. {
  438. public string PrepCode { get; set; } = string.Empty;
  439. public string PrepName { get; set; } = string.Empty;
  440. public decimal? KittingRate { get; set; }
  441. public string Status { get; set; } = string.Empty;
  442. public int? ImpactedOrderCount { get; set; }
  443. public int? RiskOrderCount { get; set; }
  444. public string? TopRiskType { get; set; }
  445. public string? TopRiskLabel { get; set; }
  446. public string? OwnerSideText { get; set; }
  447. public int SortNo { get; set; }
  448. }
  449. /// <summary>总装发货透视聚合结果:scope + 5 门禁 + 4 并行准备。</summary>
  450. public class AdoS8FinalAssemblyPivotDto
  451. {
  452. /// <summary>BASELINE_PPT | CURRENT_FILTERED</summary>
  453. public string Scope { get; set; } = string.Empty;
  454. public List<AdoS8FinalAssemblyGateDto> Gates { get; set; } = new();
  455. public List<AdoS8FinalAssemblyParallelDto> ParallelPreps { get; set; } = new();
  456. }
  457. #endregion