S8OrderFlowSnapshotSeedData.cs 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using Admin.NET.Plugin.AiDOP.Entity.S8.OrderFlow;
  2. namespace Admin.NET.Plugin.AiDOP.SeedData;
  3. /// <summary>
  4. /// ORDER-FLOW-S8-INTEGRATED-DOMAIN-RESET-1 t2c:S8 订单执行链路 BASELINE_PPT 聚合快照种子。
  5. /// 单条记录:snapshot_code = CHAIN_AGGREGATE_BASELINE / scope_code = BASELINE_PPT / scenario = PPT。
  6. /// stage_snapshots_json 含 5 阶段 PPT 第 1 页真值。onTimeRate 是整数百分比(59/98/85/89/96)。
  7. /// service 层 baseline 读取协议:scope_code=BASELINE_PPT → 取本表行;CURRENT_FILTERED → 实时聚合。
  8. /// S8-ORDER-CHAIN-PRODUCT-DESIGN-PPT-STATIC-AND-SINGLE-ORDER-ALIGN-1:PRODUCT_DESIGN
  9. /// 行按 PPT 业务口径修正为 actualAvgDays=2.5 / onTimeRate=98。
  10. /// </summary>
  11. [IncreSeed]
  12. public class S8OrderFlowSnapshotSeedData : ISqlSugarEntitySeedData<AdoS8OrderFlowSnapshot>
  13. {
  14. internal const long SnapshotIdBase = 1329909150000L;
  15. public IEnumerable<AdoS8OrderFlowSnapshot> HasData()
  16. {
  17. yield return new AdoS8OrderFlowSnapshot
  18. {
  19. Id = SnapshotIdBase + 1,
  20. TenantId = 1,
  21. FactoryId = 1,
  22. SnapshotCode = "CHAIN_AGGREGATE_BASELINE",
  23. ScopeCode = "BASELINE_PPT",
  24. TotalOrders = 105,
  25. TotalCustomers = 5,
  26. AvgResponseMinutes = 91.2m,
  27. AvgProcessingMinutes = 1060.5m,
  28. AvgLossMinutes = 1472.5m,
  29. StageSnapshotsJson = StageSnapshotsJson,
  30. ScenarioCode = "PPT",
  31. DataSource = "SEED",
  32. CreatedAt = S8OrderFlowDataset.CreatedAt,
  33. UpdatedAt = null,
  34. IsDeleted = false,
  35. };
  36. }
  37. /// <summary>BASELINE_PPT 5 阶段聚合 JSON(顺序:评审/排产/测算 → 产品设计 → 材料采购 → 本体生产 → 总装发货)。</summary>
  38. private const string StageSnapshotsJson =
  39. "[" +
  40. "{\"orderFlowCode\":\"ORDER_REVIEW_PLAN_CALC\",\"orderFlowName\":\"评审/排产/测算\",\"kpiAvgDays\":5.0,\"actualAvgDays\":6.2,\"onTimeRate\":59,\"green\":0,\"yellow\":0,\"red\":0,\"pending\":0}," +
  41. "{\"orderFlowCode\":\"PRODUCT_DESIGN\",\"orderFlowName\":\"产品设计\",\"kpiAvgDays\":3.0,\"actualAvgDays\":2.5,\"onTimeRate\":98,\"green\":0,\"yellow\":0,\"red\":0,\"pending\":0}," +
  42. "{\"orderFlowCode\":\"MATERIAL_PURCHASE\",\"orderFlowName\":\"材料采购\",\"kpiAvgDays\":14.0,\"actualAvgDays\":15.5,\"onTimeRate\":85,\"green\":0,\"yellow\":0,\"red\":0,\"pending\":0}," +
  43. "{\"orderFlowCode\":\"BODY_PRODUCTION\",\"orderFlowName\":\"本体生产\",\"kpiAvgDays\":6.0,\"actualAvgDays\":6.7,\"onTimeRate\":89,\"green\":0,\"yellow\":0,\"red\":0,\"pending\":0}," +
  44. "{\"orderFlowCode\":\"FINAL_ASSEMBLY_DELIVERY\",\"orderFlowName\":\"总装发货\",\"kpiAvgDays\":3.0,\"actualAvgDays\":2.9,\"onTimeRate\":96,\"green\":0,\"yellow\":0,\"red\":0,\"pending\":0}" +
  45. "]";
  46. }