|
@@ -190,13 +190,13 @@ public class SysMenuServiceImpl extends ServiceImpl<ISysMenuMapper, SysMenu> imp
|
|
|
List<Long> delParentIds = new ArrayList<>();
|
|
|
//如果父菜单不包含全部子菜单,将父菜单移除,不返回前端
|
|
|
for (Long menuId : menuMap.keySet()) {
|
|
|
- Long parentId = menuMap.get(menuId).getParentId();
|
|
|
- if(parentId != null && menuMap.containsKey(parentId) && !setParentIds.contains(parentId)){
|
|
|
- setParentIds.add(parentId);
|
|
|
- List<SysMenu> menuList = this.getBySonById(parentId);
|
|
|
- for (SysMenu sysMenu : menuList) {
|
|
|
- if(!menuMap.containsKey(sysMenu.getId()) ){
|
|
|
- delMenuIds.add(parentId);
|
|
|
+ SysMenu menu = menuMap.get(menuId);
|
|
|
+ if(menu.getType() != 2){
|
|
|
+ List<SysMenu> menuList = this.getBySonById(menuId);
|
|
|
+ List<Long> sonIds = menuList.stream().map(SysMenu::getId).collect(Collectors.toList());
|
|
|
+ for (Long sonId : sonIds) {
|
|
|
+ if(!menuIds.contains(sonId)){
|
|
|
+ delMenuIds.add(menuId);
|
|
|
}
|
|
|
}
|
|
|
}
|