From 46adbcdc73fcb0d0c0897af25c7a1be9ed513757 Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Tue, 21 May 2024 14:30:16 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=B8=89=E6=96=B9=E5=BA=93=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E5=B7=B2=E5=8F=91=E6=95=B0=E9=87=8F=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ThirdLocationJobAppService.cs | 6 ++--- .../ThirdLocationNoteEventHandler.cs | 25 +++++++++++++------ 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ThirdLocationJobs/ThirdLocationJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ThirdLocationJobs/ThirdLocationJobAppService.cs index a2e73a8be..55281ef5f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ThirdLocationJobs/ThirdLocationJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ThirdLocationJobs/ThirdLocationJobAppService.cs @@ -98,10 +98,10 @@ public class ThirdLocationJobAppService return dtos; } - [HttpPost("cancel-by-request/{assembleNumber}")] - public virtual async Task CancelByMaterialRequestAsync(string assembleNumber) + [HttpPost("cancel-by-request/{thirdLocationNumber}")] + public virtual async Task CancelByMaterialRequestAsync(string thirdLocationNumber) { - var entities = await _repository.GetListAsync(p => p.RequestNumber == assembleNumber).ConfigureAwait(false); + var entities = await _repository.GetListAsync(p => p.RequestNumber == thirdLocationNumber).ConfigureAwait(false); foreach (var entity in entities) { await _thirdLocationJobManager.CancelAsync(entity).ConfigureAwait(false); 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 5e7f69cdb..24d813bd1 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 @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Volo.Abp.Domain.Repositories; using Volo.Abp.EventBus; using Volo.Abp.Uow; using Win_in.Sfs.Basedata.Application.Contracts; @@ -10,6 +11,7 @@ using Win_in.Sfs.Shared.Event; using Win_in.Sfs.Wms.Inventory.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; using Win_in.Sfs.Wms.Store.Event.Transaction; +using static ClosedXML.Excel.XLPredefinedFormat; namespace Win_in.Sfs.Wms.Store.Event.Transactions; @@ -23,12 +25,14 @@ public class ThirdLocationNoteEventHandler private readonly ILocationAppService _locationAppService; private readonly IThirdLocationRequestManager _thirdLocationRequestManager; + private readonly IThirdLocationRequestRepository _ThirdLocationRequestRepository; public ThirdLocationNoteEventHandler(ILocationAppService locationAppService - , IThirdLocationRequestManager thirdLocationRequestManager) + , IThirdLocationRequestRepository ThirdLocationRequestRepository, IThirdLocationRequestManager thirdLocationRequestManager) { _locationAppService = locationAppService; _thirdLocationRequestManager = thirdLocationRequestManager; + _ThirdLocationRequestRepository = ThirdLocationRequestRepository; } [UnitOfWork] @@ -44,14 +48,21 @@ public class ThirdLocationNoteEventHandler await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false); if (!string.IsNullOrEmpty(entity.RequestNumber)) - { - var thirdLocationRequest = await _thirdLocationRequestManager.GetByNumberAsync(entity.RequestNumber).ConfigureAwait(false); - foreach(var item in thirdLocationRequest.Details) + { + //var thirdLocationRequest = await _thirdLocationRequestManager.GetByNumberAsync(entity.RequestNumber).ConfigureAwait(false); + + var entities = await _ThirdLocationRequestRepository.GetListAsync(p => p.Number == entity.RequestNumber, "Number", true).ConfigureAwait(false); + if(entities.Count>0) { - item.IssuedQty = entity.Details[0].RecommendQty; - item.ReceivedQty = entity.Details[0].HandledQty; + foreach (var item in entities[0].Details) + { + item.IssuedQty = entity.Details[0].RecommendQty; + item.ReceivedQty = entity.Details[0].HandledQty; + } + await _thirdLocationRequestManager.CompleteAsync(entities[0]).ConfigureAwait(false); + } - await _thirdLocationRequestManager.CompleteAsync(thirdLocationRequest).ConfigureAwait(false); + } } From 5c1aadf7eac232d8e9d952d800084cd3213e1f54 Mon Sep 17 00:00:00 2001 From: lvzb <35200379@qq.com> Date: Tue, 21 May 2024 16:50:08 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=9B=98=E7=82=B9=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Win_in.Sfs.Wms.Store.Event/Jobs/CountJobEventHandler.cs | 5 ++++- .../Requests/CountPlanEventHandler.cs | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/CountJobEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/CountJobEventHandler.cs index 6560175aa..f31d86af6 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/CountJobEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/CountJobEventHandler.cs @@ -59,7 +59,10 @@ public class CountJobEventHandler : foreach (var detail in countPlanUpdateInput.Details) { - detail.DetailStatus = EnumCountStatus.Completed; + if (detail.FinalCountQty != 0) + { + detail.DetailStatus = EnumCountStatus.Completed; + } await TrySetDetailPropertiesAsync(detail).ConfigureAwait(false); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/CountPlanEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/CountPlanEventHandler.cs index a453c0ef9..fbad39add 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/CountPlanEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/CountPlanEventHandler.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -99,6 +100,7 @@ public class CountPlanEventHandler foreach (var job in jobs) { var countNote = ObjectMapper.Map(job); + countNote.EndTime = DateTime.Now; notes.Add(countNote); } if (notes.Count > 0)