|
@ -52,6 +52,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
public SeSyncConfig SeSyncConfigInfo { get; set; } |
|
|
public SeSyncConfig SeSyncConfigInfo { get; set; } |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 执行发运同步
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <remarks>
|
|
|
|
|
|
/// 执行JisBBAC、买单件BBAC发运同步
|
|
|
|
|
|
/// 从WMS系统中 TM_BJBMPT_JIT_RECORD、TM_BJBMPT_JIS_RECORD 表中获取发运数据
|
|
|
|
|
|
/// </remarks>
|
|
|
[HttpPost] |
|
|
[HttpPost] |
|
|
public virtual async Task Invoke() |
|
|
public virtual async Task Invoke() |
|
|
{ |
|
|
{ |
|
@ -66,6 +73,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 同步JitRecord
|
|
|
/// 同步JitRecord
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
|
|
|
/// <remarks>
|
|
|
|
|
|
/// 同步TM_BJBMPT_JIT_RECORD表发运数据
|
|
|
|
|
|
/// 同步十次、每次同步100_000条发运数据
|
|
|
|
|
|
/// </remarks>
|
|
|
private async Task SyncJitRecordAsync() |
|
|
private async Task SyncJitRecordAsync() |
|
|
{ |
|
|
{ |
|
|
//同步表名称
|
|
|
//同步表名称
|
|
@ -92,7 +103,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
var jisSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIT_RECORD>, List<HBPO_SE_DETAIL>>(wmsSeRecords); |
|
|
var jisSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIT_RECORD>, List<HBPO_SE_DETAIL>>(wmsSeRecords); |
|
|
if (jisSeDetails.Any()) |
|
|
if (jisSeDetails.Any()) |
|
|
{ |
|
|
{ |
|
|
await SeDataPutInStorageAsync(jisSeDetails, false).ConfigureAwait(false); |
|
|
await SeDataPutInStorageAsync(jisSeDetails, syncTableName).ConfigureAwait(false); |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
@ -104,6 +115,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 同步JisRecord
|
|
|
/// 同步JisRecord
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
|
|
|
/// <remarks>
|
|
|
|
|
|
/// 同步TM_BJBMPT_JIS_RECORD表发运数据
|
|
|
|
|
|
/// 同步十次、每次同步100_000条发运数据
|
|
|
|
|
|
/// </remarks>
|
|
|
private async Task SyncJisRecordAsync() |
|
|
private async Task SyncJisRecordAsync() |
|
|
{ |
|
|
{ |
|
|
//同步表名称
|
|
|
//同步表名称
|
|
@ -130,7 +145,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
var jisSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIS_RECORD>, List<HBPO_SE_DETAIL>>(wmsRecords); |
|
|
var jisSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIS_RECORD>, List<HBPO_SE_DETAIL>>(wmsRecords); |
|
|
if (jisSeDetails.Any()) |
|
|
if (jisSeDetails.Any()) |
|
|
{ |
|
|
{ |
|
|
await SeDataPutInStorageAsync(jisSeDetails, true).ConfigureAwait(false); |
|
|
await SeDataPutInStorageAsync(jisSeDetails, syncTableName).ConfigureAwait(false); |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
@ -142,11 +157,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 发运数据入库
|
|
|
/// 发运数据入库
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
private async Task SeDataPutInStorageAsync(List<HBPO_SE_DETAIL> seDetails, bool isJisTable) |
|
|
/// <remarks>
|
|
|
|
|
|
/// 添加客户与厂内零件号关系
|
|
|
|
|
|
/// 记录同步位置、发运数据入库、入库寄售库数据
|
|
|
|
|
|
/// </remarks>
|
|
|
|
|
|
private async Task SeDataPutInStorageAsync(List<HBPO_SE_DETAIL> seDetails, string syncTableName) |
|
|
{ |
|
|
{ |
|
|
//同步表名称
|
|
|
|
|
|
var syncTableName = isJisTable ? SeSyncConfigInfo.SyncTableName + |
|
|
|
|
|
"_Jis" : SeSyncConfigInfo.SyncTableName + "_Jit"; |
|
|
|
|
|
//业务类别
|
|
|
//业务类别
|
|
|
var businessType = SeSyncConfigInfo.BusinessType; |
|
|
var businessType = SeSyncConfigInfo.BusinessType; |
|
|
|
|
|
|
|
@ -190,6 +206,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs |
|
|
_settleAccountDbContext.Add<SyncPositionFlag>(syncPositionFlag); |
|
|
_settleAccountDbContext.Add<SyncPositionFlag>(syncPositionFlag); |
|
|
} |
|
|
} |
|
|
await _settleAccountDbContext.BulkInsertAsync(seDetails).ConfigureAwait(false); |
|
|
await _settleAccountDbContext.BulkInsertAsync(seDetails).ConfigureAwait(false); |
|
|
|
|
|
var isJisTable = syncTableName.EndsWith("_Jis"); |
|
|
await _syncExtendManager.JisSeDetailsSaveConsignAsync<HBPO_SE_DETAIL>(seDetails, isJisTable).ConfigureAwait(false); |
|
|
await _syncExtendManager.JisSeDetailsSaveConsignAsync<HBPO_SE_DETAIL>(seDetails, isJisTable).ConfigureAwait(false); |
|
|
await _settleAccountDbContext.SaveChangesAsync().ConfigureAwait(false); |
|
|
await _settleAccountDbContext.SaveChangesAsync().ConfigureAwait(false); |
|
|
await transaction.CommitAsync().ConfigureAwait(false); |
|
|
await transaction.CommitAsync().ConfigureAwait(false); |
|
|