| | |
| | | using IStation.Dto; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Security.Policy; |
| | | using System.Threading.Tasks; |
| | | using System.Web.Http; |
| | | using static IStation.Common.PumpHistoryDataFileHelper; |
| | |
| | | return new IStation.Dto.ApiResult<Dto.PumpRunParasDays>(pumpRunParasDay) { Code = ApiResultCode.Success, Message = "Success" }; |
| | | } |
| | | |
| | | /* /// <summary> |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="day"></param> |
| | | /// <returns></returns> |
| | | [Route("GetByHistoryOneDay")] |
| | | [HttpGet] |
| | | public async Task<IStation.Dto.ApiResult> GetByHistoryOneDay(string day) |
| | | public async Task<IStation.Dto.ApiResult> GetByHistoryOneDay(string day) |
| | | { |
| | | if (day == null) |
| | | { |
| | |
| | | if (!DateTime.TryParse(day, out d)) |
| | | { |
| | | return new IStation.Dto.ApiResult() { Code = ApiResultCode.Error, Message = "day 格式不正确" }; |
| | | } |
| | | } |
| | | |
| | | var history = Common.PumpHistoryDataFileHelper.GetHistoryData(d); |
| | | return new IStation.Dto.ApiResult<List<RunParasData>>(history) { Code = ApiResultCode.Success, Message = "Success" }; |
| | | var history = Common.PumpRunParasHelper.GetPumpRunParas(d); |
| | | if (history == null) |
| | | { |
| | | } |
| | | history.Electric = Math.Round(history.Electric, 2); |
| | | history.Money = Math.Round(history.Money, 2); |
| | | history.FlowIn = Math.Round(history.FlowIn, 2); |
| | | if (history.Pump1.Count != 0) |
| | | { |
| | | foreach (var item in history.Pump1) |
| | | { |
| | | item.Electric = Math.Round( item.Electric,2); |
| | | item.Money = Math.Round(item.Money, 2); |
| | | item.FlowIn = Math.Round(item.FlowIn, 2); |
| | | } |
| | | } |
| | | if (history.Pump2.Count != 0) |
| | | { |
| | | foreach (var item in history.Pump2) |
| | | { |
| | | item.Electric = Math.Round(item.Electric, 2); |
| | | item.Money = Math.Round(item.Money, 2); |
| | | item.FlowIn = Math.Round(item.FlowIn, 2); |
| | | } |
| | | } |
| | | if (history.Pump3.Count != 0) |
| | | { |
| | | foreach (var item in history.Pump3) |
| | | { |
| | | item.Electric = Math.Round(item.Electric, 2); |
| | | item.Money = Math.Round(item.Money, 2); |
| | | item.FlowIn = Math.Round(item.FlowIn, 2); |
| | | } |
| | | } |
| | | if (history.Pump4.Count != 0) |
| | | { |
| | | foreach (var item in history.Pump4) |
| | | { |
| | | item.Electric = Math.Round(item.Electric, 2); |
| | | item.Money = Math.Round(item.Money, 2); |
| | | item.FlowIn = Math.Round(item.FlowIn, 2); |
| | | } |
| | | } |
| | | if (history.Pump5.Count != 0) |
| | | { |
| | | foreach (var item in history.Pump5) |
| | | { |
| | | item.Electric = Math.Round(item.Electric, 2); |
| | | item.Money = Math.Round(item.Money, 2); |
| | | item.FlowIn = Math.Round(item.FlowIn, 2); |
| | | } |
| | | } |
| | | return new IStation.Dto.ApiResult<Common.PumpRunParasHelper.RunParasData>(history) { Code = ApiResultCode.Success, Message = "Success" }; |
| | | } |
| | | */ |
| | | |
| | | |
| | | |
| | | |