diff --git a/Backend/Controllers/BuildMenuController.cs b/Backend/Controllers/BuildMenuController.cs index 3609530..f71ada7 100644 --- a/Backend/Controllers/BuildMenuController.cs +++ b/Backend/Controllers/BuildMenuController.cs @@ -191,6 +191,10 @@ namespace Backend.Controllers { dictionary.Add("@planimetric_floor_guid", buildMenu.left_planimetric_floor_guid); } + else if (buildMenu.left_drawing == 5) + { + dictionary.Add("left_build_menu_blankurl_modal", buildMenu.left_build_menu_blankurl_modal); + } if (buildMenu.right_drawing == 2) { @@ -313,6 +317,10 @@ namespace Backend.Controllers { dictionary.Add("@left_planimetric_floor_guid", buildMenu.left_planimetric_floor_guid); } + else if (buildMenu.left_drawing == 5) + { + dictionary.Add("@left_build_menu_blankurl_modal", buildMenu.left_build_menu_blankurl_modal); + } if (buildMenu.right_drawing == 2) { diff --git a/Backend/Controllers/NiagaraDataSynchronizeController.cs b/Backend/Controllers/NiagaraDataSynchronizeController.cs index 682f9b4..45ab2ef 100644 --- a/Backend/Controllers/NiagaraDataSynchronizeController.cs +++ b/Backend/Controllers/NiagaraDataSynchronizeController.cs @@ -210,34 +210,34 @@ namespace Backend.Controllers { //string ss = ds.Where(x => x.tag_name != "").FirstOrDefault().tag_name; //var building = ss.Split("_")[0]; - //var building = ds.GroupBy(x => x.device_building_tag).Select(x => x.Key).ToList(); - //#region 歷史資料處理 - //ds.Clear(); - //var isDome = await backendRepository.GetOneAsync("select system_value from variable where deleted = 0 and system_type = 'project_name';"); - //var sqlObix = $@"SELECT system_value as Value, system_key as Name FROM variable WHERE deleted = 0 AND system_type = 'obixConfig'"; - //var variableObix = backendRepository.GetAllAsync(sqlObix).Result; - //var obixApiConfig = new Backend.Models.ObixApiConfig(); - //EDFunction ed = new EDFunction(); - //obixApiConfig.ApiBase = variableObix.Where(x => x.Name == "ApiBase").Select(x => x.Value).FirstOrDefault(); - //obixApiConfig.UserName = variableObix.Where(x => x.Name == "UserName").Select(x => x.Value).FirstOrDefault(); - //obixApiConfig.Password = variableObix.Where(x => x.Name == "Password").Select(x => x.Value).FirstOrDefault(); - ////obixApiConfig.UrlSlot = variableObix.Where(x => x.Name == "url_slot").Select(x => x.Value).FirstOrDefault(); - //webRequestService svc = new webRequestService(); - //var data = svc.obixHisQuery_v2(obixApiConfig.ApiBase + "obix/config/Program/ObixQuery/query/", obixApiConfig.ApiBase + "obix/histories", "", - // obixApiConfig.UserName, obixApiConfig.Password); - //ds.AddRange(data); + var building = ds.GroupBy(x => x.device_building_tag).Select(x => x.Key).ToList(); + #region 歷史資料處理 + ds.Clear(); + var isDome = await backendRepository.GetOneAsync("select system_value from variable where deleted = 0 and system_type = 'project_name';"); + var sqlObix = $@"SELECT system_value as Value, system_key as Name FROM variable WHERE deleted = 0 AND system_type = 'obixConfig'"; + var variableObix = backendRepository.GetAllAsync(sqlObix).Result; + var obixApiConfig = new Backend.Models.ObixApiConfig(); + EDFunction ed = new EDFunction(); + obixApiConfig.ApiBase = variableObix.Where(x => x.Name == "ApiBase").Select(x => x.Value).FirstOrDefault(); + obixApiConfig.UserName = variableObix.Where(x => x.Name == "UserName").Select(x => x.Value).FirstOrDefault(); + obixApiConfig.Password = variableObix.Where(x => x.Name == "Password").Select(x => x.Value).FirstOrDefault(); + //obixApiConfig.UrlSlot = variableObix.Where(x => x.Name == "url_slot").Select(x => x.Value).FirstOrDefault(); + webRequestService svc = new webRequestService(); + var data = svc.obixHisQuery_v2(obixApiConfig.ApiBase + "obix/config/Program/ObixQuery/query/", obixApiConfig.ApiBase + "obix/histories", "", + obixApiConfig.UserName, obixApiConfig.Password); + ds.AddRange(data); - //// save to history - //await niagaraDataSynchronizeRepository.InsertItemFromNiagara_History(ds, building); // insert 暫存table import_niagara_item_history - //if (!string.IsNullOrEmpty(isDome) && isDome.Contains("ibms_dome")) - // await niagaraDataSynchronizeRepository.RecoverSysTag("import_niagara_item_history"); // recover missing deivce_system_tag - //#endregion + // save to history + await niagaraDataSynchronizeRepository.InsertItemFromNiagara_History(ds, building); // insert 暫存table import_niagara_item_history + if (!string.IsNullOrEmpty(isDome) && isDome.Contains("ibms_dome")) + await niagaraDataSynchronizeRepository.RecoverSysTag("import_niagara_item_history"); // recover missing deivce_system_tag + #endregion - //await niagaraDataSynchronizeRepository.InsertItemFromNiagara(oldDs, building); // insert 暫存table import_niagara_item - //await niagaraDataSynchronizeRepository.DeviceItemComparison(); //insert device_item - //await niagaraDataSynchronizeRepository.CheckItemDiffFullNameAndCover(); // update device_item.fullname - //await niagaraDataSynchronizeRepository.ItemCheckFullNameEmptyReplaceByDeviceName(); // 檢查device_item內FullName為空的值,以points取代 - //await niagaraDataSynchronizeRepository.CheckItemIsShowHistory(); + await niagaraDataSynchronizeRepository.InsertItemFromNiagara(oldDs, building); // insert 暫存table import_niagara_item + await niagaraDataSynchronizeRepository.DeviceItemComparison(); //insert device_item + await niagaraDataSynchronizeRepository.CheckItemDiffFullNameAndCover(); // update device_item.fullname + await niagaraDataSynchronizeRepository.ItemCheckFullNameEmptyReplaceByDeviceName(); // 檢查device_item內FullName為空的值,以points取代 + await niagaraDataSynchronizeRepository.CheckItemIsShowHistory(); result = true; diff --git a/Backend/Models/BuildMenu.cs b/Backend/Models/BuildMenu.cs index 5e8d20d..7a58457 100644 --- a/Backend/Models/BuildMenu.cs +++ b/Backend/Models/BuildMenu.cs @@ -19,6 +19,7 @@ namespace Backend.Models public string left_riser_diagram_url { get; set; } public byte left_planimetric_click { get; set; } public string left_planimetric_floor_guid { get; set; } + public string left_build_menu_blankurl_modal { get; set; } public byte right_drawing { get; set; } public byte right_icon_click { get; set; } public string right_icon_click_url { get; set; } diff --git a/Backend/Views/BuildMenu/Index.cshtml b/Backend/Views/BuildMenu/Index.cshtml index ba3bde6..d3323a1 100644 --- a/Backend/Views/BuildMenu/Index.cshtml +++ b/Backend/Views/BuildMenu/Index.cshtml @@ -938,6 +938,7 @@ left_drawing: $('input[name="drawing"]:checked').val(), left_system_url: $('#build_menu_systemurl_modal').val(), left_icon_click: left_icon_click, + left_build_menu_blankurl_modal: $("#build_menu_blankurl_modal").val(), left_icon_click_url: $('#build_menu_icon_click_url_modal').val(), left_icon_click_url_width: $('#build_menu_icon_click_url_width_modal').val(), left_icon_click_url_height: $('#build_menu_icon_click_url_height_modal').val(), @@ -990,6 +991,7 @@ $('#build_menu_sub_modal').val(rel.data.sub_system_tag); //left + $('#build_menu_blankurl_modal').val(rel.data.left_build_menu_blankurl_modal); $("input[name='drawing'][value='" + rel.data.left_drawing + "']").prop("checked", true); if (rel.data.left_planimetric_click == 1) { $('input[name="planimetric_click"]').prop("checked", true) diff --git a/Backend/appsettings.Development.json b/Backend/appsettings.Development.json index 7704050..84c3607 100644 --- a/Backend/appsettings.Development.json +++ b/Backend/appsettings.Development.json @@ -14,17 +14,18 @@ }, "DBConfig": { "MySqlDBConfig": { - "Server": "FYlY+w0XDIz+jmF2rlZWJw==", //0.201 - "Port": "js2LutKe+rdjzdxMPQUrvQ==", + "Server": "jbgI3Q4uFL4Kd9bbvToklA==", //0.201 + "Port": "mkF51jVbg40V5K5eTh2Ckw==", //"Database": "VJB2XC+lAtzuHObDGMVOAA==", //30 //"Database": "IgYBsgG2VLKKxFb64j7LOA==", //wsp //"Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome //"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": "7gWfmZ28HGIJZbxEbK+0yg==", //ibms_dome_dome "Root": "SzdxEgaJJ7tcTCrUl2zKsA==", "Password": "FVAPxztxpY4gJJKQ/se4bQ==" }, diff --git a/BackendWorkerService/Program.cs b/BackendWorkerService/Program.cs index bb7f330..f87a035 100644 --- a/BackendWorkerService/Program.cs +++ b/BackendWorkerService/Program.cs @@ -143,10 +143,10 @@ namespace BackendWorkerService #endregion #region wɨoHAPI - //services.AddSingleton(); - //services.AddSingleton( - //new JobSchedule(jobType: typeof(Quartz.Jobs.WeatherAPIJob), cronExpression: configuration.GetValue("BackgroundServiceCron:WeatherAPIJob")) - //); + services.AddSingleton(); + services.AddSingleton( + new JobSchedule(jobType: typeof(Quartz.Jobs.WeatherAPIJob), cronExpression: configuration.GetValue("BackgroundServiceCron:WeatherAPIJob")) + ); #endregion }).ConfigureLogging((hostContext, logFactory) => { diff --git a/FrontendWebApi/ApiControllers/BuildController.cs b/FrontendWebApi/ApiControllers/BuildController.cs index aa5a779..fdad389 100644 --- a/FrontendWebApi/ApiControllers/BuildController.cs +++ b/FrontendWebApi/ApiControllers/BuildController.cs @@ -345,6 +345,7 @@ namespace FrontendWebApi.ApiControllers left_planimetric_click = sub_system.left_planimetric_click, left_planimetric_floor_guid = sub_system.left_planimetric_floor_guid, left_riser_diagram_url = sub_system.left_riser_diagram_url, + left_build_menu_blankurl_modal = sub_system.left_build_menu_blankurl_modal, priority = sub_system.subpriority }; foreach (var floor in floorsql) diff --git a/FrontendWebApi/Models/Build.cs b/FrontendWebApi/Models/Build.cs index a5b5174..462563e 100644 --- a/FrontendWebApi/Models/Build.cs +++ b/FrontendWebApi/Models/Build.cs @@ -45,6 +45,7 @@ namespace FrontendWebApi.Models public string device_building_tag { get; set; } public string device_system_tag { get; set; } public byte OpenTab { get; set; } + public string left_build_menu_blankurl_modal { get; set; } } public class Floorsql : Floor { @@ -108,6 +109,7 @@ namespace FrontendWebApi.Models public byte left_planimetric_click { get; set; } public string left_planimetric_floor_guid { get; set; } public string left_riser_diagram_url { get; set; } + public string left_build_menu_blankurl_modal { get; set; } } public class Floor diff --git a/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs b/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs index 57f40ab..0384ed3 100644 --- a/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs +++ b/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs @@ -588,11 +588,16 @@ namespace Repository.BackendRepository.Implement { List result; StringBuilder sb = new StringBuilder(); - sb.Append($@" SELECT m.* - FROM import_niagara_item m - LEFT JOIN device_item d - ON m.device_system_tag = d.device_system_tag and m.device_name_tag = d.device_name_tag and m.device_point_name = d.points and m.device_building_tag collate utf8mb4_0900_ai_ci = d.device_building_tag - WHERE d.points IS NULL and d.deleted = 0;"); + sb.Append($@" SELECT m.device_point_name, m.is_history, m.device_building_tag, m.device_system_tag, m.device_name_tag, m.parent_path, m.full_name + FROM import_niagara_item m + left JOIN ( + select device_building_tag, device_system_tag, device_name_tag, points from device_item where deleted = 0 + ) d + ON m.device_system_tag = d.device_system_tag + and m.device_name_tag = d.device_name_tag + and m.device_point_name = d.points + and m.device_building_tag = d.device_building_tag + where d.points is null;"); result = (await conn.QueryAsync(sb.ToString())).ToList(); sb.Clear();