fix .
This commit is contained in:
@@ -173,24 +173,25 @@ public class GainfoUpdateService : IGainfoUpdateService
|
||||
|
||||
private async Task InsertPersonAsync(GainfoSapEntity item)
|
||||
{
|
||||
await _dbContext.InsertAsync(item);
|
||||
var info = GainfoSapToGainfo(item);
|
||||
await _dbContext.UseTransactionAsync(async () =>
|
||||
{
|
||||
await _dbContext.InsertAsync(item);
|
||||
var info = GainfoSapToGainfo(item);
|
||||
|
||||
if (item.isowner == "T")
|
||||
{
|
||||
var insertable = _dbContext.Client.Insertable(info);
|
||||
_logger.LogWarning("sql:{sql}", insertable.ToSqlString());
|
||||
await insertable.ExecuteCommandAsync();
|
||||
await _identityUserSyncService.SyncAccountAsync(info.Code, info.Name, info.IdNo, info.Factory);
|
||||
await _gainfoPermissionService.ResetPermissionsAsync(info.No, DeviceTaskEnumType.Add, null, "入职生成");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!await _dbContext.Queryable<GainfoLeaveEntity>().AnyAsync(x => x.Code == item.ename))
|
||||
if (item.isowner == "T")
|
||||
{
|
||||
await _dbContext.Client.Insertable(info).AS("GainfoLeave").ExecuteCommandAsync();
|
||||
await _dbContext.InsertAsync(info);
|
||||
await _identityUserSyncService.SyncAccountAsync(info.Code, info.Name, info.IdNo, info.Factory);
|
||||
await _gainfoPermissionService.ResetPermissionsAsync(info.No, DeviceTaskEnumType.Add, null, "入职生成");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!await _dbContext.Queryable<GainfoLeaveEntity>().AnyAsync(x => x.Code == item.ename))
|
||||
{
|
||||
await _dbContext.Client.Insertable(info).AS("GainfoLeave").ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private GainfoEntity GainfoSapToGainfo(GainfoSapEntity item)
|
||||
|
||||
@@ -23,7 +23,7 @@ public class DhResultHandler : IRemoteCallResultHandler
|
||||
throw new HttpRequestException(statusCode + " " + (int)statusCode);
|
||||
}
|
||||
|
||||
return responseBody.Adapt<TResult>();
|
||||
return apiResult.Adapt<TResult>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user