问题描述
菜单的表结构:menu_id,menu_name,parent_menu_id递归函数:publicStringgetNode(intconfigMenuId){Stringss=null;BasConfigMenuEntitybasConfigMenuEntity=newBasConfigMenuEntity();basConfigMenuEntity.setSuperMenuId(configMenuId);List<BasConfigMenuEntity>bcmeList=searchBaseConfigMenu(basConfigMenuEntity);ss=JSONUtils.toJson(bcmeList)+ss;for(BasConfigMenuEntityentity:bcmeList){System.out.println(entity.getConfigMenuId());getNode(entity.getConfigMenuId());}returnss;}我从System.out.println(entity.getConfigMenuId());可以看到各个节点都递归到了,但返回值ss不正确,各位大侠,帮手看看!!!
解决方案
解决方案二:
我没看出来你递归了啊?还有你的循环体是干什么的
时间: 2025-01-21 14:27:40