{"record":{"id":"448004e6b1644dd0","repo":"jeecgboot/JeecgBoot","slug":"error-448004","errorCode":null,"errorMessage":"管理员已拒绝您加入租户,请联系租户管理员","messagePattern":"管理员已拒绝您加入租户,请联系租户管理员","errorType":"exception","errorClass":"JeecgBootBizTipException","httpStatus":null,"severity":"warning","filePath":"jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysTenantServiceImpl.java","lineNumber":243,"sourceCode":"    @CacheEvict(value={CacheConstant.SYS_USERS_CACHE}, allEntries=true)\n    public Integer joinTenantByHouseNumber(SysTenant sysTenant, String userId) {\n        LambdaQueryWrapper<SysTenant> query = new LambdaQueryWrapper<>();\n        query.eq(SysTenant::getHouseNumber,sysTenant.getHouseNumber());\n        SysTenant one = this.getOne(query);\n        //需要返回租户id(用于前台更新缓存),返回0则代表当前租户门牌号不存在\n        if(null == one){\n            return 0;\n        }else{\n            LambdaQueryWrapper<SysUserTenant> relationQuery = new LambdaQueryWrapper<>();\n            relationQuery.eq(SysUserTenant::getTenantId,one.getId());\n            relationQuery.eq(SysUserTenant::getUserId,userId);\n            SysUserTenant relation = userTenantMapper.selectOne(relationQuery);\n            if(relation != null){\n                String msg = \"\";\n                if(CommonConstant.USER_TENANT_UNDER_REVIEW.equals(relation.getStatus())){\n                    msg = \",状态:审核中\";\n                }else if(CommonConstant.USER_TENANT_REFUSE.equals(relation.getStatus())){\n                    throw new JeecgBootBizTipException(\"管理员已拒绝您加入租户,请联系租户管理员\");\n                }else if(CommonConstant.USER_TENANT_QUIT.equals(relation.getStatus())){\n                    msg = \",状态:已离职\";\n                }\n                throw new JeecgBootBizTipException(\"您已是该租户成员\"+msg);\n            }\n            //用户加入门牌号审核中状态\n            SysUserTenant tenant = new SysUserTenant();\n            tenant.setTenantId(one.getId());\n            tenant.setUserId(userId);\n            tenant.setStatus(CommonConstant.USER_TENANT_UNDER_REVIEW);\n            userTenantMapper.insert(tenant);\n\n            // QQYUN-4526【应用】组织加入通知\n            sendMsgForApplyJoinTenant(userId, one);\n            return tenant.getTenantId();\n        }\n    }\n","sourceCodeStart":225,"sourceCodeEnd":261,"githubUrl":"https://github.com/jeecgboot/JeecgBoot/blob/96fb33f5ec68516da0b0147da06b2eb0419e063a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysTenantServiceImpl.java#L225-L261","documentation":"Thrown during the 'apply to join tenant' flow when an existing SysUserTenant relation is found with status USER_TENANT_REFUSE — an admin previously rejected the user's join request. JeecgBootBizTipException is used so the message is shown verbatim. This is a hard stop; the user cannot self-rejoin without admin action.","triggerScenarios":"A user applies to join a tenant (the method that builds the under-review relation) but a prior relation row already exists with status = refuse. The branch throws immediately rather than re-creating the application.","commonSituations":"User was rejected, then immediately tries to apply again; admin rejected then the user retries from another client; stale 'refuse' row not cleared after a policy change.","solutions":["Contact the tenant administrator to re-issue an invitation or reset the relation status.","Admin can delete the refused SysUserTenant row so the user can submit a fresh application.","Admin can update the relation status to under-review to re-open the application.","If the refusal was erroneous, admin flips status to normal/active to admit the user."],"exampleFix":"// No caller-side fix; this is a policy gate. Admin action required.\n// Admin reset example (DB or service layer):\n// UPDATE sys_tenant_user_relation SET status = 'underReview' WHERE user_id=? AND tenant_id=?;","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    sysTenantService.applyJoinTenant(tenantId);\n} catch (JeecgBootBizTipException e) {\n    if (e.getMessage().contains(\"已拒绝\")) {\n        return Result.error(\"您的申请已被拒绝，请联系租户管理员\");\n    }\n    throw e;\n}","preventionTips":["Admin must reset/delete the refused relation before the user can reapply.","Frontend should disable re-apply for tenants in 'refused' state.","Communicate the refusal reason to the user."],"tags":["tenant","authorization","state-conflict","jeecg-boot"],"backgroundTag":null,"analyzedSha":"96fb33f5ec68516da0b0147da06b2eb0419e063a","analyzedAt":"2026-08-14T00:04:16.786Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}