diff --git a/Backend/Controllers/BuildMenuController.cs b/Backend/Controllers/BuildMenuController.cs index b7c7d35..fd9fd32 100644 --- a/Backend/Controllers/BuildMenuController.cs +++ b/Backend/Controllers/BuildMenuController.cs @@ -389,6 +389,17 @@ namespace Backend.Controllers ORDER BY bm.priority, mv.system_priority ASC, sv.system_priority ASC, sv.created_at DESC ", new { building_tag = post.building_tag, MainList = post.MainList, main_system_type = main_system_type, sub_system_type = sub_system_type }); + if (buildMenuTables.Any()) + { + var data = buildMenuTables.Where(x => x.main_system_tag == "S" && x.sub_system_tag.Contains("CA")).ToList(); + foreach (var d in data) + { + if (d.sub_system_tag.Length == 3 && !(d.building_tag[0] == d.sub_system_tag[0])) + { + buildMenuTables.Remove(d); + } + } + } apiResult.Code = "0000"; apiResult.Data = buildMenuTables; } diff --git a/Backend/Controllers/UserInfoController.cs b/Backend/Controllers/UserInfoController.cs index c574434..47d6a6a 100644 --- a/Backend/Controllers/UserInfoController.cs +++ b/Backend/Controllers/UserInfoController.cs @@ -520,7 +520,7 @@ namespace Backend.Controllers { buildingGuid = $" AND ap.building_tag = '{post.SelectedBuild}'"; } - var sqlString = @$" SELECT ap.AuthCode, ap.MainName, ap.SubName FROM auth_page ap + var sqlString = @$" SELECT ap.AuthCode, ap.MainName, ap.SubName, ap.ShowView FROM auth_page ap WHERE ap.AuthType='{post.SelectedAuthType}' {buildingGuid} AND ap.AuthCode NOT IN ( @@ -531,6 +531,23 @@ namespace Backend.Controllers AND ap.AuthType='{post.SelectedAuthType}' )"; authPage = await backendRepository.GetAllAsync(sqlString); + + if (authPage.Any()) + { + var sub_system = await backendRepository.GetAllAsync($@"select * from variable where system_type = 'device_system_category_layer3' and system_value LIKE '%CA' + and LENGTH(system_value) = 3 and system_value != '{post.SelectedBuild[0]}CA'"); + if (sub_system.Any()) + { + foreach (var d in sub_system) + { + var ap = authPage.Where(x => x.ShowView.Equals(d.id.ToString())).FirstOrDefault(); + if (authPage != null) + { + authPage.Remove(ap); + } + } + } + } } apiResult.Code = "0000"; apiResult.Data = authPage; diff --git a/Backend/Models/UserInfo.cs b/Backend/Models/UserInfo.cs index 298f868..933aa81 100644 --- a/Backend/Models/UserInfo.cs +++ b/Backend/Models/UserInfo.cs @@ -121,6 +121,7 @@ namespace Backend.Models public string AuthCode { get; set; } public string MainName { get; set; } public string SubName { get; set; } + public string ShowView { get; set; } } public class PostSaveRoleAuth diff --git a/Backend/appsettings.Development.json b/Backend/appsettings.Development.json index 12cfb8b..2c7281e 100644 --- a/Backend/appsettings.Development.json +++ b/Backend/appsettings.Development.json @@ -22,9 +22,9 @@ //"Database": "siTUcDaC/g2yGTMFWD72Kg==", //tpe_dome_hotel //"Database": "iuaY0h0+TWkir44/eZLDqw==", //tpe_dome_office //"Database": "Rq7Gn4x6LwBvVtl7GY8LbA==", //mcut - //"Database": "+5RAiFLJVU+LRyDxF1K/pcLZaoZa4k/thZqF6xKoCag=", //dome_online_0821 + "Database": "+5RAiFLJVU+LRyDxF1K/pcLZaoZa4k/thZqF6xKoCag=", //dome_online_0821 //"Database": "2U+9jYGy0dCbMzLaguBXow==", //tpe_dome_mall - "Database": "FbHCCU4CapG9UryANXC1W+iMe403Bd82RnA7bCNVbL0=", //ibms_dome_cinema, + //"Database": "FbHCCU4CapG9UryANXC1W+iMe403Bd82RnA7bCNVbL0=", //ibms_dome_cinema, "Root": "SzdxEgaJJ7tcTCrUl2zKsA==", "Password": "FVAPxztxpY4gJJKQ/se4bQ==" },