diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_PD_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_PD_SERVICE.cs index 9ffbd979..9ee4a41a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_PD_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_PD_SERVICE.cs @@ -55,8 +55,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { item.State = SettleBillState.已提交扣减; } - await _repository.DbContext.BulkInsertAsync(ls); - var _taskid = await _service.ExportEnqueueAsync("BBAC待扣减任务", ExportExtentsion.Excel, DateTime.Now.ToString("yyyyMM"), string.Empty, CurrentUser, typeof(PendingDeductionService), customConditionList, (rs) => + await _repository.DbContext.BulkUpdateAsync(ls); + var _taskid = await _service.ExportEnqueueAsync("PUB待扣减任务", ExportExtentsion.Excel, DateTime.Now.ToString("yyyyMM"), string.Empty, CurrentUser, typeof(PendingDeductionService), customConditionList, (rs) => { }); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs index ba637484..3e099d13 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs @@ -208,26 +208,46 @@ public class PendingDeductionService : ApplicationService, ITransientDependency, // 执行批量数据操作 if (ls != null && ls.Count > 0) { - var count = CalculatePageCount(ls.Count, 2000); - for (int pagenumber = 0; pagenumber < count; pagenumber++) + + + var messagelist = new List(); + + _dbcontext.BulkInsert(ls); + + foreach (var item in ls) { - var lst = GetPagedData(ls, pagenumber++, 2000); - var messagelist= new List(); - foreach (var item in lst) + var message = new VmiMessage { - var message = new VmiMessage - { - Message = System.Text.Json.JsonSerializer.Serialize(item), - }; - messagelist.Add(message); - } - _dbcontext.BulkInsert(messagelist); - _dbcontext.BulkInsert(lst,new BulkConfig() { }); - Task.Delay(500); + Message = System.Text.Json.JsonSerializer.Serialize(item), + }; + messagelist.Add(message); } + + _dbcontext.BulkInsert(messagelist); + _dbcontext.BulkInsert(ls,new BulkConfig() { }); + + + + //var count = CalculatePageCount(ls.Count, 2000); + //for (int pagenumber = 0; pagenumber < count; pagenumber++) + //{ + // var lst = GetPagedData(ls, pagenumber++, 2000); + // var messagelist= new List(); + // foreach (var item in lst) + // { + // var message = new VmiMessage + // { + // Message = System.Text.Json.JsonSerializer.Serialize(item), + // }; + // messagelist.Add(message); + // } + // _dbcontext.BulkInsert(messagelist); + // _dbcontext.BulkInsert(lst,new BulkConfig() { }); + // Task.Delay(500); + //} } // 提交事务 - transaction.Commit(); + transaction.Commit(); } catch (Exception) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs index 02c14304..955e1780 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs @@ -708,7 +708,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers guid: itm.Id, keyCode: itm.KeyCode, version: itm.Version, - billNum: itm.BillNum, + billNum: itm.InvbillNum, lU: itm.LU, rELU: string.Empty, pN: itm.PN, @@ -782,7 +782,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers guid: GuidGenerator.Create(), keyCode: itm.KeyCode, version: itm.Version, - billNum: itm.InvGroupNum, + billNum: itm.InvBillNum, settleBillNum: itm.SettleBillNum, lU: itm.LU, pN: itm.PN, @@ -817,7 +817,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers guid: GuidGenerator.Create(), keyCode: itm.KeyCode, version: itm.Version, - billNum: itm.InvGroupNum, + billNum: itm.InvBillNum, settleBillNum: itm.SettleBillNum, lU: itm.LU, pN: itm.PN, @@ -861,7 +861,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers guid: itm.Id, keyCode: itm.KeyCode, version: itm.Version, - billNum: itm.BillNum, + billNum: itm.InvbillNum, lU: itm.LU, rELU: string.Empty, pN: itm.PN,