From 1c88b3182e44e0da879edd5466f120a114dbcf1a Mon Sep 17 00:00:00 2001 From: dev02 Date: Thu, 11 May 2023 17:57:45 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=BE=8C=E7=AB=AF]=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=B0=B4=E9=9B=BB=E8=A1=A8=E5=88=97=E8=A1=A8=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=AC=84=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FrontendWebApi/ApiControllers/HydroMeterController.cs | 4 ++++ FrontendWebApi/Models/HydroMeter.cs | 1 + 2 files changed, 5 insertions(+) diff --git a/FrontendWebApi/ApiControllers/HydroMeterController.cs b/FrontendWebApi/ApiControllers/HydroMeterController.cs index 3a169d0..213ac3e 100644 --- a/FrontendWebApi/ApiControllers/HydroMeterController.cs +++ b/FrontendWebApi/ApiControllers/HydroMeterController.cs @@ -71,6 +71,8 @@ namespace FrontendWebApi.ApiControllers l.rawData.AddRange( rawData.Where(x => x.device_number.Split("_")[0] == l.building_tag && x.device_number.Split("_")[2] == l.floor_tag && x.device_number.Split("_")[4] == l.device_serial_tag) ); + l.building_name = await backendRepository.GetOneAsync("select full_name from building where building_tag = @building_tag and deleted = 0", + new { building_tag = l.building_tag }); l.total = l.rawData.Count.ToString(); l.price = (await backendRepository.GetOneAsync("select system_value from variable where system_type = 'MeterPrice' and deleted = 0")).ToString(); l.total_price = (l.rawData.Count * Int32.Parse(l.price)).ToString(); @@ -139,6 +141,8 @@ namespace FrontendWebApi.ApiControllers l.rawData.AddRange( rawData.Where(x => x.device_number.Split("_")[0] == l.building_tag && x.device_number.Split("_")[2] == l.floor_tag && x.device_number.Split("_")[4] == l.device_serial_tag) ); + l.building_name = await backendRepository.GetOneAsync("select full_name from building where building_tag = @building_tag and deleted = 0", + new { building_tag = l.building_tag }); l.total = l.rawData.Count.ToString(); l.price = (await backendRepository.GetOneAsync("select system_value from variable where system_type = 'WaterPrice' and deleted = 0")).ToString(); l.total_price = (l.rawData.Count * Int32.Parse(l.price)).ToString(); diff --git a/FrontendWebApi/Models/HydroMeter.cs b/FrontendWebApi/Models/HydroMeter.cs index 6bbb95a..ebafece 100644 --- a/FrontendWebApi/Models/HydroMeter.cs +++ b/FrontendWebApi/Models/HydroMeter.cs @@ -19,6 +19,7 @@ namespace FrontendWebApi.Models public class HydroMeterOutput { + public string building_name { get; set; } public string building_tag { get; set; } public string floor_tag { get; set; } public string device_serial_tag { get; set; }