OrderFlowConstants.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. namespace Admin.NET.Plugin.AiDOP.Service.S8.OrderFlow;
  2. /// <summary>
  3. /// ORDER-FLOW-S8-INTEGRATED-DOMAIN-RESET-1 t3b:ORDER_FLOW 5 项常量 + 派生映射。
  4. /// 5 阶段顺序由 SortNo 隐含(同 ORDER_FLOW_ALL 数组顺序);S_STAGE 与 OrderFlowName 字典为只读引用。
  5. /// 不在此文件硬编码任何业务真值(KPI 天数 / 行数 / 真值矩阵)。
  6. /// </summary>
  7. public static class OrderFlowConstants
  8. {
  9. /// <summary>S8 演示数据所属租户(sys_tenant 中正式注册的 AIDOP-Demo 租户)。</summary>
  10. public const long DemoTenantId = 797403760988230L;
  11. /// <summary>预分配 Demo 工厂 OrgId(InitNewTenant / UpdateScript 1.0.317 会建)。</summary>
  12. public const long DemoFactoryId = 797403760988231L;
  13. /// <summary>Demo 租户根机构 OrgId(UpdateScript 1.0.317 预分配)。</summary>
  14. public const long DemoRootOrgId = 797403760988232L;
  15. public const string ORDER_REVIEW_PLAN_CALC = "ORDER_REVIEW_PLAN_CALC";
  16. public const string PRODUCT_DESIGN = "PRODUCT_DESIGN";
  17. public const string MATERIAL_PURCHASE = "MATERIAL_PURCHASE";
  18. public const string BODY_PRODUCTION = "BODY_PRODUCTION";
  19. public const string FINAL_ASSEMBLY_DELIVERY = "FINAL_ASSEMBLY_DELIVERY";
  20. /// <summary>5 阶段固定顺序(与 ado_s8_order_flow_stage.sort_no 1~5 对齐)。</summary>
  21. public static readonly IReadOnlyList<string> All = new[]
  22. {
  23. ORDER_REVIEW_PLAN_CALC,
  24. PRODUCT_DESIGN,
  25. MATERIAL_PURCHASE,
  26. BODY_PRODUCTION,
  27. FINAL_ASSEMBLY_DELIVERY,
  28. };
  29. /// <summary>ORDER_FLOW → S 阶段编码(演示协议固定)。</summary>
  30. public static readonly IReadOnlyDictionary<string, string> SStageMap = new Dictionary<string, string>
  31. {
  32. [ORDER_REVIEW_PLAN_CALC] = "S1",
  33. [PRODUCT_DESIGN] = "S2",
  34. [MATERIAL_PURCHASE] = "S3",
  35. [BODY_PRODUCTION] = "S6",
  36. [FINAL_ASSEMBLY_DELIVERY] = "S7",
  37. };
  38. /// <summary>ORDER_FLOW → 展示中文名(与 t2a stage seed FlowDef 一致)。</summary>
  39. public static readonly IReadOnlyDictionary<string, string> OrderFlowName = new Dictionary<string, string>
  40. {
  41. [ORDER_REVIEW_PLAN_CALC] = "评审/排产/测算",
  42. [PRODUCT_DESIGN] = "产品设计",
  43. [MATERIAL_PURCHASE] = "材料采购",
  44. [BODY_PRODUCTION] = "本体生产",
  45. [FINAL_ASSEMBLY_DELIVERY] = "总装发货",
  46. };
  47. /// <summary>未识别 code 时的 fallback 名称(直接回显 code)。</summary>
  48. public static string ResolveName(string? orderFlowCode)
  49. => !string.IsNullOrEmpty(orderFlowCode) && OrderFlowName.TryGetValue(orderFlowCode, out var n)
  50. ? n
  51. : (orderFlowCode ?? string.Empty);
  52. /// <summary>未识别 code 时回退为空字符串(service 调用方决定是否升级为异常)。</summary>
  53. public static string ResolveSStage(string? orderFlowCode)
  54. => !string.IsNullOrEmpty(orderFlowCode) && SStageMap.TryGetValue(orderFlowCode, out var s)
  55. ? s
  56. : string.Empty;
  57. }