fix idno为空人员不执行insert

This commit is contained in:
2025-10-28 11:31:16 +08:00
parent b6af5f2e93
commit e94d234566

View File

@@ -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)
{