This commit is contained in:
2024-12-28 14:41:22 +08:00
parent a47062b3d8
commit e8632b0d49
2 changed files with 17 additions and 16 deletions

View File

@@ -172,15 +172,15 @@ public class GainfoUpdateService : IGainfoUpdateService
} }
private async Task InsertPersonAsync(GainfoSapEntity item) private async Task InsertPersonAsync(GainfoSapEntity item)
{
await _dbContext.UseTransactionAsync(async () =>
{ {
await _dbContext.InsertAsync(item); await _dbContext.InsertAsync(item);
var info = GainfoSapToGainfo(item); var info = GainfoSapToGainfo(item);
if (item.isowner == "T") if (item.isowner == "T")
{ {
var insertable = _dbContext.Client.Insertable(info); await _dbContext.InsertAsync(info);
_logger.LogWarning("sql:{sql}", insertable.ToSqlString());
await insertable.ExecuteCommandAsync();
await _identityUserSyncService.SyncAccountAsync(info.Code, info.Name, info.IdNo, info.Factory); await _identityUserSyncService.SyncAccountAsync(info.Code, info.Name, info.IdNo, info.Factory);
await _gainfoPermissionService.ResetPermissionsAsync(info.No, DeviceTaskEnumType.Add, null, "入职生成"); await _gainfoPermissionService.ResetPermissionsAsync(info.No, DeviceTaskEnumType.Add, null, "入职生成");
} }
@@ -191,6 +191,7 @@ public class GainfoUpdateService : IGainfoUpdateService
await _dbContext.Client.Insertable(info).AS("GainfoLeave").ExecuteCommandAsync(); await _dbContext.Client.Insertable(info).AS("GainfoLeave").ExecuteCommandAsync();
} }
} }
});
} }
private GainfoEntity GainfoSapToGainfo(GainfoSapEntity item) private GainfoEntity GainfoSapToGainfo(GainfoSapEntity item)

View File

@@ -23,7 +23,7 @@ public class DhResultHandler : IRemoteCallResultHandler
throw new HttpRequestException(statusCode + " " + (int)statusCode); throw new HttpRequestException(statusCode + " " + (int)statusCode);
} }
return responseBody.Adapt<TResult>(); return apiResult.Adapt<TResult>();
} }
} }