修复角色菜单临时接口

This commit is contained in:
zhangchenbiao
2023-08-01 14:49:05 +08:00
parent d3a8e2d40e
commit cd46416a3c
8 changed files with 6 additions and 163 deletions

View File

@@ -13,7 +13,6 @@ import com.cool.store.utils.CommonNodeUtils;
import com.cool.store.vo.menu.MenuAuthTreeVO;
import com.cool.store.vo.menu.MenuTreeVO;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -68,14 +67,9 @@ public class MenuServiceImpl implements MenuService {
@Override
public Long deleteMenuAuth(Long id) {
List<SysMenuDO> sysMenuDOList = sysMenuDAO.selectMenuAll(null, PlatFormTypeEnum.PC.getCode());
List<Long> idList = ListUtils.emptyIfNull(sysMenuDOList)
.stream()
.map(SysMenuDO::getId)
.collect(Collectors.toList());
Map<Long, List<Long>> parentGroupMap = ListUtils.emptyIfNull(sysMenuDOList)
.stream()
.collect(Collectors.groupingBy(SysMenuDO::getParentId, Collectors.mapping(SysMenuDO::getId, Collectors.toList())));
List<SysMenuDO> menuList = sysMenuDAO.selectMenuAll(null, PlatFormTypeEnum.PC.getCode());
List<Long> idList = menuList.stream().map(SysMenuDO::getId).collect(Collectors.toList());
Map<Long, List<Long>> parentGroupMap = menuList.stream().collect(Collectors.groupingBy(SysMenuDO::getParentId, Collectors.mapping(SysMenuDO::getId, Collectors.toList())));
List<Long> allChildList = CommonNodeUtils.getAllChildListContainSelf(0L,id, idList, parentGroupMap);
sysMenuDAO.batchDeleteMenu(allChildList);
return null;