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);