mirror of https://gitee.com/stylefeng/roses
【7.6.0】【sys】更新获取菜单对应的菜单编码接口
parent
abff52c1a3
commit
3f758a68e8
|
@ -81,4 +81,12 @@ public interface SysMenuOptionsService extends IService<SysMenuOptions> {
|
|||
*/
|
||||
List<SysMenuOptions> getTotalMenuOptionsList();
|
||||
|
||||
/**
|
||||
* 获取功能编码集合,通过功能id集合
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2023/6/19 12:56
|
||||
*/
|
||||
List<String> getOptionsCodeList(List<Long> optionsIdList);
|
||||
|
||||
}
|
|
@ -104,4 +104,12 @@ public interface SysMenuService extends IService<SysMenu> {
|
|||
*/
|
||||
List<SysMenu> getTotalMenuList();
|
||||
|
||||
/**
|
||||
* 获取菜单对应的菜单编码
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2023/6/19 12:53
|
||||
*/
|
||||
List<String> getMenuCodeList(List<Long> menuIdList);
|
||||
|
||||
}
|
|
@ -22,8 +22,10 @@ import org.springframework.stereotype.Service;
|
|||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 菜单下的功能操作业务实现层
|
||||
|
@ -103,6 +105,25 @@ public class SysMenuOptionsServiceImpl extends ServiceImpl<SysMenuOptionsMapper,
|
|||
return this.list(sysMenuOptionsLambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getOptionsCodeList(List<Long> optionsIdList) {
|
||||
|
||||
if (ObjectUtil.isEmpty(optionsIdList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<SysMenuOptions> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(SysMenuOptions::getMenuOptionId, optionsIdList);
|
||||
queryWrapper.select(SysMenuOptions::getOptionCode);
|
||||
List<SysMenuOptions> sysMenuOptionsList = this.list(queryWrapper);
|
||||
|
||||
if (ObjectUtil.isEmpty(sysMenuOptionsList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
return sysMenuOptionsList.stream().map(SysMenuOptions::getOptionCode).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysMenuOptions> findList(SysMenuOptionsRequest sysMenuOptionsRequest) {
|
||||
LambdaQueryWrapper<SysMenuOptions> wrapper = this.createWrapper(sysMenuOptionsRequest);
|
||||
|
|
|
@ -177,6 +177,25 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|||
return this.list(sysMenuLambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getMenuCodeList(List<Long> menuIdList) {
|
||||
|
||||
if (ObjectUtil.isEmpty(menuIdList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<SysMenu> sysMenuLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
sysMenuLambdaQueryWrapper.in(SysMenu::getMenuId, menuIdList);
|
||||
sysMenuLambdaQueryWrapper.select(SysMenu::getMenuCode);
|
||||
List<SysMenu> list = this.list(sysMenuLambdaQueryWrapper);
|
||||
|
||||
if (ObjectUtil.isEmpty(list)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
return list.stream().map(SysMenu::getMenuCode).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AppGroupDetail> getAppMenuGroupDetail(SysMenuRequest sysMenuRequest) {
|
||||
|
||||
|
|
Loading…
Reference in New Issue