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> /// </summary>
public async Task Invoke() public async Task Invoke()
{ {
await Task.CompletedTask.ConfigureAwait(false);
if (!_globalConfigOptions.IsSyncInvoiceQadState) if (!_globalConfigOptions.IsSyncInvoiceQadState)
{ {
return; 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)] [ApiExplorerSettings(IgnoreApi = true)]
public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable
{ {
private static readonly object _locker = new object();
/// <summary> /// <summary>
/// WMS数据上下文 /// WMS数据上下文
/// </summary> /// </summary>
@ -61,12 +62,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
[HttpPost] [HttpPost]
public async Task Invoke() public async Task Invoke()
{ {
await Task.CompletedTask.ConfigureAwait(false);
if (SeSyncConfigInfo == null) if (SeSyncConfigInfo == null)
{ {
return; return;
} }
await SyncJitRecordAsync().ConfigureAwait(false); lock (_locker)
await SyncJisRecordAsync().ConfigureAwait(false); {
SyncJitRecordAsync().Wait();
SyncJisRecordAsync().Wait();
}
} }
/// <summary> /// <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)] [ApiExplorerSettings(IgnoreApi = true)]
public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable
{ {
private static readonly object _locker = new object();
/// <summary> /// <summary>
/// WMS数据上下文 /// WMS数据上下文
/// </summary> /// </summary>
@ -62,12 +63,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
[HttpPost] [HttpPost]
public virtual async Task Invoke() public virtual async Task Invoke()
{ {
await Task.CompletedTask.ConfigureAwait(false);
if (SeSyncConfigInfo == null) if (SeSyncConfigInfo == null)
{ {
return; return;
} }
await SyncJitRecordAsync().ConfigureAwait(false); lock (_locker)
await SyncJisRecordAsync().ConfigureAwait(false); {
SyncJitRecordAsync().Wait();
SyncJisRecordAsync().Wait();
}
} }
/// <summary> /// <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)] [ApiExplorerSettings(IgnoreApi = true)]
public class JitSeSyncAppService : ApplicationService, IInvocable public class JitSeSyncAppService : ApplicationService, IInvocable
{ {
private static readonly object _locker = new object();
/// <summary> /// <summary>
/// WMS数据上下文 /// WMS数据上下文
/// </summary> /// </summary>
@ -62,10 +63,19 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
[HttpPost] [HttpPost]
public async Task Invoke() public async Task Invoke()
{ {
await Task.CompletedTask.ConfigureAwait(false);
if (SeSyncConfigInfo == null) if (SeSyncConfigInfo == null)
{ {
return; return;
} }
lock (_locker)
{
SyncJitRecordAsync().Wait();
}
}
public async Task SyncJitRecordAsync()
{
//同步表名称 //同步表名称
var syncTableName = SeSyncConfigInfo.SyncTableName; var syncTableName = SeSyncConfigInfo.SyncTableName;
//同步发运主类型 //同步发运主类型

Loading…
Cancel
Save