From 4dcb744c68aa726aa5a03223edb035a39c659768 Mon Sep 17 00:00:00 2001 From: liuyunfeng Date: Tue, 28 May 2024 15:57:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TransferLibJobAppService.cs | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs index 913dc928e..e4286437b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs @@ -27,6 +27,7 @@ public class TransferLibJobAppService private readonly ILocationAppService _locationAppService; private readonly IExpectOutAppService _expectOutAppService; private readonly IBalanceAppService _balanceAppService; + private readonly IItemBasicAppService _itemBasicAppService; protected ITransferLibRequestAppService TransferLibRequestAppService => LazyServiceProvider.LazyGetRequiredService(); @@ -34,13 +35,15 @@ public class TransferLibJobAppService public TransferLibJobAppService( ITransferLibJobRepository repository, ITransferLibJobManager TransferLibJobManager, IServiceProvider serviceProvider, ILocationAppService locationAppService, - IExpectOutAppService expectOutAppService, IBalanceAppService balanceAppService) : base(repository, - TransferLibJobManager) + IExpectOutAppService expectOutAppService, IBalanceAppService balanceAppService, + IItemBasicAppService itemBasicAppService) : + base(repository, TransferLibJobManager) { _serviceProvider = serviceProvider; _locationAppService = locationAppService; _expectOutAppService = expectOutAppService; _balanceAppService = balanceAppService; + _itemBasicAppService = itemBasicAppService; } /// @@ -202,6 +205,13 @@ public class TransferLibJobAppService #endregion + List itemLst = new List(); + if (dto.Details.Any(itm => itm.StdPackQty == 0)) + { + var codeLst = dto.Details.Where(itm => itm.StdPackQty == 0).Select(itm => itm.ItemCode).ToList(); + itemLst = await _itemBasicAppService.GetByCodesAsync(codeLst).ConfigureAwait(false); + } + foreach (var detail in dto.Details) { detail.HandledFromContainerCode = string.Empty; @@ -213,6 +223,15 @@ public class TransferLibJobAppService .ConfigureAwait(false); var toLocationDto = await _locationAppService.GetByCodeAsync(detail.HandledToLocationCode).ConfigureAwait(false); + //标包为空时赋值 + if (detail.StdPackQty == 0) + { + var itemObj = itemLst.FirstOrDefault(itm => itm.Code == detail.ItemCode); + if (itemObj != null) + { + detail.StdPackQty = itemObj.StdPackQty; + } + } detail.HandledFromLocationArea = fromLocationDto.AreaCode; detail.HandledFromLocationCode = fromLocationDto.Code;