From 94950aedb0231bf0d11ce14d6e75649f660e6b29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Fri, 25 Oct 2024 14:56:00 +0800 Subject: [PATCH 1/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 --- .../UnplannedIssueJobAppService.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedIssueJobs/UnplannedIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedIssueJobs/UnplannedIssueJobAppService.cs index f684d06a8..0d91790b1 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedIssueJobs/UnplannedIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedIssueJobs/UnplannedIssueJobAppService.cs @@ -126,8 +126,16 @@ public class UnplannedIssueJobAppService var unbalanceDTOs = new List(); decimal totalDeducted = 0; + + List balances = new List(); + foreach (var item in inventory) { + BalanceDTO balanceDTO = new BalanceDTO(); + + balanceDTO.InjectFrom(item); + + var availableToDeduct = Math.Min(item.Qty, quantityToDeduct - totalDeducted); item.Qty -= availableToDeduct; totalDeducted += availableToDeduct; @@ -141,10 +149,9 @@ public class UnplannedIssueJobAppService balanceDTOs.Add(dto); if (enumLocationType == EnumLocationType.RAW) { - undto.InjectFrom(item); - - undto.Qty = item.Qty; - unbalanceDTOs.Add(undto); + //undto.InjectFrom(item); + //undto.Qty = item.Qty; + unbalanceDTOs.Add(balanceDTO); } else { @@ -153,6 +160,7 @@ public class UnplannedIssueJobAppService unbalanceDTOs.Add(undto); } } + // 如果已经扣减达到所需数量,退出循环 if (totalDeducted >= quantityToDeduct) From 9c178a9ee0c762227c1a5392e8cf38b5a53d9247 Mon Sep 17 00:00:00 2001 From: Zheng Date: Sun, 27 Oct 2024 10:46:49 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9TYRP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ExchangeDataDbContextModelCreatingExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/ExchangeData/ExchangeDataDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/ExchangeData/ExchangeDataDbContextModelCreatingExtensions.cs index 4caa0d8e4..370e8842c 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/ExchangeData/ExchangeDataDbContextModelCreatingExtensions.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/ExchangeData/ExchangeDataDbContextModelCreatingExtensions.cs @@ -30,7 +30,7 @@ public static class ExchangeDataDbContextModelCreatingExtensions b.Property(p => p.ReadTime); b.Property(p => p.ErrorCode).IsRequired().HasMaxLength(SfsPropertyConst.NameLength).HasConversion(); b.Property(p => p.ErrorMessage).HasMaxLength(SfsPropertyConst.RemarkLength); - //b.Property(p => p.TyrpNumber).IsRequired().HasDefaultValueSql(); + b.Property(p => p.TyrpNumber).IsRequired().HasDefaultValueSql(); b.Property(p => p.TyrpNumber).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength); //Relations