From 8b25d4c0c79c26900cea5de537887d658dcfa32e Mon Sep 17 00:00:00 2001 From: tangxu <tangxu76880903> Date: 星期一, 29 四月 2024 13:11:26 +0800 Subject: [PATCH] 添加接口内容 : 获取最近项目 --- WebApi/Controllers/AnaPrjController.cs | 36 ++++++++++++++++++++++++++---------- 1 files changed, 26 insertions(+), 10 deletions(-) diff --git a/WebApi/Controllers/AnaPrjController.cs b/WebApi/Controllers/AnaPrjController.cs index eb81f0f..eb06a83 100644 --- a/WebApi/Controllers/AnaPrjController.cs +++ b/WebApi/Controllers/AnaPrjController.cs @@ -33,8 +33,22 @@ public IStation.Dto.ApiResult Debug(string info) { IStation.LogHelper.Info("debug:"+ info); - + //IStation.CalcModel.AnaPrj entity = new IStation.CalcModel.AnaPrj(); + //entity.ID = "123"; + //entity.StartTime = DateTime.Now; + //entity.EndTime = DateTime.Now; + //entity.Name = "232"; + + //IStation.CalcModel.AnaRequest ana_request = new AnaRequest(); + //ana_request.TotalFlow鍙栨按鎬婚噺 = 102; + + //var dal = new IStation.DAL.AnaProject(); + //dal.Insert(entity, ana_request); + + + var dal = new IStation.DAL.AnaProject(); + var aa = dal.GetLastRecord(); return new IStation.Dto.ApiResult<string >("ok"); } @@ -43,9 +57,9 @@ /// </summary> /// <param name="day"></param> /// <returns></returns> - [Route("GetPrj")] + [Route("GetPrjByDay")] [HttpGet] - public IStation.Dto.ApiResult GetPrj(string day) + public IStation.Dto.ApiResult GetPrjByDay(string day) { if (day == null) { @@ -56,8 +70,8 @@ { return new IStation.Dto.ApiResult() { Code = ApiResultCode.Error, Message = "day 鏍煎紡涓嶆纭�" }; } - - var prj = Common.HistoryAnaPrjFileHelper.GetPrj(d); + IStation.CalcModel.AnaRequestBase requestBase = null; + var prj = Common.HistoryAnaPrjFileHelper.GetByDay(d,out requestBase); return new IStation.Dto.ApiResult<IStation.CalcModel.AnaPrj>(prj); } @@ -123,15 +137,17 @@ { return new IStation.Dto.ApiResult() { Code = ApiResultCode.Error, Message = "prj null" }; } - - var ret = Common.HistoryAnaPrjFileHelper.SavePrj( request.settting, request.requestBase, request.prj); + + var ret = Common.HistoryAnaPrjFileHelper.SavePrj(request.settting, request.requestBase, request.prj); + + //鎻掑叆鍒版暟鎹簱 + //var dal = new IStation.DAL.AnaProject(); + //dal.Insert(request.prj, request.requestBase); + if (request.isSubmit) { string error = await ZyProjectHelper.SubmitPrj(request.prj);//, (id) => { IStation.LogHelper.Info("SavePrj success id=" + id); }, (info) => { IStation.LogHelper.Info("SavePrj failse info:" + info); });//.Result; - - - if(!string.IsNullOrEmpty(error)) { -- Gitblit v1.9.3