|
@@ -1,5 +1,6 @@
|
|
|
package com.fdkankan.sale.service.impl;
|
|
|
|
|
|
+import cn.hutool.extra.mail.MailUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -191,13 +192,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);
|
|
|
}
|
|
|
}
|
|
|
}
|