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; }