|
|
@@ -3,17 +3,19 @@ using Admin.NET.Plugin.AiDOP.Entity.S8.OrderFlow;
|
|
|
namespace Admin.NET.Plugin.AiDOP.SeedData;
|
|
|
|
|
|
/// <summary>
|
|
|
-/// S8-ORDER-CHAIN-PRODUCT-DESIGN-DRAWING-PERSIST-1:S8 订单链路产品设计阶段基准业务初始化数据种子。
|
|
|
-/// 20 单 × 63 图号;严格满足七项不变量约束:
|
|
|
+/// S8-ORDER-CHAIN-PRODUCT-DESIGN-PPT-STATIC-AND-SINGLE-ORDER-ALIGN-1:S8 订单链路产品设计阶段基准业务初始化数据种子。
|
|
|
+/// 20 单 × 63 图号;按业务口径修正:
|
|
|
/// 1) COUNT(DISTINCT drawing_no) = 63;STANDARD=52 / NON_STANDARD=11
|
|
|
/// 2) SUM(product_quantity ALL) = 382;STANDARD=357 / NON_STANDARD=25
|
|
|
-/// 3) AVG(actual_days WHERE product_type='STANDARD') 落在 [1.17, 1.21]
|
|
|
-/// 4) AVG(actual_days WHERE product_type='NON_STANDARD') 落在 [9.25, 9.31]
|
|
|
-/// 5) AVG(actual_days ALL) ≈ 2.60 天
|
|
|
-/// 6) SUM(product_quantity WHERE is_achieved=false) 落在 [14, 16]
|
|
|
-/// 7) 加权达成率 = 达标 quantity / 总 quantity ≈ 96%
|
|
|
+/// 3) PRODUCT_DESIGN 阶段统一 KPI=3 天:STANDARD 与 NON_STANDARD 的 kpi_days 均为 3
|
|
|
+/// 4) NON_STANDARD 图号 actual_days 全部 > 3 → is_achieved=false / status='red'
|
|
|
+/// 5) STANDARD 51 张图号 actual_days ≤ 3 → is_achieved=true / status='green';1 张超期 actual=4.50 → red
|
|
|
+/// 6) AVG(actual_days WHERE product_type='STANDARD') 落在 [1.17, 1.21]
|
|
|
+/// 7) AVG(actual_days WHERE product_type='NON_STANDARD') 落在 [9.25, 9.31]
|
|
|
/// 图号编码:常规 D-{OrderCode}-G{NN};非标 D-{OrderCode}-X{NN}(绑定 SO-2026-001..020 真实 OrderCode)。
|
|
|
-/// 责任单位/岗位 5 选 1:研发中心 / 结构设计组 / 电气设计组 / 工艺设计组 / 设计审核组;不引入个人姓名。
|
|
|
+/// 责任人字段承载具体设计师姓名(产品设计阶段基准业务初始化数据,6 人按全表全局递增序号 seq 循环分配,确保 6 桶全覆盖)。
|
|
|
+/// 默认基线展示(顶部 2.5 / 98 + 分类汇总 354/28/382 PPT 口径)由 snapshot 表与前端基线数据共同支撑;
|
|
|
+/// 本表负责单订单态与多订单态的图号粒度真实数据。
|
|
|
/// </summary>
|
|
|
[IncreSeed]
|
|
|
public class S8OrderFlowProductDesignDrawingSeedData
|
|
|
@@ -31,20 +33,21 @@ internal static class S8OrderFlowProductDesignDrawingDataset
|
|
|
internal const string ProductTypeStandard = "STANDARD";
|
|
|
internal const string ProductTypeNonStandard = "NON_STANDARD";
|
|
|
|
|
|
- /// <summary>常规产品 KPI(天)。</summary>
|
|
|
+ /// <summary>常规产品 KPI(天)。PRODUCT_DESIGN 阶段统一标准。</summary>
|
|
|
internal const decimal StandardKpiDays = 3.00m;
|
|
|
|
|
|
- /// <summary>非标产品 KPI(天)。业务允许非标设计周期更长,落库为图号粒度独立 KPI。</summary>
|
|
|
- internal const decimal NonStandardKpiDays = 12.00m;
|
|
|
+ /// <summary>非标产品 KPI(天)。与常规产品同阶段标准。</summary>
|
|
|
+ internal const decimal NonStandardKpiDays = 3.00m;
|
|
|
|
|
|
- /// <summary>责任单位/岗位(5 选 1,按 sort_no 循环分配;不使用个人姓名)。</summary>
|
|
|
- private static readonly string[] ResponsibleUnits =
|
|
|
+ /// <summary>产品设计阶段基准业务初始化数据:设计师姓名清单(6 人按全表全局递增序号 seq 循环分配,sort_no 仅为订单内序号,无法保证 6 桶全覆盖)。</summary>
|
|
|
+ private static readonly string[] Designers =
|
|
|
{
|
|
|
- "研发中心",
|
|
|
- "结构设计组",
|
|
|
- "电气设计组",
|
|
|
- "工艺设计组",
|
|
|
- "设计审核组",
|
|
|
+ "李海峰",
|
|
|
+ "陈思远",
|
|
|
+ "王明华",
|
|
|
+ "赵建国",
|
|
|
+ "刘振宇",
|
|
|
+ "周启明",
|
|
|
};
|
|
|
|
|
|
/// <summary>
|
|
|
@@ -66,7 +69,7 @@ internal static class S8OrderFlowProductDesignDrawingDataset
|
|
|
/// <summary>52 张常规图号 spec:合计 actual_days=61.88、qty=357、1 张超期 (qty=3)。</summary>
|
|
|
private static readonly DrawingSpec[] StandardSequence = BuildStandardSequence();
|
|
|
|
|
|
- /// <summary>11 张非标图号 spec:合计 actual_days=102.08、qty=25、2 张超期 (qty=6 each)。</summary>
|
|
|
+ /// <summary>11 张非标图号 spec:合计 actual_days=102.08、qty=25;全部 actual_days > 3 → 全部不达标 red。</summary>
|
|
|
private static readonly DrawingSpec[] NonStandardSequence = BuildNonStandardSequence();
|
|
|
|
|
|
/// <summary>单张图号的回卷规格:actual_days / quantity / is_achieved / status。</summary>
|
|
|
@@ -91,15 +94,15 @@ internal static class S8OrderFlowProductDesignDrawingDataset
|
|
|
|
|
|
private static DrawingSpec[] BuildNonStandardSequence()
|
|
|
{
|
|
|
- // 11 张分布:5×(8.34, qty=1) + 4×(8.34, qty=2) + 2×(13.51, qty=6, yellow)
|
|
|
+ // 11 张分布:5×(8.34, qty=1) + 4×(8.34, qty=2) + 2×(13.51, qty=6)
|
|
|
// actual_days 合计 = 9×8.34 + 2×13.51 = 75.06 + 27.02 = 102.08 → avg 9.28 (在 [9.25, 9.31])
|
|
|
// quantity 合计 = 5×1 + 4×2 + 2×6 = 5 + 8 + 12 = 25
|
|
|
+ // 非标 KPI=3 后,所有 actual_days ≥ 8.34 > 3 → 全部 is_achieved=false / status='red'
|
|
|
var seq = new DrawingSpec[11];
|
|
|
- for (var i = 0; i < 5; i++) seq[i] = new DrawingSpec(8.34m, 1, true, "green");
|
|
|
- for (var i = 5; i < 9; i++) seq[i] = new DrawingSpec(8.34m, 2, true, "green");
|
|
|
- // 两张超期非标图号:actual=13.51 > kpi=12 → (13.51-12)/12 ≈ 0.126 ≤ 0.20 → yellow
|
|
|
- seq[9] = new DrawingSpec(13.51m, 6, false, "yellow");
|
|
|
- seq[10] = new DrawingSpec(13.51m, 6, false, "yellow");
|
|
|
+ for (var i = 0; i < 5; i++) seq[i] = new DrawingSpec(8.34m, 1, false, "red");
|
|
|
+ for (var i = 5; i < 9; i++) seq[i] = new DrawingSpec(8.34m, 2, false, "red");
|
|
|
+ seq[9] = new DrawingSpec(13.51m, 6, false, "red");
|
|
|
+ seq[10] = new DrawingSpec(13.51m, 6, false, "red");
|
|
|
return seq;
|
|
|
}
|
|
|
|
|
|
@@ -161,10 +164,11 @@ internal static class S8OrderFlowProductDesignDrawingDataset
|
|
|
DateTime plannedStart,
|
|
|
DrawingSpec spec)
|
|
|
{
|
|
|
+ // 计划区间按 KPI 推算;非标 KPI 与常规 KPI 同阶段标准 3 天,但非标设计周期允许 actual_days 较长。
|
|
|
var plannedEnd = plannedStart.AddDays((double)kpiDays);
|
|
|
var actualStart = plannedStart;
|
|
|
var actualEnd = actualStart.AddDays((double)spec.ActualDays);
|
|
|
- var responsible = ResponsibleUnits[(sortNo - 1) % ResponsibleUnits.Length];
|
|
|
+ var responsible = Designers[(seq - 1) % Designers.Length];
|
|
|
|
|
|
return new AdoS8OrderFlowProductDesignDrawing
|
|
|
{
|