fix 处理数据写入索引约束问题
This commit is contained in:
@@ -237,7 +237,10 @@ public class GainfoUpdateService : IGainfoUpdateService
|
|||||||
}
|
}
|
||||||
else
|
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;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -371,7 +374,10 @@ public class GainfoUpdateService : IGainfoUpdateService
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
var info = GainfoSapToGainfo(item);
|
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