Browse Source

删除废弃数据库查询代码

tags/24080901
WendyYang 1 year ago
parent
commit
aa11ffcdf9
1 changed files with 0 additions and 8 deletions
  1. +0
    -8
      pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/MenuManage.java

+ 0
- 8
pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/MenuManage.java View File

@@ -1,14 +1,10 @@
package com.ningdatech.pmapi.sys.manage; package com.ningdatech.pmapi.sys.manage;


import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.util.CollUtils; import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.pmapi.common.util.TreeUtil; import com.ningdatech.pmapi.common.util.TreeUtil;
import com.ningdatech.pmapi.sys.model.entity.Menu; import com.ningdatech.pmapi.sys.model.entity.Menu;
import com.ningdatech.pmapi.sys.model.entity.RoleMenu;
import com.ningdatech.pmapi.sys.model.vo.MenuRoleVO; import com.ningdatech.pmapi.sys.model.vo.MenuRoleVO;
import com.ningdatech.pmapi.sys.service.IRoleMenuService;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;


@@ -26,11 +22,7 @@ import java.util.List;
@RequiredArgsConstructor @RequiredArgsConstructor
public class MenuManage { public class MenuManage {


private final IRoleMenuService roleMenuService;

public List<MenuRoleVO> buildUserMenu(List<Menu> list) { public List<MenuRoleVO> buildUserMenu(List<Menu> list) {
List<RoleMenu> roleMenus = roleMenuService.list(Wrappers.lambdaQuery(RoleMenu.class)
.in(RoleMenu::getRoleId, LoginUserUtil.getRoleIdList()));
List<MenuRoleVO> menuRoles = CollUtils.convert(list, w -> BeanUtil.copyProperties(w, MenuRoleVO.class)); List<MenuRoleVO> menuRoles = CollUtils.convert(list, w -> BeanUtil.copyProperties(w, MenuRoleVO.class));
return TreeUtil.buildUserTree(menuRoles); return TreeUtil.buildUserTree(menuRoles);
} }


Loading…
Cancel
Save