From afc260435320ca3826f70f86bb19bd320908b53f Mon Sep 17 00:00:00 2001 From: dev02 Date: Thu, 8 Jun 2023 11:56:50 +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=E5=A0=B1=E8=A1=A8=E8=A8=AD=E5=82=99tag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FrontendWebApi/ApiControllers/HydroMeterController.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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",