From a97e24fa2bc8b6ecafebf40101774d8c4131f7d3 Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Thu, 11 Apr 2024 13:50:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E5=8F=8D=E5=B0=84?= =?UTF-8?q?=E5=BA=93=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InjectionJobs/InjectionJobAppService.cs | 7 +++++++ .../Jobs/TransferLibJobs/TransferLibJobAppService.cs | 12 ++++++++++-- .../Jobs/InjectionJobEventHandler.cs | 7 +------ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionJobs/InjectionJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionJobs/InjectionJobAppService.cs index ca7c0baab..966ee52d1 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionJobs/InjectionJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionJobs/InjectionJobAppService.cs @@ -158,4 +158,11 @@ public class InjectionJobAppService { throw new NotImplementedException(); } + + [HttpPost("test")] + public virtual async Task Test() + { + Console.WriteLine("FuAZCZXVZXVXZVZ"); + await Task.CompletedTask; + } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs index 0767c0097..16fc0eacd 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs @@ -3,6 +3,7 @@ using System.Reflection; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; @@ -18,10 +19,12 @@ public class TransferLibJobAppService : SfsJobAppServiceBase, ITransferLibJobAppService { + private readonly IServiceProvider _serviceProvider; + public TransferLibJobAppService( - ITransferLibJobRepository repository, ITransferLibJobManager TransferLibJobManager - ) : base(repository, TransferLibJobManager) + ITransferLibJobRepository repository, ITransferLibJobManager TransferLibJobManager, IServiceProvider serviceProvider) : base(repository, TransferLibJobManager) { + _serviceProvider = serviceProvider; } /// @@ -32,6 +35,11 @@ public class TransferLibJobAppService /// public override async Task CompleteAsync(Guid id, TransferLibJobDTO dto) { + var str = "Win_in.Sfs.Wms.Store.Application.InjectionJobAppService"; + var implementation=_serviceProvider.GetService(Type.GetType("Win_in.Sfs.Wms.Store.Application.InjectionJobAppService")); + MethodInfo methodInfo=implementation.GetType().GetMethod("Test"); + methodInfo.Invoke(implementation, null); + string methodPrefix = "TransferLibJobAppService.CompleteAsync - "; if (dto.CallServerName.IsNullOrEmpty()) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/InjectionJobEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/InjectionJobEventHandler.cs index 4ea37c26b..71bd14211 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/InjectionJobEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/InjectionJobEventHandler.cs @@ -167,11 +167,6 @@ public class InjectionJobEventHandler : detailInput.FromLocationErpCode= detail.RecommendFromLocationErpCode; detailInput.FromWarehouseCode= detail.RecommendFromWarehouseCode; - detailInput.ToLocationCode = "YL1"; - detailInput.ToLocationErpCode = "YL1"; - detailInput.ToLocationGroup = "YL1"; - detailInput.ToLocationArea = "YL1"; - detailInput.FromLot = detail.RecommendLot; detailInput.ToLot=detail.RecommendLot; detailInput.Qty=detail.RecommendQty; @@ -179,7 +174,7 @@ public class InjectionJobEventHandler : detailInput.Uom=detail.Uom; detailInput.SupplierBatch = detail.RecommendSupplierBatch; - await _transferLibRequestAppService.CreateAsync(input); + await _transferLibRequestAppService.CreateAsync(input).ConfigureAwait(false); } }