help的getMenuList方法和需改为getMenuTreeList

pxy的doLog修改默认值为2
This commit is contained in:
duandongmei
2019-01-10 13:43:05 +06:00
parent 00140e3c0d
commit c76de86e3b
3 changed files with 62 additions and 57 deletions

View File

@@ -25,73 +25,78 @@ public class SystemController extends BaseController{
@RequestMapping("help") @RequestMapping("help")
public String help(HttpServletRequest request, HttpServletResponse response,ModelMap model){ public String help(HttpServletRequest request, HttpServletResponse response,ModelMap model){
List<SysMenu> menuList = UserUtils.getMenuList(); List<SysMenu> menuList = UserUtils.getMenuTreeList();
List<SysMenu> newList = new ArrayList(); List<SysMenu> newList = new ArrayList();
for(SysMenu menu:menuList){ try {
if(menu.getIsTop()==1 && !StringUtil.isEmpty(menu.getChildren())){ for(SysMenu menu:menuList){
boolean topShow = false; if(menu.getIsTop()==1 && !StringUtil.isEmpty(menu.getChildren())){
for(SysMenu second:menu.getChildren()){ boolean topShow = false;
boolean secondShow = false; for(SysMenu second:menu.getChildren()){
if(second.getIsShow()==1){ boolean secondShow = false;
if(!StringUtil.isEmpty(second.getMenuBg())){ if(second.getIsShow()==1){
secondShow = true; if(!StringUtil.isEmpty(second.getMenuBg())){
} secondShow = true;
if(!StringUtil.isEmpty(second.getChildren())){ }
for(SysMenu third:second.getChildren()){ if(!StringUtil.isEmpty(second.getChildren())){
boolean thirdShow = false; for(SysMenu third:second.getChildren()){
if(third.getIsShow()==1){ boolean thirdShow = false;
if(!StringUtil.isEmpty(third.getMenuBg())){ if(third.getIsShow()==1){
thirdShow = true; if(!StringUtil.isEmpty(third.getMenuBg())){
secondShow = true; thirdShow = true;
} secondShow = true;
if(!StringUtil.isEmpty(third.getChildren())){ }
for(SysMenu fourth:third.getChildren()){ if(!StringUtil.isEmpty(third.getChildren())){
if(!StringUtil.isEmpty(fourth.getMenuBg())&&fourth.getIsShow()==1){ for(SysMenu fourth:third.getChildren()){
newList.add(fourth); if(!StringUtil.isEmpty(fourth.getMenuBg())&&fourth.getIsShow()==1){
thirdShow = true; newList.add(fourth);
secondShow = true; thirdShow = true;
secondShow = true;
}
} }
} }
} }
} if(thirdShow){
if(thirdShow){ newList.add(third);
newList.add(third); }
} }
} }
if(secondShow){
newList.add(second);
topShow = true;
}
} }
if(secondShow){
newList.add(second);
topShow = true;
}
} }
} if(topShow){
if(topShow){ newList.add(menu);
newList.add(menu); }
} }
/*if(menu.getChildren()!=null && menu.getChildren().size()>0 && menu.getIsShow()==1){
newList.add(menu);
}else if(menu.getMenuBg()!=null && !"".equals(menu.getMenuBg())){
newList.add(menu);
}else if(menu.getId()==1){
newList.add(menu);
}*/
/*if((menu.getParentIds().startsWith("0,1,86,")
|| menu.getId()==86
||menu.getId()==0
||menu.getId()==1)
&& menu.getIsShow()==1
){
System.out.println(menu.getParentIds());
newList.add(menu);
}*/
} }
} catch (Exception e) {
/*if(menu.getChildren()!=null && menu.getChildren().size()>0 && menu.getIsShow()==1){ logger.error("help error",e);
newList.add(menu);
}else if(menu.getMenuBg()!=null && !"".equals(menu.getMenuBg())){
newList.add(menu);
}else if(menu.getId()==1){
newList.add(menu);
}*/
/*if((menu.getParentIds().startsWith("0,1,86,")
|| menu.getId()==86
||menu.getId()==0
||menu.getId()==1)
&& menu.getIsShow()==1
){
System.out.println(menu.getParentIds());
newList.add(menu);
}*/
} }
logger.info("menuSize:"+newList.size());
model.addAttribute("menuList",newList); model.addAttribute("menuList",newList);
return "/help"; return "/help";
} }

View File

@@ -339,7 +339,7 @@
<input type="hidden" name="compileId" value="${_cfg.compileId}"> <input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}"> <input type="hidden" name="functionId" value="${_cfg.functionId}">
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}"> <input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
<input type="hidden" id="doLog" name="doLog" value="1"> <input type="hidden" id="doLog" name="doLog" value="2">
<div class="form-body"> <div class="form-body">
<div class="row"> <div class="row">

View File

@@ -148,7 +148,7 @@
<input type="hidden" name="compileId" value="${_cfg.compileId}"> <input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}"> <input type="hidden" name="functionId" value="${_cfg.functionId}">
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}"> <input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
<input type="hidden" id="doLog" name="doLog" value="1"> <input type="hidden" id="doLog" name="doLog" value="2">
<div class="form-body"> <div class="form-body">
<div class="row"> <div class="row">