| | |
| | | using IStation.Common; |
| | | using IStation.Dto; |
| | | using IStation.Untity; |
| | | using IStation.ZyDto; |
| | | using IStation.ZyModel; |
| | | using Microsoft.Ajax.Utilities; |
| | | using IStation.Untity; |
| | | using IStation.ZyModel; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using System.Web; |
| | | using System.Web.Http; |
| | | using System.Web.UI.WebControls; |
| | | using static IStation.ZyConnectHelper; |
| | | using System.Web.Http; |
| | | |
| | | namespace IStation.WebApi.Controllers |
| | | { |
| | |
| | | [HttpGet] |
| | | public IStation.Dto.ApiResult GetByDayDebug(string day) |
| | | { |
| | | if (isDebug) |
| | | if (ZyConnectHelper.isDebug) |
| | | return new IStation.Dto.ApiResult() { Code = ApiResultCode.Error, Message = "Debug is Unacess " }; |
| | | if (day == null) |
| | | { |
| | |
| | | [HttpGet] |
| | | public async Task<IStation.Dto.ApiResult> GetByDay(string day) |
| | | { |
| | | if (isDebug) |
| | | if (ZyConnectHelper.isDebug) |
| | | return new IStation.Dto.ApiResult() { Code = ApiResultCode.Error, Message = "Debug is Unacess " }; |
| | | if (day == null) |
| | | { |
| | |
| | | } |
| | | sum = 0; |
| | | string joinedValues = string.Join(",", tagDict.Values); |
| | | var result = HttpClientHelper.Get<List<DataPoint>>(_GetUrl, starttime, endtime, "first", "300s", joinedValues); |
| | | var realScadaDataList = GetScadaData(result); |
| | | var result = HttpClientHelper.Get<List<DataPoint>>(ZyConnectHelper.ZyApiUrl, starttime, endtime, "first", "300s", joinedValues); |
| | | var realScadaDataList = ZyConnectHelper.GetScadaData(result); |
| | | if (realScadaDataList != null && realScadaDataList.Any()) |
| | | { |
| | | foreach (var r in realScadaDataList) |
| | |
| | | [HttpGet] |
| | | public async Task<IStation.Dto.ApiResult> GetLastDay3() |
| | | { |
| | | if (isDebug) |
| | | if (ZyConnectHelper.isDebug) |
| | | return new IStation.Dto.ApiResult() { Code = ApiResultCode.Error, Message = "Debug is Unacess " }; |
| | | DateTime yest1 = DateTime.Today.AddDays(-1); |
| | | var sum1 = TotalWaterInHelper.Read(yest1); |