AdoS8OrderFlowProcurementPivot.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. namespace Admin.NET.Plugin.AiDOP.Entity.S8.OrderFlow;
  2. /// <summary>
  3. /// ORDER-FLOW-S8-INTEGRATED-DOMAIN-RESET-1 t1b:S8 订单执行链路材料采购透视表。
  4. /// 承载供应商 × 线材规格的周期透视数据;order_id / order_code 允许为空:
  5. /// - NULL → baseline / PPT / DEMO 级别基线行
  6. /// - 非 NULL → 订单级透视行(后续扩展)
  7. /// cycle_days 使用 decimal(6,3) 以承载 YY 真值的 3 位小数精度。
  8. /// material_code / supplier_code / spec_code 的 TOTAL 值表示合计行 / 合计列。
  9. /// </summary>
  10. [SugarTable("ado_s8_order_flow_procurement_pivot", "S8 订单执行链路采购透视表")]
  11. [SugarIndex("idx_order_flow_proc_pivot_baseline", nameof(TenantId), OrderByType.Asc, nameof(FactoryId), OrderByType.Asc, nameof(MaterialCode), OrderByType.Asc, nameof(SupplierCode), OrderByType.Asc, nameof(SpecCode), OrderByType.Asc)]
  12. [SugarIndex("idx_order_flow_proc_pivot_order", nameof(TenantId), OrderByType.Asc, nameof(FactoryId), OrderByType.Asc, nameof(OrderCode), OrderByType.Asc)]
  13. [SugarIndex("idx_order_flow_proc_pivot_scenario", nameof(TenantId), OrderByType.Asc, nameof(FactoryId), OrderByType.Asc, nameof(ScenarioCode), OrderByType.Asc, nameof(IsDeleted), OrderByType.Asc)]
  14. public class AdoS8OrderFlowProcurementPivot
  15. {
  16. [SugarColumn(ColumnName = "id", IsPrimaryKey = true, ColumnDataType = "bigint")]
  17. public long Id { get; set; }
  18. /// <summary>NULL = baseline 行;非 NULL = 订单级行。</summary>
  19. [SugarColumn(ColumnName = "order_id", ColumnDataType = "bigint", IsNullable = true)]
  20. public long? OrderId { get; set; }
  21. /// <summary>NULL = baseline 行;非 NULL = 订单业务键。</summary>
  22. [SugarColumn(ColumnName = "order_code", Length = 64, IsNullable = true)]
  23. public string? OrderCode { get; set; }
  24. /// <summary>材料编码:XX / YY / ZZ / TOTAL。TOTAL 表示合计行。</summary>
  25. [SugarColumn(ColumnName = "material_code", Length = 16)]
  26. public string MaterialCode { get; set; } = string.Empty;
  27. /// <summary>供应商编码:A / B / C / TOTAL。</summary>
  28. [SugarColumn(ColumnName = "supplier_code", Length = 16)]
  29. public string SupplierCode { get; set; } = string.Empty;
  30. /// <summary>线材规格:L4.5*11.2 / MT2*6.3 / MT1*5.4 / TOTAL。</summary>
  31. [SugarColumn(ColumnName = "spec_code", Length = 32)]
  32. public string SpecCode { get; set; } = string.Empty;
  33. /// <summary>周期天数。精度 decimal(6,3) 以承载 YY 真值最高位的 3 位小数。</summary>
  34. [SugarColumn(ColumnName = "cycle_days", DecimalDigits = 3, Length = 6)]
  35. public decimal CycleDays { get; set; }
  36. /// <summary>green / yellow / red。</summary>
  37. [SugarColumn(ColumnName = "status", Length = 16)]
  38. public string Status { get; set; } = "green";
  39. /// <summary>影响台次。仅 grand 单元(supplier_code=TOTAL 且 spec_code=TOTAL)承载该材料的台次合计,其它细粒度单元保持 NULL。</summary>
  40. [SugarColumn(ColumnName = "impact_count", ColumnDataType = "int", IsNullable = true)]
  41. public int? ImpactCount { get; set; }
  42. /// <summary>准时齐套率。decimal(5,4),取值范围 0.0000~1.0000;仅 grand 单元承载该材料的齐套率,其它细粒度单元保持 NULL。</summary>
  43. [SugarColumn(ColumnName = "kit_rate", DecimalDigits = 4, Length = 5, IsNullable = true)]
  44. public decimal? KitRate { get; set; }
  45. /// <summary>PPT(YY 真值)/ DEMO(XX, ZZ 演示 fixture)。</summary>
  46. [SugarColumn(ColumnName = "scenario_code", Length = 16)]
  47. public string ScenarioCode { get; set; } = "DEMO";
  48. /// <summary>SEED / IMPORT / AGG。</summary>
  49. [SugarColumn(ColumnName = "data_source", Length = 16)]
  50. public string DataSource { get; set; } = "SEED";
  51. [SugarColumn(ColumnName = "tenant_id", ColumnDataType = "bigint")]
  52. public long TenantId { get; set; }
  53. [SugarColumn(ColumnName = "factory_id", ColumnDataType = "bigint")]
  54. public long FactoryId { get; set; }
  55. [SugarColumn(ColumnName = "created_at")]
  56. public DateTime CreatedAt { get; set; } = DateTime.Now;
  57. [SugarColumn(ColumnName = "updated_at", IsNullable = true)]
  58. public DateTime? UpdatedAt { get; set; }
  59. [SugarColumn(ColumnName = "is_deleted", ColumnDataType = "boolean")]
  60. public bool IsDeleted { get; set; }
  61. }