diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs index 038899008..d42f443ea 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs @@ -164,6 +164,13 @@ public class TyrpOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase //await wmsoutmWriter.WriteAsync(customerReturnNoteList).ConfigureAwait(false); #endregion + #region 客户退货单 CustomerReturn wmsoutm + Logger.LogInformation($"Write CustomerReturnNote");//退货单 + var customerReturnNoteConvert = workerContext.ServiceProvider.GetRequiredService(); + var customerReturnNoteList = await customerReturnNoteConvert.ConvertAsync().ConfigureAwait(false); + await wmsoutmWriter.WriteAsync(customerReturnNoteList).ConfigureAwait(false); + #endregion + #region 非生产领料单 UnplannedIssue wmsoutm Logger.LogInformation($"Write UnplannedIssueNote");//非生产领料单(汇总) var unplannedIssueNoteConvert = workerContext.ServiceProvider.GetRequiredService(); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/ExchangeDatas/EnumExchangeDataType.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/ExchangeDatas/EnumExchangeDataType.cs index 547f89df8..eb36c9763 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/ExchangeDatas/EnumExchangeDataType.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/ExchangeDatas/EnumExchangeDataType.cs @@ -32,6 +32,9 @@ public enum EnumExchangeDataType //回收料调整 Item_Transform = 28, //半成品上架 - SemiPutaway = 29, - + SemiPutaway = 29, + /// + /// 客户退货 + /// + CustomerReturn = 30, } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/CustomerProductionReturnNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/CustomerProductionReturnNoteAutoMapperProfile.cs index eaa70bea5..8e479aad1 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/CustomerProductionReturnNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/CustomerProductionReturnNoteAutoMapperProfile.cs @@ -43,6 +43,12 @@ public partial class StoreEventAutoMapperProfile : Profile CreateMap() .ReverseMap(); CreateMap(); + + CreateMap() + .ForMember(x => x.Customer, y => y.MapFrom(d => d.CustomerCode)) + ; + + CreateMap(); } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/CustomerProductionReturnNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/CustomerProductionReturnNoteEventHandler.cs new file mode 100644 index 000000000..b2d8cae6c --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/CustomerProductionReturnNoteEventHandler.cs @@ -0,0 +1,40 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.EventBus; +using Volo.Abp.Uow; +using Win_in.Sfs.Shared.Event; +using Win_in.Sfs.Wms.Store.Application.Contracts; +using Win_in.Sfs.Wms.Store.Domain; + +namespace Win_in.Sfs.Wms.Store.Event.DataExchanges; + +public class CustomerProductionReturnNoteEventHandler + : StoreDataExchangeEventHandlerBase + , ILocalEventHandler> + , ILocalEventHandler>> + +{ + private const EnumExchangeDataType ExchangeDataType = EnumExchangeDataType.CustomerReturn; + + [UnitOfWork] + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) + { + var entity = eventData.Entity; + await AddExchangeDataAsync(entity).ConfigureAwait(false); + } + + [UnitOfWork] + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) + { + var entities = eventData.Entity; + await AddExchangeDataAsync(entities).ConfigureAwait(false); + } + + protected override async Task AddExchangeDataAsync(List entities) + { + var dtos = ObjectMapper.Map, List>(entities); + var exchangeData = await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.ERP, ExchangeDataType, dtos).ConfigureAwait(false); + await AddManyAsync(exchangeData).ConfigureAwait(false); + } + +}