Browse Source

[CI SKIP] 发运同步添加Lock

master
mahao 1 year ago
parent
commit
aea5493c4c
  1. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/InvoiceSyncQadInvocable.cs
  2. 9
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs
  3. 9
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs
  4. 10
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/InvoiceSyncQadInvocable.cs

@ -38,8 +38,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
/// </summary>
public async Task Invoke()
{
await Task.CompletedTask.ConfigureAwait(false);
if (!_globalConfigOptions.IsSyncInvoiceQadState)
{
return;

9
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();
/// <summary>
/// WMS数据上下文
/// </summary>
@ -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();
}
}
/// <summary>

9
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();
/// <summary>
/// WMS数据上下文
/// </summary>
@ -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();
}
}
/// <summary>

10
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();
/// <summary>
/// WMS数据上下文
/// </summary>
@ -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;
//同步发运主类型

Loading…
Cancel
Save