| | |
| | | public IStation.CalcModel.AnaRequestBase requestBase { get; set; } |
| | | public bool isSubmit { get; set; } |
| | | } |
| | | |
| | | public class ZyPrjRequest |
| | | { |
| | | { |
| | | public string StartTime { get; set; } |
| | | public string EndTime { get; set; } |
| | | //public int? StartOpenCount { get; set; } = -1;//已作废 |
| | |
| | | public string IsSubmit { get; set; }//计算完,是否推送 |
| | | public string IsTemporary { get; set; }//是否是临时算一下(新) |
| | | } |
| | | |
| | | public static void SavePrj(CalcModel.AnaRequest ana_request, CalcModel.AnaSetting ana_settting, CalcModel.AnaPrj prj, bool isSubmit) |
| | | { |
| | | if (!IStation.BLL.ServiceParas.IsRemote) |
| | | { |
| | | IStation.Common.HistoryAnaPrjFileHelper.SavePrj(ana_settting, |
| | | true, |
| | | ana_request == null ? null : new CalcModel.AnaRequestBase(ana_request), prj); |
| | | return; |
| | | IStation.Common.HistoryAnaPrjFileHelper.SavePrj(ana_settting, ana_request == null ? null : new CalcModel.AnaRequestBase(ana_request), prj); return; |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(ServiceParas.ApiServiceUrl)) |
| | |
| | | return ret.Data; |
| | | } |
| | | |
| | | public static CalcModel.AnaPrj CalcPrj(CalcModel.AnaRequest ana_request,bool isUsePredictRecord, bool isTemp ) |
| | | { |
| | | public static CalcModel.AnaPrj CalcPrj(CalcModel.AnaRequest ana_request, bool isUsePredictRecord, bool isTemp) |
| | | { |
| | | if (string.IsNullOrEmpty(ServiceParas.ApiServiceUrl)) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | |
| | | string url = string.Format(@"{0}/AnaPrj/Calc", ServiceParas.ApiServiceUrl); |
| | | |
| | | ZyPrjRequest request = new ZyPrjRequest(); |
| | | request.StartTime = ana_request.StartTime.ToString("yyyy-MM-dd HH:mm:ss"); |
| | | request.EndTime = ana_request.EndTime.ToString("yyyy-MM-dd HH:mm:ss"); |
| | | request.IsTemporary = isTemp.ToString(); |
| | | request.IsTemporary = isTemp.ToString(); |
| | | request.IsSubmit = "false"; |
| | | if(ana_request.MaxReservoirLevel != null) |
| | | request.MaxReservoirLevel = ana_request.MaxReservoirLevel.ToString(); |
| | | if (ana_request.MaxReservoirLevel != null) |
| | | request.MaxReservoirLevel = ana_request.MaxReservoirLevel.ToString(); |
| | | request.MaxReservoirLevelTime = ana_request.MaxReservoirLevelTime; |
| | | request.StartReservoirLevel = ana_request.StartReservoirLevel.ToString(); |
| | | request.StartOpenPumpIndexArray = ana_request.StartOpenPumpIndexArray; |
| | | if(ana_request.TotalFlowIn != null) |
| | | request.TotalFlowIn = ana_request.TotalFlowIn.ToString(); |
| | | if (ana_request.TotalFlowIn != null) |
| | | request.TotalFlowIn = ana_request.TotalFlowIn.ToString(); |
| | | |
| | | if (!isUsePredictRecord) |
| | | request.TotalFlowOut = (ana_request.PerHourFlowOut.Sum() - ana_request.PerHourFlowOut.Last()).ToString(); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | string parameterData = (new System.Web.Script.Serialization.JavaScriptSerializer()).Serialize(request); |
| | | //先根据用户请求的uri构造请求地址 |
| | |
| | | /// </summary> |
| | | /// <param name="time"></param> |
| | | /// <returns></returns> |
| | | public static CalcModel.ZyStartInfo GetAnaStartPara(DateTime time ) |
| | | public static CalcModel.ZyStartInfo GetAnaStartPara(DateTime time) |
| | | { |
| | | if (!ServiceParas.IsRemote) |
| | | { |
| | | return null; |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(ServiceParas.ApiServiceUrl)) |
| | |
| | | myResponse.Close(); |
| | | return null; |
| | | } |
| | | var ret = (new System.Web.Script.Serialization.JavaScriptSerializer()).Deserialize<IStation.Dto.ApiResult<string >>(returnData); |
| | | var ret = (new System.Web.Script.Serialization.JavaScriptSerializer()).Deserialize<IStation.Dto.ApiResult<string>>(returnData); |
| | | reader.Close(); |
| | | myResponse.Close(); |
| | | |
| | | var res_str = ret.Data; |
| | | if (string.IsNullOrEmpty(res_str)) |
| | | { |
| | | return null ; |
| | | return null; |
| | | } |
| | | List<int> list = new List<int>(); |
| | | foreach (var s in list) { list.Add(Convert.ToInt32(s)); } |