{"record":{"id":"4a55355fc0f4023e","repo":"paascloud/paascloud-master","slug":"uac10015001","errorCode":"UAC10015001","errorMessage":"UAC10015001","messagePattern":"UAC10015001","errorType":"error_code","errorClass":"UacBizException","httpStatus":null,"severity":"error","filePath":"paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacGroupServiceImpl.java","lineNumber":83,"sourceCode":"\t}\n\n\tprivate int editUacGroup(UacGroup group) {\n\t\treturn uacGroupMapper.updateByPrimaryKeySelective(group);\n\t}\n\n\t@Override\n\tpublic int updateUacGroupStatusById(IdStatusDto idStatusDto, LoginAuthDto loginAuthDto) {\n\n\t\tLong groupId = idStatusDto.getId();\n\t\tInteger status = idStatusDto.getStatus();\n\n\t\tUacGroup uacGroup = new UacGroup();\n\t\tuacGroup.setId(groupId);\n\t\tuacGroup.setStatus(status);\n\n\t\tUacGroup group = uacGroupMapper.selectByPrimaryKey(groupId);\n\t\tif (PublicUtil.isEmpty(group)) {\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10015001, groupId);\n\t\t}\n\t\tif (!UacGroupStatusEnum.contains(status)) {\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10015002);\n\t\t}\n\n\t\t//查询所有的组织\n\t\tList<UacGroup> totalGroupList = uacGroupMapper.selectAll();\n\t\tList<GroupZtreeVo> totalList = Lists.newArrayList();\n\t\tGroupZtreeVo zTreeVo;\n\t\tfor (UacGroup vo : totalGroupList) {\n\t\t\tzTreeVo = new GroupZtreeVo();\n\t\t\tzTreeVo.setId(vo.getId());\n\t\t\ttotalList.add(zTreeVo);\n\t\t}\n\n\t\tUacGroupUser uacGroupUser = new UacGroupUser();\n\t\tuacGroupUser.setUserId(loginAuthDto.getUserId());\n\t\tUacGroupUser groupUser = uacGroupUserMapper.selectOne(uacGroupUser);","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/paascloud/paascloud-master/blob/781281a9503332ed3cef44ea618349d14230a127/paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacGroupServiceImpl.java#L65-L101","documentation":"UAC10015001 (\"找不到组织信息,groupId=%s\") is thrown by UacGroupServiceImpl when an organization (group) with the given groupId cannot be found in the database. The service loads the group via uacGroupMapper.selectByPrimaryKey(groupId) and throws this business exception if the lookup returns empty, aborting the status update before any modification.","triggerScenarios":"Calling updateUacGroupStatusById(groupId, status) with a groupId that does not exist in the uac_group table, a groupId referencing a row already deleted by another user/transaction, or a stale groupId passed from the client after the group was removed.","commonSituations":"Front-end pages caching a group tree that was deleted server-side; concurrent admin operations where one admin deletes a group while another enables/disables it; test/seed data cleaned up between runs; copying a groupId from a different environment database.","solutions":["Verify the groupId exists: SELECT * FROM uac_group WHERE id = <groupId>; before calling the API","Refresh the group list/tree in the client so it does not reference deleted groups","Handle UacBizException code UAC10015001 in the caller and surface a 'group not found, please refresh' message","Check environment/tenant: ensure the groupId belongs to the database the service is connected to"],"exampleFix":"// before\nuacGroupService.updateUacGroupStatusById(9999L, UacGroupStatusEnum.DISABLE.getStatus());\n// after\nUacGroup group = uacGroupService.queryUacGroupByGroupId(9999L); // or check via mapper first\nif (group == null) {\n    throw new UacBizException(ErrorCodeEnum.UAC10015001, 9999L); // or return friendly error to UI\n}\nuacGroupService.updateUacGroupStatusById(9999L, UacGroupStatusEnum.DISABLE.getStatus());","handlingStrategy":"validation","validationCode":"// Java, before calling the API\nUacGroup g = uacGroupMapper.selectByPrimaryKey(groupId);\nif (g == null) {\n    throw new IllegalArgumentException(\"Group not found: \" + groupId);\n}\nuacGroupService.updateUacGroupStatusById(groupId, status);","typeGuard":"if (groupId == null || groupId <= 0L) { throw new IllegalArgumentException(\"invalid groupId\"); }","tryCatchPattern":"try {\n    uacGroupService.updateUacGroupStatusById(groupId, status);\n} catch (UacBizException e) {\n    if (ErrorCodeEnum.UAC10015001.getCode().equals(e.getCode())) { /* group missing: refresh & inform user */ }\n    else throw e;\n}","preventionTips":["Always fetch the group by id before mutating it","Refresh client-side group trees after delete operations","Never hardcode groupIds across environments"],"tags":["mybatis","organization","not-found","business-exception"],"backgroundTag":"resource-not-found","analyzedSha":"781281a9503332ed3cef44ea618349d14230a127","analyzedAt":"2026-09-10T10:59:02.070Z","contentChangedAt":"2026-09-10T10:59:02.070Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}