|
|
|
@ -65,9 +65,19 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|
|
|
|
* @return 所有菜单信息
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public List<SysMenu> selectMenuList(SysMenu menu)
|
|
|
|
|
public List<SysMenu> selectMenuList(SysMenu menu, Long userId)
|
|
|
|
|
{
|
|
|
|
|
return menuMapper.selectMenuList(menu);
|
|
|
|
|
List<SysMenu> menuList = null;
|
|
|
|
|
if (SysUser.isAdmin(userId))
|
|
|
|
|
{
|
|
|
|
|
menuList = menuMapper.selectMenuList(menu);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
menu.getParams().put("userId", userId);
|
|
|
|
|
menuList = menuMapper.selectMenuListByUserId(menu);
|
|
|
|
|
}
|
|
|
|
|
return menuList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -76,9 +86,18 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|
|
|
|
* @return 所有菜单信息
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public List<SysMenu> selectMenuAll()
|
|
|
|
|
public List<SysMenu> selectMenuAll(Long userId)
|
|
|
|
|
{
|
|
|
|
|
return menuMapper.selectMenuAll();
|
|
|
|
|
List<SysMenu> menuList = null;
|
|
|
|
|
if (SysUser.isAdmin(userId))
|
|
|
|
|
{
|
|
|
|
|
menuList = menuMapper.selectMenuAll();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
menuList = menuMapper.selectMenuAllByUserId(userId);
|
|
|
|
|
}
|
|
|
|
|
return menuList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -109,11 +128,11 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|
|
|
|
* @return 菜单列表
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public List<Ztree> roleMenuTreeData(SysRole role)
|
|
|
|
|
public List<Ztree> roleMenuTreeData(SysRole role, Long userId)
|
|
|
|
|
{
|
|
|
|
|
Long roleId = role.getRoleId();
|
|
|
|
|
List<Ztree> ztrees = new ArrayList<Ztree>();
|
|
|
|
|
List<SysMenu> menuList = menuMapper.selectMenuAll();
|
|
|
|
|
List<SysMenu> menuList = selectMenuAll(userId);
|
|
|
|
|
if (StringUtils.isNotNull(roleId))
|
|
|
|
|
{
|
|
|
|
|
List<String> roleMenuList = menuMapper.selectMenuTree(roleId);
|
|
|
|
@ -132,9 +151,9 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|
|
|
|
* @return 菜单列表
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public List<Ztree> menuTreeData()
|
|
|
|
|
public List<Ztree> menuTreeData(Long userId)
|
|
|
|
|
{
|
|
|
|
|
List<SysMenu> menuList = menuMapper.selectMenuAll();
|
|
|
|
|
List<SysMenu> menuList = selectMenuAll(userId);
|
|
|
|
|
List<Ztree> ztrees = initZtree(menuList);
|
|
|
|
|
return ztrees;
|
|
|
|
|
}
|
|
|
|
@ -145,10 +164,10 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|
|
|
|
* @return 权限列表
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public LinkedHashMap<String, String> selectPermsAll()
|
|
|
|
|
public LinkedHashMap<String, String> selectPermsAll(Long userId)
|
|
|
|
|
{
|
|
|
|
|
LinkedHashMap<String, String> section = new LinkedHashMap<>();
|
|
|
|
|
List<SysMenu> permissions = menuMapper.selectMenuAll();
|
|
|
|
|
List<SysMenu> permissions = selectMenuAll(userId);
|
|
|
|
|
if (StringUtils.isNotEmpty(permissions))
|
|
|
|
|
{
|
|
|
|
|
for (SysMenu menu : permissions)
|
|
|
|
|