提交 095f48ff 编写于 作者: sq3536's avatar sq3536

排除空节点

上级 64700eb4
...@@ -144,16 +144,14 @@ public class SysStructure ...@@ -144,16 +144,14 @@ public class SysStructure
if(this.getApps()!=null) if(this.getApps()!=null)
{ {
this.getApps().forEach(app->{ this.getApps().forEach(app->{
PermissionNode appNode = PermissionNode.builder()
.label("应用-"+app.getAppname()).build()
.setUniKey(systemid, app.getAppid());
if(app.getAppmenus()!=null) if(app.getAppmenus()!=null)
{ {
app.getAppmenus().forEach(appmenu->{ app.getAppmenus().forEach(appmenu->{
PermissionNode appMenuNode = PermissionNode.builder() PermissionNode appMenuNode = PermissionNode.builder()
.label("菜单-"+appmenu.getMenuname()).build() .label("应用-"+app.getAppname()+"菜单-"+appmenu.getMenuname()).build()
.setUniKey(systemid, appmenu.getMenuid()); .setUniKey(systemid, app.getAppid()+"-"+appmenu.getMenuid());
if(appmenu.getMenuitems()!=null) if(appmenu.getMenuitems()!=null)
{ {
...@@ -162,11 +160,10 @@ public class SysStructure ...@@ -162,11 +160,10 @@ public class SysStructure
}); });
} }
appNode.getChildren().add(appMenuNode); root.getChildren().add(appMenuNode);
}); });
} }
root.getChildren().add(appNode);
}); });
} }
break; break;
......
...@@ -56,9 +56,15 @@ public class UAACoreService { ...@@ -56,9 +56,15 @@ public class UAACoreService {
page.getContent().forEach(system->{ page.getContent().forEach(system->{
if(system.getSysstructure()==null) if(system.getSysstructure()==null)
return; return;
apps.add(system.getSysstructure().getPermissionTree(PermissionType.APPMENU)); PermissionNode appnode=system.getSysstructure().getPermissionTree(PermissionType.APPMENU);
uniResIds.add(system.getSysstructure().getPermissionTree(PermissionType.UNIRES)); if(appnode.getChildren().size()>0)
oppirvs.add(system.getSysstructure().getPermissionTree(PermissionType.OPPRIV)); apps.add(appnode);
PermissionNode uniresnode=system.getSysstructure().getPermissionTree(PermissionType.UNIRES);
if(uniresnode.getChildren().size()>0)
uniResIds.add(uniresnode);
PermissionNode opprivnode=system.getSysstructure().getPermissionTree(PermissionType.OPPRIV);
if(opprivnode.getChildren().size()>0)
oppirvs.add(opprivnode);
}); });
Map<String,List<PermissionNode>> map = new HashMap<>(); Map<String,List<PermissionNode>> map = new HashMap<>();
map.put(PermissionType.APPMENU.toString(),apps); map.put(PermissionType.APPMENU.toString(),apps);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册