{"record":{"id":"134db8fc019176cf","repo":"jeecgboot/JeecgBoot","slug":"error-134db8","errorCode":null,"errorMessage":"当前用户不存在，请核对手机号","messagePattern":"当前用户不存在，请核对手机号","errorType":"exception","errorClass":"JeecgBootException","httpStatus":null,"severity":"error","filePath":"jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysTenantServiceImpl.java","lineNumber":117,"sourceCode":"\n    @Override\n    public boolean removeTenantById(String id) {\n        // 查找出已被关联的用户数量\n        return super.removeById(Integer.parseInt(id));\n    }\n\n    @Override\n    @CacheEvict(value={CacheConstant.SYS_USERS_CACHE}, allEntries=true)\n    public void invitationUserJoin(String ids, String phone,String username) {\n        String[] idArray = ids.split(SymbolConstant.COMMA);\n        String userId = null;\n        SysUser userByPhone = null;\n        // 代码逻辑说明: 【QQYUN-4605】后台的邀请谁加入租户，没办法选不是租户下的用户，通过手机号邀请------------\n        if(oConvertUtils.isNotEmpty(phone)){\n            userByPhone = userService.getUserByPhone(phone);\n            //说明用户不存在\n            if(null == userByPhone){\n                throw new JeecgBootException(\"当前用户不存在，请核对手机号\");\n            }\n            userId = userByPhone.getId();\n        }else{\n            userByPhone = userService.getUserByName(username);\n            //说明用户不存在\n            if(null == userByPhone){\n                throw new JeecgBootException(\"当前用户不存在，请核对手机号\");\n            }\n            userId = userByPhone.getId();\n        }\n\n        //循环租户id\n        for (String id:idArray) {\n            //获取被邀请人是否已存在\n            SysUserTenant userTenant = userTenantMapper.getUserTenantByTenantId(userId, Integer.valueOf(id));\n            if(null == userTenant){\n                SysUserTenant relation = new SysUserTenant();\n                relation.setUserId(userId);","sourceCodeStart":99,"sourceCodeEnd":135,"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#L99-L135","documentation":"Thrown by SysTenantServiceImpl.invitationUserJoin in the phone branch: userService.getUserByPhone(phone) returns null, meaning no system account is registered with that phone number. invitationUserJoin invites an existing platform user into one or more tenants, so a non-existent user cannot be invited.","triggerScenarios":"Calling the invitation endpoint with a phone number that has no matching SysUser record (oConvertUtils.isNotEmpty(phone) is true, so the phone branch is taken). The ids param is a comma-joined list of tenant IDs to invite the user into.","commonSituations":"Typo in the phone number; the invitee registered with a different phone; the user was soft-deleted; phone stored with a country code or formatting mismatch (e.g. +86 prefix vs bare digits); testing with a fabricated number.","solutions":["Verify the phone number digit-for-digit against the user's profile; correct typos and re-submit.","Confirm the user has not been logically deleted (check sys_user delete_flag).","Normalize phone format (strip spaces, country code, dashes) before lookup to match stored format.","If the user genuinely doesn't exist, create the account first, then invite."],"exampleFix":"// before\ntenantService.invitationUserJoin(tenantIds, phone, \"\");\n\n// after\nSysUser found = userService.getUserByPhone(normalizePhone(phone));\nif (found == null) {\n    return Result.error(\"未找到该手机号对应的用户，请确认号码或先注册账号\");\n}\ntenantService.invitationUserJoin(tenantIds, phone, \"\");","handlingStrategy":"validation","validationCode":"SysUser found = userService.getUserByPhone(normalizePhone(phone));\nif (found == null) {\n    return Result.error(\"未找到该手机号用户，请确认或先注册\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Normalize phone format (strip +86, spaces, dashes) before lookup.","Verify the number with the invitee out-of-band before submitting.","Confirm the user isn't soft-deleted (delete_flag)."],"tags":["tenant","invitation","user-lookup","jeecg-boot"],"backgroundTag":null,"analyzedSha":"96fb33f5ec68516da0b0147da06b2eb0419e063a","analyzedAt":"2026-08-14T00:04:16.786Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}