[後端] 修改資料顯示人流計算

This commit is contained in:
dev02 2023-09-19 19:14:51 +08:00
parent d02642ae27
commit 05f708224a
4 changed files with 32 additions and 3 deletions

View File

@ -389,6 +389,17 @@ namespace Backend.Controllers
ORDER BY bm.priority, mv.system_priority ASC, sv.system_priority ASC, sv.created_at DESC ", 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 }); 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.Code = "0000";
apiResult.Data = buildMenuTables; apiResult.Data = buildMenuTables;
} }

View File

@ -520,7 +520,7 @@ namespace Backend.Controllers
{ {
buildingGuid = $" AND ap.building_tag = '{post.SelectedBuild}'"; 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}' WHERE ap.AuthType='{post.SelectedAuthType}'
{buildingGuid} {buildingGuid}
AND ap.AuthCode NOT IN ( AND ap.AuthCode NOT IN (
@ -531,6 +531,23 @@ namespace Backend.Controllers
AND ap.AuthType='{post.SelectedAuthType}' AND ap.AuthType='{post.SelectedAuthType}'
)"; )";
authPage = await backendRepository.GetAllAsync<AuthPage>(sqlString); authPage = await backendRepository.GetAllAsync<AuthPage>(sqlString);
if (authPage.Any())
{
var sub_system = await backendRepository.GetAllAsync<VariableInfo>($@"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.Code = "0000";
apiResult.Data = authPage; apiResult.Data = authPage;

View File

@ -121,6 +121,7 @@ namespace Backend.Models
public string AuthCode { get; set; } public string AuthCode { get; set; }
public string MainName { get; set; } public string MainName { get; set; }
public string SubName { get; set; } public string SubName { get; set; }
public string ShowView { get; set; }
} }
public class PostSaveRoleAuth public class PostSaveRoleAuth

View File

@ -22,9 +22,9 @@
//"Database": "siTUcDaC/g2yGTMFWD72Kg==", //tpe_dome_hotel //"Database": "siTUcDaC/g2yGTMFWD72Kg==", //tpe_dome_hotel
//"Database": "iuaY0h0+TWkir44/eZLDqw==", //tpe_dome_office //"Database": "iuaY0h0+TWkir44/eZLDqw==", //tpe_dome_office
//"Database": "Rq7Gn4x6LwBvVtl7GY8LbA==", //mcut //"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": "2U+9jYGy0dCbMzLaguBXow==", //tpe_dome_mall
"Database": "FbHCCU4CapG9UryANXC1W+iMe403Bd82RnA7bCNVbL0=", //ibms_dome_cinema, //"Database": "FbHCCU4CapG9UryANXC1W+iMe403Bd82RnA7bCNVbL0=", //ibms_dome_cinema,
"Root": "SzdxEgaJJ7tcTCrUl2zKsA==", "Root": "SzdxEgaJJ7tcTCrUl2zKsA==",
"Password": "FVAPxztxpY4gJJKQ/se4bQ==" "Password": "FVAPxztxpY4gJJKQ/se4bQ=="
}, },