namespace Admin.NET.Plugin.AiDOP.Infrastructure.S8; /// /// S8 监控大屏 5 张类别卡稳定 Key 与中文 Label 的双向映射。 /// Key 写入 ado_s8_exception_type.monitoring_category_key;Label 用于 byCategory.category 输出, /// 与前端 CATEGORY_DEFS_FALLBACK / OVERVIEW_CATEGORY_KEY_BY_CELL_CODE 字面 100% 对齐。 /// public static class S8MonitoringCategory { public const string OrderReview = "ORDER_REVIEW"; public const string ProductDesign = "PRODUCT_DESIGN"; public const string MaterialPurchase = "MATERIAL_PURCHASE"; public const string BodyProduction = "BODY_PRODUCTION"; public const string FinalAssemblyDelivery = "FINAL_ASSEMBLY_DELIVERY"; public const string OrderReviewLabel = "订单评审"; public const string ProductDesignLabel = "产品设计"; public const string MaterialPurchaseLabel = "材料采购"; public const string BodyProductionLabel = "本体生产"; public const string FinalAssemblyDeliveryLabel = "总装发货"; public static string? Normalize(string? key) { var normalized = key?.Trim().ToUpperInvariant(); return IsValid(normalized) ? normalized : null; } public static bool IsValid(string? key) => key is OrderReview or ProductDesign or MaterialPurchase or BodyProduction or FinalAssemblyDelivery; public static string? KeyToLabel(string? key) => Normalize(key) switch { OrderReview => OrderReviewLabel, ProductDesign => ProductDesignLabel, MaterialPurchase => MaterialPurchaseLabel, BodyProduction => BodyProductionLabel, FinalAssemblyDelivery => FinalAssemblyDeliveryLabel, _ => null, }; }