{"record":{"id":"4109f8fdb294e2a6","repo":"paascloud/paascloud-master","slug":"uac10011011","errorCode":"UAC10011011","errorMessage":"ErrorCodeEnum.UAC10011011","messagePattern":"ErrorCodeEnum\\.UAC10011011","errorType":"error_code","errorClass":"UacBizException","httpStatus":null,"severity":"error","filePath":"paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacUserServiceImpl.java","lineNumber":268,"sourceCode":"\t@Override\n\t@Transactional(readOnly = true, rollbackFor = Exception.class)\n\tpublic List<UacLog> queryUserLogListWithUserId(Long userId) {\n\t\tif (PublicUtil.isEmpty(userId)) {\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10011001);\n\t\t}\n\t\treturn uacLogService.selectUserLogListByUserId(userId);\n\t}\n\n\t@Override\n\tpublic int modifyUserStatusById(UacUser uacUser, LoginAuthDto authResDto) {\n\t\tLong loginUserId = authResDto.getUserId();\n\t\tLong userId = uacUser.getId();\n\t\tif (loginUserId.equals(userId)) {\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10011023);\n\t\t}\n\t\tUacUser u = uacUserMapper.selectByPrimaryKey(userId);\n\t\tif (u == null) {\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10011011, userId);\n\t\t}\n\n\t\t// 更新用户最后修改人与修改时间\n\t\tuacUser.setVersion(u.getVersion() + 1);\n\t\tuacUser.setUpdateInfo(authResDto);\n\t\treturn uacUserMapper.updateByPrimaryKeySelective(uacUser);\n\t}\n\n\t@Override\n\tpublic void bindUserRoles(BindUserRolesDto bindUserRolesDto, LoginAuthDto authResDto) {\n\n\t\tif (bindUserRolesDto == null) {\n\t\t\tlogger.error(\"参数不能为空\");\n\t\t\tthrow new IllegalArgumentException(\"参数不能为空\");\n\t\t}\n\n\t\tLong operUserId = bindUserRolesDto.getUserId();\n\t\tLong loginUserId = authResDto.getUserId();","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/paascloud/paascloud-master/blob/781281a9503332ed3cef44ea618349d14230a127/paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacUserServiceImpl.java#L250-L286","documentation":"UacBizException with ErrorCodeEnum.UAC10011011 (\"用户不存在, userId=%\") is thrown by UacUserServiceImpl.modifyUserStatusById when uacUserMapper.selectByPrimaryKey(userId) returns null — the target user id does not correspond to any row in uac_user.","triggerScenarios":"Calling modifyUserStatusById with a UacUser whose id references a deleted or never-existing user, or an id from another data source/environment.","commonSituations":"Stale frontend list where the row was deleted by another admin; hard-coded or copied userId in a script/test; cross-environment data (test id used against prod DB); soft-deleted user filtered out by a logic-delete plugin.","solutions":["Verify the userId exists (selectByPrimaryKey or the user-detail API) before calling modifyUserStatusById","Refresh the user list on the client after delete operations to avoid stale ids","Check whether the user is soft-deleted (logic delete flag) and use the tool's undelete path if needed","Catch UacBizException code 10011011 and show 'user not found, list may be outdated — please refresh'"],"exampleFix":"// before\nUacUser target = new UacUser();\ntarget.setId(request.getUserId());\ntarget.setStatus(status);\nuacUserService.modifyUserStatusById(target, authResDto);\n// after\nif (uacUserMapper.selectByPrimaryKey(request.getUserId()) != null) {\n    UacUser target = new UacUser();\n    target.setId(request.getUserId());\n    target.setStatus(status);\n    uacUserService.modifyUserStatusById(target, authResDto);\n}","handlingStrategy":"validation","validationCode":"UacUser u = uacUserMapper.selectByPrimaryKey(userId);\nif (u == null) {\n    throw new BusinessException(\"user not found: \" + userId);\n}","typeGuard":"UacUser u = uacUserMapper.selectByPrimaryKey(userId);\nif (u != null) {\n    uacUserService.modifyUserStatusById(uacUser, authResDto);\n}","tryCatchPattern":"try {\n    uacUserService.modifyUserStatusById(uacUser, authResDto);\n} catch (UacBizException e) {\n    if (e.getCode() == 10011011) { /* refresh list, report user not found */ }\n    else throw e;\n}","preventionTips":["Refresh lists after deletes to avoid stale ids","Verify existence via user-detail API before mutations","Watch for soft-deleted rows invisible to queries"],"tags":["record-not-found","user-management","stale-data"],"backgroundTag":"record-not-found","analyzedSha":"781281a9503332ed3cef44ea618349d14230a127","analyzedAt":"2026-09-10T10:59:02.070Z","contentChangedAt":"2026-09-10T10:59:02.070Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}