Calc/IStation.Calc.Core/CalcPrj.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Calc/IStation.Calc.Core/计算基类/ErQuCalcBaseHelper.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Calc/IStation.Calc.Core/递归计算2/ErQuCalcHelper_2_递归.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Calc/IStation.Calc.Core/递归计算2/ErQuCalcHelper_2_递归_定水位_任意时间.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Calc/IStation.Calc.Core/递归计算2/ErQuCalcHelper_2_递归_定水位_指定时间.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Calc/IStation.Calc.Core/递归计算2/ErQuCalcHelper_2_递归_定水量.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Calc/IStation.Calc.Model/AnaPrj.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Calc/IStation.Calc.Model/AnaRequest.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DAL/IStation.DAL.Project/历史调度方案/HistoryAnaPrjFileHelper.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebApi/Controllers/ZyPrjController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebApi/Web.config | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebApi/众毅调度/dto/DtoPrj.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
Calc/IStation.Calc.Core/CalcPrj.cs
@@ -39,7 +39,32 @@ //anaPrjs.Sort(new AnaPrj.Comparer(anaRequest.CalcOptType)); //optPrj = anaPrjs.First(); // double maxHeight = 0; DateTime maxHeightTime = optPrj.StartTime; if (optPrj.BlockTimes != null) { foreach (var bt in optPrj.BlockTimes) { if (bt.OpenPumpIndexs == null) continue; if (bt.PointTimes != null) { foreach (var bt2 in bt.PointTimes) { if (maxHeight < bt2.WaterLevelH) { maxHeight = bt2.WaterLevelH; //maxHeight = Math.Max(maxHeight, bt2.WaterLevelH); maxHeightTime = bt2.Time; } } } } } optPrj.MaxWaterLevelH = maxHeight; optPrj.MaxWaterLevelTime = maxHeightTime; return null; } Calc/IStation.Calc.Core/¼ÆËã»ùÀà/ErQuCalcBaseHelper.cs
@@ -24,7 +24,6 @@ { var calc = new IStation.Calc.ErQuCalcHelper_2_éå½_宿°´ä½_ä»»ææ¶é´(); calc.SetMaxReservoirHeight(anaRequest.MaxReservoirLevel.Value); return calc; } else @@ -128,7 +127,7 @@ /// <summary> /// /// </summary> protected double _stationTotalFlow = 0;//便°´æ»é(ä¸ä¸å®æå¼ åä½: å¨) protected double _flowInTotalFlow = 0;//åæ°´æ»é(ä¸ä¸å®æå¼ åä½: å¨) /// <summary> /// @@ -138,7 +137,7 @@ { this._start_levelæ°´åºæ°´ä½ = anaRequest.StartReservoirLevel; this._clacOptType = anaRequest.CalcOptType; if (anaRequest.IsKnownStartOpenPump) { if (anaRequest.StartOpenPumpIndexArray == null) @@ -157,7 +156,7 @@ } if (anaRequest.TotalFlowIn != null) this._stationTotalFlow = anaRequest.TotalFlowIn.Value; this._flowInTotalFlow = anaRequest.TotalFlowIn.Value; this.Initialæ°´åºåæ°(anaRequest); Calc/IStation.Calc.Core/µÝ¹é¼ÆËã2/ErQuCalcHelper_2_µÝ¹é.cs
@@ -13,6 +13,17 @@ public List<RunBlock> Items { get; set; } public double TotalCompare;//åçæè çµè´¹(å计) public double TotalFlow; public double GetByTime(DateTime time) { //foreach (var item in this.Items) //{ // if (item.ReservoirStartHeight >= _maxReservoirHeight || item.ReservoirEndHeight >= _maxReservoirHeight) // { // return ToAnaPrj(result宿°´é); // } //} return 0; } } #region Project 转å @@ -248,7 +259,7 @@ var unablePumpIndexArray = IStation.AnaGlobalParas.Setting.UnablePumpIndexArray; if (unablePumpIndexArray != null && unablePumpIndexArray.Count() > 0 ) if (unablePumpIndexArray != null && unablePumpIndexArray.Count() > 0) { //åé¢å弿£ä¿®çæ³µ if (openPumpIndexSequence != null) @@ -291,7 +302,7 @@ // "openPumpIndexSequence:{0},closePumpIndexSequence:{1}", // string.Join(",",openPumpIndexSequence), // string.Join(",", closePumpIndexSequence))); @@ -547,7 +558,7 @@ return true; } private AnaPrjBlockTime BuildAnaPrjBlockTime(int block_id, int open_pump_count, protected AnaPrjBlockTime BuildAnaPrjBlockTime(int block_id, int open_pump_count, int start_indx, int end_index, double reservoir_start_height, double reservoir_end_height) { Calc/IStation.Calc.Core/µÝ¹é¼ÆËã2/ErQuCalcHelper_2_µÝ¹é_¶¨Ë®Î»_ÈÎÒâʱ¼ä.cs
@@ -19,17 +19,21 @@ _minTimeCountSwitch = this.MinSwitchPumpMinute / this.CalcSpaceMinute; //this._maxPumpSwitchCount = 5; var result宿°´é = CalcOptPrjsBlockItems宿°´é(); if (result宿°´é == null) return null; foreach (var item in result宿°´é.Items) if (this._flowInTotalFlow > 0) { if (item.ReservoirStartHeight >= _maxReservoirHeight || item.ReservoirEndHeight >= _maxReservoirHeight) ErQuCalcHelper_2_éå½.BlockItemList result宿°´é = CalcOptPrjsBlockItems宿°´é(); if (result宿°´é == null) return null; foreach (var item in result宿°´é.Items) { return ToAnaPrj(result宿°´é); if (item.ReservoirStartHeight >= _maxReservoirHeight || item.ReservoirEndHeight >= _maxReservoirHeight) {//åªè¦ä¸ç«¯è¶ è¿è¦æ±æ°´ä½, 峿¹æ¡å¯è¡ return ToAnaPrj(result宿°´é); } } } var result = CalcOptPrjsBlockItems_宿°´ä½_ä»»ææ¶é´(); @@ -179,7 +183,7 @@ var td = GetTimeDataBundle(pumpNum_left); td.GetRangeDataStart1(0, out sumFlowWhole, out sumCompareWhole); if (sumFlowWhole >= this._stationTotalFlow) if (sumFlowWhole >= this._flowInTotalFlow) { if (sumCompareWhole < current_best_solution.TotalCompare) { @@ -271,7 +275,7 @@ td.GetRangeData1(0, splitIndx, out sumFlowLeft, out sumCompareLeft); if (sumFlowLeft >= this._stationTotalFlow) if (sumFlowLeft >= this._flowInTotalFlow) { #region 左侧已ç»è½è¾¾å°è¦æ±äº,å³è¾¹çå ¨å ³æº if (current_best_solution.TotalCompare > sumCompareLeft) @@ -380,7 +384,7 @@ return null; } if (lastTotalFlow > this._stationTotalFlow) if (lastTotalFlow > this._flowInTotalFlow) {//å·²è¾¾å°æµé:åºæ¬ä¸ä¸ä¼åºç°,è¿å ¥å已夿 return null; } @@ -407,7 +411,7 @@ if (cache_model.Items.First().PumpCount == lastOpenPumpCount) return null; if (cache_model.TotalFlow + lastTotalFlow >= this._stationTotalFlow) if (cache_model.TotalFlow + lastTotalFlow >= this._flowInTotalFlow) { BlockItemList cache_model_copy = new BlockItemList(); cache_model_copy.TotalCompare = cache_model.TotalCompare; @@ -465,7 +469,7 @@ if (sumCompareWhole == double.MaxValue) continue; if (sumFlowWhole + lastTotalFlow >= this._stationTotalFlow && if (sumFlowWhole + lastTotalFlow >= this._flowInTotalFlow && sumCompareWhole < current_best_solution.TotalCompare) { //å·¦ä¾§ç»ææ¶çæ°´ä½ @@ -572,7 +576,7 @@ continue; var total_current_flow = left_sumFlowLeft + lastTotalFlow; if (total_current_flow >= this._stationTotalFlow) if (total_current_flow >= this._flowInTotalFlow) {//左侧已ç»è½è¾¾å°è¦æ±äº if (current_best_solution.TotalCompare > left_sumCompareLeft) { Calc/IStation.Calc.Core/µÝ¹é¼ÆËã2/ErQuCalcHelper_2_µÝ¹é_¶¨Ë®Î»_Ö¸¶¨Ê±¼ä.cs
@@ -18,6 +18,27 @@ _minTimeCountSwitch = this.MinSwitchPumpMinute / this.CalcSpaceMinute; //this._maxPumpSwitchCount = 5; #region 夿宿°´éæ¯å¦å¯ä»¥ if (this._flowInTotalFlow > 0) { var result宿°´é = CalcOptPrjsBlockItems宿°´é(); if (result宿°´é == null) return null; //if (CheckMaxLevel(result宿°´é.Items)) //{ // return ToAnaPrj(result宿°´é); //} var prj宿°´é = ToAnaPrj(result宿°´é); var height = prj宿°´é.GetWaterLevelHByTime(_maxReservoirTime); if(height >= _maxReservoirHeight) { return prj宿°´é; } } #endregion for (int i = 0; i < _timeList.Count; i++) { if (_timeList[i].Time >= _maxReservoirTime) @@ -28,19 +49,16 @@ } //var result宿°´é = CalcOptPrjsBlockItems宿°´é(); //if (result宿°´é == null) // return null; //if (CheckMaxLevel(result宿°´é.Items)) //{ // return ToAnaPrj(result宿°´é); //} // var result = CalcOptPrjsBlockItems_宿°´ä½_æå®æ¶é´(); if (result == null) return null; return ToAnaPrj(result); } @@ -201,7 +219,7 @@ var td = GetTimeDataBundle(pumpNum_left); td.GetRangeDataStart1(0, out sumFlowWhole, out sumCompareWhole); if (sumFlowWhole >= this._stationTotalFlow) if (sumFlowWhole >= this._flowInTotalFlow) { if (sumCompareWhole < current_best_solution.TotalCompare) { @@ -296,7 +314,7 @@ td.GetRangeData1(0, splitIndx, out sumFlowLeft, out sumCompareLeft); if (sumFlowLeft >= this._stationTotalFlow) if (sumFlowLeft >= this._flowInTotalFlow) { #region 左侧已ç»è½è¾¾å°è¦æ±äº,å³è¾¹çå ¨å ³æº if (current_best_solution.TotalCompare > sumCompareLeft) @@ -422,7 +440,7 @@ return null; } if (lastTotalFlow > this._stationTotalFlow) if (lastTotalFlow > this._flowInTotalFlow) {//å·²è¾¾å°æµé:åºæ¬ä¸ä¸ä¼åºç°,è¿å ¥å已夿 return null; } @@ -484,7 +502,7 @@ if (sumCompareWhole == double.MaxValue) continue; if (sumFlowWhole + lastTotalFlow >= this._stationTotalFlow && if (sumFlowWhole + lastTotalFlow >= this._flowInTotalFlow && sumCompareWhole < current_best_solution.TotalCompare) { //å·¦ä¾§ç»ææ¶çæ°´ä½ @@ -612,7 +630,7 @@ continue; var total_current_flow = left_sumFlowLeft + lastTotalFlow; if (total_current_flow >= this._stationTotalFlow) if (total_current_flow >= this._flowInTotalFlow) {//左侧已ç»è½è¾¾å°è¦æ±äº if (current_best_solution.TotalCompare > left_sumCompareLeft) { Calc/IStation.Calc.Core/µÝ¹é¼ÆËã2/ErQuCalcHelper_2_µÝ¹é_¶¨Ë®Á¿.cs
@@ -6,6 +6,9 @@ namespace IStation.Calc { /// <summary> /// å®åæ°´æ»é /// </summary> internal partial class ErQuCalcHelper_2_éå½_宿°´é : ErQuCalcHelper_2_éå½ { protected List<List<Dictionary<int, BlockItemList>>> _dictCalcCache宿°´é; @@ -142,7 +145,7 @@ var td = GetTimeDataBundle(pumpNum_left); td.GetRangeDataStart1(0, out sumFlowWhole, out sumCompareWhole); if (sumFlowWhole >= this._stationTotalFlow) if (sumFlowWhole >= this._flowInTotalFlow) { if (sumCompareWhole < current_best_solution.TotalCompare) { @@ -212,7 +215,7 @@ td.GetRangeData1(0, splitIndx, out sumFlowLeft, out sumCompareLeft); if (sumFlowLeft >= this._stationTotalFlow) if (sumFlowLeft >= this._flowInTotalFlow) {//左侧已ç»è½è¾¾å°è¦æ±äº if (current_best_solution.TotalCompare > sumCompareLeft) { @@ -290,7 +293,7 @@ return null; } if (lastTotalFlow > this._stationTotalFlow) if (lastTotalFlow > this._flowInTotalFlow) {//å·²è¾¾å°æµé:åºæ¬ä¸ä¸ä¼åºç°,è¿å ¥å已夿 return null; } @@ -318,7 +321,7 @@ isNeedInsertCache = false; if (cache_model.TotalFlow + lastTotalFlow >= this._stationTotalFlow) if (cache_model.TotalFlow + lastTotalFlow >= this._flowInTotalFlow) { BlockItemList cache_model_copy = new BlockItemList(); cache_model_copy.TotalCompare = cache_model.TotalCompare; @@ -352,7 +355,7 @@ if (sumCompareWhole == double.MaxValue) continue; if (sumFlowWhole + lastTotalFlow >= this._stationTotalFlow && if (sumFlowWhole + lastTotalFlow >= this._flowInTotalFlow && sumCompareWhole < current_best_solution.TotalCompare) { current_best_solution.TotalCompare = sumCompareWhole; @@ -433,7 +436,7 @@ if (sumCompareLeft == double.MaxValue) continue; var total_current_flow = sumFlowLeft + lastTotalFlow; if (total_current_flow >= this._stationTotalFlow) if (total_current_flow >= this._flowInTotalFlow) {//左侧已ç»è½è¾¾å°è¦æ±äº if (current_best_solution.TotalCompare > sumCompareLeft) { Calc/IStation.Calc.Model/AnaPrj.cs
@@ -31,12 +31,12 @@ } public List<AnaPrjPointTime> GetAllPointTimeList() { List < AnaPrjPointTime > list = new List<AnaPrjPointTime>(); List<AnaPrjPointTime> list = new List<AnaPrjPointTime>(); if (this.BlockTimes != null) { foreach (var bt in this.BlockTimes) { if(bt.PointTimes != null) if (bt.PointTimes != null) { list.AddRange(bt.PointTimes); } @@ -45,18 +45,42 @@ return list; } public double GetWaterLevelHByTime(DateTime time) { List<AnaPrjPointTime> list = new List<AnaPrjPointTime>(); if (this.BlockTimes != null) { foreach (var bt in this.BlockTimes) { if (bt.PointTimes == null) continue; foreach (var tp in bt.PointTimes) { if (tp.Time >= time) return tp.WaterLevelH; } } } return -1; } public DateTime StartTime { get; set; } public DateTime EndTime { get; set; } public string ID { get; set; } public string Name { get; set; } //æµæ°´å· public string WaterLevelInfo { get; set; } public double SumFlow { get; set; }//å¨ public double SumFlow { get; set; }//å¨(计ç®å¼) public double SumPower { get; set; } public double SumMoney { get; set; } public double SumFlow4Disp { get { return Math.Round(SumFlow / 10000, 2); } } public double SumPower4Disp { get { return Math.Round(SumPower, 0); } } public double MaxWaterLevelH { get; set; }//æå¤§æ°´åºæ°´ä½ public DateTime MaxWaterLevelTime { get; set; }//æå¤§æ°´åºæ°´ä½æ¶é´ public int CalcSpaceMinute { get; set; } @@ -310,8 +334,6 @@ public double SumFlow { get; set; }//æµé , èèæ¶é´æ®µ public double SumPower { get; set; }//ç¨çµé , èèæ¶é´æ®µ public double SumMoney { get; set; }//è´¹çµ , èèæ¶é´æ®µ Calc/IStation.Calc.Model/AnaRequest.cs
@@ -41,7 +41,7 @@ public DateTime EndTime { get; set; } public List<int> StartOpenPumpIndexArray { get; set; }//å¼å§æ¶å¼çæ¯åªäºå å°æ³µ public bool IsKnownStartOpenPump { get; set; } //æ¯å¦ç¥éç¥éå¼å§æ¶ç弿³µç¶æ public double? TotalFlowIn { get; set; }//åä½ å¨ public double? TotalFlowIn { get; set; }//åæ°´æ»é åä½(å¨) public double StartReservoirLevel { get; set; }//å½åæ°´åºæ°´ä½(ç±CurrentWaterBoxLevel æ¹) DAL/IStation.DAL.Project/ÀúÊ·µ÷¶È·½°¸/HistoryAnaPrjFileHelper.cs
@@ -9,7 +9,11 @@ { public class HistoryAnaPrjFileHelper { public static bool SavePrj(CalcModel.AnaSetting settting, IStation.CalcModel.AnaRequest request, IStation.CalcModel.AnaPrj prj) public static bool SavePrj( CalcModel.AnaSetting settting, bool isPredictRecord,//æ¯å¦æ¯ç¨å°æ°´é颿µ IStation.CalcModel.AnaRequest request, IStation.CalcModel.AnaPrj prj) { if (prj == null || prj.BlockTimes == null || prj.BlockTimes.Count == 0 || request == null) return false; @@ -26,11 +30,15 @@ } dal.Insert(prj, request); return WriteXmlFile(settting, request, prj); return WriteXmlFile(settting, isPredictRecord, request, prj); } //ä¿å public static bool SavePrj(CalcModel.AnaSetting settting, IStation.CalcModel.AnaRequestBase requestBase, IStation.CalcModel.AnaPrj prj) public static bool SavePrj( CalcModel.AnaSetting settting, bool isPredictRecord,//æ¯å¦æ¯ç¨å°æ°´é颿µ IStation.CalcModel.AnaRequestBase requestBase, IStation.CalcModel.AnaPrj prj) { if (prj == null || prj.BlockTimes == null || prj.BlockTimes.Count == 0) return false; @@ -38,13 +46,17 @@ var dal = new IStation.DAL.AnaProject(); dal.Insert(prj, requestBase); return WriteXmlFile(settting, requestBase, prj); return WriteXmlFile(settting, isPredictRecord, requestBase, prj); } #region XML读å // private static bool WriteXmlFile(CalcModel.AnaSetting settting, IStation.CalcModel.AnaRequestBase requestBase, IStation.CalcModel.AnaPrj prj) private static bool WriteXmlFile( CalcModel.AnaSetting settting, bool isPredictRecord,//æ¯å¦æ¯ç¨å°æ°´é颿µ IStation.CalcModel.AnaRequestBase requestBase, IStation.CalcModel.AnaPrj prj) { var root_folder = System.IO.Path.Combine(IStation.DataFolderHelper.GetRootPath(), "History"); if (!System.IO.Directory.Exists(root_folder)) @@ -72,10 +84,6 @@ XmlElement rootNode = xmlDoc.CreateElement("root"); xmlDoc.AppendChild(rootNode); // root ä¸çåèç¹ //XmlElement toTalTick = xmlDoc.CreateElement("TotalTick"); //toTalTick.InnerText = "10"; //rootNode.AppendChild(toTalTick); //注æè¿éæ¯ root.AppendChild #region çæ¬ä¿¡æ¯ @@ -137,6 +145,15 @@ var nodeCalcSpaceMinute = xmlDoc.CreateElement("CalcSpaceMinute"); nodeCalcSpaceMinute.InnerText = prj.CalcSpaceMinute.ToString(); nodeProject.AppendChild(nodeCalcSpaceMinute); var nodeMaxWaterLevelH = xmlDoc.CreateElement("MaxWaterLevelH"); nodeMaxWaterLevelH.InnerText = prj.MaxWaterLevelH.ToString(); nodeProject.AppendChild(nodeMaxWaterLevelH); var nodeMaxWaterLevelTime = xmlDoc.CreateElement("MaxWaterLevelTime"); nodeMaxWaterLevelTime.InnerText = prj.MaxWaterLevelTime.ToString(); nodeProject.AppendChild(nodeMaxWaterLevelTime); if (prj.EndTimeOpenPumpStatus != null) { @@ -485,12 +502,18 @@ nodeAnaRequest.AppendChild(node_MaxReservoirLevel); XmlNode node_MaxReservoirLevelTime = xmlDoc.CreateElement("MaxReservoirLevelTime"); node_MaxReservoirLevelTime.InnerText = requestBase.MaxReservoirLevelTime == null ? "" : requestBase.MaxReservoirLevelTime; node_MaxReservoirLevelTime.InnerText = string.IsNullOrEmpty( requestBase.MaxReservoirLevelTime) ? "" : requestBase.MaxReservoirLevelTime; nodeAnaRequest.AppendChild(node_MaxReservoirLevelTime); XmlNode node_ReservoirDropFlow = xmlDoc.CreateElement("SpaceFlowOut"); node_ReservoirDropFlow.InnerText = requestBase.PerHourFlowOut == null ? "" : string.Join(",", requestBase.PerHourFlowOut); nodeAnaRequest.AppendChild(node_ReservoirDropFlow); XmlNode node_IsPredictRecord = xmlDoc.CreateElement("IsPredictRecord"); node_IsPredictRecord.InnerText = isPredictRecord.ToString(); nodeAnaRequest.AppendChild(node_IsPredictRecord); //XmlNode node_MaxReservoirLevel = xmlDoc.CreateElement("MaxReservoirLevel"); //node_MaxReservoirLevel.InnerText = requestBase.MaxReservoirLevel == null ? "" : requestBase.MaxReservoirLevel.ToString(); @@ -558,6 +581,19 @@ if (nodeCalcSpaceMinute == null) return null; prj.CalcSpaceMinute = Convert.ToInt32(nodeCalcSpaceMinute.InnerText); // var nodeMaxWaterLevelH = nodeProjectInfo.SelectSingleNode("MaxWaterLevelH"); if (nodeMaxWaterLevelH != null) { prj.MaxWaterLevelH = Convert.ToDouble(nodeMaxWaterLevelH.InnerText); } var nodeMaxWaterLevelTime = nodeProjectInfo.SelectSingleNode("MaxWaterLevelTime"); if (nodeMaxWaterLevelTime != null) { prj.MaxWaterLevelTime = Convert.ToDateTime(nodeMaxWaterLevelTime.InnerText); } #region BlockTimes @@ -726,6 +762,8 @@ requestBase.PerHourFlowOut.Add(Convert.ToDouble(s)); } } } return prj; WebApi/Controllers/ZyPrjController.cs
@@ -102,10 +102,9 @@ anaRequest.WaterLevelsé¿æ± = GetTide3Day(_tideSouce, start_timme); #region åæ°´æ»é double TotalFlowIn = 0; if (!string.IsNullOrEmpty(request.TotalFlowIn) && !string.IsNullOrWhiteSpace(request.TotalFlowIn)) { double TotalFlowIn = 0; { if (!double.TryParse(request.TotalFlowIn, out TotalFlowIn)) { return new IStation.Dto.ApiResult() { Code = ApiResultCode.Error, Message = "请è¾å ¥æ°åååæ°´æ»é,æ¥åå°çè¾å ¥å¼æ¯:" + request.TotalFlowIn }; @@ -148,10 +147,10 @@ { return new IStation.Dto.ApiResult() { Code = ApiResultCode.Error, Message = "请è¾å ¥åæ°´æ»éææ°´ä½è¦æ±" }; } double TotalFlowIn = 0; if (!double.TryParse(request.TotalFlowIn, out TotalFlowIn)) if (TotalFlowIn < 1000) { return new IStation.Dto.ApiResult() { Code = ApiResultCode.Error, Message = "请è¾å ¥æ°åååæ°´æ»é,æ¥åå°çè¾å ¥å¼æ¯:" + request.TotalFlowIn }; return new IStation.Dto.ApiResult() { Code = ApiResultCode.Error, Message = "请è¾å ¥åæ°´æ»é,æ¥åå°çè¾å ¥å¼æ¯:" + request.TotalFlowIn }; } } @@ -303,10 +302,9 @@ // var dto_prj = ToPrjDto(defaultPrj); dto_prj.FlowTotalOut = FlowTotalOutéæ±; #region æ¨é //æ¨é:代ç ä¿ç //if (!string.IsNullOrEmpty(request.IsSubmit) && Convert.ToBoolean(request.IsSubmit)) //{ // Task.Run(() => @@ -315,9 +313,10 @@ // }); //} #endregion æ¨é // IStation.LogHelper.Info(string.Format(" 产çè®¡ç®æ¹æ¡:{0}", dto_prj.schemeID)); //IStation.LogHelper.Info(string.Format(" 产çè®¡ç®æ¹æ¡:{0}", dto_prj.schemeID)); //IStation.LogHelper.Info(string.Format("Zy Prj è®¡ç®æå: \r\n {0} ", JsonHelper.Object2Json(dto_prj))); return new IStation.Dto.ApiResult<IStation.ZyDto.SubmitPrj>(dto_prj) { Code = ApiResultCode.Success }; } @@ -450,6 +449,17 @@ var sumFlow = (from x in requestBase.PerHourFlowOut select x).Sum(); dto_prj.FlowTotalOut = sumFlow; } if(dto_prj.Switchs != null) { var switch2 = from x in dto_prj.Switchs orderby x.Time select x; int index = 1; foreach (var sw in switch2) { sw.Index = index; index++; } dto_prj.Switchs = switch2.ToList(); } return new IStation.Dto.ApiResult<IStation.ZyDto.SubmitPrj>(dto_prj) { Code = ApiResultCode.Success }; } @@ -487,7 +497,17 @@ var sumFlow = (from x in requestBase.PerHourFlowOut select x).Sum(); dto_prj.FlowTotalOut = sumFlow; } if (dto_prj.Switchs != null) { var switch2 = from x in dto_prj.Switchs orderby x.Time select x; int index = 1; foreach (var sw in switch2) { sw.Index = index; index++; } dto_prj.Switchs = switch2.ToList(); } return new IStation.Dto.ApiResult<IStation.ZyDto.SubmitPrj>(dto_prj) { Code = ApiResultCode.Success }; } else @@ -527,7 +547,17 @@ var sumFlow = (from x in requestBase.PerHourFlowOut select x).Sum(); dto_prj.FlowTotalOut = sumFlow; } if (dto_prj.Switchs != null) { var switch2 = from x in dto_prj.Switchs orderby x.Time select x; int index = 1; foreach (var sw in switch2) { sw.Index = index; index++; } dto_prj.Switchs = switch2.ToList(); } return new IStation.Dto.ApiResult<IStation.ZyDto.SubmitPrj>(dto_prj) { Code = ApiResultCode.Success }; } else @@ -1001,7 +1031,7 @@ dto_prj.MoneyTotal = Math.Round(defaultPrj.SumMoney, 0); dto_prj.BlockTimes = new List<ZyDto.SubmitPrjBlockTime>(); double maxHeight = 0; double startHeight = 0; if (defaultPrj.BlockTimes != null) @@ -1023,7 +1053,13 @@ dto_item.Records = new List<SubmitPrjTime>(); foreach (var bt2 in bt.PointTimes) { maxHeight = Math.Max(maxHeight, bt2.WaterLevelH); //if(maxHeight < bt2.WaterLevelH) //{ // maxHeight = bt2.WaterLevelH; // //maxHeight = Math.Max(maxHeight, bt2.WaterLevelH); // maxHeightTime = bt2.Time; //} dto_item.Records.Add(new SubmitPrjTime(bt2)); } } @@ -1031,8 +1067,46 @@ dto_prj.BlockTimes.Add(dto_item); } } dto_prj.MaxWaterLevelH = maxHeight; dto_prj.StartWaterLevelH = startHeight; if (defaultPrj.MaxWaterLevelH <= 0) { double maxHeight = 0; DateTime maxHeightTime = defaultPrj.StartTime; if (defaultPrj.BlockTimes != null) { foreach (var bt in defaultPrj.BlockTimes) { if (bt.OpenPumpIndexs == null) continue; if (bt.PointTimes != null) { foreach (var bt2 in bt.PointTimes) { if (maxHeight < bt2.WaterLevelH) { maxHeight = bt2.WaterLevelH; //maxHeight = Math.Max(maxHeight, bt2.WaterLevelH); maxHeightTime = bt2.Time; } } } } } defaultPrj.MaxWaterLevelH = maxHeight; defaultPrj.MaxWaterLevelTime = maxHeightTime; } if(defaultPrj.MaxWaterLevelTime> defaultPrj.StartTime) dto_prj.MaxWaterLevelH = string.Format("{0:N2} ({1})", Math.Round( defaultPrj.MaxWaterLevelH,2) , defaultPrj.MaxWaterLevelTime.ToString("HH:mm")); else dto_prj.MaxWaterLevelH = string.Format("{0:N2} ", Math.Round(defaultPrj.MaxWaterLevelH, 2)); //dto_prj.MaxWaterLevelH = defaultPrj.MaxWaterLevelH; //dto_prj.MaxWaterLevelTime = defaultPrj.MaxWaterLevelTime; dto_prj.StartWaterLevelH = string.Format("{0:N2} ({1})", Math.Round(startHeight, 2), defaultPrj.StartTime.ToString("HH:mm")); ; dto_prj.Switchs = new List<SubmitPrjSwitchInfo>(); if (defaultPrj.PumpSwitchs != null) { WebApi/Web.config
@@ -15,7 +15,7 @@ <add key="UnobtrusiveJavaScriptEnabled" value="true" /> <add key="isDebug" value="false" /> <add key="ZYAPiUrl" value="http://192.168.201.235:8009/" /> <add key="WaterPredictDsPath" value="D:\WorkData\IStation\ChEqCalc.V1.3\WaterPredict\IStation.ChEr.Entry.Predict\bin\Debug\net6.0\Data" /> <add key="WaterPredictDsPath" value="D:\WorkData\IStation\ChEq\CodeV1.3\WebApi\Data\PredictData" /> </appSettings> <system.web> <compilation debug="true" targetFramework="4.7.2" /> WebApi/ÖÚÒãµ÷¶È/dto/DtoPrj.cs
@@ -16,8 +16,12 @@ public string EndTime { get; set; } public double FlowTotalIn { get; set; }//åæ°´æ»é (å¨) public double FlowTotalOut { get; set; }//便°´æ»é(å¨) public double StartWaterLevelH { get; set; }//å¼å§æ°´åºæ°´ä½ public double MaxWaterLevelH { get; set; }//æå¤§æ°´åºæ°´ä½ public string StartWaterLevelH { get; set; }//å¼å§æ°´åºæ°´ä½ //public double MaxWaterLevelH { get; set; }//æå¤§æ°´åºæ°´ä½ //public DateTime MaxWaterLevelTime { get; set; }//æå¤§æ°´åºæ°´ä½æ¶é´ public string MaxWaterLevelH { get; set; }//æå¤§æ°´åºæ°´ä½+æ°´ä½æ¶é´ public double PowerTotal { get; set; } public double MoneyTotal { get; set; }