fix 处理数据写入索引约束问题
This commit is contained in:
@@ -237,7 +237,10 @@ public class GainfoUpdateService : IGainfoUpdateService
|
||||
}
|
||||
else
|
||||
{
|
||||
await _dbContext.Client.Insertable(info).AS("GainfoLeave").ExecuteCommandAsync();
|
||||
if (!await _dbContext.Queryable<GainfoLeaveEntity>().AnyAsync(x => x.Code == item.ename))
|
||||
{
|
||||
await _dbContext.Client.Insertable(info).AS("GainfoLeave").ExecuteCommandAsync();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -371,7 +374,10 @@ public class GainfoUpdateService : IGainfoUpdateService
|
||||
else
|
||||
{
|
||||
var info = GainfoSapToGainfo(item);
|
||||
await _dbContext.Client.Insertable(info).AS("GainfoLeave").ExecuteCommandAsync();
|
||||
if (!await _dbContext.Queryable<GainfoLeaveEntity>().AnyAsync(x => x.Code == item.ename))
|
||||
{
|
||||
await _dbContext.Client.Insertable(info).AS("GainfoLeave").ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user