heheng
2024-11-07 3ca43826a747fda1447b2501901f84fc1a9019dd
src/main/java/com/gkhy/labRiskManage/application/riskReport/service/impl/RiskAccessAppServiceImpl.java
@@ -607,14 +607,15 @@
        }
        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 != 1){
            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户不是管理人员,无权限添加");
        }
//        for (SysUserRoleBindDomainDTO role : user.getRoles()) {
//            if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){
//                roleTag = 1;
//            }
//        }
        //20241107修改注释权限
//        if (roleTag != 1){
//            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户不是管理人员,无权限添加");
//        }
        if (ObjectUtils.isEmpty(riskUnitInsertReqBO.getExperimentId())){
            throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "所选实验不能为空");
        }
@@ -715,14 +716,15 @@
        }
        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 != 1){
            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户不是管理人员,无权限修改");
        }
//        for (SysUserRoleBindDomainDTO role : user.getRoles()) {
//            if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){
//                roleTag = 1;
//            }
//        }
        //20241107修改注释权限
//        if (roleTag != 1){
//            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户不是管理人员,无权限修改");
//        }
        if (ObjectUtils.isEmpty(updateReqBO.getExperimentId())){
            throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "所选实验不能为空,或实验已被删除");
        }
@@ -764,14 +766,15 @@
        }
        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 != 1){
            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 != 1){
//            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户不是管理人员,无权限添加");
//        }
        RiskUnitDeleteDTO deleteResult = riskUnitService.deleteRiskUnit(currentUserId, id);
        if (ObjectUtils.isEmpty(deleteResult)){