| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- namespace Admin.NET.Plugin.AiDOP.Entity.S8.OrderFlow;
- /// <summary>
- /// ORDER-FLOW-S8-INTEGRATED-DOMAIN-RESET-1 t1a:S8 订单链路基线快照表(baseline 聚合)。
- /// 同时替代 service 层任何 baseline 硬编码。
- /// service 读取协议:scope_code=BASELINE_PPT → 取本表行;scope_code=CURRENT_FILTERED → 实时聚合明细表。
- /// 任何 baseline 数值(如总订单数 / 平均时长 / 5 阶段聚合)严禁出现在 service 字面量。
- /// </summary>
- [SugarTable("ado_s8_order_flow_snapshot", "S8 订单执行链路聚合快照")]
- [SugarIndex("uk_order_flow_snapshot_code", nameof(TenantId), OrderByType.Asc, nameof(FactoryId), OrderByType.Asc, nameof(SnapshotCode), OrderByType.Asc, IsUnique = true)]
- [SugarIndex("idx_order_flow_snapshot_scope", nameof(TenantId), OrderByType.Asc, nameof(FactoryId), OrderByType.Asc, nameof(ScopeCode), OrderByType.Asc, nameof(IsDeleted), OrderByType.Asc)]
- public class AdoS8OrderFlowSnapshot
- {
- [SugarColumn(ColumnName = "id", IsPrimaryKey = true, ColumnDataType = "bigint")]
- public long Id { get; set; }
- [SugarColumn(ColumnName = "tenant_id", ColumnDataType = "bigint")]
- public long TenantId { get; set; }
- [SugarColumn(ColumnName = "factory_id", ColumnDataType = "bigint")]
- public long FactoryId { get; set; }
- /// <summary>快照业务键,唯一。t2c seed 首条值固定为 CHAIN_AGGREGATE_BASELINE。</summary>
- [SugarColumn(ColumnName = "snapshot_code", Length = 64)]
- public string SnapshotCode { get; set; } = string.Empty;
- /// <summary>BASELINE_PPT / BASELINE_DEMO。t2c seed 首条值固定为 BASELINE_PPT。</summary>
- [SugarColumn(ColumnName = "scope_code", Length = 32)]
- public string ScopeCode { get; set; } = string.Empty;
- [SugarColumn(ColumnName = "total_orders")]
- public int TotalOrders { get; set; }
- [SugarColumn(ColumnName = "total_customers")]
- public int TotalCustomers { get; set; }
- [SugarColumn(ColumnName = "avg_response_minutes", DecimalDigits = 2, Length = 8)]
- public decimal AvgResponseMinutes { get; set; }
- [SugarColumn(ColumnName = "avg_processing_minutes", DecimalDigits = 2, Length = 8)]
- public decimal AvgProcessingMinutes { get; set; }
- [SugarColumn(ColumnName = "avg_loss_minutes", DecimalDigits = 2, Length = 8)]
- public decimal AvgLossMinutes { get; set; }
- /// <summary>5 阶段聚合 JSON。每项含 orderFlowCode/orderFlowName/kpiAvgDays/actualAvgDays/onTimeRate(int %)/green/yellow/red/pending。t2c seed 写入 BASELINE_PPT 真值。</summary>
- [SugarColumn(ColumnName = "stage_snapshots_json", ColumnDataType = "longtext")]
- public string StageSnapshotsJson { get; set; } = string.Empty;
- /// <summary>PPT / DEMO。</summary>
- [SugarColumn(ColumnName = "scenario_code", Length = 16)]
- public string ScenarioCode { get; set; } = "PPT";
- /// <summary>SEED / IMPORT / AGG。</summary>
- [SugarColumn(ColumnName = "data_source", Length = 16)]
- public string DataSource { get; set; } = "SEED";
- [SugarColumn(ColumnName = "created_at")]
- public DateTime CreatedAt { get; set; } = DateTime.Now;
- [SugarColumn(ColumnName = "updated_at", IsNullable = true)]
- public DateTime? UpdatedAt { get; set; }
- [SugarColumn(ColumnName = "is_deleted", ColumnDataType = "boolean")]
- public bool IsDeleted { get; set; }
- }
|