From 2399f124c8af347dea80c071c98a26129a643d1d Mon Sep 17 00:00:00 2001
From: tangxu <tangxu76880903>
Date: 星期三, 07 八月 2024 13:26:06 +0800
Subject: [PATCH] 添加开始水库水位

---
 WebApi/Controllers/PumpRunController.cs |   28 +++++++++++++++++++++++++---
 1 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/WebApi/Controllers/PumpRunController.cs b/WebApi/Controllers/PumpRunController.cs
index 13264f8..b082193 100644
--- a/WebApi/Controllers/PumpRunController.cs
+++ b/WebApi/Controllers/PumpRunController.cs
@@ -20,8 +20,6 @@
     [RoutePrefix("PumpRun")]
     public class PumpRunController : ApiController
     {
-        private bool isdebug = true;
-
         /// <summary>
         ///  鑾峰彇娉靛疄闄呰繍琛屽弬鏁�(涓�澶�)
         /// </summary>
@@ -48,7 +46,7 @@
             PumpRunParasHelper pumpRunParasHelper = new PumpRunParasHelper();
             result = Common.PumpRunParasHelper.ReadPumpRunParas(d);
             string geterroer = null;
-            if (result != null && isdebug)
+            if (result != null)
             {
                 result.Electric = Math.Round(result.Electric, 2);
                 result.Money = Math.Round(result.Money, 2);
@@ -418,5 +416,29 @@
             }
             return new IStation.Dto.ApiResult<List<SSAData>>(totalOneDays) { Code = ApiResultCode.Success, Message = "Success" };
         }
+
+
+
+        [Route("GetPumpRealData")]
+        [HttpGet]
+        public async Task<IStation.Dto.ApiResult> GetPumpRealData(string startday, string endday, string resolution)
+        {
+            if (startday == null || endday == null)
+            {
+                return new IStation.Dto.ApiResult() { Code = ApiResultCode.Error, Message = "day null" };
+            }
+            DateTime Start;
+            if (!DateTime.TryParse(startday, out Start))
+            {
+                return new IStation.Dto.ApiResult() { Code = ApiResultCode.Error, Message = "day 鏍煎紡涓嶆纭�" };
+            }
+            DateTime d;
+            if (!DateTime.TryParse(endday, out d))
+            {
+                return new IStation.Dto.ApiResult() { Code = ApiResultCode.Error, Message = "day 鏍煎紡涓嶆纭�" };
+            }
+            var TotalWater = await ZyConnectHelper.GetTotalWaterByTimeRange_Out(Start, d, resolution);    //鍙栨按閲�
+            return new IStation.Dto.ApiResult<List<RealScadaData>>(TotalWater) { Code = ApiResultCode.Success, Message = "Success" };
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3