From 3cbcaec3fe7add7a04ad0652e9a7a312ae2f2681 Mon Sep 17 00:00:00 2001 From: liuyunfeng Date: Mon, 25 Dec 2023 14:36:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=20=E7=BA=BF=E8=BE=B9=20?= =?UTF-8?q?=E9=9D=9E=E7=94=9F=E4=BA=A7=20=E9=80=80=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nplannedReceiptRequestAutoMapperProfile.cs | 6 ++++++ ...nnedReceiptRequestForDongyangAppService.cs | 21 +++++++++++-------- .../UnplannedReceiptRequestEventHandler.cs | 11 +++++----- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestAutoMapperProfile.cs index 078029270..a14612046 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestAutoMapperProfile.cs @@ -61,5 +61,11 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.Status) .Ignore(x => x.Number) ; + + CreateMap(); + + CreateMap(); + + } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestForDongyangAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestForDongyangAppService.cs index f4436577b..e8105d1d1 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestForDongyangAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestForDongyangAppService.cs @@ -17,6 +17,7 @@ using Win_in.Sfs.Shared.Domain.Shared.Enums.Store; using Win_in.Sfs.Wms.Inventory.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; +using Win_in.Sfs.Wms.Store.Domain.Acl.Dict; namespace Win_in.Sfs.Wms.Store.Application; @@ -27,14 +28,15 @@ public class UnplannedReceiptRequestForDongyangAppService : UnplannedReceiptRequ private readonly ILocationAppService _locationAppService; private readonly IUnplannedReceiptRequestManager _unplannedReceiptRequestManager; private readonly IBalanceAppService _balanceAppService; - + private new readonly IDictAclService DictAclService; public UnplannedReceiptRequestForDongyangAppService(IUnplannedReceiptRequestRepository repository, IUnplannedReceiptRequestManager unplannedReceiptRequestManager, IDepartmentAppService departmentApp, //LocationManager locationManager, ILocationAppService locationAppService, - IBalanceAppService balanceAppService + IBalanceAppService balanceAppService, + IDictAclService dictAclService ) : base(repository, unplannedReceiptRequestManager) { _unplannedReceiptRequestManager = unplannedReceiptRequestManager; @@ -42,6 +44,7 @@ public class UnplannedReceiptRequestForDongyangAppService : UnplannedReceiptRequ //_locationManager = locationManager; _locationAppService = locationAppService; _balanceAppService = balanceAppService; + DictAclService = dictAclService; } /// /// OA创建计划外入库申请 @@ -58,17 +61,17 @@ public class UnplannedReceiptRequestForDongyangAppService : UnplannedReceiptRequ await SetDetailPropertiesAsync(item).ConfigureAwait(false); } - entity.AutoCompleteJob = true; + entity.AutoCompleteJob = false; //任务到记录 entity.AutoSubmit = true; entity.AutoAgree = true; entity.AutoHandle = true; if (entity.UnplannedReceiptType == EnumUnplannedReceiptType.Wip) { - entity.DirectCreateNote = false; + entity.DirectCreateNote = true; //线边直接生成记录 } else { - entity.DirectCreateNote = true; + entity.DirectCreateNote = false; //原料先生成任务、再生成记录 } await _unplannedReceiptRequestManager.CreateAsync(entity).ConfigureAwait(false); @@ -313,7 +316,7 @@ public class UnplannedReceiptRequestForDongyangAppService : UnplannedReceiptRequ { if (!string.IsNullOrEmpty(importInput.CaseCode)) { - var dict = await DictAclService.GetByCodeAsync(nameof(importInput.CaseCode)).ConfigureAwait(false); + var dict = await base.DictAclService.GetByCodeAsync(nameof(importInput.CaseCode)).ConfigureAwait(false); Check.NotNull(dict, "字典编码", $"字典编码{nameof(importInput.CaseCode)}不存在"); if (dict == null) @@ -389,7 +392,7 @@ public class UnplannedReceiptRequestForDongyangAppService : UnplannedReceiptRequ { if (!string.IsNullOrEmpty(importInput.OnceBusiCode)) { - var dict = await DictAclService.GetByCodeAsync(nameof(importInput.OnceBusiCode)).ConfigureAwait(false); + var dict = await base.DictAclService.GetByCodeAsync(nameof(importInput.OnceBusiCode)).ConfigureAwait(false); if (dict == null) { validationRresult.Add("字典编码", $"字典编码{nameof(importInput.OnceBusiCode)}不存在"); @@ -410,7 +413,7 @@ public class UnplannedReceiptRequestForDongyangAppService : UnplannedReceiptRequ protected virtual async Task CheckProjCapacityCodeAsync(UnplannedReceiptRequestImportInput importInput, List validationRresult) { - var dict = await DictAclService.GetByCodeAsync(nameof(importInput.ProjCapacityCode)).ConfigureAwait(false); + var dict = await base.DictAclService.GetByCodeAsync(nameof(importInput.ProjCapacityCode)).ConfigureAwait(false); if (dict == null) { validationRresult.Add("字典编码", $"字典编码{nameof(importInput.ProjCapacityCode)}不存在"); @@ -442,7 +445,7 @@ public class UnplannedReceiptRequestForDongyangAppService : UnplannedReceiptRequ { if (!string.IsNullOrEmpty(detail.CaseCode)) { - var dict = await DictAclService.GetByCodeAsync(nameof(detail.CaseCode)).ConfigureAwait(false); + var dict = await base.DictAclService.GetByCodeAsync(nameof(detail.CaseCode)).ConfigureAwait(false); if (dict == null) { diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/UnplannedReceiptRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/UnplannedReceiptRequestEventHandler.cs index dcec7d221..e9ad9854e 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/UnplannedReceiptRequestEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/UnplannedReceiptRequestEventHandler.cs @@ -34,11 +34,11 @@ public class UnplannedReceiptRequestEventHandler /// Event data public async Task HandleEventAsync(SfsCreatedEntityEventData eventData) { - var entity = eventData.Entity; - if (entity.AutoSubmit) - { - await _unplannedReceiptRequestManager.SubmitAsync(entity).ConfigureAwait(false); - } + //var entity = eventData.Entity; + //if (entity.AutoSubmit) + //{ + // await _unplannedReceiptRequestManager.SubmitAsync(entity).ConfigureAwait(false); + //} } /// @@ -112,6 +112,7 @@ public class UnplannedReceiptRequestEventHandler detail.ExtraProperties = inputDetail.ExtraProperties; createInput.Details.Add(detail); + } return createInput;