namespace Admin.NET.Plugin.AiDOP.Infrastructure.S8; /// /// S8 异常场景码常量。 /// scene_code 格式:S{模块组}_场景域,方便前端按监控页分类。 /// public static class S8SceneCode { /// 交付异常(S1 订单评审变更 + S7 成品出库交期) public const string S1S7Delivery = "S1S7_DELIVERY"; /// 生产异常(S2 工单开工 + S6 完工/质量) public const string S2S6Production = "S2S6_PRODUCTION"; /// 供应异常(S3 MRP套料 + S5 IQC/库存) public const string S3S5Supply = "S3S5_SUPPLY"; /// 采购执行异常(S4 PO跟单/收货/退货) public const string S4Purchase = "S4_PURCHASE"; /// scene_code → 中文名称 public static string Label(string sceneCode) => sceneCode switch { S1S7Delivery => "交付异常", S2S6Production => "生产异常", S3S5Supply => "供应异常", S4Purchase => "采购执行异常", _ => sceneCode }; /// scene_code → 所属模块列表(用于页面展示列头) public static string[] Modules(string sceneCode) => sceneCode switch { S1S7Delivery => new[] { "S1", "S7" }, S2S6Production => new[] { "S2", "S6" }, S3S5Supply => new[] { "S3", "S5" }, S4Purchase => new[] { "S4" }, _ => Array.Empty() }; /// 所有 scene_code 有序列表(综合全景页列顺序) public static readonly string[] All = { S1S7Delivery, S2S6Production, S3S5Supply, S4Purchase }; } /// /// S8 模块码常量(对应 S1-S7 业务模块)。 /// public static class S8ModuleCode { public const string S1 = "S1"; public const string S2 = "S2"; public const string S3 = "S3"; public const string S4 = "S4"; public const string S5 = "S5"; public const string S6 = "S6"; public const string S7 = "S7"; /// module_code → 中文名称 public static string Label(string moduleCode) => moduleCode switch { S1 => "S1·销售评审", S2 => "S2·计划排产", S3 => "S3·物料套料", S4 => "S4·采购执行", S5 => "S5·IQC入库", S6 => "S6·生产完工", S7 => "S7·成品出库", _ => moduleCode }; /// module_code → 所属 scene_code public static string SceneOf(string moduleCode) => moduleCode switch { S1 or S7 => S8SceneCode.S1S7Delivery, S2 or S6 => S8SceneCode.S2S6Production, S3 or S5 => S8SceneCode.S3S5Supply, S4 => S8SceneCode.S4Purchase, _ => string.Empty }; /// 所有模块码有序列表 public static readonly string[] All = { S1, S2, S3, S4, S5, S6, S7 }; }