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
|
}
|
}
|