fix 异步问题
This commit is contained in:
@@ -7,7 +7,6 @@ using Dlhis.ScheduledTask.SyncSapInfo.Dto;
|
|||||||
using Dlhis.ScheduledTask.SyncSapInfo.Comparers;
|
using Dlhis.ScheduledTask.SyncSapInfo.Comparers;
|
||||||
using Dlhis.ScheduledTask.SyncSapInfo.Services;
|
using Dlhis.ScheduledTask.SyncSapInfo.Services;
|
||||||
using Kurisu.AspNetCore.Scope;
|
using Kurisu.AspNetCore.Scope;
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
|
|
||||||
namespace Dlhis.ScheduledTask.SyncSapInfo.Job;
|
namespace Dlhis.ScheduledTask.SyncSapInfo.Job;
|
||||||
|
|
||||||
@@ -39,7 +38,7 @@ public class SyncPersonJob
|
|||||||
_logger.LogInformation("SAP人员差异数量为:{count}", modifiedPersons.Count);
|
_logger.LogInformation("SAP人员差异数量为:{count}", modifiedPersons.Count);
|
||||||
if (modifiedPersons.Count > 0)
|
if (modifiedPersons.Count > 0)
|
||||||
{
|
{
|
||||||
var failedRecords = SavePerson(modifiedPersons);
|
var failedRecords = await SavePerson(modifiedPersons);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -81,7 +80,7 @@ public class SyncPersonJob
|
|||||||
i++;
|
i++;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await SavePerson(dbContext, item);
|
await InsertPerson(dbContext, item);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -111,7 +110,7 @@ public class SyncPersonJob
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task SavePerson(IDbContext db, GainfoSapEntity item)
|
private async Task InsertPerson(IDbContext db, GainfoSapEntity item)
|
||||||
{
|
{
|
||||||
var info = new GainfoEntity
|
var info = new GainfoEntity
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user