{"record":{"id":"d38e709763be094d","repo":"paascloud/paascloud-master","slug":"uac10014002","errorCode":"UAC10014002","errorMessage":"UAC10014002","messagePattern":"UAC10014002","errorType":"error_code","errorClass":"UacBizException","httpStatus":null,"severity":"error","filePath":"paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacActionServiceImpl.java","lineNumber":87,"sourceCode":"\t\tUacAction uacAction = uacActionMapper.selectByPrimaryKey(actionId);\n\t\tif (uacAction == null) {\n\t\t\tlogger.error(\"找不到权限信息 actionId={}\", actionId);\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10014001, actionId);\n\t\t}\n\n\t\t// 删除角色权限表数据  不查询了 直接删除了\n\t\tuacRoleActionMapper.deleteByActionId(actionId);\n\n\t\treturn uacActionMapper.deleteByPrimaryKey(actionId);\n\t}\n\n\t@Override\n\tpublic void batchDeleteByIdList(List<Long> deleteIdList) {\n\t\tlogger.info(\"批量删除角色. deleteIdList={}\", deleteIdList);\n\t\tPreconditions.checkArgument(PublicUtil.isNotEmpty(deleteIdList), \"删除权限ID不能为空\");\n\t\tint result = uacActionMapper.batchDeleteByIdList(deleteIdList);\n\t\tif (result < deleteIdList.size()) {\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10014002, Joiner.on(GlobalConstant.Symbol.COMMA).join(deleteIdList));\n\t\t}\n\t}\n\n\t@Override\n\tpublic void saveAction(UacAction action, LoginAuthDto loginAuthDto) {\n\t\tList<Long> menuIdList = action.getMenuIdList();\n\t\tLong menuId;\n\t\tPreconditions.checkArgument(PublicUtil.isNotEmpty(menuIdList), \"菜单名称不能为空\");\n\t\tmenuId = menuIdList.get(menuIdList.size() - 1);\n\t\taction.setMenuId(menuId);\n\t\taction.setUpdateInfo(loginAuthDto);\n\t\tif (action.isNew()) {\n\t\t\tLong actionId = super.generateId();\n\t\t\taction.setId(actionId);\n\t\t\tuacActionMapper.insertSelective(action);\n\t\t} else {\n\t\t\tint result = uacActionMapper.updateByPrimaryKeySelective(action);\n\t\t\tif (result < 1) {","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/paascloud/paascloud-master/blob/781281a9503332ed3cef44ea618349d14230a127/paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacActionServiceImpl.java#L69-L105","documentation":"UAC10014002 is thrown by batchDeleteByIdList when the number of rows deleted (result) is less than the size of deleteIdList, meaning some (or all) permission ids could not be deleted. The message carries the comma-joined id list.","triggerScenarios":"batchDeleteByIdList(deleteIdList) where one or more ids in the list no longer exist in uac_action, or a row is protected/locked so the batch delete statement skips it.","commonSituations":"Concurrent deletion by another user between listing and batch delete; list contains ids from another environment; partially seeded data.","solutions":["Re-query uac_action to keep only existing ids, then batch delete again","Compare the deleted count against remaining ids to identify which failed","Retry the batch transactionally or delete remaining ids one by one with individual error reporting"],"exampleFix":"// before\nint result = uacActionMapper.batchDeleteByIdList(deleteIdList);\nif (result < deleteIdList.size()) {\n    throw new UacBizException(ErrorCodeEnum.UAC10014002, Joiner.on(\",\").join(deleteIdList));\n}\n// after\nint result = uacActionMapper.batchDeleteByIdList(deleteIdList);\nif (result < deleteIdList.size()) {\n    logger.warn(\"partial delete: requested={}, deleted={}\", deleteIdList.size(), result);\n}","handlingStrategy":"validation","validationCode":"List<Long> existing = filterExistingIds(deleteIdList); if (existing.isEmpty()) return;","typeGuard":"null","tryCatchPattern":"try { service.batchDeleteByIdList(ids); } catch (UacBizException e) { logger.warn(\"partial batch delete: {}\", e.getMessage()); }","preventionTips":["Re-check id existence immediately before batch delete","Handle partial success instead of failing the whole batch","Use transactions so partial deletes roll back cleanly"],"tags":["batch-delete","database","partial-failure"],"backgroundTag":"database-write-failed","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"}