AdoS8OrderFlowSubstep.cs 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. namespace Admin.NET.Plugin.AiDOP.Entity.S8.OrderFlow;
  2. /// <summary>
  3. /// ORDER-FLOW-S8-INTEGRATED-DOMAIN-RESET-1 t1b:S8 订单执行链路 L2 子节点。
  4. /// 首版用于 ORDER_REVIEW_PLAN_CALC 阶段的 5 个评审子节点(意见评审 / 意见反馈 /
  5. /// 二次评审 / 领导意见 / 合同盖章)。substep_code 白名单由 service / seed 约束,
  6. /// 不在 DB CHECK 中固化,便于后续扩展其它阶段的子节点。
  7. /// </summary>
  8. [SugarTable("ado_s8_order_flow_substep", "S8 订单执行链路 L2 子节点")]
  9. [SugarIndex("uk_order_flow_substep", nameof(OrderId), OrderByType.Asc, nameof(SubstepCode), OrderByType.Asc, IsUnique = true)]
  10. [SugarIndex("idx_order_flow_substep_order_code", nameof(TenantId), OrderByType.Asc, nameof(FactoryId), OrderByType.Asc, nameof(OrderCode), OrderByType.Asc)]
  11. [SugarIndex("idx_order_flow_substep_flow", nameof(TenantId), OrderByType.Asc, nameof(FactoryId), OrderByType.Asc, nameof(OrderFlowCode), OrderByType.Asc)]
  12. public class AdoS8OrderFlowSubstep
  13. {
  14. [SugarColumn(ColumnName = "id", IsPrimaryKey = true, ColumnDataType = "bigint")]
  15. public long Id { get; set; }
  16. /// <summary>外键 → ado_s8_order_flow_order.id。</summary>
  17. [SugarColumn(ColumnName = "order_id", ColumnDataType = "bigint")]
  18. public long OrderId { get; set; }
  19. /// <summary>冗余订单业务键,便于按 order_code 聚合。</summary>
  20. [SugarColumn(ColumnName = "order_code", Length = 64)]
  21. public string OrderCode { get; set; } = string.Empty;
  22. /// <summary>UPPER ORDER_FLOW node_code,首版主要承载 ORDER_REVIEW_PLAN_CALC。白名单由 service / seed 约束。</summary>
  23. [SugarColumn(ColumnName = "order_flow_code", Length = 64)]
  24. public string OrderFlowCode { get; set; } = string.Empty;
  25. /// <summary>L2 子节点编码:OPINION_REVIEW / OPINION_FEEDBACK / SECOND_REVIEW / LEADER_REVIEW / CONTRACT_SEAL。</summary>
  26. [SugarColumn(ColumnName = "substep_code", Length = 32)]
  27. public string SubstepCode { get; set; } = string.Empty;
  28. [SugarColumn(ColumnName = "substep_name", Length = 32)]
  29. public string SubstepName { get; set; } = string.Empty;
  30. /// <summary>PI 基线工时(小时)。t2b seed 按 PPT 第 2 页基线写入。</summary>
  31. [SugarColumn(ColumnName = "pi_hours", DecimalDigits = 1, Length = 6)]
  32. public decimal PiHours { get; set; }
  33. /// <summary>实际工时(小时)。nullable,未完成时为空。</summary>
  34. [SugarColumn(ColumnName = "actual_hours", DecimalDigits = 1, Length = 6, IsNullable = true)]
  35. public decimal? ActualHours { get; set; }
  36. /// <summary>green / yellow / red / pending。</summary>
  37. [SugarColumn(ColumnName = "status", Length = 16)]
  38. public string Status { get; set; } = "pending";
  39. [SugarColumn(ColumnName = "sort_no")]
  40. public int SortNo { get; set; }
  41. /// <summary>PPT / DEMO / PROD。</summary>
  42. [SugarColumn(ColumnName = "scenario_code", Length = 16)]
  43. public string ScenarioCode { get; set; } = "DEMO";
  44. /// <summary>SEED / IMPORT / AGG。</summary>
  45. [SugarColumn(ColumnName = "data_source", Length = 16)]
  46. public string DataSource { get; set; } = "SEED";
  47. [SugarColumn(ColumnName = "tenant_id", ColumnDataType = "bigint")]
  48. public long TenantId { get; set; }
  49. [SugarColumn(ColumnName = "factory_id", ColumnDataType = "bigint")]
  50. public long FactoryId { get; set; }
  51. [SugarColumn(ColumnName = "created_at")]
  52. public DateTime CreatedAt { get; set; } = DateTime.Now;
  53. [SugarColumn(ColumnName = "updated_at", IsNullable = true)]
  54. public DateTime? UpdatedAt { get; set; }
  55. [SugarColumn(ColumnName = "is_deleted", ColumnDataType = "boolean")]
  56. public bool IsDeleted { get; set; }
  57. }