AdoS8OrderFlowOrder.cs 4.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. namespace Admin.NET.Plugin.AiDOP.Entity.S8.OrderFlow;
  2. /// <summary>
  3. /// ORDER-FLOW-S8-INTEGRATED-DOMAIN-RESET-1 t1a:S8 订单链路正式主表。
  4. /// order_code 为业务键;不保留异常数预存字段,
  5. /// 异常数由 ado_s8_exception 实时聚合,order 表只持有 response/processing/loss KPI。
  6. /// </summary>
  7. [SugarTable("ado_s8_order_flow_order", "S8 订单执行链路主档")]
  8. [SugarIndex("uk_order_flow_order_code", nameof(TenantId), OrderByType.Asc, nameof(FactoryId), OrderByType.Asc, nameof(OrderCode), OrderByType.Asc, IsUnique = true)]
  9. [SugarIndex("idx_order_flow_order_current_flow", nameof(TenantId), OrderByType.Asc, nameof(FactoryId), OrderByType.Asc, nameof(CurrentOrderFlowCode), OrderByType.Asc)]
  10. [SugarIndex("idx_order_flow_order_customer", nameof(TenantId), OrderByType.Asc, nameof(FactoryId), OrderByType.Asc, nameof(CustomerCode), OrderByType.Asc)]
  11. public class AdoS8OrderFlowOrder
  12. {
  13. [SugarColumn(ColumnName = "id", IsPrimaryKey = true, ColumnDataType = "bigint")]
  14. public long Id { get; set; }
  15. [SugarColumn(ColumnName = "tenant_id", ColumnDataType = "bigint")]
  16. public long TenantId { get; set; }
  17. [SugarColumn(ColumnName = "factory_id", ColumnDataType = "bigint")]
  18. public long FactoryId { get; set; }
  19. /// <summary>订单业务键,全局唯一(tenant/factory 维度)。</summary>
  20. [SugarColumn(ColumnName = "order_code", Length = 64)]
  21. public string OrderCode { get; set; } = string.Empty;
  22. [SugarColumn(ColumnName = "product_name", Length = 128)]
  23. public string ProductName { get; set; } = string.Empty;
  24. [SugarColumn(ColumnName = "product_line", Length = 32)]
  25. public string ProductLine { get; set; } = string.Empty;
  26. [SugarColumn(ColumnName = "customer_code", Length = 64)]
  27. public string CustomerCode { get; set; } = string.Empty;
  28. [SugarColumn(ColumnName = "customer_name", Length = 128)]
  29. public string CustomerName { get; set; } = string.Empty;
  30. /// <summary>KA / SMB / MICRO。</summary>
  31. [SugarColumn(ColumnName = "customer_type", Length = 16)]
  32. public string CustomerType { get; set; } = "KA";
  33. [SugarColumn(ColumnName = "region", Length = 32)]
  34. public string Region { get; set; } = string.Empty;
  35. /// <summary>P1 / P2 / P3。</summary>
  36. [SugarColumn(ColumnName = "priority", Length = 16)]
  37. public string Priority { get; set; } = "P2";
  38. /// <summary>completed / in_progress。</summary>
  39. [SugarColumn(ColumnName = "workflow_status", Length = 32)]
  40. public string WorkflowStatus { get; set; } = "in_progress";
  41. /// <summary>UPPER ORDER_FLOW node_code(5 选 1):ORDER_REVIEW_PLAN_CALC / PRODUCT_DESIGN / MATERIAL_PURCHASE / BODY_PRODUCTION / FINAL_ASSEMBLY_DELIVERY。白名单由 service 层校验。</summary>
  42. [SugarColumn(ColumnName = "current_order_flow_code", Length = 64)]
  43. public string CurrentOrderFlowCode { get; set; } = string.Empty;
  44. [SugarColumn(ColumnName = "release_at")]
  45. public DateTime ReleaseAt { get; set; }
  46. [SugarColumn(ColumnName = "target_cycle_days", DecimalDigits = 1, Length = 6)]
  47. public decimal TargetCycleDays { get; set; }
  48. [SugarColumn(ColumnName = "actual_cycle_days", DecimalDigits = 1, Length = 6, IsNullable = true)]
  49. public decimal? ActualCycleDays { get; set; }
  50. /// <summary>KPI:响应时长(分钟)。来源 = 主档业务字段,不从 ado_s8_exception 派生。</summary>
  51. [SugarColumn(ColumnName = "response_minutes", IsNullable = true)]
  52. public int? ResponseMinutes { get; set; }
  53. /// <summary>KPI:处理时长(分钟)。来源 = 主档业务字段。</summary>
  54. [SugarColumn(ColumnName = "processing_minutes", IsNullable = true)]
  55. public int? ProcessingMinutes { get; set; }
  56. /// <summary>KPI:总损失时长(分钟)。来源 = 主档业务字段。</summary>
  57. [SugarColumn(ColumnName = "total_loss_minutes", IsNullable = true)]
  58. public int? TotalLossMinutes { get; set; }
  59. /// <summary>PPT / DEMO / PROD。SO-2026-001 = PPT;其余 19 单 = DEMO。</summary>
  60. [SugarColumn(ColumnName = "scenario_code", Length = 16)]
  61. public string ScenarioCode { get; set; } = "DEMO";
  62. /// <summary>SEED / IMPORT / AGG。t2a seed 全部为 SEED。</summary>
  63. [SugarColumn(ColumnName = "data_source", Length = 16)]
  64. public string DataSource { get; set; } = "SEED";
  65. [SugarColumn(ColumnName = "created_at")]
  66. public DateTime CreatedAt { get; set; } = DateTime.Now;
  67. [SugarColumn(ColumnName = "updated_at", IsNullable = true)]
  68. public DateTime? UpdatedAt { get; set; }
  69. [SugarColumn(ColumnName = "is_deleted", ColumnDataType = "boolean")]
  70. public bool IsDeleted { get; set; }
  71. }