[後台] 後端修改get menu 安全系統小類 人流計數類別的顯示輸出

[前台] 前端修改歷史資料查詢問題
This commit is contained in:
dev02 2023-06-12 12:34:59 +08:00
parent 8ce6316200
commit 1164388253
2 changed files with 36 additions and 11 deletions

View File

@ -362,8 +362,8 @@
function searchDate() {
let start = new Date($('#his_startdate').val());
let end = new Date(new Date().setDate(new Date($('#his_enddate input').val()).getDate() + 1));
if (pageAct.dateType == "today")
if (pageAct.dateType == "today" || pageAct.dateType == "day" || pageAct.dateType == "ytd")
end = new Date(new Date().setDate(start.getDate() + 1));
else if (pageAct.dateType == "month") {
start = new Date($('#getmonth').val());

View File

@ -236,18 +236,43 @@ namespace FrontendWebApi.ApiControllers
Sub_system = new List<Sub_systemGuid>()
};
var subsystem = ma.GroupBy(a => a.sub_system_tag).ToList();
string mainSystemTag = ma.Select(m => m.main_system_tag).FirstOrDefault();
foreach (var sub in subsystem)
{
Sub_systemGuid sub_System = new Sub_systemGuid()
if (mainSystemTag != "S") //normal
{
sub_system_tag = sub.Select(a => a.sub_system_tag).FirstOrDefault(),
full_name = sub.Select(a => a.subfull_name).FirstOrDefault(),
priority = sub.Select(a => a.subpriority).FirstOrDefault(),
device_system_tag = sub.Select(a => a.device_system_tag).FirstOrDefault(),
OpenTab = sub.Select(a => a.OpenTab).FirstOrDefault(),
system_url = sub.Select(a => a.left_system_url).FirstOrDefault()
};
main_System.Sub_system.Add(sub_System);
Sub_systemGuid sub_System = new Sub_systemGuid()
{
sub_system_tag = sub.Select(a => a.sub_system_tag).FirstOrDefault(),
full_name = sub.Select(a => a.subfull_name).FirstOrDefault(),
priority = sub.Select(a => a.subpriority).FirstOrDefault(),
device_system_tag = sub.Select(a => a.device_system_tag).FirstOrDefault(),
OpenTab = sub.Select(a => a.OpenTab).FirstOrDefault(),
system_url = sub.Select(a => a.left_system_url).FirstOrDefault()
};
main_System.Sub_system.Add(sub_System);
}
else // 人流計數處理
{
string name = sub.Select(s => s.subfull_name).FirstOrDefault();
bool check = true;
if (name == "人流計數")
check = sub.Select(s => s.sub_system_tag).FirstOrDefault().StartsWith(menu.Select(m => m.device_building_tag).FirstOrDefault());
if (check)
{
Sub_systemGuid sub_System = new Sub_systemGuid()
{
sub_system_tag = sub.Select(a => a.sub_system_tag).FirstOrDefault(),
full_name = sub.Select(a => a.subfull_name).FirstOrDefault(),
priority = sub.Select(a => a.subpriority).FirstOrDefault(),
device_system_tag = sub.Select(a => a.device_system_tag).FirstOrDefault(),
OpenTab = sub.Select(a => a.OpenTab).FirstOrDefault(),
system_url = sub.Select(a => a.left_system_url).FirstOrDefault()
};
main_System.Sub_system.Add(sub_System);
}
}
}
building1.main_system.Add(main_System);
}