tangxu
2024-12-19 9acdf3c826311bd67180821ce19c625d0e384ca8
紧急提交更新
已修改12个文件
344 ■■■■ 文件已修改
Calc/IStation.Calc.Core/CalcPrj.cs 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Calc/IStation.Calc.Core/计算基类/ErQuCalcBaseHelper.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Calc/IStation.Calc.Core/递归计算2/ErQuCalcHelper_2_递归.cs 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Calc/IStation.Calc.Core/递归计算2/ErQuCalcHelper_2_递归_定水位_任意时间.cs 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Calc/IStation.Calc.Core/递归计算2/ErQuCalcHelper_2_递归_定水位_指定时间.cs 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Calc/IStation.Calc.Core/递归计算2/ErQuCalcHelper_2_递归_定水量.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Calc/IStation.Calc.Model/AnaPrj.cs 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Calc/IStation.Calc.Model/AnaRequest.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/IStation.DAL.Project/历史调度方案/HistoryAnaPrjFileHelper.cs 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebApi/Controllers/ZyPrjController.cs 106 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebApi/Web.config 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebApi/众毅调度/dto/DtoPrj.cs 8 ●●●● 补丁 | 查看 | 原始文档 | 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; }