fix 判断是否存在

This commit is contained in:
2026-05-13 13:52:33 +08:00
parent 37f67cb2ce
commit 4ece8fc1e5

View File

@@ -178,7 +178,11 @@ public class GainfoUpdateService : IGainfoUpdateService
if (item.isowner == "T") if (item.isowner == "T")
{ {
await _dbContext.InsertAsync(info); if (!await _dbContext.Queryable<GainfoEntity>().AnyAsync(x => x.Code == item.ename))
{
await _dbContext.InsertAsync(info);
}
await _identityUserSyncService.SyncAccountAsync(info.Code, info.Name, info.IdNo, info.Factory); await _identityUserSyncService.SyncAccountAsync(info.Code, info.Name, info.IdNo, info.Factory);
} }
else else