1 changed files with 45 additions and 0 deletions
@ -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<ThirdLocationNote> |
||||
|
, ILocalEventHandler<SfsCreatedEntityEventData<ThirdLocationNote>> |
||||
|
{ |
||||
|
private readonly Domain.Acl.Location.ILocationAclService _locationAclService; |
||||
|
|
||||
|
public ThirdLocationNoteEventHandler(ILocationAclService locationAclService) |
||||
|
{ |
||||
|
_locationAclService = locationAclService; |
||||
|
} |
||||
|
|
||||
|
[UnitOfWork] |
||||
|
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<ThirdLocationNote> eventData) |
||||
|
{ |
||||
|
var entity = eventData.Entity; |
||||
|
await AddExchangeDataAsync(entity).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
protected override async Task AddExchangeDataAsync(List<ThirdLocationNote> entities) |
||||
|
{ |
||||
|
var dtos = ObjectMapper.Map<List<ThirdLocationNote>, List<TransferNoteDTO>>(entities); |
||||
|
|
||||
|
var exchangeData = await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.ERP, EnumExchangeDataType.Transfer, dtos).ConfigureAwait(false); |
||||
|
await AddManyAsync(exchangeData).ConfigureAwait(false); |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue