fix log chunk
This commit is contained in:
@@ -6,6 +6,7 @@ using Dlhis.Entity.Basic.Enums;
|
||||
using Dlhis.ScheduledTask.SyncSapInfo.Dto;
|
||||
using Dlhis.ScheduledTask.SyncSapInfo.Comparers;
|
||||
using Dlhis.ScheduledTask.SyncSapInfo.Services;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Dlhis.ScheduledTask.SyncSapInfo.Job;
|
||||
|
||||
@@ -45,9 +46,12 @@ public class SyncPersonJob
|
||||
{
|
||||
var failure = 0;
|
||||
var workCodes = persons.Select(x => x.ZWORKCODE).ToList();
|
||||
var chunks = workCodes.Chunk(4000).ToList();
|
||||
|
||||
foreach (var searchCodes in workCodes.Chunk(4000))
|
||||
foreach (var searchCodes in chunks)
|
||||
{
|
||||
_logger.LogInformation("SAP分批处理Chunk数量:{count}", searchCodes.Count());
|
||||
|
||||
var existsWorkCodes = await _dbContext.Queryable<GainfoSapEntity>()
|
||||
.Where(x => searchCodes.Contains(x.ename))
|
||||
.Select(x => x.ename)
|
||||
|
||||
Reference in New Issue
Block a user