fix 处理离职下发问题
This commit is contained in:
@@ -9,6 +9,7 @@ using Dlhis.ScheduledTask.Common.Dto;
|
||||
using Dlhis.ScheduledTask.Common.Comparers;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Dlhis.Basic.Api.Dtos;
|
||||
using Microsoft.AspNetCore.Mvc.Formatters;
|
||||
|
||||
namespace Dlhis.ScheduledTask.Common.Services.Implements;
|
||||
|
||||
@@ -17,6 +18,7 @@ public class GainfoUpdateService : IGainfoUpdateService
|
||||
private readonly IDbContext _dbContext;
|
||||
private readonly ILogger<GainfoUpdateService> _logger;
|
||||
private readonly ITenantApi _tenantApi;
|
||||
private readonly IBusinessPlacePermissionsApi _businessPlacePermissionsApi;
|
||||
private readonly IDevicePermissionApi _devicePermissionApi;
|
||||
private readonly IJinkoSapService _jinkoSapService;
|
||||
|
||||
@@ -27,6 +29,7 @@ public class GainfoUpdateService : IGainfoUpdateService
|
||||
public GainfoUpdateService(IDbContext dbContext,
|
||||
ILogger<GainfoUpdateService> logger,
|
||||
ITenantApi tenantApi,
|
||||
IBusinessPlacePermissionsApi businessPlacePermissionsApi,
|
||||
IDevicePermissionApi devicePermissionApi,
|
||||
IJinkoSapService jinkoSapService)
|
||||
{
|
||||
@@ -34,6 +37,7 @@ public class GainfoUpdateService : IGainfoUpdateService
|
||||
_dbContext.Client.QueryFilter.Clear();
|
||||
_logger = logger;
|
||||
_tenantApi = tenantApi;
|
||||
_businessPlacePermissionsApi = businessPlacePermissionsApi;
|
||||
_devicePermissionApi = devicePermissionApi;
|
||||
_jinkoSapService = jinkoSapService;
|
||||
}
|
||||
@@ -334,8 +338,22 @@ public class GainfoUpdateService : IGainfoUpdateService
|
||||
}
|
||||
else
|
||||
{
|
||||
//离职
|
||||
if (gainfo != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
await _businessPlacePermissionsApi.ResetAsync(new Basic.Api.Request.GainfoPermissionResetRequest
|
||||
{
|
||||
IsLeave = true,
|
||||
UserNo = gainfo.No
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "离职任务生成失败:{message}", ex.Message);
|
||||
}
|
||||
|
||||
//先写入离职表
|
||||
gainfo.IdentityUserId = (int)gainfo.Id;
|
||||
gainfo.Id = 0;
|
||||
|
||||
Reference in New Issue
Block a user