From 587ad4081475bdca53b82ae8edc1e1b31ae17d46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Sat, 2 Sep 2023 15:19:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/PUB_PD_SERVICE.cs | 4 +- .../BQ/Syncs/PendingDeductionService.cs | 50 +++++++++++++------ .../Entities/BQ/Managers/INV_MNG.cs | 8 +-- 3 files changed, 41 insertions(+), 21 deletions(-) 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,