|
|
@ -59,14 +59,30 @@ public class DeliverNoteEventHandler |
|
|
|
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<List<DeliverNote>> eventDatas) |
|
|
|
{ |
|
|
|
var entitys = eventDatas.Entity; |
|
|
|
var transferLogs = new List<TransferLogEditInput>(); |
|
|
|
foreach (var entity in entitys) |
|
|
|
if (await SettingManager.IsTrueAsync(StoreSettings.Common.EnableCustomerLocation).ConfigureAwait(false)) |
|
|
|
{ |
|
|
|
transferLogs.AddRange(BuildTransferLogs(entity)); |
|
|
|
var transferLogs = new List<TransferLogEditInput>(); |
|
|
|
foreach (var entity in entitys) |
|
|
|
{ |
|
|
|
transferLogs.AddRange(BuildTransferLogs(entity)); |
|
|
|
|
|
|
|
await SetRequestStatusAsync(entity).ConfigureAwait(false); |
|
|
|
} |
|
|
|
await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var transactions = new List<TransactionEditInput>(); |
|
|
|
foreach (var entity in entitys) |
|
|
|
{ |
|
|
|
transactions.AddRange(BuildTransactions(entity)); |
|
|
|
|
|
|
|
await SetRequestStatusAsync(entity).ConfigureAwait(false); |
|
|
|
} |
|
|
|
await TransactionAppService.AddManyAsync(transactions).ConfigureAwait(false); |
|
|
|
|
|
|
|
await SetRequestStatusAsync(entity).ConfigureAwait(false); |
|
|
|
} |
|
|
|
await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false); |
|
|
|
|
|
|
|
} |
|
|
|
#region 私有
|
|
|
|
|
|
|
|