| | |
| | | |
| | | |
| | | |
| | | IStation.LogHelper.Info(string.Format("Zy Prj Time:{0}-{1} ,StartOpenCount:{2} ", |
| | | start_timme, end_timme, request.StartOpenCount )); |
| | | |
| | | |
| | | IStation.CalcModel.AnaRequest anaRequest = new AnaRequest(); |
| | | anaRequest.CalcOptType = (eCalcOptType)IStation.AnaGlobalParas.Setting.OptSortType; |
| | |
| | | { |
| | | if (string.IsNullOrEmpty(request.MaxReservoirLevel)) |
| | | { |
| | | IStation.LogHelper.Info(string.Format("Zy Prj Time:{0}-{1} , 请输入取水总量或水位要求", |
| | | start_timme, end_timme )); |
| | | return new IStation.Dto.ApiResult() { Code = ApiResultCode.Error, Message = "请输入取水总量或水位要求" }; |
| | | } |
| | | } |
| | |
| | | { |
| | | double TotalFlowIn = 0; |
| | | if(!double.TryParse( request.TotalFlowIn,out TotalFlowIn)) |
| | | { |
| | | { |
| | | IStation.LogHelper.Info(string.Format("Zy Prj Time:{0}-{1} , 注意取水总量单位是吨,当前参数参数过小", |
| | | start_timme, end_timme)); |
| | | return new IStation.Dto.ApiResult() { Code = ApiResultCode.Error, Message = "注意取水总量单位是吨,当前参数参数过小" }; |
| | | } |
| | | if (TotalFlowIn < 10000) |
| | | { |
| | | IStation.LogHelper.Info(string.Format("Zy Prj Time:{0}-{1} , 注意取水总量单位是吨,当前参数参数过小", |
| | | start_timme, end_timme)); |
| | | return new IStation.Dto.ApiResult() { Code = ApiResultCode.Error, Message = "注意取水总量单位是吨,当前参数参数过小" }; |
| | | } |
| | | |
| | |
| | | var water_records = dal.GetByHourRangle( start_timme , end_timme ); |
| | | if (water_records == null) |
| | | { |
| | | IStation.LogHelper.Info(string.Format("Zy Prj Time:{0}-{1} , 水位预测数据为空,请先保持水位预测服务正常运行", |
| | | start_timme, end_timme)); |
| | | return new IStation.Dto.ApiResult<string>() { Code = ApiResultCode.Error, Data = "水位预测数据为空,请先保持水位预测服务正常运行" }; |
| | | } |
| | | var count = (end_timme - start_timme).TotalHours; |
| | | if (water_records.Count != count) |
| | | { |
| | | { |
| | | IStation.LogHelper.Info(string.Format("Zy Prj Time:{0}-{1} , 预测数据获取失败,数据条无法匹配, 检查是否预测服务中断", |
| | | start_timme, end_timme)); |
| | | return new IStation.Dto.ApiResult<string>() { Code = ApiResultCode.Error, Data = "预测数据获取失败,数据条无法匹配, 检查是否预测服务中断" }; |
| | | } |
| | | |
| | |
| | | { |
| | | if(r.States == 0) |
| | | { |
| | | return new IStation.Dto.ApiResult<string>() { Code = ApiResultCode.Error, Data = |
| | | string.Format("预测数据异常,无法进行水位计算:{0} {1},{2}",r.DayHour,r.LastPredictValue,r.Description )}; |
| | | var error_info11 = string.Format("预测数据异常,无法进行水位计算:{0} {1},{2}", r.DayHour, r.LastPredictValue, r.Description); |
| | | IStation.LogHelper.Info(string.Format("Zy Prj Time:{0}-{1} , {2}}", |
| | | start_timme, end_timme, error_info11)); |
| | | return new IStation.Dto.ApiResult<string>() { Code = ApiResultCode.Error, Data = error_info11 |
| | | }; |
| | | } |
| | | anaRequest.SpaceFlowOut.Add(r.LastPredictValue); |
| | | anaRequest.SpaceFlowOut.Add(r.LastPredictValue/10000); |
| | | } |
| | | } |
| | | |
| | |
| | | string error_info = calcHelper.Calc(anaRequest, out defaultPrj); |
| | | if (!string.IsNullOrEmpty(error_info) || defaultPrj == null) |
| | | { |
| | | IStation.LogHelper.Info(string.Format("Zy Prj Time:{0}-{1} , 计算错误, 原因是:{2} ,Request::: ", |
| | | start_timme, end_timme, error_info)+ JsonHelper.Object2Json( anaRequest)); |
| | | return new IStation.Dto.ApiResult() { Code = ApiResultCode.Error, Message = "计算错误, 原因是:" + error_info }; |
| | | } |
| | | else |
| | | { |
| | | IStation.LogHelper.Info(string.Format("Zy Prj Time:{0}-{1} , 计算成功", start_timme, end_timme )); |
| | | } |
| | | |
| | | //保存方案 |
| | | var ret = Common.HistoryAnaPrjFileHelper.SavePrj(IStation.AnaGlobalParas.Setting, anaRequest, defaultPrj); |