mirror of https://gitee.com/stylefeng/roses
【7.0.4】【menu】更新菜单接口
parent
f95e60c256
commit
e70e176548
|
@ -145,21 +145,14 @@ public interface SysMenuService extends IService<SysMenu> {
|
|||
*/
|
||||
List<LayuiMenuAndButtonTreeResponse> getMenuAndButtonTree(SysRoleRequest sysRoleRequest, Boolean lateralFlag);
|
||||
|
||||
/**
|
||||
* 获取当前用户的所有菜单
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/27 18:11
|
||||
*/
|
||||
List<SysMenu> getCurrentUserMenus();
|
||||
|
||||
/**
|
||||
* 获取当前用户的某个应用下的菜单
|
||||
*
|
||||
* @param appCode 应用编码
|
||||
* @param appCode 应用编码
|
||||
* @param layuiVisibleFlag layui版本查询查询条件,如果穿true,则会带上layui_visible为Y的查询条件
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/27 18:11
|
||||
*/
|
||||
List<SysMenu> getCurrentUserMenus(String appCode);
|
||||
List<SysMenu> getCurrentUserMenus(String appCode, Boolean layuiVisibleFlag);
|
||||
|
||||
}
|
||||
|
|
|
@ -39,7 +39,6 @@ import cn.stylefeng.roses.kernel.rule.enums.YesOrNotEnum;
|
|||
import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
|
||||
import cn.stylefeng.roses.kernel.rule.tree.factory.DefaultTreeBuildFactory;
|
||||
import cn.stylefeng.roses.kernel.rule.tree.ztree.ZTreeNode;
|
||||
import cn.stylefeng.roses.kernel.rule.util.ProjectUtil;
|
||||
import cn.stylefeng.roses.kernel.system.api.AppServiceApi;
|
||||
import cn.stylefeng.roses.kernel.system.api.MenuServiceApi;
|
||||
import cn.stylefeng.roses.kernel.system.api.RoleServiceApi;
|
||||
|
@ -262,7 +261,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|||
public List<LayuiAppIndexMenusVO> getLayuiIndexMenus() {
|
||||
|
||||
// 获取当前用户所有菜单
|
||||
List<SysMenu> currentUserMenus = this.getCurrentUserMenus();
|
||||
List<SysMenu> currentUserMenus = this.getCurrentUserMenus(null, true);
|
||||
|
||||
// 组装每个应用的菜单树
|
||||
List<LayuiAppIndexMenusVO> layuiAppIndexMenuVOS = LayuiMenusFactory.createLayuiAppIndexMenus(currentUserMenus);
|
||||
|
@ -284,7 +283,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|||
// 不分应用查询菜单
|
||||
List<SysMenu> currentUserMenus = null;
|
||||
if (sysMenuRequest.getTotalMenus() != null && sysMenuRequest.getTotalMenus()) {
|
||||
currentUserMenus = this.getCurrentUserMenus(null);
|
||||
currentUserMenus = this.getCurrentUserMenus(null, false);
|
||||
}
|
||||
// 根据应用查询菜单
|
||||
else {
|
||||
|
@ -292,7 +291,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|||
if (ObjectUtil.isEmpty(appCode)) {
|
||||
appCode = appServiceApi.getActiveAppCode();
|
||||
}
|
||||
currentUserMenus = this.getCurrentUserMenus(appCode);
|
||||
currentUserMenus = this.getCurrentUserMenus(appCode, false);
|
||||
}
|
||||
|
||||
return AntdMenusFactory.createTotalMenus(currentUserMenus);
|
||||
|
@ -404,12 +403,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<SysMenu> getCurrentUserMenus() {
|
||||
return getCurrentUserMenus(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysMenu> getCurrentUserMenus(String appCode) {
|
||||
public List<SysMenu> getCurrentUserMenus(String appCode, Boolean layuiVisibleFlag) {
|
||||
|
||||
// 菜单查询条件
|
||||
LambdaQueryWrapper<SysMenu> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
@ -423,7 +417,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|||
}
|
||||
|
||||
// 如果是不分离版本,则筛选一下不需要显示的菜单
|
||||
if (!ProjectUtil.getSeparationFlag()) {
|
||||
if (layuiVisibleFlag != null && layuiVisibleFlag) {
|
||||
queryWrapper.eq(SysMenu::getLayuiVisible, YesOrNotEnum.Y.getCode());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue