From aac9ef3f9e9741b7e81ff2ac094a809e005e44cf Mon Sep 17 00:00:00 2001 From: dev02 Date: Thu, 17 Nov 2022 14:57:08 +0800 Subject: [PATCH 1/4] fix error --- FrontendWebApi/ApiControllers/DeviceManageController.cs | 4 ++-- FrontendWebApi/Models/Device.cs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/FrontendWebApi/ApiControllers/DeviceManageController.cs b/FrontendWebApi/ApiControllers/DeviceManageController.cs index 2c2366d..ad7739f 100644 --- a/FrontendWebApi/ApiControllers/DeviceManageController.cs +++ b/FrontendWebApi/ApiControllers/DeviceManageController.cs @@ -186,8 +186,8 @@ namespace FrontendWebApi.ApiControllers from device d left join device_kind dk on d.device_building_tag = dk.device_building_tag and d.device_system_tag = dk.device_system_tag and d.device_name_tag = dk.device_name_tag - where d.deleted = 0 and d.device_system_tag = @sub_system_tag and d.device_building_tag = @building_tag and d.device_floor_tag = ifnull(@floor_tag, d.device_floor_tag)"; - var dlParam = new { @main_system_tag = fd.main_system_tag, @building_tag = fd.building_tag, @floor_tag = fd.floor_tag }; + where d.deleted = 0 and d.device_name_tag = @sub_system_tag and d.device_building_tag = @building_tag and d.device_floor_tag = ifnull(@floor_tag, d.device_floor_tag)"; + var dlParam = new { @sub_system_tag = fd.sub_system_tag, @building_tag = fd.building_tag, @floor_tag = fd.floor_tag }; dl = await backendRepository.GetAllAsync(sqlString, dlParam); f.device_list = dl; } diff --git a/FrontendWebApi/Models/Device.cs b/FrontendWebApi/Models/Device.cs index 0a10c4b..ec8c44f 100644 --- a/FrontendWebApi/Models/Device.cs +++ b/FrontendWebApi/Models/Device.cs @@ -7,6 +7,7 @@ namespace FrontendWebApi.Models public class FindDevice { public string main_system_tag { get; set; } + public string sub_system_tag { get; set; } public string building_tag { get; set; } public string floor_tag { get; set; } public string device_guid { get; set; } From 6fb85de6aae99440aa6288c0fe703919963b29a7 Mon Sep 17 00:00:00 2001 From: dev02 Date: Thu, 17 Nov 2022 15:14:59 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=9C=80=E6=B1=82?= =?UTF-8?q?=E6=AC=84=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ApiControllers/DeviceManageController.cs | 9 ++++++--- FrontendWebApi/Models/Device.cs | 12 ++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/FrontendWebApi/ApiControllers/DeviceManageController.cs b/FrontendWebApi/ApiControllers/DeviceManageController.cs index ad7739f..78a9d8a 100644 --- a/FrontendWebApi/ApiControllers/DeviceManageController.cs +++ b/FrontendWebApi/ApiControllers/DeviceManageController.cs @@ -182,12 +182,15 @@ namespace FrontendWebApi.ApiControllers foreach (var f in fl) { List dl = new List(); - sqlString = $@"select d.device_guid, d.full_name, d.device_coordinate, dk.device_image, d.device_number, dk.device_normal_flashing, dk.device_close_flashing, dk.device_error_flashing + sqlString = $@"select d.device_guid, d.full_name, d.device_coordinate, dk.device_image, d.device_number, + dk.device_normal_point_id, dk.device_normal_point_guid, dk.device_normal_point_col, dk.device_normal_point_value, dk.device_normal_flashing, + dk.device_close_point_id, dk.device_close_point_guid, dk.device_close_point_col, dk.device_close_point_value, dk.device_close_flashing, + dk.device_error_point_id, dk.device_error_point_guid, dk.device_error_point_col, dk.device_error_point_value, dk.device_error_flashing from device d left join device_kind dk on d.device_building_tag = dk.device_building_tag and d.device_system_tag = dk.device_system_tag - and d.device_name_tag = dk.device_name_tag + and d.device_name_tag = dk.device_name_tag where d.deleted = 0 and d.device_name_tag = @sub_system_tag and d.device_building_tag = @building_tag and d.device_floor_tag = ifnull(@floor_tag, d.device_floor_tag)"; - var dlParam = new { @sub_system_tag = fd.sub_system_tag, @building_tag = fd.building_tag, @floor_tag = fd.floor_tag }; + var dlParam = new { @main_system_tag = fd.main_system_tag, @building_tag = fd.building_tag, @floor_tag = fd.floor_tag }; dl = await backendRepository.GetAllAsync(sqlString, dlParam); f.device_list = dl; } diff --git a/FrontendWebApi/Models/Device.cs b/FrontendWebApi/Models/Device.cs index ec8c44f..f8054b3 100644 --- a/FrontendWebApi/Models/Device.cs +++ b/FrontendWebApi/Models/Device.cs @@ -50,8 +50,20 @@ namespace FrontendWebApi.Models } } public string device_image { get; set; } + public string device_normal_point_id { get; set; } + public string device_normal_point_guid { get; set; } + public string device_normal_point_col { get; set; } + public string device_normal_point_value { get; set; } public string device_normal_flashing { get; set; } + public string device_close_point_id { get; set; } + public string device_close_point_guid { get; set; } + public string device_close_point_col { get; set; } + public string device_close_point_value { get; set; } public string device_close_flashing { get; set; } + public string device_error_point_id { get; set; } + public string device_error_point_guid { get; set; } + public string device_error_point_col { get; set; } + public string device_error_point_value { get; set; } public string device_error_flashing { get; set; } } From d0880ca34833b2adf7b9511b341cd4a7ee615341 Mon Sep 17 00:00:00 2001 From: dev02 Date: Thu, 17 Nov 2022 15:17:32 +0800 Subject: [PATCH 3/4] fix error --- FrontendWebApi/ApiControllers/DeviceManageController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FrontendWebApi/ApiControllers/DeviceManageController.cs b/FrontendWebApi/ApiControllers/DeviceManageController.cs index 78a9d8a..7e2bc64 100644 --- a/FrontendWebApi/ApiControllers/DeviceManageController.cs +++ b/FrontendWebApi/ApiControllers/DeviceManageController.cs @@ -190,7 +190,7 @@ namespace FrontendWebApi.ApiControllers left join device_kind dk on d.device_building_tag = dk.device_building_tag and d.device_system_tag = dk.device_system_tag and d.device_name_tag = dk.device_name_tag where d.deleted = 0 and d.device_name_tag = @sub_system_tag and d.device_building_tag = @building_tag and d.device_floor_tag = ifnull(@floor_tag, d.device_floor_tag)"; - var dlParam = new { @main_system_tag = fd.main_system_tag, @building_tag = fd.building_tag, @floor_tag = fd.floor_tag }; + var dlParam = new { @sub_system_tag = fd.sub_system_tag, @building_tag = fd.building_tag, @floor_tag = fd.floor_tag }; dl = await backendRepository.GetAllAsync(sqlString, dlParam); f.device_list = dl; } From 978e85f857db27bd0ab18d349e0a7df91d0157b8 Mon Sep 17 00:00:00 2001 From: dev02 Date: Thu, 17 Nov 2022 15:20:31 +0800 Subject: [PATCH 4/4] fix modal --- FrontendWebApi/Models/Device.cs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/FrontendWebApi/Models/Device.cs b/FrontendWebApi/Models/Device.cs index f8054b3..d35bbec 100644 --- a/FrontendWebApi/Models/Device.cs +++ b/FrontendWebApi/Models/Device.cs @@ -36,19 +36,19 @@ namespace FrontendWebApi.Models public string device_coordinate { get; set; } public string device_coordinate_3d { get; set; } public string status { get; set; } - public string device_status - { - get - { - Dictionary name = new Dictionary() - { - { "0", "關閉"}, - { "1", "正常"}, - { "2", "異常"} - }; - return name[status]; - } - } + //public string device_status + //{ + // get + // { + // Dictionary name = new Dictionary() + // { + // { "0", "關閉"}, + // { "1", "正常"}, + // { "2", "異常"} + // }; + // return name[status]; + // } + //} public string device_image { get; set; } public string device_normal_point_id { get; set; } public string device_normal_point_guid { get; set; }