AdoDemoOrderFlowSnapshot.cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. namespace Admin.NET.Plugin.AiDOP.Entity.S8.Demo;
  2. /// <summary>
  3. /// ORDER-FLOW-BE-DEMO-DATASET-RESET-1 演示基线聚合快照:chain 默认全选展示用。
  4. /// 注意:本快照不是当前明细 20 单的实时聚合结果,而是冻结的 105 单基线展示快照,
  5. /// 由 SeedData 一次性写入。前端 chain 默认全选独立读取此快照,与 /orders 不同源。
  6. /// </summary>
  7. [SugarTable("ado_demo_order_flow_snapshot", "演示基线聚合快照(baseline,独立于 20 单明细)")]
  8. [SugarIndex("uk_demo_order_flow_snapshot_code", nameof(SnapshotCode), OrderByType.Asc, true)]
  9. public class AdoDemoOrderFlowSnapshot
  10. {
  11. [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = false, ColumnDataType = "bigint")]
  12. public long Id { get; set; }
  13. /// <summary>固定为 'CHAIN_AGGREGATE_BASELINE'。</summary>
  14. [SugarColumn(ColumnName = "snapshot_code", Length = 64)]
  15. public string SnapshotCode { get; set; } = "CHAIN_AGGREGATE_BASELINE";
  16. /// <summary>UI 直接展示的标签文本,例如 "基线聚合 · 样本 105"。</summary>
  17. [SugarColumn(ColumnName = "snapshot_label", Length = 64)]
  18. public string SnapshotLabel { get; set; } = "基线聚合 · 样本 105";
  19. [SugarColumn(ColumnName = "total_orders")]
  20. public int TotalOrders { get; set; }
  21. [SugarColumn(ColumnName = "total_customers")]
  22. public int TotalCustomers { get; set; }
  23. [SugarColumn(ColumnName = "avg_response_minutes", DecimalDigits = 2, Length = 8)]
  24. public decimal AvgResponseMinutes { get; set; }
  25. [SugarColumn(ColumnName = "avg_processing_minutes", DecimalDigits = 2, Length = 8)]
  26. public decimal AvgProcessingMinutes { get; set; }
  27. [SugarColumn(ColumnName = "avg_loss_minutes", DecimalDigits = 2, Length = 8)]
  28. public decimal AvgLossMinutes { get; set; }
  29. /// <summary>5 阶段聚合 JSON 数组:stageKey/stageName/ownerDept/kpiAvgDays/actualAvgDays/onTimeRate/green/yellow/red/pending。</summary>
  30. [SugarColumn(ColumnName = "stage_snapshots_json", ColumnDataType = "longtext", IsJson = false)]
  31. public string StageSnapshotsJson { get; set; } = "[]";
  32. [SugarColumn(ColumnName = "remark", Length = 256, IsNullable = true)]
  33. public string? Remark { get; set; }
  34. [SugarColumn(ColumnName = "tenant_id", ColumnDataType = "bigint")]
  35. public long TenantId { get; set; }
  36. [SugarColumn(ColumnName = "factory_id", ColumnDataType = "bigint")]
  37. public long FactoryId { get; set; }
  38. [SugarColumn(ColumnName = "created_at")]
  39. public DateTime CreatedAt { get; set; } = DateTime.Now;
  40. [SugarColumn(ColumnName = "updated_at", IsNullable = true)]
  41. public DateTime? UpdatedAt { get; set; }
  42. [SugarColumn(ColumnName = "is_deleted", ColumnDataType = "boolean")]
  43. public bool IsDeleted { get; set; }
  44. }