From f92811cc0657eeb368749c5b3f0d6ba092ec5625 Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Tue, 7 Jan 2025 17:10:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20=E5=90=88=E7=AE=B1?= =?UTF-8?q?=E6=A0=87=E5=8C=85=E6=A0=A1=E9=AA=8C=20=E4=BF=AE=E6=94=B9=20?= =?UTF-8?q?=E5=96=B7=E6=B6=82=E5=8F=AB=E6=96=99AGV=E5=9B=9E=E8=B0=83?= =?UTF-8?q?=E7=9A=84=E5=BA=93=E4=BD=8DBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CoatingIssueJobAppService.cs | 17 ++++++++++++++--- .../IntegrationPackingNoteAppService.cs | 7 +++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs index 31b731662..a2d5889e3 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs @@ -950,14 +950,25 @@ public class CoatingIssueJobAppService } try { - foreach (var detail in entity.Details) { var detailDto = new CoatingIssueJobDetailDTO(); if (!string.IsNullOrEmpty(detail.TransferLibFromLocationCode)) { - //库移的最终目标 挪到 推荐的目标 - var fromloc = await _locationAppService.GetByCodeAsync(detail.TransferLibToLocationCode).ConfigureAwait(false); + var fromloc = new LocationDTO(); + if (detail.TransferLibFromLocationCode == detail.RecommendFromLocationCode && + detail.TransferLibToLocationCode == detail.RecommendToLocationCode) + { + //库移的最终目标 挪到 推荐的目标 + fromloc = await _locationAppService.GetByCodeAsync(detail.RecommendFromLocationCode).ConfigureAwait(false); + } + else + { + //库移的最终目标 挪到 推荐的目标 + fromloc = await _locationAppService.GetByCodeAsync(detail.TransferLibToLocationCode).ConfigureAwait(false); + } + + var toloc = await _locationAppService.GetByCodeAsync(detail.RecommendToLocationCode).ConfigureAwait(false); detailDto.InjectFrom(detail); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/OperationPacking/IntegrationPackingNotes/IntegrationPackingNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/OperationPacking/IntegrationPackingNotes/IntegrationPackingNoteAppService.cs index 63a614869..bba30a5f8 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/OperationPacking/IntegrationPackingNotes/IntegrationPackingNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/OperationPacking/IntegrationPackingNotes/IntegrationPackingNoteAppService.cs @@ -93,6 +93,7 @@ public class IntegrationPackingNoteAppService : entity = await _repository.InsertAsync(entity).ConfigureAwait(false); + var balanceDetailDtos = new List(); foreach (var detailInput in input.Details) { var balanceDetailDto=await _balanceAppService.GetByPackingCodeAsync(detailInput.PackingCode).ConfigureAwait(false); @@ -106,6 +107,12 @@ public class IntegrationPackingNoteAppService : await BuildTransferLogsAsync(entity, detailInput) .ConfigureAwait(false); transferLogEditInputs.Add(transferLogEditInput); + balanceDetailDtos.Add(balanceDetailDto); + } + + if (balanceDetailDtos.Sum(p=>p.Qty) > input.StdPackQty) + { + throw new UserFriendlyException($"合箱数量超过标包"); } await _transferLogAppService.AddManyAsync(transferLogEditInputs).ConfigureAwait(false);