【7.6.0】【sys】更新获取菜单对应的菜单编码接口

pull/57/head
fengshuonan 2023-06-19 12:59:46 +08:00
parent abff52c1a3
commit 3f758a68e8
4 changed files with 56 additions and 0 deletions

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);

View File

@ -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) {