AdoS8OrderFlowProcurementPivot.cs 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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>PPT(YY 真值)/ DEMO(XX, ZZ 演示 fixture)。</summary>
  40. [SugarColumn(ColumnName = "scenario_code", Length = 16)]
  41. public string ScenarioCode { get; set; } = "DEMO";
  42. /// <summary>SEED / IMPORT / AGG。</summary>
  43. [SugarColumn(ColumnName = "data_source", Length = 16)]
  44. public string DataSource { get; set; } = "SEED";
  45. [SugarColumn(ColumnName = "tenant_id", ColumnDataType = "bigint")]
  46. public long TenantId { get; set; }
  47. [SugarColumn(ColumnName = "factory_id", ColumnDataType = "bigint")]
  48. public long FactoryId { get; set; }
  49. [SugarColumn(ColumnName = "created_at")]
  50. public DateTime CreatedAt { get; set; } = DateTime.Now;
  51. [SugarColumn(ColumnName = "updated_at", IsNullable = true)]
  52. public DateTime? UpdatedAt { get; set; }
  53. [SugarColumn(ColumnName = "is_deleted", ColumnDataType = "boolean")]
  54. public bool IsDeleted { get; set; }
  55. }