From bdd84cc48ba7b2527584c44d174da8e7d20c5375 Mon Sep 17 00:00:00 2001 From: zhaowc <526854230@qq.com> Date: 星期三, 18 九月 2024 16:37:13 +0800 Subject: [PATCH] 增加对申请入库时对平库库位的校验 --- Wms/Wms/Controllers/BllSoController.cs | 118 ++++++++++++++++++++++------------------------------------- 1 files changed, 44 insertions(+), 74 deletions(-) diff --git a/Wms/Wms/Controllers/BllSoController.cs b/Wms/Wms/Controllers/BllSoController.cs index 6e9040d..73a6d6d 100644 --- a/Wms/Wms/Controllers/BllSoController.cs +++ b/Wms/Wms/Controllers/BllSoController.cs @@ -13,6 +13,10 @@ using Newtonsoft.Json; using Utility.Tools; using Model.InterFaceModel; +using SqlSugar; +using Utility; +using System.Threading.Tasks; +using Model.ModelDto.BllSoDto; namespace Wms.Controllers { @@ -53,18 +57,13 @@ /// <param name="model"></param> /// <returns></returns> [HttpPost] - public IActionResult GetExportNoticeList(GetExportNoticeVm model) + [ServiceFilter(typeof(ApiResponseActionFilter))] + public async Task<SqlSugarPagedList> GetExportNoticeList(GetExportNoticeVm model) { - try - { - var bolls = _exNoticeSvc.GetExportNoticeList(model.No, model.Type, model.Status,model.LotNo,model.LogisticsId,model.IsWave,model.IsDespatch,model.WaveNo, model.Page, model.Limit, out int count); + RefAsync<int> count = new RefAsync<int>(); + var bolls = await _exNoticeSvc.GetExportNoticeList(model, count); - return Ok(new { code = 0, count, msg = "鍑哄簱鍗曚俊鎭�", data = bolls }); - } - catch (Exception e) - { - return Ok(new { code = 1, msg = e.Message }); - } + return new SqlSugarPagedList() { Items = bolls, Total = count }; } /// <summary> @@ -280,18 +279,13 @@ /// <param name="model"></param> /// <returns></returns> [HttpPost] - public IActionResult GetExportNoticeDetailList(GetExportNoticeDetailVm model) + [ServiceFilter(typeof(ApiResponseActionFilter))] + public async Task<SqlSugarPagedList> GetExportNoticeDetailList(GetExportNoticeDetailVm model) { - try - { - var bolls = _exNoticeDetailSvc.GetExportNoticeDetailList(model.SoNo, model.Page, model.Limit, out int count); + RefAsync<int> count = new RefAsync<int>(); + var bolls = await _exNoticeDetailSvc.GetExportNoticeDetailList(model, count); - return Ok(new { code = 0, count, msg = "鍑哄簱鍗曟槑缁嗕俊鎭�", data = bolls }); - } - catch (Exception e) - { - return Ok(new { code = 1, msg = e.Message }); - } + return new SqlSugarPagedList() { Items = bolls, Total = count }; } /// <summary> @@ -528,18 +522,13 @@ /// <param name="model"></param> /// <returns></returns> [HttpPost] - public IActionResult GetExportAllotList(GetExportAllotVm model) + [ServiceFilter(typeof(ApiResponseActionFilter))] + public async Task<SqlSugarPagedList> GetExportAllotList(GetExportAllotVm model) { - try - { - var bolls = _exAllotSvc.GetExportAllotList(model.SoNo, model.WaveNo, model.PalletNo, model.SkuNo, model.SkuName, model.LotNo, model.Status,model.BoxNo, model.Page, model.Limit, out int count); + RefAsync<int> count = new RefAsync<int>(); + var bolls = await _exAllotSvc.GetExportAllotList(model, count); - return Ok(new { code = 0, count, msg = "鍑哄簱鍒嗛厤淇℃伅", data = bolls }); - } - catch (Exception e) - { - return Ok(new { code = 1, msg = e.Message }); - } + return new SqlSugarPagedList() { Items = bolls, Total = count }; } /// <summary> @@ -583,18 +572,13 @@ /// <param name="model"></param> /// <returns></returns> [HttpPost] - public IActionResult GetCompleteDetailList(GetCompleteDetailVm model) + [ServiceFilter(typeof(ApiResponseActionFilter))] + public async Task<SqlSugarPagedList> GetCompleteDetailList(GetCompleteDetailVm model) { - try - { - var bolls = _comDetailSvc.GetCompleteDetailList(model.Id,model.Page, model.Limit, out int count); + RefAsync<int> count = new RefAsync<int>(); + var bolls = await _comDetailSvc.GetCompleteDetailList(model, count); - return Ok(new { code = 0, count, msg = "鎷h揣鏄庣粏淇℃伅", data = bolls }); - } - catch (Exception e) - { - return Ok(new { code = 1, msg = e.Message }); - } + return new SqlSugarPagedList() { Items = bolls, Total = count }; } [HttpGet] @@ -621,19 +605,14 @@ /// </summary> /// <param name="model"></param> /// <returns></returns> - [HttpPost] - public IActionResult GetPalletNoOutList(GetPalletNoOutVm model) + [HttpPost] + [ServiceFilter(typeof(ApiResponseActionFilter))] + public async Task<SqlSugarPagedList> GetPalletNoOutList(GetPalletNoOutVm model) { - try - { - var bolls = _exNoticeSvc.GetPalletNoOutList(model.SkuNo,model.SkuName,model.PalletNo,model.LotNo,model.InspectMark,model.BitPalletMark,model.Page,model.Limit,out int count); + RefAsync<int> count = new RefAsync<int>(); + var bolls = await _exNoticeSvc.GetPalletNoOutList(model, count); - return Ok(new { code = 0, count, msg = "鑾峰彇鎵樼洏鍑哄簱鏁版嵁寮傚父", data = bolls}); - } - catch (Exception e) - { - return Ok(new { code = 1, msg = "鎵樼洏鍑哄簱鏁版嵁" + e.Message }); - } + return new SqlSugarPagedList() { Items = bolls, Total = count }; } /// <summary> @@ -720,14 +699,15 @@ /// <param name="model"></param> /// <returns></returns> [HttpPost] - public IActionResult GetExportTaskList(GetTaskVm model) + public async Task<IActionResult> GetExportTaskList(GetTaskVm model) { try { var type = new List<string>(){"1","4"}; - 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 }); + return Ok(new { code = 0, count = count.Value, msg = "鍑哄簱浠诲姟淇℃伅", data = bolls }); } catch (Exception e) { @@ -870,18 +850,13 @@ /// <param name="model"></param> /// <returns></returns> [HttpPost] - public IActionResult GetLogOperationSoList(GetOperationVm model) + [ServiceFilter(typeof(ApiResponseActionFilter))] + public async Task<SqlSugarPagedList> GetLogOperationSoList(GetOperationVm model) { - try - { - var bolls = _logSvc.GetLogOperationSoList(model.MenuName, model.Type, model.Msg, model.StartTime, model.EndTime,model.Page, model.Limit, out int count); + RefAsync<int> count = new RefAsync<int>(); + var bolls = await _logSvc.GetLogOperationSoList(model.MenuName, model.Type, model.Msg, model.StartTime, model.EndTime, model.Page, model.Limit, count); - return Ok(new { code = 0, count, msg = "鍑哄簱鎿嶄綔鏃ュ織淇℃伅", data = bolls }); - } - catch (Exception e) - { - return Ok(new { code = 1, msg = e.Message }); - } + return new SqlSugarPagedList() { Items = bolls, Total = count }; } #endregion @@ -915,18 +890,13 @@ /// <param name="model"></param> /// <returns></returns> [HttpPost] - public IActionResult GetWaveMageList(GetWaveMageVm model) + [ServiceFilter(typeof(ApiResponseActionFilter))] + public async Task<SqlSugarPagedList> GetWaveMageList(GetWaveMageVm model) { - try - { - var bolls = _waveSvc.GetWaveMageList(model.WaveNo, model.Status, model.LotNo, model.LogisticsId, model.Page, model.Limit, out int count); + RefAsync<int> count = new RefAsync<int>(); + var bolls = await _waveSvc.GetWaveMageList(model, count); - return Ok(new { code = 0, count, msg = "鍑哄簱鍗曚俊鎭�", data = bolls }); - } - catch (Exception e) - { - return Ok(new { code = 1, msg = e.Message }); - } + return new SqlSugarPagedList() { Items = bolls, Total = count }; } /// <summary> -- Gitblit v1.8.0