From 0eed36315d985bf2931edaaea1649d351b5f7681 Mon Sep 17 00:00:00 2001 From: tangxu <tangxu76880903> Date: 星期三, 29 五月 2024 16:31:28 +0800 Subject: [PATCH] 更改 AnaProject.db --- WebApi/Controllers/ZyPrjController.cs | 32 +++++++++++++++++++++++++------- 1 files changed, 25 insertions(+), 7 deletions(-) diff --git a/WebApi/Controllers/ZyPrjController.cs b/WebApi/Controllers/ZyPrjController.cs index 860c9ba..e9ef32e 100644 --- a/WebApi/Controllers/ZyPrjController.cs +++ b/WebApi/Controllers/ZyPrjController.cs @@ -95,8 +95,7 @@ - IStation.LogHelper.Info(string.Format("Zy Prj Time:{0}-{1} ,StartOpenCount:{2} ", - start_timme, end_timme, request.StartOpenCount )); + IStation.CalcModel.AnaRequest anaRequest = new AnaRequest(); anaRequest.CalcOptType = (eCalcOptType)IStation.AnaGlobalParas.Setting.OptSortType; @@ -109,6 +108,8 @@ { if (string.IsNullOrEmpty(request.MaxReservoirLevel)) { + IStation.LogHelper.Info(string.Format("Zy Prj Time:{0}-{1} , 璇疯緭鍏ュ彇姘存�婚噺鎴栨按浣嶈姹�", + start_timme, end_timme )); return new IStation.Dto.ApiResult() { Code = ApiResultCode.Error, Message = "璇疯緭鍏ュ彇姘存�婚噺鎴栨按浣嶈姹�" }; } } @@ -116,11 +117,15 @@ { double TotalFlowIn = 0; if(!double.TryParse( request.TotalFlowIn,out TotalFlowIn)) - { + { + IStation.LogHelper.Info(string.Format("Zy Prj Time:{0}-{1} , 娉ㄦ剰鍙栨按鎬婚噺鍗曚綅鏄惃,褰撳墠鍙傛暟鍙傛暟杩囧皬", + start_timme, end_timme)); return new IStation.Dto.ApiResult() { Code = ApiResultCode.Error, Message = "娉ㄦ剰鍙栨按鎬婚噺鍗曚綅鏄惃,褰撳墠鍙傛暟鍙傛暟杩囧皬" }; } if (TotalFlowIn < 10000) { + IStation.LogHelper.Info(string.Format("Zy Prj Time:{0}-{1} , 娉ㄦ剰鍙栨按鎬婚噺鍗曚綅鏄惃,褰撳墠鍙傛暟鍙傛暟杩囧皬", + start_timme, end_timme)); return new IStation.Dto.ApiResult() { Code = ApiResultCode.Error, Message = "娉ㄦ剰鍙栨按鎬婚噺鍗曚綅鏄惃,褰撳墠鍙傛暟鍙傛暟杩囧皬" }; } @@ -134,11 +139,15 @@ var water_records = dal.GetByHourRangle( start_timme , end_timme ); if (water_records == null) { + IStation.LogHelper.Info(string.Format("Zy Prj Time:{0}-{1} , 姘翠綅棰勬祴鏁版嵁涓虹┖,璇峰厛淇濇寔姘翠綅棰勬祴鏈嶅姟姝e父杩愯", + start_timme, end_timme)); return new IStation.Dto.ApiResult<string>() { Code = ApiResultCode.Error, Data = "姘翠綅棰勬祴鏁版嵁涓虹┖,璇峰厛淇濇寔姘翠綅棰勬祴鏈嶅姟姝e父杩愯" }; } var count = (end_timme - start_timme).TotalHours; if (water_records.Count != count) - { + { + IStation.LogHelper.Info(string.Format("Zy Prj Time:{0}-{1} , 棰勬祴鏁版嵁鑾峰彇澶辫触,鏁版嵁鏉℃棤娉曞尮閰�, 妫�鏌ユ槸鍚﹂娴嬫湇鍔′腑鏂�", + start_timme, end_timme)); return new IStation.Dto.ApiResult<string>() { Code = ApiResultCode.Error, Data = "棰勬祴鏁版嵁鑾峰彇澶辫触,鏁版嵁鏉℃棤娉曞尮閰�, 妫�鏌ユ槸鍚﹂娴嬫湇鍔′腑鏂�" }; } @@ -147,10 +156,13 @@ { if(r.States == 0) { - return new IStation.Dto.ApiResult<string>() { Code = ApiResultCode.Error, Data = - string.Format("棰勬祴鏁版嵁寮傚父,鏃犳硶杩涜姘翠綅璁$畻:{0} {1},{2}",r.DayHour,r.LastPredictValue,r.Description )}; + var error_info11 = string.Format("棰勬祴鏁版嵁寮傚父,鏃犳硶杩涜姘翠綅璁$畻:{0} {1},{2}", r.DayHour, r.LastPredictValue, r.Description); + IStation.LogHelper.Info(string.Format("Zy Prj Time:{0}-{1} , {2}}", + start_timme, end_timme, error_info11)); + return new IStation.Dto.ApiResult<string>() { Code = ApiResultCode.Error, Data = error_info11 + }; } - anaRequest.SpaceFlowOut.Add(r.LastPredictValue); + anaRequest.SpaceFlowOut.Add(r.LastPredictValue/10000); } } @@ -189,8 +201,14 @@ string error_info = calcHelper.Calc(anaRequest, out defaultPrj); if (!string.IsNullOrEmpty(error_info) || defaultPrj == null) { + IStation.LogHelper.Info(string.Format("Zy Prj Time:{0}-{1} , 璁$畻閿欒, 鍘熷洜鏄�:{2} ,Request::: ", + start_timme, end_timme, error_info)+ JsonHelper.Object2Json( anaRequest)); return new IStation.Dto.ApiResult() { Code = ApiResultCode.Error, Message = "璁$畻閿欒, 鍘熷洜鏄�:" + error_info }; } + else + { + IStation.LogHelper.Info(string.Format("Zy Prj Time:{0}-{1} , 璁$畻鎴愬姛", start_timme, end_timme )); + } //淇濆瓨鏂规 var ret = Common.HistoryAnaPrjFileHelper.SavePrj(IStation.AnaGlobalParas.Setting, anaRequest, defaultPrj); -- Gitblit v1.9.3