|
|
@ -208,12 +208,13 @@ 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 lst = GetPagedData(ls, pagenumber++, 2000); |
|
|
|
var messagelist= new List<VmiMessage>(); |
|
|
|
foreach (var item in lst) |
|
|
|
|
|
|
|
|
|
|
|
var messagelist = new List<VmiMessage>(); |
|
|
|
|
|
|
|
_dbcontext.BulkInsert(ls); |
|
|
|
|
|
|
|
foreach (var item in ls) |
|
|
|
{ |
|
|
|
var message = new VmiMessage |
|
|
|
{ |
|
|
@ -221,10 +222,29 @@ public class PendingDeductionService : ApplicationService, ITransientDependency, |
|
|
|
}; |
|
|
|
messagelist.Add(message); |
|
|
|
} |
|
|
|
|
|
|
|
_dbcontext.BulkInsert(messagelist); |
|
|
|
_dbcontext.BulkInsert(lst,new BulkConfig() { }); |
|
|
|
Task.Delay(500); |
|
|
|
} |
|
|
|
_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<VmiMessage>();
|
|
|
|
// 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(); |
|
|
|