diff --git a/FrontendWebApi/ApiControllers/HydroMeterController.cs b/FrontendWebApi/ApiControllers/HydroMeterController.cs index 11b8d9e..07d2ed2 100644 --- a/FrontendWebApi/ApiControllers/HydroMeterController.cs +++ b/FrontendWebApi/ApiControllers/HydroMeterController.cs @@ -143,7 +143,7 @@ namespace FrontendWebApi.ApiControllers else { list = rawData - .GroupBy(x => new { building_tag = x.device_number.Split("_")[1], floor_tag = x.device_number.Split("_")[4], device_serial_tag = x.device_number.Split("_")[3] }) + .GroupBy(x => new { building_tag = x.device_number.Split("_")[1], floor_tag = x.device_number.Split("_")[4], device_serial_tag = x.device_number.Split("_")[7] }) .Select(x => new HydroMeterOutput { building_tag = x.Key.building_tag, floor_tag = x.Key.floor_tag, device_serial_tag = x.Key.device_serial_tag }) .ToList(); } @@ -160,7 +160,7 @@ namespace FrontendWebApi.ApiControllers else { l.rawData.AddRange( - rawData.Where(x => x.device_number.Split("_")[1] == l.building_tag && x.device_number.Split("_")[4] == l.floor_tag && x.device_number.Split("_")[3] == l.device_serial_tag) + rawData.Where(x => x.device_number.Split("_")[1] == l.building_tag && x.device_number.Split("_")[4] == l.floor_tag && x.device_number.Split("_")[7] == l.device_serial_tag) ); } l.building_name = await backendRepository.GetOneAsync("select full_name from building where building_tag = @building_tag and deleted = 0", @@ -304,7 +304,7 @@ namespace FrontendWebApi.ApiControllers else { list = rawData - .GroupBy(x => new { building_tag = x.device_number.Split("_")[1], floor_tag = x.device_number.Split("_")[4], device_serial_tag = x.device_number.Split("_")[3] }) + .GroupBy(x => new { building_tag = x.device_number.Split("_")[1], floor_tag = x.device_number.Split("_")[4], device_serial_tag = x.device_number.Split("_")[7] }) .Select(x => new HydroMeterOutput { building_tag = x.Key.building_tag, floor_tag = x.Key.floor_tag, device_serial_tag = x.Key.device_serial_tag }) .ToList(); } @@ -321,7 +321,7 @@ namespace FrontendWebApi.ApiControllers else { l.rawData.AddRange( - rawData.Where(x => x.device_number.Split("_")[1] == l.building_tag && x.device_number.Split("_")[4] == l.floor_tag && x.device_number.Split("_")[3] == l.device_serial_tag) + rawData.Where(x => x.device_number.Split("_")[1] == l.building_tag && x.device_number.Split("_")[4] == l.floor_tag && x.device_number.Split("_")[7] == l.device_serial_tag) ); } l.building_name = await backendRepository.GetOneAsync("select full_name from building where building_tag = @building_tag and deleted = 0",