From 048bb80f9c181c4f6aab8282470bc01dcefa4081 Mon Sep 17 00:00:00 2001 From: dev02 Date: Mon, 19 Jun 2023 13:51:16 +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=E9=A1=AF=E7=A4=BA=E5=95=8F=E9=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FrontendWebApi/ApiControllers/HydroMeterController.cs | 6 +++--- FrontendWebApi/Models/HydroMeter.cs | 1 + FrontendWebApi/appsettings.Development.json | 4 ++-- FrontendWebApi/appsettings.json | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/FrontendWebApi/ApiControllers/HydroMeterController.cs b/FrontendWebApi/ApiControllers/HydroMeterController.cs index f796b49..bd27c93 100644 --- a/FrontendWebApi/ApiControllers/HydroMeterController.cs +++ b/FrontendWebApi/ApiControllers/HydroMeterController.cs @@ -153,8 +153,8 @@ 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("_")[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 }) + .GroupBy(x => new { building_tag = x.device_number.Split("_")[1], floor_tag = x.device_number.Split("_")[4], device_master = x.device_number.Split("_")[5], 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, device_master = x.Key.device_master }) .ToList(); } @@ -170,7 +170,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("_")[7] == 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("_")[5] == l.device_master && 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", diff --git a/FrontendWebApi/Models/HydroMeter.cs b/FrontendWebApi/Models/HydroMeter.cs index 4ac5c25..a3ffd70 100644 --- a/FrontendWebApi/Models/HydroMeter.cs +++ b/FrontendWebApi/Models/HydroMeter.cs @@ -24,6 +24,7 @@ namespace FrontendWebApi.Models public string building_tag { get; set; } public string floor_tag { get; set; } public string device_serial_tag { get; set; } + public string device_master { get; set; } public string total { get; set; } public string price { get; set; } public string total_price { get; set; } diff --git a/FrontendWebApi/appsettings.Development.json b/FrontendWebApi/appsettings.Development.json index f976969..b87a385 100644 --- a/FrontendWebApi/appsettings.Development.json +++ b/FrontendWebApi/appsettings.Development.json @@ -18,10 +18,10 @@ "Port": "js2LutKe+rdjzdxMPQUrvQ==", //"Database": "VJB2XC+lAtzuHObDGMVOAA==", //30 //"Database": "IgYBsgG2VLKKxFb64j7LOA==", //wsp - "Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome + //"Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome //"Database": "siTUcDaC/g2yGTMFWD72Kg==", //tpe_dome_hotel //"Database": "iuaY0h0+TWkir44/eZLDqw==", //tpe_dome_office - //"Database": "Rq7Gn4x6LwBvVtl7GY8LbA==", //MCUT + "Database": "Rq7Gn4x6LwBvVtl7GY8LbA==", //MCUT "Root": "SzdxEgaJJ7tcTCrUl2zKsA==", "Password": "FVAPxztxpY4gJJKQ/se4bQ==" } diff --git a/FrontendWebApi/appsettings.json b/FrontendWebApi/appsettings.json index e57bf74..ef7cff1 100644 --- a/FrontendWebApi/appsettings.json +++ b/FrontendWebApi/appsettings.json @@ -24,8 +24,8 @@ "Port": "js2LutKe+rdjzdxMPQUrvQ==", //"Database": "VJB2XC+lAtzuHObDGMVOAA==", //三菱 //"Database": "IgYBsgG2VLKKxFb64j7LOA==", //wsp - //"Database": "Rq7Gn4x6LwBvVtl7GY8LbA==", //MCUT - "Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome + "Database": "Rq7Gn4x6LwBvVtl7GY8LbA==", //MCUT + //"Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome //"Database": "siTUcDaC/g2yGTMFWD72Kg==", //tpe_dome_hotel //"Database": "iuaY0h0+TWkir44/eZLDqw==", //tpe_dome_office "Root": "SzdxEgaJJ7tcTCrUl2zKsA==",