|
@@ -12,8 +12,8 @@ import com.ningdatech.pmapi.sys.model.entity.RoleMenu; |
|
|
import com.ningdatech.pmapi.sys.model.req.RolePageReq; |
|
|
import com.ningdatech.pmapi.sys.model.req.RolePageReq; |
|
|
import com.ningdatech.pmapi.sys.model.vo.MenuRoleVO; |
|
|
import com.ningdatech.pmapi.sys.model.vo.MenuRoleVO; |
|
|
import com.ningdatech.pmapi.sys.model.vo.RoleVO; |
|
|
import com.ningdatech.pmapi.sys.model.vo.RoleVO; |
|
|
import com.ningdatech.pmapi.sys.service.IRoleMenuService; |
|
|
|
|
|
import com.ningdatech.pmapi.sys.service.IMenuService; |
|
|
import com.ningdatech.pmapi.sys.service.IMenuService; |
|
|
|
|
|
import com.ningdatech.pmapi.sys.service.IRoleMenuService; |
|
|
import com.ningdatech.pmapi.sys.service.IRoleService; |
|
|
import com.ningdatech.pmapi.sys.service.IRoleService; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
@@ -35,9 +35,8 @@ import java.util.stream.Collectors; |
|
|
@RequiredArgsConstructor |
|
|
@RequiredArgsConstructor |
|
|
public class RoleManage { |
|
|
public class RoleManage { |
|
|
|
|
|
|
|
|
private final IRoleService IRoleService; |
|
|
|
|
|
private final IMenuService IMenuService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final IRoleService roleService; |
|
|
|
|
|
private final IMenuService menuService; |
|
|
private final IRoleMenuService roleMenuService; |
|
|
private final IRoleMenuService roleMenuService; |
|
|
|
|
|
|
|
|
public PageVo<RoleVO> queryList(RolePageReq rolePageReq) { |
|
|
public PageVo<RoleVO> queryList(RolePageReq rolePageReq) { |
|
@@ -48,16 +47,17 @@ public class RoleManage { |
|
|
return PageVo.of(data, page.getTotal()); |
|
|
return PageVo.of(data, page.getTotal()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void searchList(Page<Role> page, LambdaQueryWrapper<Role> wrapper, RolePageReq rolePageReq) { |
|
|
|
|
|
wrapper.like(StringUtils.isNotBlank(rolePageReq.getName()), Role::getName, rolePageReq.getName()) |
|
|
|
|
|
|
|
|
private void searchList(Page<Role> page, LambdaQueryWrapper<Role> wrapper, RolePageReq req) { |
|
|
|
|
|
wrapper.like(StringUtils.isNotBlank(req.getName()), Role::getName, req.getName()) |
|
|
|
|
|
.eq(req.getFixed() != null, Role::getFixed, req.getFixed()) |
|
|
.orderByDesc(Role::getUpdateOn); |
|
|
.orderByDesc(Role::getUpdateOn); |
|
|
IRoleService.page(page, wrapper); |
|
|
|
|
|
|
|
|
roleService.page(page, wrapper); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void buildMenu(RoleVO query) { |
|
|
public void buildMenu(RoleVO query) { |
|
|
//改成直接返回有权限的 |
|
|
//改成直接返回有权限的 |
|
|
List<Menu> list = IMenuService.list(Wrappers.lambdaQuery(Menu.class).orderByAsc(Menu::getSort)); |
|
|
|
|
|
|
|
|
List<Menu> list = menuService.list(Wrappers.lambdaQuery(Menu.class).orderByAsc(Menu::getSort)); |
|
|
List<RoleMenu> roleMenus = roleMenuService.list(Wrappers.lambdaQuery(RoleMenu.class) |
|
|
List<RoleMenu> roleMenus = roleMenuService.list(Wrappers.lambdaQuery(RoleMenu.class) |
|
|
.eq(RoleMenu::getRoleId, query.getId())); |
|
|
.eq(RoleMenu::getRoleId, query.getId())); |
|
|
List<MenuRoleVO> menus = list.stream().map(menu -> { |
|
|
List<MenuRoleVO> menus = list.stream().map(menu -> { |
|
|