{"record":{"id":"cae3bb67390a409e","repo":"paascloud/paascloud-master","slug":"uac10013005","errorCode":"UAC10013005","errorMessage":"禁用菜单失败,menuId=%s","messagePattern":"禁用菜单失败,menuId=(.+?)","errorType":"error_code","errorClass":"UacBizException","httpStatus":null,"severity":"error","filePath":"paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacMenuServiceImpl.java","lineNumber":267,"sourceCode":"\t\treturn uacMenuList;\n\t}\n\n\t@Override\n\tpublic int disableMenuList(List<UacMenu> menuList, LoginAuthDto loginAuthDto) {\n\t\tUacMenu uacMenuUpdate = new UacMenu();\n\t\tint sum = 0;\n\t\tfor (UacMenu menu : menuList) {\n\t\t\tuacMenuUpdate.setId(menu.getId());\n\t\t\tuacMenuUpdate.setVersion(menu.getVersion() + 1);\n\t\t\tuacMenuUpdate.setStatus(UacMenuStatusEnum.DISABLE.getType());\n\t\t\tuacMenuUpdate.setLastOperator(loginAuthDto.getLoginName());\n\t\t\tuacMenuUpdate.setLastOperatorId(loginAuthDto.getUserId());\n\t\t\tuacMenuUpdate.setUpdateTime(new Date());\n\t\t\tint result = mapper.updateByPrimaryKeySelective(uacMenuUpdate);\n\t\t\tif (result > 0) {\n\t\t\t\tsum += 1;\n\t\t\t} else {\n\t\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10013005, menu.getId());\n\t\t\t}\n\t\t}\n\t\treturn sum;\n\t}\n\n\t@Override\n\t@Transactional(readOnly = true, rollbackFor = Exception.class)\n\tpublic List<UacMenu> selectMenuList(UacMenu uacMenu) {\n\t\treturn uacMenuMapper.selectMenuList(uacMenu);\n\t}\n\n\t@Override\n\t@Transactional(readOnly = true, rollbackFor = Exception.class)\n\tpublic List<MenuVo> findAllMenuListByAuthResDto(LoginAuthDto authResDto) {\n\t\tList<MenuVo> voList = Lists.newArrayList();\n\t\tPreconditions.checkArgument(authResDto != null, \"无权访问\");\n\n\t\tif (!GlobalConstant.Sys.SUPER_MANAGER_LOGIN_NAME.equals(authResDto.getLoginName())) {","sourceCodeStart":249,"sourceCodeEnd":285,"githubUrl":"https://github.com/paascloud/paascloud-master/blob/781281a9503332ed3cef44ea618349d14230a127/paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacMenuServiceImpl.java#L249-L285","documentation":"UacBizException UAC10013005 thrown by disableMenuList when a batch update setting a menu's status to DISABLE affects 0 rows (mapper.updateByPrimaryKeySelective returned 0) for one of the menus in the collected list. Called from updateUacMenuStatusById when disabling a menu with its child menus. Message contains the offending menuId.","triggerScenarios":"Calling updateUacMenuStatusById with status=DISABLE where a menu in the computed menuList (target plus descendants) was deleted or modified concurrently so its selective update matches no row.","commonSituations":"A child menu removed by another admin while the parent is being disabled; stale UI tree listing already-deleted menus; concurrent status updates overwriting each other.","solutions":["Refresh the menu tree and retry the disable operation so deleted sub-menus are excluded.","Verify each menuId in the batch exists before disabling (selectByPrimaryKey check).","Avoid concurrent delete/disable operations on the same subtree across admin sessions.","Inspect the reported menuId in uac_menu to confirm whether it was removed mid-transaction."],"exampleFix":"// before: disable every collected menu unconditionally\nint result = mapper.updateByPrimaryKeySelective(uacMenuUpdate);\nif (result < 1) { throw new UacBizException(ErrorCodeEnum.UAC10013005, menu.getId()); }\n// after: skip menus that vanished\nif (mapper.selectByPrimaryKey(menu.getId()) == null) { continue; }\nmapper.updateByPrimaryKeySelective(uacMenuUpdate);","handlingStrategy":"retry","validationCode":"List<Long> missing = menuList.stream()\n    .map(UacMenu::getId)\n    .filter(mid -> uacMenuMapper.selectByPrimaryKey(mid) == null)\n    .collect(Collectors.toList());\nif (!missing.isEmpty()) { /* re-fetch tree and rebuild menuList */ }","typeGuard":"boolean allMenusExist(List<UacMenu> menus) {\n  return menus.stream().allMatch(m -> uacMenuMapper.selectByPrimaryKey(m.getId()) != null);\n}","tryCatchPattern":"try {\n  uacMenuService.updateUacMenuStatusById(statusDto, loginAuthDto);\n} catch (UacBizException e) {\n  if (\"UAC10013005\".equals(e.getCode())) { /* re-fetch tree, retry once */ }\n  throw e;\n}","preventionTips":["Verify all sub-menus exist before disabling a parent.","Coordinate with other admins to avoid simultaneous delete/disable operations.","Reload the menu tree in the UI right before performing the batch disable."],"tags":["database","menu-management","uac","disable","batch-update"],"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"}