| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- namespace Admin.NET.Plugin.AiDOP.Entity.S8.OrderFlow;
- /// <summary>
- /// S8-ORDER-CHAIN-PRODUCT-DESIGN-DRAWING-PERSIST-1:S8 订单链路产品设计图号事实表。
- /// 承载 PRODUCT_DESIGN 阶段图号粒度的产品设计阶段基准业务初始化数据:
- /// - 1 行 = 1 张图号绑定 1 个订单(OrderCode + DrawingNo 为业务唯一);
- /// - 台数 / 占比 / 加权达成率 全部由 product_quantity 字段单一来源驱动;
- /// - 平均设计周期 由 actual_days 算术平均;
- /// - 达标判定 由 is_achieved + 当前 KPI=3 天为阈值(actual_days <= kpi_days);
- /// 设计语义独立,不复用 ado_s8_order_flow_substep / substep_unit 的工时小时口径,
- /// 也不与 ado_product_design(独立 Order 域表)建立物理依赖。
- /// </summary>
- [SugarTable("ado_s8_order_flow_product_design_drawing", "S8 订单链路产品设计图号事实表")]
- [SugarIndex("uk_order_flow_pdd_drawing",
- nameof(TenantId), OrderByType.Asc,
- nameof(FactoryId), OrderByType.Asc,
- nameof(OrderCode), OrderByType.Asc,
- nameof(DrawingNo), OrderByType.Asc,
- IsUnique = true)]
- [SugarIndex("idx_order_flow_pdd_order_code",
- nameof(TenantId), OrderByType.Asc,
- nameof(FactoryId), OrderByType.Asc,
- nameof(OrderCode), OrderByType.Asc)]
- [SugarIndex("idx_order_flow_pdd_product_type",
- nameof(TenantId), OrderByType.Asc,
- nameof(FactoryId), OrderByType.Asc,
- nameof(ProductType), OrderByType.Asc)]
- public class AdoS8OrderFlowProductDesignDrawing
- {
- [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>订单业务键,引用 ado_s8_order_flow_order.order_code(无物理 FK,逻辑一致性由 service 保证)。</summary>
- [SugarColumn(ColumnName = "order_code", Length = 64)]
- public string OrderCode { get; set; } = string.Empty;
- /// <summary>图号编码:常规 D-{OrderCode}-G{NN};非标 D-{OrderCode}-X{NN}。租户/工厂内 OrderCode + DrawingNo 业务唯一。</summary>
- [SugarColumn(ColumnName = "drawing_no", Length = 64)]
- public string DrawingNo { get; set; } = string.Empty;
- /// <summary>产品类型:STANDARD(常规产品)/ NON_STANDARD(非标产品)。白名单由 service / seed 约束。</summary>
- [SugarColumn(ColumnName = "product_type", Length = 16)]
- public string ProductType { get; set; } = string.Empty;
- /// <summary>该图号对应台数。前端"台数 / 占比 / 加权达成率"三种口径的唯一数据源。</summary>
- [SugarColumn(ColumnName = "product_quantity")]
- public int ProductQuantity { get; set; }
- /// <summary>负责人字段,承载责任单位/岗位(研发中心 / 结构设计组 / 电气设计组 / 工艺设计组 / 设计审核组)。</summary>
- [SugarColumn(ColumnName = "responsible_person", Length = 64)]
- public string ResponsiblePerson { get; set; } = string.Empty;
- /// <summary>图号粒度计划开始日期(订单 PRODUCT_DESIGN 阶段区间内)。</summary>
- [SugarColumn(ColumnName = "planned_start_date")]
- public DateTime PlannedStartDate { get; set; }
- /// <summary>图号粒度计划结束日期。</summary>
- [SugarColumn(ColumnName = "planned_end_date")]
- public DateTime PlannedEndDate { get; set; }
- /// <summary>图号粒度实际开始日期;未开工时为 null。</summary>
- [SugarColumn(ColumnName = "actual_start_date", IsNullable = true)]
- public DateTime? ActualStartDate { get; set; }
- /// <summary>图号粒度实际结束日期;未完成时为 null。</summary>
- [SugarColumn(ColumnName = "actual_end_date", IsNullable = true)]
- public DateTime? ActualEndDate { get; set; }
- /// <summary>KPI 标准设计天数。PRODUCT_DESIGN 阶段固定 3 天,落库为常量字段以支持后续 KPI 调整。</summary>
- [SugarColumn(ColumnName = "kpi_days", DecimalDigits = 2, Length = 6)]
- public decimal KpiDays { get; set; }
- /// <summary>实际设计周期(天)。actual_end_date - actual_start_date 派生;未完成时为 null。</summary>
- [SugarColumn(ColumnName = "actual_days", DecimalDigits = 2, Length = 6, IsNullable = true)]
- public decimal? ActualDays { get; set; }
- /// <summary>是否达标:actual_days <= kpi_days。未完成图号此列 false。</summary>
- [SugarColumn(ColumnName = "is_achieved", ColumnDataType = "boolean")]
- public bool IsAchieved { get; set; }
- /// <summary>green / yellow / red / pending。green = actual_days <= kpi_days;yellow = (actual - kpi)/kpi <= 0.20;red = 其余;pending = 未完成。</summary>
- [SugarColumn(ColumnName = "status", Length = 16)]
- public string Status { get; set; } = "pending";
- /// <summary>同订单内图号展示顺序,从 1 起。</summary>
- [SugarColumn(ColumnName = "sort_no")]
- public int SortNo { get; set; }
- [SugarColumn(ColumnName = "is_deleted", ColumnDataType = "boolean")]
- public bool IsDeleted { get; set; }
- [SugarColumn(ColumnName = "create_time")]
- public DateTime CreateTime { get; set; } = DateTime.Now;
- [SugarColumn(ColumnName = "update_time", IsNullable = true)]
- public DateTime? UpdateTime { get; set; }
- }
|