|
|
@ -1,6 +1,7 @@ |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Volo.Abp.Domain.Entities; |
|
|
|
using Volo.Abp.EventBus; |
|
|
|
using Volo.Abp.Uow; |
|
|
|
using Win_in.Sfs.Shared.Event; |
|
|
@ -20,30 +21,23 @@ public class UnplannedReceiptNoteEventHandler |
|
|
|
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<UnplannedReceiptNote> eventData) |
|
|
|
{ |
|
|
|
var entity = eventData.Entity; |
|
|
|
if(entity.Details!=null && entity.Details.Count>0) |
|
|
|
if (entity.Details!= null && entity.Details.Count > 0) |
|
|
|
{ |
|
|
|
await AddExchangeDataAsync(entity).ConfigureAwait(false); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
[UnitOfWork] |
|
|
|
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<List<UnplannedReceiptNote>> eventData) |
|
|
|
{ |
|
|
|
var entities = eventData.Entity; |
|
|
|
|
|
|
|
List<UnplannedReceiptNote> notelist = new List<UnplannedReceiptNote>(); |
|
|
|
foreach (var entity in entities) |
|
|
|
{ |
|
|
|
if (entity.Details != null && entity.Details.Count > 0) |
|
|
|
{ |
|
|
|
notelist.Add(entity); |
|
|
|
await AddExchangeDataAsync(entity).ConfigureAwait(false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
await AddExchangeDataAsync(notelist).ConfigureAwait(false); |
|
|
|
} |
|
|
|
|
|
|
|
protected override async Task AddExchangeDataAsync(List<UnplannedReceiptNote> entities) |
|
|
@ -56,5 +50,4 @@ public class UnplannedReceiptNoteEventHandler |
|
|
|
var exchangeData = await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.ERP, ExchangeDataType, dtos).ConfigureAwait(false); |
|
|
|
await AddManyAsync(exchangeData).ConfigureAwait(false); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|