|
|
|
|
@ -1,15 +1,5 @@
|
|
|
|
|
package com.ruoyi.system.service.impl;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.HashSet;
|
|
|
|
|
import java.util.Iterator;
|
|
|
|
|
import java.util.LinkedList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Set;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import com.ruoyi.common.constant.Constants;
|
|
|
|
|
import com.ruoyi.common.constant.UserConstants;
|
|
|
|
|
import com.ruoyi.common.core.domain.TreeSelect;
|
|
|
|
|
@ -24,6 +14,11 @@ import com.ruoyi.system.mapper.SysMenuMapper;
|
|
|
|
|
import com.ruoyi.system.mapper.SysRoleMapper;
|
|
|
|
|
import com.ruoyi.system.mapper.SysRoleMenuMapper;
|
|
|
|
|
import com.ruoyi.system.service.ISysMenuService;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 菜单 业务层处理
|
|
|
|
|
@ -66,6 +61,7 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|
|
|
|
public List<SysMenu> selectMenuList(SysMenu menu, Long userId)
|
|
|
|
|
{
|
|
|
|
|
List<SysMenu> menuList = null;
|
|
|
|
|
menu.setVisible("0");
|
|
|
|
|
// 管理员显示所有菜单信息
|
|
|
|
|
if (SysUser.isAdmin(userId))
|
|
|
|
|
{
|
|
|
|
|
@ -73,8 +69,8 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
menu.getParams().put("userId", userId);
|
|
|
|
|
menuList = menuMapper.selectMenuListByUserId(menu);
|
|
|
|
|
// menu.getParams().put("userId", userId);
|
|
|
|
|
menuList = menuMapper.selectMenuListByUserId(userId,SecurityUtils.getLoginUser().getNowTenantId());
|
|
|
|
|
}
|
|
|
|
|
return menuList;
|
|
|
|
|
}
|
|
|
|
|
@ -88,7 +84,8 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|
|
|
|
@Override
|
|
|
|
|
public Set<String> selectMenuPermsByUserId(Long userId)
|
|
|
|
|
{
|
|
|
|
|
List<String> perms = menuMapper.selectMenuPermsByUserId(userId);
|
|
|
|
|
|
|
|
|
|
List<String> perms = menuMapper.selectMenuPermsByUserId(userId,SecurityUtils.getLoginUser().getNowTenantId());
|
|
|
|
|
Set<String> permsSet = new HashSet<>();
|
|
|
|
|
for (String perm : perms)
|
|
|
|
|
{
|
|
|
|
|
|