From 40a36614b7b41b623fd1e26b3110818a5ef0b175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Thu, 2 Jan 2025 13:30:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=9F=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CustomerProductionReturnNoteAppService.cs | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteAppService.cs index 71d460828..8480dd421 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteAppService.cs @@ -9,6 +9,7 @@ using Volo.Abp; using Volo.Abp.Application.Dtos; using Win_in.Sfs.Basedata.Application; using Win_in.Sfs.Basedata.Application.Contracts; +using Win_in.Sfs.Basedata.Domain; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; @@ -32,7 +33,7 @@ public class CustomerProductionReturnNoteAppService : private readonly ICustomerItemAppService _customerItemAppService; private readonly ICustomerAppService _customerAppService; - + private readonly ICustomerItemRepository _customerItemRepository; private readonly ISalePriceSheetAppService _salePriceSheetAppService; public CustomerProductionReturnNoteAppService( @@ -40,10 +41,12 @@ public class CustomerProductionReturnNoteAppService : , ICustomerProductionReturnNoteManager CustomerProductionReturnNoteManager , ICustomerItemAppService customerItemAppService, ISalePriceSheetAppService salePriceSheetAppService, - ICustomerAppService customerAppService + ICustomerAppService customerAppService, + ICustomerItemRepository customerItemRepository ) : base(repository) { + _customerItemRepository = customerItemRepository; _customerItemAppService = customerItemAppService; @@ -89,6 +92,7 @@ public class CustomerProductionReturnNoteAppService : if (customerlist.Count > 0) { + entity.CustomerName = customerlist.FirstOrDefault().Name; } else @@ -114,7 +118,17 @@ public class CustomerProductionReturnNoteAppService : #endregion #region 20241230修改 - + foreach (var itm in input.Details) + { + var part= custitmDetail.FirstOrDefault(p => p.CustomerCode == entity.CustomerCode && p.ItemCode==itm.ItemCode); + if (part == null) + { + throw new UserFriendlyException($"零件编号{itm.ItemCode}客户编码{entity.CustomerCode}在零件关系表中不存在!"); + } + } + + +