{"record":{"id":"5de0af3eb5175ecc","repo":"paascloud/paascloud-master","slug":"uac10015004","errorCode":"UAC10015004","errorMessage":"找不到组织信息,groupId=%s","messagePattern":"找不到组织信息,groupId=(.+?)","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":154,"sourceCode":"\t\t\t\tresult = uacGroupMapper.updateByPrimaryKeySelective(childGroup);\n\t\t\t\tif (result < 1) {\n\t\t\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10015006, uacGroup1.getId());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\t@Override\n\tpublic int deleteUacGroupById(Long id) {\n\n\t\tPreconditions.checkArgument(id != null, \"组织id为空\");\n\t\tPreconditions.checkArgument(!Objects.equals(id, GlobalConstant.Sys.SUPER_MANAGER_GROUP_ID), \"该组织不能删除\");\n\n\t\t// 根据前台传入的组织参数校验该组织是否存在\n\t\tUacGroup uacGroup = uacGroupMapper.selectByPrimaryKey(id);\n\t\tif (PublicUtil.isEmpty(uacGroup)) {\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10015004, id);\n\t\t}\n\t\t//判断该组织下是否存在子节点\n\t\tUacGroup childGroup = new UacGroup();\n\t\tchildGroup.setPid(id);\n\t\tList<UacGroup> childGroupList = uacGroupMapper.select(childGroup);\n\t\tif (PublicUtil.isNotEmpty(childGroupList)) {\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10015007, id);\n\t\t}\n\t\t//判断该组织下是否存在用户\n\t\tUacGroupUser uacGroupUser = new UacGroupUser();\n\t\tuacGroupUser.setGroupId(id);\n\t\tList<UacGroupUser> uacGroupUserList = uacGroupUserMapper.select(uacGroupUser);\n\t\tif (PublicUtil.isNotEmpty(uacGroupUserList)) {\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10015008, id);\n\t\t}\n\n\t\treturn mapper.deleteByPrimaryKey(id);\n\t}","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/paascloud/paascloud-master/blob/781281a9503332ed3cef44ea618349d14230a127/paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacGroupServiceImpl.java#L136-L172","documentation":"UAC10015004 (\"找不到组织信息,groupId=%s\") is thrown by deleteUacGroupById when the group id to delete does not exist in uac_group. The preconditions (non-null id, not the super-manager group) pass, but selectByPrimaryKey(id) returns empty so the delete aborts.","triggerScenarios":"Calling deleteUacGroupById(id) with a non-existent id, an id already deleted in a concurrent request, or an id from another environment/datasource.","commonSituations":"Double-click delete causing the second request to hit an already-removed row; stale client tree after another admin deleted the group; hardcoded/seed ids not present in the target database.","solutions":["Check existence with SELECT * FROM uac_group WHERE id = <id> before deleting","Handle UacBizException UAC10015004 idempotently — treat 'already deleted' as success in the UI flow","Refresh the client's group tree after each delete to avoid stale ids"],"exampleFix":"// before\nuacGroupService.deleteUacGroupById(groupId);\n// after\ntry {\n    uacGroupService.deleteUacGroupById(groupId);\n} catch (UacBizException e) {\n    if (ErrorCodeEnum.UAC10015004.getCode().equals(e.getCode())) {\n        return; // already deleted; idempotent success\n    }\n    throw e;\n}","handlingStrategy":"try-catch","validationCode":"UacGroup g = uacGroupMapper.selectByPrimaryKey(id);\nif (g == null) { return; /* already deleted — idempotent */ }","typeGuard":"if (id == null || Objects.equals(id, GlobalConstant.Sys.SUPER_MANAGER_GROUP_ID)) { return; }","tryCatchPattern":"try {\n    uacGroupService.deleteUacGroupById(id);\n} catch (UacBizException e) {\n    if (ErrorCodeEnum.UAC10015004.getCode().equals(e.getCode())) { /* treat as already-deleted success */ }\n    else throw e;\n}","preventionTips":["Make delete operations idempotent on the client","Refresh the group tree after any delete","Never reuse ids copied from other environments"],"tags":["mybatis","organization","not-found","delete"],"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-16T04:17:20.429Z"}