From 116438825350abbc85e910523e4e751724812f4b Mon Sep 17 00:00:00 2001 From: dev02 Date: Mon, 12 Jun 2023 12:34:59 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=BE=8C=E5=8F=B0]=20=E5=BE=8C=E7=AB=AF?= =?UTF-8?q?=E4=BF=AE=E6=94=B9get=20menu=20=E5=AE=89=E5=85=A8=E7=B3=BB?= =?UTF-8?q?=E7=B5=B1=E5=B0=8F=E9=A1=9E=20=E4=BA=BA=E6=B5=81=E8=A8=88?= =?UTF-8?q?=E6=95=B8=E9=A1=9E=E5=88=A5=E7=9A=84=E9=A1=AF=E7=A4=BA=E8=BC=B8?= =?UTF-8?q?=E5=87=BA=20[=E5=89=8D=E5=8F=B0]=20=E5=89=8D=E7=AB=AF=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=AD=B7=E5=8F=B2=E8=B3=87=E6=96=99=E6=9F=A5=E8=A9=A2?= =?UTF-8?q?=E5=95=8F=E9=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Frontend/_historyData.html | 4 +- .../ApiControllers/BuildController.cs | 43 +++++++++++++++---- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/Frontend/_historyData.html b/Frontend/_historyData.html index 8c23cb7..a8e0325 100644 --- a/Frontend/_historyData.html +++ b/Frontend/_historyData.html @@ -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()); diff --git a/FrontendWebApi/ApiControllers/BuildController.cs b/FrontendWebApi/ApiControllers/BuildController.cs index 5bb4334..af2e0d7 100644 --- a/FrontendWebApi/ApiControllers/BuildController.cs +++ b/FrontendWebApi/ApiControllers/BuildController.cs @@ -236,18 +236,43 @@ namespace FrontendWebApi.ApiControllers Sub_system = new List() }; 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); }