fix 增加日志调试
This commit is contained in:
@@ -13,7 +13,7 @@ public class JobPack : BaseAppPack
|
||||
|
||||
public override void Invoke(IServiceProvider serviceProvider)
|
||||
{
|
||||
RecurringJob.AddOrUpdate<SyncOrganizationJob>("SyncSap", s => s.SyncOrgInfo(), "0 0 2 * * ?", new RecurringJobOptions
|
||||
RecurringJob.AddOrUpdate<SyncOrganizationJob>("SyncSap", s => s.RunAsync(), "0 0 2 * * ?", new RecurringJobOptions
|
||||
{
|
||||
TimeZone = TimeZoneInfo.Local
|
||||
});
|
||||
|
||||
@@ -20,7 +20,7 @@ public class SyncOrganizationJob
|
||||
_jinkoSapService = jinkoSapService;
|
||||
}
|
||||
|
||||
public async Task SyncOrgInfo()
|
||||
public async Task RunAsync()
|
||||
{
|
||||
var orgResult = await _jinkoSapService.GetSapOrganizationsAsync();
|
||||
|
||||
|
||||
@@ -28,10 +28,12 @@ public class SyncPersonJob
|
||||
var personResp = await _jinkoSapService.GetPersonsAsync();
|
||||
var persons = personResp.Person.Items;
|
||||
|
||||
_logger.LogInformation("获取SAP人员数量为:{count}", persons.Count);
|
||||
if (persons.Count > 0)
|
||||
{
|
||||
_positions = await _dbContext.Queryable<PositionEntity>().ToListAsync();
|
||||
var modifiedPersons = await GetModifiedPersonAsync(persons.OrderByDescending(x => x.ZSTATUS).ThenBy(x => x.ZRZRQ).ToList());
|
||||
_logger.LogInformation("SAP人员差异数量为:{count}", modifiedPersons.Count);
|
||||
if (modifiedPersons.Count > 0)
|
||||
{
|
||||
var failedRecords = SavePerson(modifiedPersons);
|
||||
|
||||
Reference in New Issue
Block a user