diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/InvoiceSyncQadInvocable.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/InvoiceSyncQadInvocable.cs
index 3251bc6b..e47a8042 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/InvoiceSyncQadInvocable.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/InvoiceSyncQadInvocable.cs
@@ -38,8 +38,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
///
public async Task Invoke()
{
- await Task.CompletedTask.ConfigureAwait(false);
-
if (!_globalConfigOptions.IsSyncInvoiceQadState)
{
return;
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs
index 7cd62c05..d20a5bfc 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs
@@ -20,6 +20,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
[ApiExplorerSettings(IgnoreApi = true)]
public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable
{
+ private static readonly object _locker = new object();
///
/// WMS数据上下文
///
@@ -61,12 +62,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
[HttpPost]
public async Task Invoke()
{
+ await Task.CompletedTask.ConfigureAwait(false);
if (SeSyncConfigInfo == null)
{
return;
}
- await SyncJitRecordAsync().ConfigureAwait(false);
- await SyncJisRecordAsync().ConfigureAwait(false);
+ lock (_locker)
+ {
+ SyncJitRecordAsync().Wait();
+ SyncJisRecordAsync().Wait();
+ }
}
///
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs
index d5074f24..095f0ecb 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs
@@ -20,6 +20,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
[ApiExplorerSettings(IgnoreApi = true)]
public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable
{
+ private static readonly object _locker = new object();
///
/// WMS数据上下文
///
@@ -62,12 +63,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
[HttpPost]
public virtual async Task Invoke()
{
+ await Task.CompletedTask.ConfigureAwait(false);
if (SeSyncConfigInfo == null)
{
return;
}
- await SyncJitRecordAsync().ConfigureAwait(false);
- await SyncJisRecordAsync().ConfigureAwait(false);
+ lock (_locker)
+ {
+ SyncJitRecordAsync().Wait();
+ SyncJisRecordAsync().Wait();
+ }
}
///
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs
index 5eecce8d..dcc402b3 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs
@@ -21,6 +21,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
[ApiExplorerSettings(IgnoreApi = true)]
public class JitSeSyncAppService : ApplicationService, IInvocable
{
+ private static readonly object _locker = new object();
///
/// WMS数据上下文
///
@@ -62,10 +63,19 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
[HttpPost]
public async Task Invoke()
{
+ await Task.CompletedTask.ConfigureAwait(false);
if (SeSyncConfigInfo == null)
{
return;
}
+ lock (_locker)
+ {
+ SyncJitRecordAsync().Wait();
+ }
+ }
+
+ public async Task SyncJitRecordAsync()
+ {
//同步表名称
var syncTableName = SeSyncConfigInfo.SyncTableName;
//同步发运主类型