| | |
| | | /// </summary> |
| | | [RoutePrefix("PumpRun")] |
| | | public class PumpRunController : ApiController |
| | | { |
| | | { |
| | | /// <summary> |
| | | /// 获取泵实际运行参数(一天) |
| | | /// </summary> |
| | |
| | | PumpRunParasHelper pumpRunParasHelper = new PumpRunParasHelper(); |
| | | result = Common.PumpRunParasHelper.ReadPumpRunParas(d); |
| | | string geterroer = null; |
| | | if (result != null ) |
| | | if (result != null) |
| | | { |
| | | result.Electric = Math.Round(result.Electric, 2); |
| | | result.Money = Math.Round(result.Money, 2); |
| | |
| | | } |
| | | return new IStation.Dto.ApiResult<List<SSAData>>(totalOneDays) { Code = ApiResultCode.Success, Message = "Success" }; |
| | | } |
| | | |
| | | |
| | | |
| | | [Route("GetPumpRealData")] |
| | | [HttpGet] |
| | | public async Task<IStation.Dto.ApiResult> GetPumpRealData(string startday, string endday, string resolution) |
| | | { |
| | | if (startday == null || endday == null) |
| | | { |
| | | return new IStation.Dto.ApiResult() { Code = ApiResultCode.Error, Message = "day null" }; |
| | | } |
| | | DateTime Start; |
| | | if (!DateTime.TryParse(startday, out Start)) |
| | | { |
| | | return new IStation.Dto.ApiResult() { Code = ApiResultCode.Error, Message = "day 格式不正确" }; |
| | | } |
| | | DateTime d; |
| | | if (!DateTime.TryParse(endday, out d)) |
| | | { |
| | | return new IStation.Dto.ApiResult() { Code = ApiResultCode.Error, Message = "day 格式不正确" }; |
| | | } |
| | | var TotalWater = await ZyConnectHelper.GetTotalWaterByTimeRange_Out(Start, d, resolution); //取水量 |
| | | return new IStation.Dto.ApiResult<List<RealScadaData>>(TotalWater) { Code = ApiResultCode.Success, Message = "Success" }; |
| | | } |
| | | } |
| | | } |