update 优化 租户套餐菜单查询过滤掉 租户管理相关菜单

This commit is contained in:
疯狂的狮子Li 2025-06-05 18:27:44 +08:00
parent eff131a1ed
commit 529f1e5dbb

View File

@ -21,6 +21,7 @@ import org.dromara.system.service.ISysMenuService;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -111,9 +112,14 @@ public class SysMenuController extends BaseController {
@GetMapping(value = "/tenantPackageMenuTreeselect/{packageId}") @GetMapping(value = "/tenantPackageMenuTreeselect/{packageId}")
public R<MenuTreeSelectVo> tenantPackageMenuTreeselect(@PathVariable("packageId") Long packageId) { public R<MenuTreeSelectVo> tenantPackageMenuTreeselect(@PathVariable("packageId") Long packageId) {
List<SysMenuVo> menus = menuService.selectMenuList(LoginHelper.getUserId()); List<SysMenuVo> menus = menuService.selectMenuList(LoginHelper.getUserId());
MenuTreeSelectVo selectVo = new MenuTreeSelectVo( List<Tree<Long>> list = menuService.buildMenuTreeSelect(menus);
menuService.selectMenuListByPackageId(packageId), // 删除租户管理菜单
menuService.buildMenuTreeSelect(menus)); list.removeIf(menu -> menu.getId() == 6L);
List<Long> ids = new ArrayList<>();
if (packageId > 0L) {
ids = menuService.selectMenuListByPackageId(packageId);
}
MenuTreeSelectVo selectVo = new MenuTreeSelectVo(ids, list);
return R.ok(selectVo); return R.ok(selectVo);
} }