From fafed81594e9a9af583c8096512455adf44c3b1e Mon Sep 17 00:00:00 2001 From: 44673626 <44673626@qq.com> Date: Sat, 19 Mar 2022 16:45:27 +0800 Subject: [PATCH] =?UTF-8?q?3.19=20=E7=BA=A2=E6=97=97=E4=B8=80=E8=BD=BF?= =?UTF-8?q?=E6=89=8B=E5=B7=A5=E5=87=BA=E5=BA=93=E5=8D=95=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=A3=80=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/WMS/WmsHQCarAppService.cs | 7 ++- .../Entities/WMS/WmsHQKBOutputAppService.cs | 49 +++++++++++++++++-- 2 files changed, 50 insertions(+), 6 deletions(-) diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQCarAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQCarAppService.cs index 8c1078b1..b970a058 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQCarAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQCarAppService.cs @@ -541,7 +541,12 @@ namespace Win.Sfs.SettleAccount.Entities.WMS //[Authorize(SettleAccountPermissions.SettleAccounts.Default)] virtual public async Task ExportAsync(WmsKanbanOutPutDetialRequestDto input) { - input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "BillNum", Logic = EnumFilterLogic.And, Value = input.BillNum }); + if (!string.IsNullOrEmpty(input.BillNum)) + { + input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "BillNum", Logic = EnumFilterLogic.And, Value = input.BillNum }); + } + + var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue, 0, true); diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs index cc04410d..cc9fc28f 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs @@ -237,7 +237,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS [UnitOfWork(false)] public async Task WmsKanbanOutPut([FromForm] IFormFileCollection files, string version) { - + var checkList = new List(); //var _count1 = _wmsVersionRepository.Count(p => p.Version == version); //if (_count1 > 0) //{ @@ -255,13 +255,51 @@ namespace Win.Sfs.SettleAccount.Entities.WMS //var _list = _dapper.GetNoKanbanSettleDetail(input.Version); ExportImporter _exportImporter = new ExportImporter(); - var _list = await _exportImporter.ExtendExcelOfSheetOneImport(files, _excelImportService); + var _listOrgin = await _exportImporter.ExtendExcelOfSheetOneImport(files, _excelImportService); - if (_list == null || _list.Count == 0) + if (_listOrgin == null || _listOrgin.Count == 0) { throw new BusinessException("导入模板数据不能为空!"); } - + //物料号不能为空 + var _list = _listOrgin.Where(p => p.SapMaterialCode != ""); + + foreach (var itm in _list) + { + if (string.IsNullOrEmpty(itm.IsBack) || string.IsNullOrEmpty(itm.Extend)) + { + checkList.Add(new ErrorExportDto(version, "红旗一轿出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中SAP编码{0}的是否备件及客户号不能为空,影响出库请检查!", itm.SapMaterialCode), string.Empty)); + } + } + if (checkList.Count > 0) + { + return await ExportErrorReportAsync(checkList); + } + + foreach (var itm in _list) + { + if (itm.IsBack != "是" && itm.IsBack != "否") + { + checkList.Add(new ErrorExportDto(version, "红旗一轿出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中SAP编码{0}的是否备件请填写是或否,影响出库请检查!", itm.SapMaterialCode), string.Empty)); + } + } + if (checkList.Count > 0) + { + return await ExportErrorReportAsync(checkList); + } + + //翻译一下是否备件 + foreach (var itm in _list) + { + if (itm.IsBack == "是") + { + itm.IsBack = "1"; + } + else + { + itm.IsBack = "0"; + } + } var stockList = _wmsDapper.GetSalesStock(); var query = from itm in _list @@ -270,7 +308,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS from tm1 in temp1.DefaultIfEmpty() select new WmsHQWithOutKanbanOutPutDetial( GuidGenerator.Create(), - "无看板发货", + "红旗一轿手工出库", itm.SapMaterialCode, itm.MaterialDesc, version, @@ -425,6 +463,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS virtual public async Task ExportAsync(WmsKanbanOutPutDetialRequestDto input) { input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "BillNum", Logic = EnumFilterLogic.And, Value = input.BillNum }); + var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue, 0, true);