namespace Oms.Application.DataPerm; public static class DataPermConstants { public const string AdminRoleCode = "Admin"; public const string CustomerRoleCode = "Customer"; public const string CustomerSubRolePrefix = "CustomerSub_"; public const int OrgScopeSelfOnly = 1; public const int OrgScopeSelfAndChildren = 2; public const int DataScopePersonal = 1; public const int DataScopeTeam = 2; public const int DataScopeDepartment = 3; public const int DataScopeOrgTree = 4; public const int DataScopeGlobal = 5; public static readonly int[] DefaultSecretLevels = [1, 2]; public static readonly string[] FilterOperators = [ "eq", "ne", "in", "notIn", "gt", "gte", "lt", "lte", "between", "like", "isNull", "isNotNull" ]; public static readonly IReadOnlyDictionary FilterableFieldsByResource = new Dictionary(StringComparer.OrdinalIgnoreCase) { ["Order"] = ["CreateTime", "OrderStatus", "DeclaredSum", "CustomerId", "WarehouseId", "ProductCode", "SecretLevel"], ["Customer"] = ["CreateTime", "CustomerGroup", "Salesman", "SecretLevel"], ["Recharge"] = ["CreateTime", "SecretLevel", "CustomerId"], ["ChannelProduct"] = ["ProductCode", "ProductGroup", "IsActive"], ["Xhs"] = ["CreateTime", "Status"] }; public static readonly IReadOnlyList<(string Value, string Label)> OrgScopeOptions = [ (OrgScopeSelfOnly.ToString(), "仅本级"), (OrgScopeSelfAndChildren.ToString(), "本级及下级") ]; public static readonly IReadOnlyList<(int Value, string Label)> DataScopeOptions = [ (DataScopePersonal, "个人"), (DataScopeTeam, "小组"), (DataScopeDepartment, "部门"), (DataScopeOrgTree, "组织树"), (DataScopeGlobal, "全局") ]; public static readonly IReadOnlyList<(string Value, string Label)> BizTypeOptions = [ ("product_line", "产品线"), ("kpi_area", "KPI 区域"), ("customer_group", "客户分组"), ("warehouse", "仓库"), ("region", "区域") ]; public static readonly IReadOnlyList<(int Value, string Label)> SecretLevelOptions = [ (1, "公开"), (2, "内部"), (3, "机密"), (4, "绝密") ]; public static readonly IReadOnlyList<(int Value, string Label)> CustomerGroupOptions = [ (1, "普通客户"), (2, "VIP1"), (3, "VIP2"), (4, "VIP3"), (5, "VIP4"), (6, "VIP5") ]; }