From 9c247fc802c8a9b48dae041bf5de53defaa68a39 Mon Sep 17 00:00:00 2001 From: hwh <332078369@qq.com> Date: 星期一, 15 七月 2024 17:00:34 +0800 Subject: [PATCH] Merge branch 'master' of http://47.95.120.53:8083/r/JC26WMS --- Wms/Wms/Controllers/BllAsnController.cs | 85 +++++++++++++++++++----------------------- 1 files changed, 39 insertions(+), 46 deletions(-) diff --git a/Wms/Wms/Controllers/BllAsnController.cs b/Wms/Wms/Controllers/BllAsnController.cs index 3a703ac..c747d12 100644 --- a/Wms/Wms/Controllers/BllAsnController.cs +++ b/Wms/Wms/Controllers/BllAsnController.cs @@ -9,12 +9,18 @@ using WMS.IBLL.IBllAsnServer; using WMS.IBLL.ILogServer; using Model.ModelVm.BllAsnVm; +using Utility; +using Model.ModelDto.BllAsnDto; +using System.Threading.Tasks; +using SqlSugar; +using System.Diagnostics; namespace Wms.Controllers { [Route("api/[controller]/[action]")] [ApiController] [Authorize] + public class BllAsnController : ControllerBase { #region 渚濊禆娉ㄥ叆 @@ -51,33 +57,23 @@ /// <param name="model">鏌ヨ鏉′欢</param> /// <returns>鍏ュ簱鍗曚俊鎭�</returns> [HttpPost] - public IActionResult GetArrivalNoticeList(ArrivalNoticeVm model) + [ServiceFilter(typeof(ApiResponseActionFilter))] + public async Task<SqlSugarPagedList> GetArrivalNoticeList(ArrivalNoticeVm model) { - try - { - var models = _arrivalNoticeSvc.GetArrivalNoticeList(model, out int count); - return Ok(new { code = 0, count, msg = "鍏ュ簱鍗曚俊鎭�", data = models }); - } - catch (Exception e) - { - return Ok(new { code = 1, msg = e.Message }); - } + RefAsync<int> count = new RefAsync<int>(); + var bolls = await _arrivalNoticeSvc.GetArrivalNoticeList(model, count); + return new SqlSugarPagedList() { Items = bolls, Total = count }; } - [HttpPost] - public IActionResult GetArrivalNoticeDetailList(ArrivalNoticeDetailVm model) - { - try - { - var models = _arrivalNoticeSvc.GetArrivalNoticeDetailList(model, out int count); - return Ok(new { code = 0, count, msg = "鍏ュ簱鍗曟槑缁嗕俊鎭�", data = models }); - } - catch (Exception e) - { - return Ok(new { code = 1, msg = e.Message }); - } + [HttpPost] + [ServiceFilter(typeof(ApiResponseActionFilter))] + public async Task<SqlSugarPagedList> GetArrivalNoticeDetailList(ArrivalNoticeDetailVm model) + { + RefAsync<int> count = new RefAsync<int>(); + var bolls = await _arrivalNoticeSvc.GetArrivalNoticeDetailList(model, count); + return new SqlSugarPagedList() { Items = bolls, Total = count }; } /// <summary> @@ -684,12 +680,13 @@ /// <param name="model"></param> /// <returns></returns> [HttpPost] - public IActionResult GetArrivalTaskList(GetTaskVm model) + public async Task<IActionResult> GetArrivalTaskList(GetTaskVm model) { try { var type = new List<string>() { "0" }; - var bolls = _taskSvc.GetTaskList(type, model.Type, model.Status, model.TaskNo, model.IsSuccess, model.PalletNo, model.Msg, model.Page, model.Limit, out int count); + RefAsync<int> count = new RefAsync<int>(); + var bolls = await _taskSvc.GetTaskList(type, model.Type, model.Status, model.TaskNo, model.IsSuccess, model.PalletNo, model.Msg, model.Page, model.Limit, count); return Ok(new { code = 0, count, msg = "鍏ュ簱浠诲姟淇℃伅", data = bolls }); } @@ -1164,40 +1161,36 @@ /// 鑾峰彇閲囪喘鍗曚俊鎭� /// </summary> /// <param name="model">鏌ヨ鏉′欢</param> - /// <returns>鍏ュ簱鍗曚俊鎭�</returns> + /// <returns>閲囪喘鍗曚俊鎭�</returns> [HttpPost] - public IActionResult GetProcurePlanNoticeList(ProcurePlanNoticeVm model) + [ServiceFilter(typeof(ApiResponseActionFilter))] + public async Task<SqlSugarPagedList> GetProcurePlanNoticeList(ProcurePlanNoticeVm model) { - try - { - var models = _procurePlanSvc.GetProcurePlanNoticeList(model, out int count); - - return Ok(new { code = 0, count, msg = "鍏ュ簱鍗曚俊鎭�", data = models }); - } - catch (Exception e) - { - return Ok(new { code = 1, msg = e.Message }); - } + RefAsync<int> count = new RefAsync<int>(); + var bolls = await _procurePlanSvc.GetProcurePlanNoticeList(model, count); + return new SqlSugarPagedList() { Items = bolls, Total = count }; } + /// <summary> /// 鑾峰彇閲囪喘鍗曟槑缁嗕俊鎭� /// </summary> /// <param name="model"></param> /// <returns></returns> [HttpPost] - public IActionResult GetProcurePlanNoticeDetailList(ProcurePlanNoticeDetailVm model) + [ServiceFilter(typeof(ApiResponseActionFilter))] + public async Task<SqlSugarPagedList> GetProcurePlanNoticeDetailList(ProcurePlanNoticeDetailVm model) { - try - { - var models = _procurePlanSvc.GetProcurePlanNoticeDetailList(model, out int count); + Stopwatch stopwatch = new Stopwatch(); + stopwatch.Start(); + RefAsync<int> count = new RefAsync<int>(); + var bolls = await _procurePlanSvc.GetProcurePlanNoticeDetailList(model, count); + stopwatch.Stop(); - return Ok(new { code = 0, count, msg = "鍏ュ簱鍗曟槑缁嗕俊鎭�", data = models }); - } - catch (Exception e) - { - return Ok(new { code = 1, msg = e.Message }); - } + var time = stopwatch.ElapsedMilliseconds; + return new SqlSugarPagedList() { Items = bolls, Total = count }; } + + /// <summary> /// 閫氳繃閲囪喘鍗曠敓鎴愬叆搴撳崟鎹� /// </summary> -- Gitblit v1.8.0