From e11d8b598080e501d9c3a7de1ccb283ad3beeb15 Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Wed, 24 Apr 2024 08:22:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=B8=89=E6=96=B9=E5=BA=93TY?= =?UTF-8?q?RP=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ThirdLocationNoteEventHandler.cs | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/ThirdLocationNoteEventHandler.cs diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/ThirdLocationNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/ThirdLocationNoteEventHandler.cs new file mode 100644 index 000000000..abd58f12a --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/ThirdLocationNoteEventHandler.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.EventBus; +using Volo.Abp.Uow; +using Win_in.Sfs.Basedata.Application.Contracts; +using Win_in.Sfs.Shared.Event; +using Win_in.Sfs.Wms.Inventory.Domain.Acl.Location; +using Win_in.Sfs.Wms.Store.Application.Contracts; +using Win_in.Sfs.Wms.Store.Domain; +using ILocationAclService = Win_in.Sfs.Wms.Store.Domain.Acl.Location.ILocationAclService; + +namespace Win_in.Sfs.Wms.Store.Event.DataExchanges +{ + public class ThirdLocationNoteEventHandler : + StoreDataExchangeEventHandlerBase + , ILocalEventHandler> + { + private readonly Domain.Acl.Location.ILocationAclService _locationAclService; + + public ThirdLocationNoteEventHandler(ILocationAclService locationAclService) + { + _locationAclService = locationAclService; + } + + [UnitOfWork] + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) + { + var entity = eventData.Entity; + await AddExchangeDataAsync(entity).ConfigureAwait(false); + } + + + protected override async Task AddExchangeDataAsync(List entities) + { + var dtos = ObjectMapper.Map, List>(entities); + + var exchangeData = await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.ERP, EnumExchangeDataType.Transfer, dtos).ConfigureAwait(false); + await AddManyAsync(exchangeData).ConfigureAwait(false); + + } + } +}