作者 郑周

1. 获取员工考核结果,增加超级管理员

... ... @@ -1937,18 +1937,22 @@ func (srv *SummaryEvaluationService) ListAllEvaluationFinish(param *command.Quer
defer func() {
_ = transactionContext.RollbackTransaction()
}()
//判断是否是hrbp
// 判断是否是hrbp
flagHrbp, err := roleService.GetHrBp(transactionContext, param.CompanyId, param.UserId)
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
if flagHrbp != domain.RoleTypeSystem {
// 判断是否是超级管理员
superAdminFlag, err := roleService.GetSuperAdmin(transactionContext, param.CompanyId, param.UserId)
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
// 不是HRBP 或 超级管理员
if flagHrbp != domain.RoleTypeSystem && superAdminFlag != domain.RoleTypeSuperAdmin {
return tool_funs.SimpleWrapGridMap(0, []string{}), nil
}
//判断是否是上级
userRepo := factory.CreateUserRepository(map[string]interface{}{
"transactionContext": transactionContext,
})
userRepo := factory.CreateUserRepository(map[string]interface{}{"transactionContext": transactionContext})
_, parentUser, _ := userRepo.Find(map[string]interface{}{
"parentId": param.UserId,
... ...