From d92fc6eff943cf892dfef5aad41163a96ac18558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Thu, 14 Nov 2024 17:02:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=A2=E6=88=B7=E9=80=80?= =?UTF-8?q?=E8=B4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DTOs/CustomerProductionReturnNoteDTO.cs | 7 +++++ .../DTOs/CustomerReturnNoteDTO.cs | 4 +++ .../CustomerProductionReturnNoteAppService.cs | 30 ++++++++++++++++++- ...erProductionReturnNoteAutoMapperProfile.cs | 1 + .../CustomerProductionReturnNote.cs | 6 ++-- .../CustomerReturnNotes/CustomerReturnNote.cs | 2 ++ .../CustomerReturnNoteEventHandler.cs | 2 ++ 7 files changed, 49 insertions(+), 3 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CustomerProductionReturnNotes/DTOs/CustomerProductionReturnNoteDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CustomerProductionReturnNotes/DTOs/CustomerProductionReturnNoteDTO.cs index eccb90065..6b01b54cb 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CustomerProductionReturnNotes/DTOs/CustomerProductionReturnNoteDTO.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CustomerProductionReturnNotes/DTOs/CustomerProductionReturnNoteDTO.cs @@ -23,6 +23,13 @@ public class CustomerProductionReturnNoteDTO : SfsStoreDTOBase + ///客户编码 + /// + [Display(Name = "客户名称")] + public string CustomerName { get; set; } + + /// /// 退料单号 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CustomerReturnNotes/DTOs/CustomerReturnNoteDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CustomerReturnNotes/DTOs/CustomerReturnNoteDTO.cs index 7aa584af3..822c43223 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CustomerReturnNotes/DTOs/CustomerReturnNoteDTO.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/CustomerReturnNotes/DTOs/CustomerReturnNoteDTO.cs @@ -29,4 +29,8 @@ public class CustomerReturnNoteDTO : SfsStoreDTOBase @@ -58,6 +63,25 @@ public class CustomerProductionReturnNoteAppService : { var entity = ObjectMapper.Map(input); + var customerlist= await _customerAppService.GetByCodesWithPostAsync(new List() { entity.CustomerCode }).ConfigureAwait(false); + + if (customerlist.Count > 0) + { + entity.CustomerName = customerlist.FirstOrDefault().Name; + } + else + { + throw new UserFriendlyException($"未{entity.CustomerCode}查到客户信息!"); + } + + + /// + /// 客户名称 + /// + + + + var parts= input.Details.Select(itm => itm.ItemCode).Distinct(); //var ls=await IsExistCustomerItemPrice(parts.ToList(),input.CustomerCode).ConfigureAwait(false); @@ -154,5 +178,9 @@ public class CustomerProductionReturnNoteAppService : + + + + } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteAutoMapperProfile.cs index d8a6ef92b..6649e3e53 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteAutoMapperProfile.cs @@ -28,6 +28,7 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.Number) .Ignore(x => x.Id) .Ignore(x=>x.Remark) + .Ignore(x=>x.CustomerName) .Ignore(x=>x.ExtraProperties) ; } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNote.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNote.cs index 19dc19e07..6cf1d6585 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNote.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNote.cs @@ -26,8 +26,10 @@ public class CustomerProductionReturnNote : SfsStoreAggregateRootBase public string CustomerCode { get; set; } - - + /// + /// 客户名称 + /// + public string CustomerName { get; set; } /// /// 退料时间 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/CustomerReturnNotes/CustomerReturnNote.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/CustomerReturnNotes/CustomerReturnNote.cs index d32dcb5f9..b0fc04a0e 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/CustomerReturnNotes/CustomerReturnNote.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/CustomerReturnNotes/CustomerReturnNote.cs @@ -23,6 +23,8 @@ public class CustomerReturnNote : SfsStoreAggregateRootBase public string Customer { get; set; } + + /// /// 明细列表 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/CustomerReturnNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/CustomerReturnNoteEventHandler.cs index f06e1acc3..c266edda6 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/CustomerReturnNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/CustomerReturnNoteEventHandler.cs @@ -63,6 +63,8 @@ public class CustomerReturnNoteEventHandler transferLog.Worker = customerReturnNote.Worker; transferLog.DocNumber = customerReturnNote.Number; transferLog.JobNumber = customerReturnNote.JobNumber; + + transferLogCreateInputs.Add(transferLog); }