相关问题修复
This commit is contained in:
@@ -6,19 +6,16 @@ namespace SimpleAdmin.Application;
|
||||
public class OnboardingAuditService : IOnboardingAuditService
|
||||
{
|
||||
private readonly SqlSugarScope _db;
|
||||
private readonly IConfigService _config;
|
||||
private readonly IOnboardingContractSnapshotService _snapshotService;
|
||||
private readonly IOnboardingEmployeeContractSnapshotService _employeeContractSnapshotService;
|
||||
private readonly IOnboardingDataPermissionService _dataPermission;
|
||||
|
||||
public OnboardingAuditService(
|
||||
IConfigService config,
|
||||
IOnboardingContractSnapshotService snapshotService,
|
||||
IOnboardingEmployeeContractSnapshotService employeeContractSnapshotService,
|
||||
IOnboardingDataPermissionService dataPermission)
|
||||
{
|
||||
_db = DbContext.DB;
|
||||
_config = config;
|
||||
_snapshotService = snapshotService;
|
||||
_employeeContractSnapshotService = employeeContractSnapshotService;
|
||||
_dataPermission = dataPermission;
|
||||
@@ -137,11 +134,8 @@ public class OnboardingAuditService : IOnboardingAuditService
|
||||
if (task.CreateUserId.HasValue && task.CreateUserId != UserManager.UserId)
|
||||
{
|
||||
await _db.Updateable<ObEmployee>()
|
||||
.SetColumns(item => new ObEmployee
|
||||
{
|
||||
CreateUserId = task.CreateUserId,
|
||||
CreateUser = task.CreateUser
|
||||
})
|
||||
.SetColumns(item => item.CreateUserId == task.CreateUserId)
|
||||
.SetColumns(item => item.CreateUser == task.CreateUser)
|
||||
.Where(item => item.Id == employee.Id)
|
||||
.ExecuteCommandAsync();
|
||||
|
||||
@@ -227,20 +221,6 @@ public class OnboardingAuditService : IOnboardingAuditService
|
||||
OnboardingPermissionCodes.TaskManageAll,
|
||||
"入职任务");
|
||||
|
||||
// 人事管理员/超级管理员可处理全部任务;普通人事还必须属于配置的审核人。
|
||||
if (await _dataPermission.CanManage(null, OnboardingPermissionCodes.TaskManageAll))
|
||||
return task;
|
||||
|
||||
var config = await _config.GetByConfigKey(CateGoryConst.CONFIG_BIZ_DEFINE, "onboard.reviewer.userIds")
|
||||
?? throw Oops.Bah("请配置入职审核人");
|
||||
// 审核人由全局配置与公司专属配置合并得出,不依赖独立业务表。
|
||||
var reviewerIds = OnboardingReviewerConfigParser.Parse(config.ConfigValue, task.CompanyId);
|
||||
|
||||
if (!reviewerIds.Contains(UserManager.UserId))
|
||||
{
|
||||
throw Oops.Bah("您不是该入职任务的审核人");
|
||||
}
|
||||
|
||||
return task;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user