From eefb7bb12a0d7b966dc8d6a5993f85616899f374 Mon Sep 17 00:00:00 2001 From: dev02 Date: Tue, 31 Oct 2023 16:03:12 +0800 Subject: [PATCH 1/6] =?UTF-8?q?[=E5=BE=8C=E7=AB=AF]=20=E4=BF=AE=E6=94=B9sq?= =?UTF-8?q?l,=20=E4=BF=AE=E6=94=B9parking=20header,=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=90=8C=E6=AD=A5disaster=20=E7=9B=B8=E5=90=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Backend/Controllers/SystemCategoryController.cs | 10 ++++++++-- Backend/Models/Parking.cs | 2 ++ BackendWorkerService/Quartz/Jobs/ParkingJob.cs | 7 +++++++ BackendWorkerService/appsettings.Development.json | 3 ++- BackendWorkerService/appsettings.json | 3 ++- .../Implement/NiagaraDataSynchronizeRepository.cs | 14 +++++++++----- 6 files changed, 30 insertions(+), 9 deletions(-) diff --git a/Backend/Controllers/SystemCategoryController.cs b/Backend/Controllers/SystemCategoryController.cs index 3361f66..bf6d835 100644 --- a/Backend/Controllers/SystemCategoryController.cs +++ b/Backend/Controllers/SystemCategoryController.cs @@ -623,11 +623,17 @@ namespace Backend.Controllers try { var building_tag = await backendRepository.GetOneAsync($@"select system_value from variable where system_type = 'project_name' and deleted = 0"); - var sql = @"SELECT di.* + //var sql = @"SELECT di.* + // FROM device_item di + // JOIN variable sv ON di.device_name_tag = sv.system_value + // JOIN variable mv ON sv.system_parent_id = mv.id AND di.device_system_tag = mv.system_value + // WHERE sv.id = @id AND di.deleted = @Deleted and di.device_building_tag = @building_tag and di.is_link = 1"; + var sql = @"SELECT min(di.id), di.full_name, di.points, di.unit, di.is_show, di.is_show_riserDiagram, di.is_controll, di.is_bool, di.is_link, di.is_show_history, di.device_system_tag, di.device_name_tag FROM device_item di JOIN variable sv ON di.device_name_tag = sv.system_value JOIN variable mv ON sv.system_parent_id = mv.id AND di.device_system_tag = mv.system_value - WHERE sv.id = @id AND di.deleted = @Deleted and di.device_building_tag = @building_tag and di.is_link = 1"; + WHERE sv.id = 35 and di.deleted = 0 and di.is_link = 1 + group by di.full_name, di.points, di.unit, di.is_show, di.is_show_riserDiagram, di.is_controll, di.is_bool, di.is_link, di.is_show_history, di.device_system_tag, di.device_name_tag"; object param = new { Deleted = 0, id = id, building_tag = building_tag.Split("/")[1] }; diff --git a/Backend/Models/Parking.cs b/Backend/Models/Parking.cs index 018cd5a..21facfa 100644 --- a/Backend/Models/Parking.cs +++ b/Backend/Models/Parking.cs @@ -18,6 +18,8 @@ namespace Backend.Models public string ApiBase { get; set; } public string UserName { get; set; } public string Password { get; set; } + public string VendorId { get; set; } + public string VendorToken { get; set; } } public class SpaceResponse diff --git a/BackendWorkerService/Quartz/Jobs/ParkingJob.cs b/BackendWorkerService/Quartz/Jobs/ParkingJob.cs index 12df07e..653db61 100644 --- a/BackendWorkerService/Quartz/Jobs/ParkingJob.cs +++ b/BackendWorkerService/Quartz/Jobs/ParkingJob.cs @@ -2,6 +2,7 @@ using Microsoft.Extensions.Logging; using Newtonsoft.Json; using Newtonsoft.Json.Linq; +using NPOI.OpenXml4Net.OPC; using Quartz; using Repository.BackendRepository.Interface; using System; @@ -56,6 +57,8 @@ namespace BackendWorkerService.Quartz.Jobs parkingConfig.ApiBase = variable.Where(x => x.Name == "ApiBase").Select(x => x.Value).FirstOrDefault(); parkingConfig.UserName = ed.AESDecrypt(variable.Where(x => x.Name == "UserName").Select(x => x.Value).FirstOrDefault()); parkingConfig.Password = ed.AESDecrypt(variable.Where(x => x.Name == "Password").Select(x => x.Value).FirstOrDefault()); + parkingConfig.VendorId = variable.Where(x => x.Name == "X-VENDOR-ID").Select(x => x.Value).FirstOrDefault(); + parkingConfig.VendorToken = variable.Where(x => x.Name == "X-VENDOR-TOKEN").Select(x => x.Value).FirstOrDefault(); String encoded = System.Convert.ToBase64String(System.Text.Encoding.GetEncoding("ISO-8859-1").GetBytes(parkingConfig.UserName + ":" + parkingConfig.Password)); @@ -68,6 +71,8 @@ namespace BackendWorkerService.Quartz.Jobs HttpWebRequest spaceRequest = (HttpWebRequest)WebRequest.Create($"{parkingConfig.Host}{parkingConfig.Prefix}/api/space/details"); spaceRequest.Method = "GET"; //request.Headers.Add("Authorization", "Basic " + encoded); + spaceRequest.Headers.Add("X-VENDOR-ID", parkingConfig.VendorId); + spaceRequest.Headers.Add("X-VENDOR-TOKEN", parkingConfig.VendorToken); spaceRequest.PreAuthenticate = true; spaceRequest.Timeout = System.Threading.Timeout.Infinite; spaceRequest.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true; @@ -192,6 +197,8 @@ namespace BackendWorkerService.Quartz.Jobs HttpWebRequest equipmentRequest = (HttpWebRequest)WebRequest.Create($"{parkingConfig.Host}{parkingConfig.Prefix}/api/equipment/state"); equipmentRequest.Method = "GET"; //request.Headers.Add("Authorization", "Basic " + encoded); + equipmentRequest.Headers.Add("X-VENDOR-ID", parkingConfig.VendorId); + equipmentRequest.Headers.Add("X-VENDOR-TOKEN", parkingConfig.VendorToken); equipmentRequest.PreAuthenticate = true; equipmentRequest.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true; diff --git a/BackendWorkerService/appsettings.Development.json b/BackendWorkerService/appsettings.Development.json index e822289..5c0ee01 100644 --- a/BackendWorkerService/appsettings.Development.json +++ b/BackendWorkerService/appsettings.Development.json @@ -26,7 +26,8 @@ //"Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome //"Database": "siTUcDaC/g2yGTMFWD72Kg==", //tpe_dome_hotel //"Database": "Rq7Gn4x6LwBvVtl7GY8LbA==", //mcut - "Database": "+5RAiFLJVU+LRyDxF1K/pcLZaoZa4k/thZqF6xKoCag=", //dome_online_0821 + //"Database": "+5RAiFLJVU+LRyDxF1K/pcLZaoZa4k/thZqF6xKoCag=", //dome_online_0821 + "Database": "7gWfmZ28HGIJZbxEbK+0yg==", //ibms_dome_dome "Root": "SzdxEgaJJ7tcTCrUl2zKsA==", "Password": "FVAPxztxpY4gJJKQ/se4bQ==" }, diff --git a/BackendWorkerService/appsettings.json b/BackendWorkerService/appsettings.json index 8c853d2..771a64b 100644 --- a/BackendWorkerService/appsettings.json +++ b/BackendWorkerService/appsettings.json @@ -26,7 +26,8 @@ //"Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome //"Database": "siTUcDaC/g2yGTMFWD72Kg==", //tpe_dome_hotel //"Database": "Rq7Gn4x6LwBvVtl7GY8LbA==", //mcut - "Database": "+5RAiFLJVU+LRyDxF1K/pcLZaoZa4k/thZqF6xKoCag=", //dome_online_0821 + //"Database": "+5RAiFLJVU+LRyDxF1K/pcLZaoZa4k/thZqF6xKoCag=", //dome_online_0821 + "Database": "7gWfmZ28HGIJZbxEbK+0yg==", //ibms_dome_dome "Root": "SzdxEgaJJ7tcTCrUl2zKsA==", "Password": "FVAPxztxpY4gJJKQ/se4bQ==" }, diff --git a/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs b/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs index 0384ed3..f20749a 100644 --- a/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs +++ b/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs @@ -1140,11 +1140,15 @@ namespace Repository.BackendRepository.Implement string device_guid = device.Where(x => x.device_number == device_number).Select(x => x.device_guid).FirstOrDefault(); string device_system_tag = device.Where(x => x.device_number == device_number).Select(x => x.device_system_tag).FirstOrDefault(); string device_name_tag = device.Where(x => x.device_number == device_number).Select(x => x.device_name_tag).FirstOrDefault(); - sb.Append($@" - insert into device_disaster - (device_guid, device_system_value, device_building_tag, device_system_tag, device_name_tag, device_floor_tag, device_serial_tag, device_number) - values ('{device_guid}', '{d.disasterValue}', '{device_number.Split('_')[0]}', '{device_system_tag}', '{device_name_tag}', '{device_number.Split('_')[2]}', - '{device_number.Split('_')[4]}', '{device_number}'); "); + var check = (await conn.QueryAsync($"select device_guid from device_disaster where device_guid = '{device_guid}' and device_system_value = '{d.disasterValue}'")).FirstOrDefault(); + if (string.IsNullOrEmpty(check)) + { + sb.Append($@" + insert into device_disaster + (device_guid, device_system_value, device_building_tag, device_system_tag, device_name_tag, device_floor_tag, device_serial_tag, device_number) + values ('{device_guid}', '{d.disasterValue}', '{device_number.Split('_')[0]}', '{device_system_tag}', '{device_name_tag}', '{device_number.Split('_')[2]}', + '{device_number.Split('_')[4]}', '{device_number}'); "); + } } using (TransactionScope scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled)) From 12b1a143195a2bf0e368d34a30316443cba432af Mon Sep 17 00:00:00 2001 From: dev02 Date: Tue, 31 Oct 2023 16:25:42 +0800 Subject: [PATCH 2/6] =?UTF-8?q?[=E5=BE=8C=E7=AB=AF]=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E9=8C=AF=E8=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implement/NiagaraDataSynchronizeRepository.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs b/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs index f20749a..a0acdbc 100644 --- a/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs +++ b/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs @@ -443,10 +443,18 @@ namespace Repository.BackendRepository.Implement using (TransactionScope scope = new TransactionScope((TransactionScopeOption)TransactionScopeAsyncFlowOption.Enabled)) { await conn.ExecuteAsync(sb.ToString()); - await conn.ExecuteAsync(sb2.ToString()); } sb.Clear(); + } + + if (sb2.Length > 0) + { + using (TransactionScope scope = new TransactionScope((TransactionScopeOption)TransactionScopeAsyncFlowOption.Enabled)) + { + await conn.ExecuteAsync(sb2.ToString()); + } + sb2.Clear(); } } From 8b693b60b41da26b01182bcf4d5351c07889ca87 Mon Sep 17 00:00:00 2001 From: dev02 Date: Wed, 1 Nov 2023 14:22:45 +0800 Subject: [PATCH 3/6] =?UTF-8?q?[=E5=BE=8C=E7=AB=AF]=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=88=A4=E6=96=B7=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Backend/Controllers/SystemCategoryController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Backend/Controllers/SystemCategoryController.cs b/Backend/Controllers/SystemCategoryController.cs index bf6d835..0ce5a7b 100644 --- a/Backend/Controllers/SystemCategoryController.cs +++ b/Backend/Controllers/SystemCategoryController.cs @@ -632,7 +632,7 @@ namespace Backend.Controllers FROM device_item di JOIN variable sv ON di.device_name_tag = sv.system_value JOIN variable mv ON sv.system_parent_id = mv.id AND di.device_system_tag = mv.system_value - WHERE sv.id = 35 and di.deleted = 0 and di.is_link = 1 + WHERE sv.id = @id and di.deleted = 0 and di.is_link = 1 group by di.full_name, di.points, di.unit, di.is_show, di.is_show_riserDiagram, di.is_controll, di.is_bool, di.is_link, di.is_show_history, di.device_system_tag, di.device_name_tag"; object param = new { Deleted = 0, id = id, building_tag = building_tag.Split("/")[1] }; From 73ea4a9a680913694d7e2e19153731439936118e Mon Sep 17 00:00:00 2001 From: dev02 Date: Thu, 2 Nov 2023 13:19:23 +0800 Subject: [PATCH 4/6] =?UTF-8?q?[=E5=BE=8C=E7=AB=AF]=20=E8=AA=BF=E6=95=B4?= =?UTF-8?q?=E6=8E=92=E7=A8=8B=E5=81=9C=E8=BB=8A=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Backend/Models/Parking.cs | 6 ++--- Backend/appsettings.Development.json | 2 +- .../Quartz/Jobs/ParkingJob.cs | 25 +++++++++++-------- .../appsettings.Development.json | 4 +-- BackendWorkerService/appsettings.json | 7 +++--- 5 files changed, 25 insertions(+), 19 deletions(-) diff --git a/Backend/Models/Parking.cs b/Backend/Models/Parking.cs index 21facfa..784083d 100644 --- a/Backend/Models/Parking.cs +++ b/Backend/Models/Parking.cs @@ -36,7 +36,7 @@ namespace Backend.Models public class CarType { - public int Vehicle_type_id { get; set; } //車種(請參照車種列表) + public string Vehicle_type_id { get; set; } //車種(請參照車種列表) public int Total { get; set; } //該車種總車位數 public int Remain { get; set; } //該車種剩餘車位數 } @@ -44,7 +44,7 @@ namespace Backend.Models public partial class Area { public string Name { get; set; } - public int Vehicle_type_id { get; set; } + public string Vehicle_type_id { get; set; } public int Total { get; set; } public int Remain { get; set; } } @@ -57,7 +57,7 @@ namespace Backend.Models public class EquipmentPayload { - public int Id { get; set; } + public string Id { get; set; } public string Name { get; set; } public string Type { get; set; } public bool Alive { get; set; } diff --git a/Backend/appsettings.Development.json b/Backend/appsettings.Development.json index 84c3607..2a7e0a5 100644 --- a/Backend/appsettings.Development.json +++ b/Backend/appsettings.Development.json @@ -15,7 +15,7 @@ "DBConfig": { "MySqlDBConfig": { "Server": "jbgI3Q4uFL4Kd9bbvToklA==", //0.201 - "Port": "mkF51jVbg40V5K5eTh2Ckw==", + "Port": "mkF51jVbg40V5K5eTh2Ckw==", //3306 //"Database": "VJB2XC+lAtzuHObDGMVOAA==", //30 //"Database": "IgYBsgG2VLKKxFb64j7LOA==", //wsp //"Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome diff --git a/BackendWorkerService/Quartz/Jobs/ParkingJob.cs b/BackendWorkerService/Quartz/Jobs/ParkingJob.cs index 653db61..e2a9c25 100644 --- a/BackendWorkerService/Quartz/Jobs/ParkingJob.cs +++ b/BackendWorkerService/Quartz/Jobs/ParkingJob.cs @@ -45,6 +45,7 @@ namespace BackendWorkerService.Quartz.Jobs { if(await task_Detail.GetNeedWorkTask("ParkingJob", "All")) { + var item = string.Empty; await task_Detail.InsertWorkTime("ParkingJob", "All", "任務開始"); EDFunction ed = new EDFunction(); var parkingConfig = new ParkingConfig(); @@ -55,8 +56,8 @@ namespace BackendWorkerService.Quartz.Jobs parkingConfig.Host = variable.Where(x => x.Name == "Host").Select(x => x.Value).FirstOrDefault(); parkingConfig.Prefix = variable.Where(x => x.Name == "Prefix").Select(x => x.Value).FirstOrDefault(); parkingConfig.ApiBase = variable.Where(x => x.Name == "ApiBase").Select(x => x.Value).FirstOrDefault(); - parkingConfig.UserName = ed.AESDecrypt(variable.Where(x => x.Name == "UserName").Select(x => x.Value).FirstOrDefault()); - parkingConfig.Password = ed.AESDecrypt(variable.Where(x => x.Name == "Password").Select(x => x.Value).FirstOrDefault()); + parkingConfig.UserName = variable.Where(x => x.Name == "UserName").Select(x => x.Value).FirstOrDefault(); + parkingConfig.Password = variable.Where(x => x.Name == "Password").Select(x => x.Value).FirstOrDefault(); parkingConfig.VendorId = variable.Where(x => x.Name == "X-VENDOR-ID").Select(x => x.Value).FirstOrDefault(); parkingConfig.VendorToken = variable.Where(x => x.Name == "X-VENDOR-TOKEN").Select(x => x.Value).FirstOrDefault(); @@ -68,7 +69,7 @@ namespace BackendWorkerService.Quartz.Jobs try { await task_Detail.InsertWorkTime("ParkingJob", "Parking", "開始執行停車場剩餘車位Job"); - HttpWebRequest spaceRequest = (HttpWebRequest)WebRequest.Create($"{parkingConfig.Host}{parkingConfig.Prefix}/api/space/details"); + HttpWebRequest spaceRequest = (HttpWebRequest)WebRequest.Create($"{parkingConfig.Host}/api/space/details"); spaceRequest.Method = "GET"; //request.Headers.Add("Authorization", "Basic " + encoded); spaceRequest.Headers.Add("X-VENDOR-ID", parkingConfig.VendorId); @@ -100,9 +101,9 @@ namespace BackendWorkerService.Quartz.Jobs var selectedMapping = parkingSapceMapping.Where(x => x.System_key == area.Name).FirstOrDefault(); if (selectedMapping != null) { + item = area.Name; var tagName = selectedMapping.system_value; var apiFormat = @"{0}obix/config/Arena/{1}/{2}/{3}/{4}/{5}/CV/set"; - var tagNameSplit = tagName.Split("_"); var parames = new List(); @@ -118,7 +119,7 @@ namespace BackendWorkerService.Quartz.Jobs parames.Add(tagName); // 第五段 完整 tag } } - logger.LogError(@$"【ParkingJob】【停車場剩餘車位】{apiFormat}"); + //logger.LogError(@$"【ParkingJob】【停車場剩餘車位】{apiFormat}"); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(string.Format(apiFormat, parames.ToArray())); request.Method = "POST"; request.Headers.Add("Authorization", "Basic " + encoded); @@ -182,19 +183,21 @@ namespace BackendWorkerService.Quartz.Jobs await task_Detail.WorkFail("ParkingJob", "Parking", exception.ToString()); logger.LogInformation("【ParkingJob】【執行失敗停車場剩餘車位Job】"); logger.LogInformation("【ParkingJob】【執行失敗停車場剩餘車位Job】[Exception]:{0}", exception.ToString()); + logger.LogInformation("【ParkingJob】【執行失敗停車場剩餘車位Job】[Item]: {0}", item); + logger.LogInformation("【ParkingJob】【執行失敗停車場剩餘車位Job】[encoded]: {0}", encoded); } } #endregion #region 取得設備資訊 - if (await task_Detail.GetNeedWorkTask("ParkingJob", "Device")) + if (await task_Detail.GetNeedWorkTask("ParkingJob", "Device")) { try { await task_Detail.InsertWorkTime("ParkingJob", "Device", "開始執行設備資訊Job"); //logger.LogInformation("【ParkingJob】【開始執行設備資訊Job】"); - HttpWebRequest equipmentRequest = (HttpWebRequest)WebRequest.Create($"{parkingConfig.Host}{parkingConfig.Prefix}/api/equipment/state"); + HttpWebRequest equipmentRequest = (HttpWebRequest)WebRequest.Create($"{parkingConfig.Host}/api/equipment/state"); equipmentRequest.Method = "GET"; //request.Headers.Add("Authorization", "Basic " + encoded); equipmentRequest.Headers.Add("X-VENDOR-ID", parkingConfig.VendorId); @@ -228,10 +231,10 @@ namespace BackendWorkerService.Quartz.Jobs foreach (var equipment in equipmentResponseResult.Payload) { //找出對定的設備代碼 - var selectedMapping = parkingEquipmentMapping.Where(x => x.System_key == equipment.Name).FirstOrDefault(); + var selectedMapping = parkingEquipmentMapping.Where(x => x.System_key == equipment.Id).FirstOrDefault(); if (selectedMapping != null) { - + item = equipment.Id; var tagName = selectedMapping.system_value; var apiFormat = @"{0}obix/config/Arena/{1}/{2}/{3}/{4}/{5}/ST/set"; @@ -297,7 +300,7 @@ namespace BackendWorkerService.Quartz.Jobs } else { - logger.LogWarning("【ParkingJob】【設備資訊】[查無該名稱對應表]:{0}", equipment.Name); + logger.LogWarning("【ParkingJob】【設備資訊】[查無該名稱對應表]:{0}", equipment.Id); } } } @@ -313,6 +316,8 @@ namespace BackendWorkerService.Quartz.Jobs await task_Detail.WorkFail("ParkingJob", "Device", exception.ToString()); logger.LogInformation("【ParkingJob】【執行失敗設備資訊Job】"); logger.LogInformation("【ParkingJob】【執行失敗設備資訊Job】[Exception]:{0}", exception.ToString()); + logger.LogInformation("【ParkingJob】【執行失敗設備資訊Job】[item]:{0}", item); + logger.LogInformation("【ParkingJob】【執行失敗設備資訊Job】[encoded]:{0}", encoded); } } #endregion diff --git a/BackendWorkerService/appsettings.Development.json b/BackendWorkerService/appsettings.Development.json index 5c0ee01..8c89eee 100644 --- a/BackendWorkerService/appsettings.Development.json +++ b/BackendWorkerService/appsettings.Development.json @@ -19,8 +19,8 @@ }, "DBConfig": { "MySqlDBConfig": { - "Server": "FYlY+w0XDIz+jmF2rlZWJw==", //0.201 - "Port": "js2LutKe+rdjzdxMPQUrvQ==", + "Server": "jbgI3Q4uFL4Kd9bbvToklA==", //0.202 + "Port": "mkF51jVbg40V5K5eTh2Ckw==", //3306 //"Database": "VJB2XC+lAtzuHObDGMVOAA==", //30 //"Database": "IgYBsgG2VLKKxFb64j7LOA==", //wsp //"Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome diff --git a/BackendWorkerService/appsettings.json b/BackendWorkerService/appsettings.json index 771a64b..201af70 100644 --- a/BackendWorkerService/appsettings.json +++ b/BackendWorkerService/appsettings.json @@ -12,15 +12,16 @@ "MessageNotificationJob": "0 0 2 * * ?", "DataDeliveryJob": "0 0 2 * * ?", "RegularUpdateDBTableJob": "0 0 2 * * ?", - "ParkingJob": "0 0 2 * * ?", + "ParkingJob": "0/5 * * * * ?", + //"ParkingJob": "0 0 2 * * ?", "ArchiveElectricMeterHourJob": "0 0 2 * * ?", "ArchiveElectricMeterDayJob": "0/5 * * * * ?", "WeatherAPIJob": "0 0 2 * * ?" }, "DBConfig": { "MySqlDBConfig": { - "Server": "FYlY+w0XDIz+jmF2rlZWJw==", //0.201 - "Port": "js2LutKe+rdjzdxMPQUrvQ==", + "Server": "jbgI3Q4uFL4Kd9bbvToklA==", //0.202 + "Port": "mkF51jVbg40V5K5eTh2Ckw==", //3306 //"Database": "VJB2XC+lAtzuHObDGMVOAA==", //30 //"Database": "IgYBsgG2VLKKxFb64j7LOA==", //wsp //"Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome From 98f21b5813cf2f3e1cf1773865ceec999afa1ac6 Mon Sep 17 00:00:00 2001 From: dev02 Date: Thu, 2 Nov 2023 16:42:29 +0800 Subject: [PATCH 5/6] =?UTF-8?q?[=E5=BE=8C=E7=AB=AF]=20=E4=BF=AE=E6=94=B9sq?= =?UTF-8?q?l=20commend?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Backend/Controllers/SystemCategoryController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Backend/Controllers/SystemCategoryController.cs b/Backend/Controllers/SystemCategoryController.cs index 0ce5a7b..2964e7c 100644 --- a/Backend/Controllers/SystemCategoryController.cs +++ b/Backend/Controllers/SystemCategoryController.cs @@ -628,7 +628,7 @@ namespace Backend.Controllers // JOIN variable sv ON di.device_name_tag = sv.system_value // JOIN variable mv ON sv.system_parent_id = mv.id AND di.device_system_tag = mv.system_value // WHERE sv.id = @id AND di.deleted = @Deleted and di.device_building_tag = @building_tag and di.is_link = 1"; - var sql = @"SELECT min(di.id), di.full_name, di.points, di.unit, di.is_show, di.is_show_riserDiagram, di.is_controll, di.is_bool, di.is_link, di.is_show_history, di.device_system_tag, di.device_name_tag + var sql = @"SELECT min(di.id) as id, di.full_name, di.points, di.unit, di.is_show, di.is_show_riserDiagram, di.is_controll, di.is_bool, di.is_link, di.is_show_history, di.device_system_tag, di.device_name_tag FROM device_item di JOIN variable sv ON di.device_name_tag = sv.system_value JOIN variable mv ON sv.system_parent_id = mv.id AND di.device_system_tag = mv.system_value From b808ac91bc3e4cbde36ed2ade634e20fedc39842 Mon Sep 17 00:00:00 2001 From: dev02 Date: Thu, 2 Nov 2023 18:11:53 +0800 Subject: [PATCH 6/6] =?UTF-8?q?[=E5=BE=8C=E7=AB=AF]=20=E8=AA=BF=E6=95=B4?= =?UTF-8?q?=E8=A8=98=E9=8C=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BackendWorkerService/Quartz/Jobs/ParkingJob.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/BackendWorkerService/Quartz/Jobs/ParkingJob.cs b/BackendWorkerService/Quartz/Jobs/ParkingJob.cs index e2a9c25..ac9e52a 100644 --- a/BackendWorkerService/Quartz/Jobs/ParkingJob.cs +++ b/BackendWorkerService/Quartz/Jobs/ParkingJob.cs @@ -160,6 +160,11 @@ namespace BackendWorkerService.Quartz.Jobs { logger.LogError("【ParkingJob】【停車場剩餘車位資訊】[修改失敗]:{0}", display.ToString()); } + else + { + logger.LogInformation("【ParkingJob】【停車場剩餘車位資訊】[修改成功]:{0}", display.ToString()); + logger.LogInformation("【ParkingJob】【停車場剩餘車位資訊】[停車場資訊]:{0}", item); + } } } } @@ -294,6 +299,11 @@ namespace BackendWorkerService.Quartz.Jobs { logger.LogError("【ParkingJob】【設備資訊】[修改失敗]:{0}", val.ToString()); } + else + { + logger.LogInformation("【ParkingJob】【設備資訊】[修改成功]:{0}", val.ToString()); + logger.LogInformation("【ParkingJob】【設備資訊】[設備資訊]:{0}", item); + } } } }