From 34f2eeef04c4a60c2a40945b1483fbf2c9cf4f39 Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Mon, 3 Jun 2024 13:14:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=94=AF=E4=B8=80=E7=B4=A2?= =?UTF-8?q?=E5=BC=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ocationNoteDbContextModelCreatingExtensions.cs | 4 ++-- .../Transactions/ThirdLocationNoteEventHandler.cs | 15 ++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/ThirdLocationNotes/ThirdLocationNoteDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/ThirdLocationNotes/ThirdLocationNoteDbContextModelCreatingExtensions.cs index e4498d321..ad466fea8 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/ThirdLocationNotes/ThirdLocationNoteDbContextModelCreatingExtensions.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/ThirdLocationNotes/ThirdLocationNoteDbContextModelCreatingExtensions.cs @@ -56,8 +56,8 @@ public static class ThirdLocationNoteDbContextModelCreatingExtensions //Relations //Indexes - b.HasIndex(q => new { q.Number, q.FromPackingCode, q.FromLocationCode, q.ToLocationCode }).IsUnique(); - b.HasIndex(q => new { q.FromPackingCode }); + //b.HasIndex(q => new { q.Number, q.ItemCode, q.FromLocationCode, q.ToLocationCode }).IsUnique(); + b.HasIndex(q => new { q.Number }); }); } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ThirdLocationNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ThirdLocationNoteEventHandler.cs index 05a4e35c8..300e5a73a 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ThirdLocationNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ThirdLocationNoteEventHandler.cs @@ -55,17 +55,18 @@ public class ThirdLocationNoteEventHandler if(requestEntities.Count>0 && entity.Details.Count>0) { bool isDone = false; - var requestDetail = requestEntities[0].Details.FirstOrDefault(p => p.ItemCode == entity.Details[0].ItemCode); - if(requestDetail != null) + foreach(var item in requestEntities[0].Details) { - requestDetail.ReceivedQty += entity.Details[0].HandledQty; - if(requestDetail.IssuedQty == requestDetail.ReceivedQty) + var noteDetail = entity.Details.FirstOrDefault(p => p.ItemCode == item.ItemCode); + if(noteDetail != null) { - isDone = true; + item.ReceivedQty += noteDetail.HandledQty; + } - } + + } - foreach(var item in requestEntities[0].Details.FindAll(p=>p.ItemCode!= entity.Details[0].ItemCode)) + foreach(var item in requestEntities[0].Details) { if(item.IssuedQty == item.ReceivedQty) {