From 4e104ea24e0a6acc2c6d9ce6b3241198dcf28e26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Wed, 25 Dec 2024 17:27:54 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A7=BB=E5=BA=93?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TransferNotes/TransferNoteAppService.cs | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs index 2f1b557b1..8cb896f3e 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs @@ -96,6 +96,10 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase + $"在实际库存中查询到【ERP料号】{balanceDto.ItemCode}【库位】{balanceDto.LocationCode}【箱码】{balanceDto.PackingCode}【状态】{balanceDto.Status}【数量】{balanceDto.Qty}" + $"【库存不足】"); } + + + + } } @@ -111,6 +115,8 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase var toLocationDto = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false); var fromLocationDto = await _locationAppService.GetByCodeAsync(detail.FromLocationCode).ConfigureAwait(false); + await CheckPackingCode(balanceDto.PackingCode).ConfigureAwait(false); + CheckLocation(toLocationDto, detail); CheckFromLocation(fromLocationDto, detail); if (toLocationDto.Type != fromLocationDto.Type) @@ -150,6 +156,9 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase detail.ToLocationArea = balanceDto.LocationArea; detail.ToStatus = balanceDto.Status; detail.ToLot = balanceDto.Lot; + + + } } } @@ -157,6 +166,17 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase return dictionary; } + private async Task CheckPackingCode(string packingCode) + { + var packingcode = await _expectOutAppService.GetListByPackingCodeAsync(packingCode).ConfigureAwait(false); + if (packingcode != null) + { + throw new UserFriendlyException($"箱码{packingCode}在预计出中已存在!"); + } + } + + + /// /// 拆箱 /// @@ -394,6 +414,13 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase + $"【库存不足】"); } } + foreach (var detail in entity.Details) + { + if (!string.IsNullOrEmpty(detail.FromPackingCode)) + { + await CheckPackingCode(detail.FromPackingCode).ConfigureAwait(false); + } + } entity =await _transferNoteManager.CreateAsync(entity).ConfigureAwait(false); From 3dec128f90e9472d9498d2b712c0114286907175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Thu, 26 Dec 2024 08:57:00 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Notes/TransferNotes/TransferNoteAppService.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs index 8cb896f3e..b5595c504 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs @@ -455,6 +455,15 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase + $"【库存不足】"); } } + foreach (var detail in entity.Details) + { + if (!string.IsNullOrEmpty(detail.FromPackingCode)) + { + await CheckPackingCode(detail.FromPackingCode).ConfigureAwait(false); + } + } + + resultEntity.Add(await _transferNoteManager.CreateAsync(entity).ConfigureAwait(false)); _ = ObjectMapper.Map(entity);