Browse Source

更新版本

master
zhaoxinyu 11 months ago
parent
commit
6d60d77154
  1. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs
  2. 26
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs

5
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs

@ -366,12 +366,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
// var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 // var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细
if (adjlist != null && adjlist.Count > 0) if (adjlist != null && adjlist.Count > 0)
{ {
var relationList =_relationRepository.Where(p => p.BusinessType == inv.BusinessType).ToList(); var relationList =_relationRepository.Where(p => p.BusinessType == inv.BusinessType).ToList();
var relist= relationList.GroupBy(p => new { p.SettleMaterialCode, p.ErpMaterialCode }).Select(p => p.FirstOrDefault()).ToList(); var relist= relationList.GroupBy(p => new { p.SettleMaterialCode, p.ErpMaterialCode }).Select(p => p.FirstOrDefault()).ToList();
foreach (var itm in adjlist) foreach (var itm in adjlist)
{ {
@ -379,7 +375,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
itm.BusinessType= inv.BusinessType; itm.BusinessType= inv.BusinessType;
if (itm.Qty > 0) if (itm.Qty > 0)
{ {
bbaclist.Add(new BBAC_CAN_SA_DETAIL( bbaclist.Add(new BBAC_CAN_SA_DETAIL(
guid: GuidGenerator.Create(), guid: GuidGenerator.Create(),
keyCode: itm.KeyCode, keyCode: itm.KeyCode,

26
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs

@ -237,7 +237,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
await _exChangeCenterDbContext.BulkInsertAsync(new List<TEA_TASK_SUB>() { teaTaskSub }).ConfigureAwait(false); await _exChangeCenterDbContext.BulkInsertAsync(new List<TEA_TASK_SUB>() { teaTaskSub }).ConfigureAwait(false);
await _exChangeCenterDbContext.BulkInsertAsync(tedsaInvs1).ConfigureAwait(false); await _exChangeCenterDbContext.BulkInsertAsync(tedsaInvs1).ConfigureAwait(false);
invoiceGrp.State = SettleBillState.QAD; invoiceGrp.State = SettleBillState.QAD;
_repository.DbContext.BulkUpdateAsync(new List<INVOICE_GRP>() { invoiceGrp }); await _repository.DbContext.BulkUpdateAsync(new List<INVOICE_GRP>() { invoiceGrp });
await BindInvoiceSyncQadAsync(teaTaskSub, invoiceGrp.RealnvBillNum, invoiceGrp.InvbillNum, invoiceGrp.ClientCode).ConfigureAwait(false); await BindInvoiceSyncQadAsync(teaTaskSub, invoiceGrp.RealnvBillNum, invoiceGrp.InvbillNum, invoiceGrp.ClientCode).ConfigureAwait(false);
//await _exChangeCenterDbContext.SaveChangesAsync().ConfigureAwait(false); //await _exChangeCenterDbContext.SaveChangesAsync().ConfigureAwait(false);
@ -330,28 +330,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
await SubmitToQadHongChongAsync(invoiceGrp.ParentInvbillNum).ConfigureAwait(false); await SubmitToQadHongChongAsync(invoiceGrp.ParentInvbillNum).ConfigureAwait(false);
} }
//await _exChangeCenterDbContext.Set<TEA_TASK_SUB>().AddAsync(teaTaskSub).ConfigureAwait(false);
//await _exChangeCenterDbContext.Set<TED_SAS_INVOICE>().AddRangeAsync(tedSaInvs).ConfigureAwait(false);
//invoiceGrp.State = SettleBillState.已提交QAD;
////构建发票同步Qad状态表数据
//await BindInvoiceSyncQadAsync(teaTaskSub, invoiceGrp.RealnvBillNum, invoiceGrp.InvbillNum, invoiceGrp.ClientCode).ConfigureAwait(false);
await _exChangeCenterDbContext.BulkInsertAsync(new List<TEA_TASK_SUB>() { teaTaskSub }).ConfigureAwait(false); await _exChangeCenterDbContext.BulkInsertAsync(new List<TEA_TASK_SUB>() { teaTaskSub }).ConfigureAwait(false);
await _exChangeCenterDbContext.BulkInsertAsync(tedSaInvs).ConfigureAwait(false); await _exChangeCenterDbContext.BulkInsertAsync(tedSaInvs).ConfigureAwait(false);
invoiceGrp.State = SettleBillState.QAD; invoiceGrp.State = SettleBillState.QAD;
_repository.DbContext.BulkUpdateAsync(new List<INVOICE_GRP>() { invoiceGrp }); await _repository.DbContext.BulkUpdateAsync(new List<INVOICE_GRP>() { invoiceGrp });
await BindInvoiceSyncQadAsync(teaTaskSub, invoiceGrp.RealnvBillNum, invoiceGrp.InvbillNum, invoiceGrp.ClientCode).ConfigureAwait(false); await BindInvoiceSyncQadAsync(teaTaskSub, invoiceGrp.RealnvBillNum, invoiceGrp.InvbillNum, invoiceGrp.ClientCode).ConfigureAwait(false);
// await _exChangeCenterDbContext.SaveChangesAsync().ConfigureAwait(false);
// var retryPolicyAsync = Policy.Handle<Exception>().WaitAndRetryAsync(new[] {
// TimeSpan.FromSeconds(1),
// TimeSpan.FromSeconds(5),
// TimeSpan.FromSeconds(5),
// TimeSpan.FromSeconds(5)
//}, (exception, timeSpan, retryCount, context) =>
//{
// _logger.LogError($"提交到QAD,修改发票状态执行失败,第 {retryCount} 次重试");
//});
// await retryPolicyAsync.ExecuteAsync(async () => await _settleAccountDbContext.SaveChangesAsync().ConfigureAwait(false)).ConfigureAwait(false);
} }
} }
@ -477,7 +463,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
await _exChangeCenterDbContext.BulkInsertAsync(new List<TEA_TASK_SUB>() { teaTaskSub }).ConfigureAwait(false); await _exChangeCenterDbContext.BulkInsertAsync(new List<TEA_TASK_SUB>() { teaTaskSub }).ConfigureAwait(false);
await _exChangeCenterDbContext.BulkInsertAsync(tedsaInvs1).ConfigureAwait(false); await _exChangeCenterDbContext.BulkInsertAsync(tedsaInvs1).ConfigureAwait(false);
invoiceGrp.State = SettleBillState.QAD; invoiceGrp.State = SettleBillState.QAD;
_repository.DbContext.BulkUpdateAsync(new List<INVOICE_GRP>() { invoiceGrp }); await _repository.DbContext.BulkUpdateAsync(new List<INVOICE_GRP>() { invoiceGrp });
await BindInvoiceSyncQadAsync(teaTaskSub, invoiceGrp.RealnvBillNum, invoiceGrp.InvbillNum, invoiceGrp.ClientCode).ConfigureAwait(false); await BindInvoiceSyncQadAsync(teaTaskSub, invoiceGrp.RealnvBillNum, invoiceGrp.InvbillNum, invoiceGrp.ClientCode).ConfigureAwait(false);
} }
} }
@ -549,7 +535,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
await _exChangeCenterDbContext.BulkInsertAsync(new List<TEA_TASK_SUB>() { teaTaskSub }).ConfigureAwait(false); await _exChangeCenterDbContext.BulkInsertAsync(new List<TEA_TASK_SUB>() { teaTaskSub }).ConfigureAwait(false);
await _exChangeCenterDbContext.BulkInsertAsync(tedSaInvs).ConfigureAwait(false); await _exChangeCenterDbContext.BulkInsertAsync(tedSaInvs).ConfigureAwait(false);
invoiceGrp.State = SettleBillState.QAD; invoiceGrp.State = SettleBillState.QAD;
_repository.DbContext.BulkUpdateAsync(new List<INVOICE_GRP>() { invoiceGrp }); await _repository.DbContext.BulkUpdateAsync(new List<INVOICE_GRP>() { invoiceGrp });
await BindInvoiceSyncQadAsync(teaTaskSub, invoiceGrp.RealnvBillNum, invoiceGrp.InvbillNum, invoiceGrp.ClientCode).ConfigureAwait(false); await BindInvoiceSyncQadAsync(teaTaskSub, invoiceGrp.RealnvBillNum, invoiceGrp.InvbillNum, invoiceGrp.ClientCode).ConfigureAwait(false);
} }

Loading…
Cancel
Save