| | |
| | | // 检查是否是实验管理者 |
| | | int roleTag = 0; |
| | | UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); |
| | | for (SysUserRoleBindDomainDTO role : user.getRoles()) { |
| | | if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){ |
| | | roleTag = 1; |
| | | } |
| | | } |
| | | if (roleTag ==0 ){ |
| | | throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无权添加实验评估计划"); |
| | | } |
| | | //20241107修改注释 |
| | | // for (SysUserRoleBindDomainDTO role : user.getRoles()) { |
| | | // if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){ |
| | | // roleTag = 1; |
| | | // } |
| | | // } |
| | | // if (roleTag ==0 ){ |
| | | // throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无权添加实验评估计划"); |
| | | // } |
| | | if (ObjectUtils.isEmpty(user)){ |
| | | throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户不存在或已被删除"); |
| | | } |
| | |
| | | // 检查是否是实验管理者 |
| | | int roleTag = 0; |
| | | UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); |
| | | for (SysUserRoleBindDomainDTO role : user.getRoles()) { |
| | | if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){ |
| | | roleTag = 1; |
| | | } |
| | | } |
| | | if (roleTag ==0 ){ |
| | | throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无权修改实验评估计划"); |
| | | } |
| | | //20241107修改注释 |
| | | // for (SysUserRoleBindDomainDTO role : user.getRoles()) { |
| | | // if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){ |
| | | // roleTag = 1; |
| | | // } |
| | | // } |
| | | // if (roleTag ==0 ){ |
| | | // throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无权修改实验评估计划"); |
| | | // } |
| | | //参数校验 |
| | | if (ObjectUtils.isEmpty(updateParam)){ |
| | | throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "要求改的参数为空"); |
| | |
| | | // 检查是否是实验管理者 |
| | | int roleTag = 0; |
| | | UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); |
| | | for (SysUserRoleBindDomainDTO role : user.getRoles()) { |
| | | if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){ |
| | | roleTag = 1; |
| | | } |
| | | } |
| | | if (roleTag ==0 ){ |
| | | throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无权删除实验评估计划"); |
| | | } |
| | | //20241107注释 |
| | | // for (SysUserRoleBindDomainDTO role : user.getRoles()) { |
| | | // if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){ |
| | | // roleTag = 1; |
| | | // } |
| | | // } |
| | | // if (roleTag ==0 ){ |
| | | // throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无权删除实验评估计划"); |
| | | // } |
| | | UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); |
| | | if (ObjectUtils.isEmpty(userInfoById)){ |
| | | throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户不存在或已被删除"); |