From f44115e381c4b51df62731ec70feb3fdd3305a8d Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Fri, 7 Jun 2024 17:12:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E5=BA=93=E7=A7=BB=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TransferLibJobAppService.cs | 5 ++++ .../Jobs/TransferLibJobEventHandler.cs | 14 +++++++++++ .../TransferLibRequestEventHandler.cs | 25 ++++++++++++++++++- 3 files changed, 43 insertions(+), 1 deletion(-) 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 e4286437b..edeb8f883 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 @@ -219,6 +219,11 @@ public class TransferLibJobAppService var balanceDto=await _balanceAppService.GetByPackingCodeAsync(detail.HandledToPackingCode).ConfigureAwait(false); + if (balanceDto == null) + { + throw new UserFriendlyException($"箱码{detail.HandledToPackingCode}没有找到库存"); + } + var fromLocationDto = await _locationAppService.GetByCodeAsync(detail.HandledFromLocationCode) .ConfigureAwait(false); var toLocationDto = diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/TransferLibJobEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/TransferLibJobEventHandler.cs index 3b1e5b52a..0e6c3e2d4 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/TransferLibJobEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/TransferLibJobEventHandler.cs @@ -61,6 +61,20 @@ public class TransferLibJobEventHandler : { var createInput = ObjectMapper.Map(entity); + createInput.Confirmed = true; + createInput.ConfirmTime = Clock.Now; + foreach(var item in createInput.Details) + { + if(string.IsNullOrEmpty(item.HandledFromLot)) + { + item.HandledFromLot = ""; + } + if (string.IsNullOrEmpty(item.HandledToLot)) + { + item.HandledToLot = ""; + } + } + return createInput; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/TransferLibRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/TransferLibRequestEventHandler.cs index 8179741c4..fec8d1ddc 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/TransferLibRequestEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/TransferLibRequestEventHandler.cs @@ -26,18 +26,20 @@ public class TransferLibRequestEventHandler { private readonly ITransferLibNoteManager _transferLibNoteManager; private readonly ILocationAppService _locationAppService; + private readonly IItemBasicAppService _itemBasicAppService; private readonly ITransferLibRequestManager _transferLibRequestManager; private readonly ITransferLibJobManager _transferLibJobManager; protected ILocalEventBus LocalEventBus => LazyServiceProvider.LazyGetRequiredService(); public TransferLibRequestEventHandler( - ITransferLibNoteManager transferLibNoteManager, ILocationAppService locationAppService, ITransferLibRequestManager transferLibRequestManager, ITransferLibJobManager transferLibJobManager) + ITransferLibNoteManager transferLibNoteManager, ILocationAppService locationAppService, IItemBasicAppService itemBasicAppService, ITransferLibRequestManager transferLibRequestManager, ITransferLibJobManager transferLibJobManager) { _transferLibNoteManager = transferLibNoteManager; _locationAppService = locationAppService; _transferLibRequestManager = transferLibRequestManager; _transferLibJobManager = transferLibJobManager; + _itemBasicAppService = itemBasicAppService; } @@ -81,6 +83,27 @@ public class TransferLibRequestEventHandler var locationDto = await _locationAppService.GetFirstByTypeAsync(EnumLocationType.TRANSPORT) .ConfigureAwait(false); + foreach(var item in input.Details) + { + var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(item.ItemCode).ConfigureAwait(false); + + if(itemBasicDto!=null) + { + item.ItemDesc1 = itemBasicDto.Desc1; + item.ItemDesc2 = itemBasicDto.Desc2; + item.ItemName = itemBasicDto.Name; + item.Uom = itemBasicDto.BasicUom; + item.StdPackQty = itemBasicDto.StdPackQty; + } + else + { + throw new UserFriendlyException($"未找到此物品{item.ItemCode}的信息"); + } + + } + + + //var transferOnTheWayLocation = // await SettingManager.GetOrNullGlobalAsync(StoreSettings.Common.TransferOnTheWayLocation) // .ConfigureAwait(false);