fix idno为空人员不执行insert
This commit is contained in:
@@ -166,11 +166,14 @@ public class GainfoUpdateService : IGainfoUpdateService
|
||||
}
|
||||
|
||||
private async Task InsertPersonAsync(GainfoSapEntity item)
|
||||
{
|
||||
var info = GainfoSapToGainfo(item);
|
||||
//只有身份证号存在才进行新增
|
||||
if (info.IdNo.IsPresent())
|
||||
{
|
||||
await _dbContext.UseTransactionAsync(async () =>
|
||||
{
|
||||
await _dbContext.InsertAsync(item);
|
||||
var info = GainfoSapToGainfo(item);
|
||||
|
||||
if (item.isowner == "T")
|
||||
{
|
||||
@@ -186,6 +189,11 @@ public class GainfoUpdateService : IGainfoUpdateService
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.LogWarning("SAP新增人员失败,身份证号不存在:{userCode},{userName}", info.Code, info.Name);
|
||||
}
|
||||
}
|
||||
|
||||
private static GainfoEntity GainfoSapToGainfo(GainfoSapEntity item)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user