From b7a9185f87b9a1fce734a71a56087f91511d9758 Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Tue, 16 Jul 2024 14:59:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=93=E5=AD=98=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=A2=9E=E5=8A=A0ERP=E7=89=A9=E6=96=99?= =?UTF-8?q?=E5=8F=B7=E5=92=8C=E5=BA=93=E4=BD=8D=E5=85=B3=E7=B3=BB=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InventoryInitialNoteAppService.cs | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/InventoryInitialNotes/InventoryInitialNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/InventoryInitialNotes/InventoryInitialNoteAppService.cs index 6aaab4364..5eecd553e 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/InventoryInitialNotes/InventoryInitialNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/InventoryInitialNotes/InventoryInitialNoteAppService.cs @@ -19,6 +19,7 @@ using Volo.Abp; using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Basedata.Application.Contracts; +using Win_in.Sfs.Wms.Inventory.Domain.Acl.ErpLocationItem; /// /// 库存初始化记录 @@ -32,17 +33,20 @@ public class InventoryInitialNoteAppService : private readonly IInventoryInitialNoteManager _inventoryInitialNoteManager; private readonly IInventoryLabelAppService _inventoryLabelService; private readonly IItemBasicAppService _itemBasicAppService; + private readonly IErpLocationItemAclService _erpLocationItemAclService; public InventoryInitialNoteAppService( IInventoryInitialNoteRepository repository , IInventoryInitialNoteManager inventoryInitialNoteManager , IInventoryLabelAppService inventoryLabelService, + IErpLocationItemAclService erpLocationItemAclService, IItemBasicAppService itemBasicAppService ) : base(repository) { _inventoryInitialNoteManager = inventoryInitialNoteManager; _inventoryLabelService = inventoryLabelService; _itemBasicAppService = itemBasicAppService; + _erpLocationItemAclService= erpLocationItemAclService; } /// /// 数据加工 @@ -88,8 +92,8 @@ public class InventoryInitialNoteAppService : await CheckItemBasicAsync(importInput, validationRresult).ConfigureAwait(false); await CheckLocationAsync(importInput, validationRresult).ConfigureAwait(false); await CheckStatusAsync(importInput, validationRresult).ConfigureAwait(false); - await CheckPackingAsync(importInput, validationRresult).ConfigureAwait(false); - + await CheckPackingAsync(importInput, validationRresult).ConfigureAwait(false); + await CheckErpLocationItemAsync(importInput, validationRresult).ConfigureAwait(false); } private static void CheckItemBasic(ItemBasicDTO itemcBasicDto, string itemCode) @@ -130,6 +134,7 @@ public class InventoryInitialNoteAppService : await CheckLocationAsync(importInput, validationRresult).ConfigureAwait(false); await CheckStatusAsync(importInput, validationRresult).ConfigureAwait(false); await CheckPackingAsync(importInput, validationRresult).ConfigureAwait(false); + } private async Task CheckPackingAsync(InventoryInitialNoteImportInput importInput, List validationRresult) @@ -175,6 +180,23 @@ public class InventoryInitialNoteAppService : } } + /// + /// 校验开账信息 + /// + /// + /// + /// + /// + private async Task CheckErpLocationItemAsync(InventoryInitialNoteImportInput importInput, List validationRresult) + { + var erpLocationItem = await _erpLocationItemAclService.GetFirstAsync(importInput.ItemCode, importInput.LocationErpCode).ConfigureAwait(false); + + if (erpLocationItem == null) + { + validationRresult.Add("ERP料号", $"未找到物品【{importInput.ItemCode}】与ERP储位【{importInput.LocationErpCode}】的开账信息"); + } + } + protected async Task CheckLocationAsync(InventoryInitialNoteImportInput importInput, List validationRresult) { var location = await LocationAclService.GetByCodeAsync(importInput.LocationCode).ConfigureAwait(false);