1
ningshuxia
2023-04-13 df27c5419af98c9bd179cb3d1fe42251458db107
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using IStation.Model.Api;
using IStation.ViewModel;
using AutoMapper;
using System.IO;
using Microsoft.Web.Http;
 
namespace IStation.WebApi.Controllers.OpenApi
{
    /// <summary>
    /// 给原水的
    /// </summary>
    [RoutePrefix("OpenApi/DispatchAna/SHYS")]
    [ApiVersion("OpenApi")]
    public class ShysDispatchAnaController : ApiController
    {
        #region 计算保持的方案
 
 
        /// <summary>
        /// 计算保持的方案
        /// </summary> 
        [Route("CalcuKeepDispatch")]
        [HttpPost]
        public IStation.Dto.SHYS.AnaScheme CalcuKeepDispatch(IStation.Dto.SHYS.DispatchStationEx dispatch)
        {
            //if(dispatch.type)
 
            return IStation.WebApi.Controllers.OpenApi.DispatchAnaCalcHelper.Station长兴岛(dispatch );
        }
 
 
 
 
 
    
        #endregion
 
 
        /// <summary>
        /// 根据流量扬程计算(简易)
        /// </summary>
        /// <param name="StationName">青草沙输水泵房</param>
        /// <param name="Flow"></param>
        /// <param name="Head"></param>
        /// <param name="SortType">排序方式</param>
        /// <param name="Number">方案数据</param>
        /// <returns></returns>
        //[Route("SimpleCalcByFlowHead")]
        //[HttpGet]
        //public Result SimpleCalcByFlowHead(string StationName, double Flow, double Head, int SortType, int Number)
        //{
        //    long StationID = 51;//青草沙输水泵站(要根据入参判断泵站ID)
        //    SortType = 0;
        //    IStation.WebApi.DispatchAnaHelper helper = new IStation.WebApi.DispatchAnaHelper();
        //    helper.InitialParas(StationID, Flow, Head, null, null);
        //    DispatchAnaHelper.eSortType sortType = DispatchAnaHelper.eSortType.功率;
        //    if (SortType == 0 || SortType == 1)
        //        sortType = (DispatchAnaHelper.eSortType)SortType;
 
        //    var items = helper.CalcProject(sortType, Number);
        //    if (items == null || items.Count() == 0)
        //    {
        //        return new Result(IStation.Model.Api.Code.Alert, "未找到任何组合符合当前参数");
        //    }
        //    else
        //    {
        //        return new Result<List<DispatchAnaHelper.Project>>(items);
        //    }
        //}
 
        #region 测试接口
        /// <summary>
        /// 根据流量扬程计算(测试)
        /// </summary> 
        /*[Route("CeShi")]
        [HttpPost]
        public Result CeShi(double Flow1, double Flow2, double Press1, double Press2, double Level, int Status)
        {
            var q = Flow2 + Flow1;
            var h = (Press1 + Press2) / 2;
            h = MPaToM(h);
            var helper = new DispatchAnaHelper();
            if (!helper.InitialParas(4, 2, q, h, "", ""))
            {
                return new Result<string>("初始化失败!");
            }
            var list = helper.CalcProject(DispatchAnaHelper.eSortType.流量差值, 10);
            return new Result<List<DispatchAnaHelper.Project>>(list);
        }*/
 
        #endregion
    }
}