Merge branch 'master' of http://47.103.154.90:83/r/IStation/shys/ChEqCalc.V1.3
| | |
| | | |
| | | |
| | | |
| | | return SavePrj(settting, new IStation.CalcModel.AnaRequestBase(request), prj); |
| | | return SavePrjCore(settting, new IStation.CalcModel.AnaRequestBase(request), prj); |
| | | } |
| | | |
| | | //ä¿å |
| | |
| | | var dal = new IStation.DAL.AnaProject(); |
| | | dal.Insert(prj, requestBase); |
| | | |
| | | // |
| | | var root_folder = System.IO.Path.Combine(IStation.DataFolderHelper.GetRootPath(), "History"); |
| | | return SavePrjCore(settting, requestBase, prj); |
| | | } |
| | | |
| | | private static bool SavePrjCore(CalcModel.AnaSetting settting, IStation.CalcModel.AnaRequestBase requestBase, IStation.CalcModel.AnaPrj prj) |
| | | { |
| | | var root_folder = System.IO.Path.Combine(IStation.DataFolderHelper.GetRootPath(), "History"); |
| | | if (!System.IO.Directory.Exists(root_folder)) |
| | | { |
| | | System.IO.Directory.CreateDirectory(root_folder); |
| | |
| | | { |
| | | entity.TotalFlowIn = ana_request.TotalFlowIn.ToString(); |
| | | } |
| | | |
| | | if (ana_request.SpaceFlowOut != null) |
| | | { |
| | | entity.TotalFlowOut = string.Join(",", ana_request.SpaceFlowOut) ; |
| | | } |
| | | if(ana_request.MaxLimitWaterBoxLevel != null) |
| | | { |
| | | entity.LevelRequest = string.Format("{0}@{1}", ana_request.MaxLimitWaterBoxLevel, ana_request.MaxLimitWaterBoxTime); |
| | | } |
| | | entity.CalcOptType = (int)ana_request.CalcOptType; |
| | | |
| | | SnowFlakeSingle.WorkId = 1; |
| | |
| | | { |
| | | entity.TotalFlowIn = ana_request.TotalFlowIn.ToString(); |
| | | } |
| | | |
| | | if (ana_request.SpaceFlowOut != null) |
| | | { |
| | | entity.TotalFlowOut = string.Join(",", ana_request.SpaceFlowOut); |
| | | } |
| | | if (ana_request.MaxLimitWaterBoxLevel != null) |
| | | { |
| | | entity.LevelRequest = string.Format("{0}@{1}", ana_request.MaxLimitWaterBoxLevel, ana_request.MaxLimitWaterBoxTime); |
| | | } |
| | | entity.CalcOptType = (int)ana_request.CalcOptType; |
| | | |
| | | SnowFlakeSingle.WorkId = 1; |
| | |
| | | |
| | | [DataMember] |
| | | public int CalcOptType { get; set; } |
| | | [DataMember] |
| | | public string LevelRequest { get; set; } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | 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); |