jeecgboot/JeecgBoot · warning · JeecgBootBizTipException

您已是该租户成员{msg}

Error message

您已是该租户成员{msg}

What it means

Thrown in the same apply-to-join flow when an existing relation is found with status under-review (审核中) or quit (已离职). The msg variable is appended (',状态:审核中' or ',状态:已离职') so the user knows the precise existing state. Note the 'refuse' status is handled by a separate throw (error 207).

Source

Thrown at jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysTenantServiceImpl.java:247

        SysTenant one = this.getOne(query);
        //需要返回租户id(用于前台更新缓存),返回0则代表当前租户门牌号不存在
        if(null == one){
            return 0;
        }else{
            LambdaQueryWrapper<SysUserTenant> relationQuery = new LambdaQueryWrapper<>();
            relationQuery.eq(SysUserTenant::getTenantId,one.getId());
            relationQuery.eq(SysUserTenant::getUserId,userId);
            SysUserTenant relation = userTenantMapper.selectOne(relationQuery);
            if(relation != null){
                String msg = "";
                if(CommonConstant.USER_TENANT_UNDER_REVIEW.equals(relation.getStatus())){
                    msg = ",状态:审核中";
                }else if(CommonConstant.USER_TENANT_REFUSE.equals(relation.getStatus())){
                    throw new JeecgBootBizTipException("管理员已拒绝您加入租户,请联系租户管理员");
                }else if(CommonConstant.USER_TENANT_QUIT.equals(relation.getStatus())){
                    msg = ",状态:已离职";
                }
                throw new JeecgBootBizTipException("您已是该租户成员"+msg);
            }
            //用户加入门牌号审核中状态
            SysUserTenant tenant = new SysUserTenant();
            tenant.setTenantId(one.getId());
            tenant.setUserId(userId);
            tenant.setStatus(CommonConstant.USER_TENANT_UNDER_REVIEW);
            userTenantMapper.insert(tenant);

            // QQYUN-4526【应用】组织加入通知
            sendMsgForApplyJoinTenant(userId, one);
            return tenant.getTenantId();
        }
    }

    @Override
    public Integer countCreateTenantNum(String userId) {
        return this.userTenantMapper.countCreateTenantNum(userId);
    }

View on GitHub (pinned to 96fb33f5ec)

Solutions

  1. If status is under-review, wait for admin approval instead of re-applying.
  2. If status is quit, ask the admin to reset the relation (delete the row or change status) so a fresh application can be created.
  3. Frontend should disable the 'apply' button when a relation already exists for that tenant.
  4. Admin reviews sys_user_tenant for the user/tenant pair and resolves the stale state.

Example fix

// before (user keeps clicking apply)
sysTenantService.applyJoinTenant(tenantId);

// after (frontend guard)
const existing = await checkExistingRelation(tenantId);
if (existing) {
    notify(`您已是该组织成员,状态:${statusLabel(existing.status)}`);
    return;
}
sysTenantService.applyJoinTenant(tenantId);
Defensive patterns

Strategy: validation

Validate before calling

SysUserTenant rel = userTenantMapper.getUserTenantByTenantId(userId, tenantId);
if (rel != null) {
    return Result.ok("已有关系,状态:" + statusLabel(rel.getStatus()));
}

Try / catch

try {
    sysTenantService.applyJoinTenant(tenantId);
} catch (JeecgBootBizTipException e) {
    if (e.getMessage().contains("已是该租户成员")) {
        return Result.error(e.getMessage()); // show the appended status
    }
    throw e;
}

Prevention

When it happens

Trigger: Applying to join a tenant where the user already has a relation that is either pending review or marked as resigned/quit. The method builds msg then throws a single consolidated JeecgBootBizTipException.

Common situations: User already applied and is waiting for approval then clicks apply again; a former employee (quit status) tries to rejoin without admin resetting the relation.

Related errors


AI-assisted analysis of jeecgboot/JeecgBoot@96fb33f5ec (2026-08-14). Data as JSON: /api/errors/62a06ecf04630a70. Report an issue: GitHub.