linwe
2023-11-15 25df5530b89fc57a3f32a0e4c706bb40d3e4b415
标签控制+通知详情优化
16 files modified
378 ■■■■ changed files
src/main/java/org/springblade/modules/article/controller/ArticleController.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/article/mapper/ArticleMapper.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/article/mapper/ArticleMapper.xml 74 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/article/service/ArticleService.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/article/service/impl/ArticleServiceImpl.java 8 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/controller/UserHouseLabelController.java 16 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/mapper/UserHouseLabelMapper.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/mapper/UserHouseLabelMapper.xml 36 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/service/IUserHouseLabelService.java 5 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/service/impl/HouseLabelServiceImpl.java 12 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/controller/MenuController.java 6 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/controller/UserController.java 8 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/entity/Menu.java 104 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/mapper/MenuMapper.xml 53 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/service/IMenuService.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/service/impl/MenuServiceImpl.java 46 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/article/controller/ArticleController.java
@@ -109,7 +109,7 @@
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入articleoy")
    public R<Article> detail(Article article) {
        Article detail = articleService.getOne(Condition.getQueryWrapper(article));
        Article detail = articleService.getArticleOne(article);
        UpdateWrapper<Article> objectUpdateWrapper = new UpdateWrapper<>();
        objectUpdateWrapper.setSql("view_number = view_number + 1");
        objectUpdateWrapper.eq("id", article.getId());
src/main/java/org/springblade/modules/article/mapper/ArticleMapper.java
@@ -53,4 +53,6 @@
    List<Article> pageCollect(IPage<Article> page, @Param("article") ArticleVO article);
    Boolean upcomment(String ids, String type);
    ArticleVO getArticleOne(Article article);
}
src/main/java/org/springblade/modules/article/mapper/ArticleMapper.xml
@@ -51,6 +51,32 @@
          and jn.id = #{id}
    </select>
    <sql id="selectArticle">
        select
            id,
            title,
            type,
            content,
            url,
            video_url,
            source_id,
            source_name,
            article_type,
            recommend,
            publish,
            iscomment,
            view_number,
            create_time,
            update_time,
            update_user,
            create_user,
            is_deleted
        from
            jczz_article
    </sql>
    <select id="selectArticlePageByApp" resultMap="noticeResultMap">
        select ja.id,
        ja.title,
@@ -340,4 +366,52 @@
        and iswords = "0" and type!=1
        order by id desc
    </select>
    <select id="getArticleOne" parameterType="org.springblade.modules.article.vo.ArticleVO" resultMap="noticeResultMap">
        select ja.id,
        ja.title,
        ja.type,
        ja.url,
        ja.video_url,
        ja.source_id,
        ja.content,
        ja.source_name,
        ja.article_type,
        ja.recommend,
        ja.publish,
        ja.iscomment,
        ja.view_number,
        ja.create_time,
        ja.update_time,
        ja.update_user,
        ja.create_user,
        ja.is_deleted,
        bdb.dict_value dictValue
        from jczz_article ja LEFT JOIN blade_dict_biz bdb on ja.article_type = bdb.dict_key
        <where>
            <if test="id != null "> and ja.id = #{id}</if>
            <if test="title != null  and title != ''"> and ja.title = #{title}</if>
            <if test="type != null "> and ja.type = #{type}</if>
            <if test="content != null  and content != ''"> and ja.content = #{content}</if>
            <if test="url != null  and url != ''"> and ja.url = #{url}</if>
            <if test="videoUrl != null  and videoUrl != ''"> and ja.video_url = #{videoUrl}</if>
            <if test="sourceId != null  and sourceId != ''"> and ja.source_id = #{sourceId}</if>
            <if test="sourceName != null  and sourceName != ''"> and ja.source_name = #{sourceName}</if>
            <if test="articleType != null  and articleType != ''"> and ja.article_type = #{articleType}</if>
            <if test="recommend != null "> and ja.recommend = #{recommend}</if>
            <if test="publish != null  and publish != ''"> and ja.publish = #{publish}</if>
            <if test="iscomment != null  and iscomment != ''"> and ja.iscomment = #{iscomment}</if>
            <if test="viewNumber != null "> and ja.view_number = #{viewNumber}</if>
            <if test="createTime != null "> and ja.create_time = #{createTime}</if>
            <if test="updateTime != null "> and ja.update_time = #{updateTime}</if>
            <if test="updateUser != null "> and ja.update_user = #{updateUser}</if>
            <if test="createUser != null "> and ja.create_user = #{createUser}</if>
            <if test="isDeleted != null "> and ja.is_deleted = #{isDeleted}</if>
        </where>
        and  ja.is_deleted = 0
        and ja.publish = 1
        and bdb.parent_id = '1722966265111248897'
        order by ja.create_time desc
    </select>
</mapper>
src/main/java/org/springblade/modules/article/service/ArticleService.java
@@ -59,4 +59,6 @@
    IPage<Article> pageCollect(IPage<Article> page, ArticleVO article);
    Boolean upcomment(String ids, String type);
    ArticleVO getArticleOne(Article article);
}
src/main/java/org/springblade/modules/article/service/impl/ArticleServiceImpl.java
@@ -88,11 +88,17 @@
    /**
     * 批量更新
     *
     * @return
     */
    @Override
    public Boolean upcomment(String ids, String type) {
        return baseMapper.upcomment(ids,type);
        return baseMapper.upcomment(ids, type);
    }
    @Override
    public ArticleVO getArticleOne(Article article) {
        ArticleVO articleVO = baseMapper.getArticleOne(article);
        return articleVO;
    }
}
src/main/java/org/springblade/modules/house/controller/UserHouseLabelController.java
@@ -26,8 +26,11 @@
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.AesUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.house.dto.UserHouseLabelDTO;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.house.entity.UserHouseLabelEntity;
@@ -35,6 +38,8 @@
import org.springblade.modules.house.wrapper.HouseLabelWrapper;
import org.springblade.modules.house.service.IUserHouseLabelService;
import org.springblade.core.boot.ctrl.BladeController;
import java.util.List;
/**
 * 房屋-标签 控制器
@@ -83,6 +88,17 @@
    }
    /**
     * 房屋-标签 自定义分页
     */
    @GetMapping("/userLabelList")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "查询用户的标签", notes = "传入houseLabel")
    public R<List<Integer>> userLabelList() {
        List<Integer> pages = userHouseLabelService.selectUserLabelList(new UserHouseLabelDTO());
        return R.data(pages);
    }
    /**
     * 房屋-标签 新增
     */
    @PostMapping("/save")
src/main/java/org/springblade/modules/house/mapper/UserHouseLabelMapper.java
@@ -16,6 +16,7 @@
 */
package org.springblade.modules.house.mapper;
import org.springblade.modules.house.dto.UserHouseLabelDTO;
import org.springblade.modules.house.entity.UserHouseLabelEntity;
import org.springblade.modules.house.vo.HouseLabelVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -40,4 +41,5 @@
    List<HouseLabelVO> selectHouseLabelPage(IPage page, HouseLabelVO houseLabel);
    List<Integer> getUserLabelList(UserHouseLabelDTO userHouseLabelDTO);
}
src/main/java/org/springblade/modules/house/mapper/UserHouseLabelMapper.xml
@@ -47,14 +47,34 @@
    <select id="selectHouseLabelPage" resultMap="UserHouseLabelDTOResult">
        <include refid="selectUserHouseLabel"/>
        <where>
            <if test="houseLabel.id != null "> and id = #{houseLabel.id}</if>
            <if test="houseLabel.houseCode != null  and houseLabel.houseCode != ''"> and house_code = #{houseLabel.houseCode}</if>
            <if test="houseLabel.labelId != null "> and label_id = #{houseLabel.labelId}</if>
            <if test="houseLabel.labelName != null  and houseLabel.labelName != ''"> and label_name = #{houseLabel.labelName}</if>
            <if test="houseLabel.color != null  and houseLabel.color != ''"> and color = #{houseLabel.color}</if>
            <if test="houseLabel.remark != null  and remark != ''"> and remark = #{houseLabel.remark}</if>
            <if test="houseLabel.userId != null "> and user_id = #{houseLabel.userId}</if>
            <if test="houseLabel.lableType != null "> and lable_type = #{houseLabel.lableType}</if>
            <if test="houseLabel.id != null ">and id = #{houseLabel.id}</if>
            <if test="houseLabel.houseCode != null  and houseLabel.houseCode != ''">and house_code =
                #{houseLabel.houseCode}
            </if>
            <if test="houseLabel.labelId != null ">and label_id = #{houseLabel.labelId}</if>
            <if test="houseLabel.labelName != null  and houseLabel.labelName != ''">and label_name =
                #{houseLabel.labelName}
            </if>
            <if test="houseLabel.color != null  and houseLabel.color != ''">and color = #{houseLabel.color}</if>
            <if test="houseLabel.remark != null  and remark != ''">and remark = #{houseLabel.remark}</if>
            <if test="houseLabel.userId != null ">and user_id = #{houseLabel.userId}</if>
            <if test="houseLabel.lableType != null ">and lable_type = #{houseLabel.lableType}</if>
        </where>
    </select>
    <select id="getUserLabelList" resultType="java.lang.Integer"  parameterType="org.springblade.modules.house.dto.UserHouseLabelDTO">
        select label_id
        from jczz_user_house_label
        <where>
            <if test="id != null "> and id = #{id}</if>
            <if test="houseCode != null  and houseCode != ''"> and house_code = #{houseCode}</if>
            <if test="labelId != null "> and label_id = #{labelId}</if>
            <if test="labelName != null  and labelName != ''"> and label_name = #{labelName}</if>
            <if test="color != null  and color != ''"> and color = #{color}</if>
            <if test="remark != null  and remark != ''"> and remark = #{remark}</if>
            <if test="userId != null "> and user_id = #{userId}</if>
            <if test="lableType != null "> and lable_type = #{lableType}</if>
        </where>
    </select>
src/main/java/org/springblade/modules/house/service/IUserHouseLabelService.java
@@ -17,9 +17,12 @@
package org.springblade.modules.house.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.modules.house.dto.UserHouseLabelDTO;
import org.springblade.modules.house.entity.UserHouseLabelEntity;
import org.springblade.modules.house.vo.HouseLabelVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
 * 房屋-标签 服务类
@@ -45,4 +48,6 @@
     * @return
     */
    boolean saveOrUpdateHouseLabel(UserHouseLabelEntity houseLabel);
    List<Integer> selectUserLabelList(UserHouseLabelDTO userHouseLabelDTO);
}
src/main/java/org/springblade/modules/house/service/impl/HouseLabelServiceImpl.java
@@ -17,7 +17,10 @@
package org.springblade.modules.house.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.modules.house.dto.UserHouseLabelDTO;
import org.springblade.modules.house.entity.UserHouseLabelEntity;
import org.springblade.modules.house.vo.HouseLabelVO;
import org.springblade.modules.house.mapper.UserHouseLabelMapper;
@@ -27,6 +30,8 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
 * 房屋-标签 服务实现类
@@ -68,4 +73,11 @@
        // 插入
        return save(houseLabel);
    }
    @Override
    public List<Integer> selectUserLabelList(UserHouseLabelDTO userHouseLabelDTO) {
        userHouseLabelDTO.setUserId(AuthUtil.getUserId());
        List<Integer> list = baseMapper.getUserLabelList(userHouseLabelDTO);
        return list;
    }
}
src/main/java/org/springblade/modules/system/controller/MenuController.java
@@ -129,8 +129,8 @@
     */
    @GetMapping("/dynamicMenu")
    @ApiOperation(value = "菜单列表", notes = "传入menu")
    public R<List<MenuVO>> dynamicMenu(String roleId,Long topMenuId) {
        List<MenuVO> list = menuService.routes(roleId,topMenuId);
    public R<List<MenuVO>> dynamicMenu(String roleId, Long topMenuId, @RequestParam(value = "labelType", required = false) Integer labelType) {
        List<MenuVO> list = menuService.routes(roleId, topMenuId,labelType);
        return R.data(list);
    }
@@ -191,7 +191,7 @@
    @ApiOperationSupport(order = 8)
    @ApiOperation(value = "前端菜单数据", notes = "前端菜单数据")
    public R<List<MenuVO>> routes(BladeUser user, Long topMenuId) {
        List<MenuVO> list = menuService.routes((user == null) ? null : user.getRoleId(), topMenuId);
        List<MenuVO> list = menuService.routes((user == null) ? null : user.getRoleId(), topMenuId,null);
        return R.data(list);
    }
src/main/java/org/springblade/modules/system/controller/UserController.java
@@ -21,10 +21,7 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.*;
import lombok.AllArgsConstructor;
import org.springblade.common.cache.CacheNames;
import org.springblade.core.cache.utils.CacheUtil;
@@ -68,10 +65,11 @@
 * @author Chill
 */
@NonDS
@ApiIgnore
//@ApiIgnore
@RestController
@RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME+"/user")
@AllArgsConstructor
@Api(value = "用户管理", tags = "用户管理")
public class UserController {
    private final IUserService userService;
src/main/java/org/springblade/modules/system/entity/Menu.java
@@ -16,10 +16,7 @@
 */
package org.springblade.modules.system.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
@@ -57,73 +54,82 @@
    @ApiModelProperty(value = "菜单父主键")
    private Long parentId;
    /**
     * 菜单编号
     */
    @ApiModelProperty(value = "菜单编号")
    /** 菜单编号 */
    @ApiModelProperty(value = "菜单编号", example = "")
    @TableField("code")
    private String code;
    /**
     * 菜单名称
     */
    @ApiModelProperty(value = "菜单名称")
    /** 菜单名称 */
    @ApiModelProperty(value = "菜单名称", example = "")
    @TableField("name")
    private String name;
    /**
     * 菜单别名
     */
    @ApiModelProperty(value = "菜单别名")
    /** 菜单别名 */
    @ApiModelProperty(value = "菜单别名", example = "")
    @TableField("alias")
    private String alias;
    /**
     * 请求地址
     */
    @ApiModelProperty(value = "请求地址")
    /** 请求地址 */
    @ApiModelProperty(value = "请求地址", example = "")
    @TableField("path")
    private String path;
    /**
     * 菜单资源
     */
    @ApiModelProperty(value = "菜单资源")
    /** 菜单资源 */
    @ApiModelProperty(value = "菜单资源", example = "")
    @TableField("source")
    private String source;
    /**
     * 排序
     */
    @ApiModelProperty(value = "排序")
    /** 排序 */
    @ApiModelProperty(value = "排序", example = "")
    @TableField("sort")
    private Integer sort;
    /**
     * 菜单类型
     */
    @ApiModelProperty(value = "菜单类型")
    /** 菜单类型:菜单,按钮 */
    @ApiModelProperty(value = "菜单类型:菜单,按钮", example = "")
    @TableField("category")
    private Integer category;
    /**
     * 操作按钮类型
     */
    @ApiModelProperty(value = "操作按钮类型")
    /** 操作按钮类型 */
    @ApiModelProperty(value = "操作按钮类型", example = "")
    @TableField("action")
    private Integer action;
    /**
     * 是否打开新页面
     */
    @ApiModelProperty(value = "是否打开新页面")
    /** 是否打开新页面 */
    @ApiModelProperty(value = "是否打开新页面", example = "")
    @TableField("is_open")
    private Integer isOpen;
    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    /** 组件地址 */
    @ApiModelProperty(value = "组件地址", example = "")
    @TableField("component")
    private String component;
    /** 备注 */
    @ApiModelProperty(value = "备注", example = "")
    @TableField("remark")
    private String remark;
    /**
     * 是否已删除
     */
    @TableLogic
    @ApiModelProperty(value = "是否已删除")
    /** 是否已删除 */
    @ApiModelProperty(value = "是否已删除", example = "")
    @TableField("is_deleted")
    private Integer isDeleted;
    /** 图片地址 */
    @ApiModelProperty(value = "图片地址", example = "")
    @TableField("picture_img")
    private String pictureImg;
    /** 标签 */
    @ApiModelProperty(value = "标签", example = "")
    @TableField("label_id")
    private String labelId;
    /** 颜色 */
    @ApiModelProperty(value = "颜色", example = "")
    @TableField("background")
    private String background;
    @Override
    public boolean equals(Object obj) {
src/main/java/org/springblade/modules/system/mapper/MenuMapper.xml
@@ -4,19 +4,23 @@
    <!-- 通用查询映射结果 -->
    <resultMap id="menuResultMap" type="org.springblade.modules.system.entity.Menu">
        <id column="id" property="id"/>
        <result column="code" property="code"/>
        <result column="parent_id" property="parentId"/>
        <result column="name" property="name"/>
        <result column="alias" property="alias"/>
        <result column="path" property="path"/>
        <result column="source" property="source"/>
        <result column="sort" property="sort"/>
        <result column="category" property="category"/>
        <result column="action" property="action"/>
        <result column="is_open" property="isOpen"/>
        <result column="remark" property="remark"/>
        <result column="is_deleted" property="isDeleted"/>
        <result property="id"    column="id"    />
        <result property="parentId"    column="parent_id"    />
        <result property="code"    column="code"    />
        <result property="name"    column="name"    />
        <result property="alias"    column="alias"    />
        <result property="path"    column="path"    />
        <result property="source"    column="source"    />
        <result property="sort"    column="sort"    />
        <result property="category"    column="category"    />
        <result property="action"    column="action"    />
        <result property="isOpen"    column="is_open"    />
        <result property="component"    column="component"    />
        <result property="remark"    column="remark"    />
        <result property="isDeleted"    column="is_deleted"    />
        <result property="pictureImg"    column="picture_img"    />
        <result property="labelId"    column="label_id"    />
        <result property="background"    column="background"    />
    </resultMap>
    <resultMap id="menuVOResultMap" type="org.springblade.modules.system.vo.MenuVO">
@@ -44,6 +48,29 @@
        <result column="key" property="key"/>
    </resultMap>
    <sql id="selectBladeMenu">
        select
            id,
            parent_id,
            code,
            name,
            alias,
            path,
            source,
            sort,
            category,
            action,
            is_open,
            component,
            remark,
            is_deleted,
            picture_img,
            label_id,
            background
        from
            blade_menu
    </sql>
    <select id="lazyList" resultMap="menuVOResultMap">
        SELECT
src/main/java/org/springblade/modules/system/service/IMenuService.java
@@ -58,7 +58,7 @@
     * @param topMenuId
     * @return
     */
    List<MenuVO> routes(String roleId, Long topMenuId);
    List<MenuVO> routes(String roleId, Long topMenuId,Integer labelType);
    /**
     * 菜单树形结构
src/main/java/org/springblade/modules/system/service/impl/MenuServiceImpl.java
@@ -20,6 +20,8 @@
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.AllArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springblade.common.cache.SysCache;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.secure.BladeUser;
@@ -31,6 +33,8 @@
import org.springblade.core.tool.support.Kv;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.modules.house.dto.UserHouseLabelDTO;
import org.springblade.modules.house.service.IUserHouseLabelService;
import org.springblade.modules.system.dto.MenuDTO;
import org.springblade.modules.system.entity.*;
import org.springblade.modules.system.mapper.MenuMapper;
@@ -43,6 +47,8 @@
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.*;
import java.util.stream.Collectors;
@@ -65,6 +71,9 @@
    private final static String PARENT_ID = "parentId";
    private final static Integer MENU_CATEGORY = 1;
    @Resource
    private IUserHouseLabelService iUserHouseLabelService;
    @Override
    public List<MenuVO> lazyList(Long parentId, Map<String, Object> param) {
        if (Func.isEmpty(Func.toStr(param.get(PARENT_ID)))) {
@@ -81,8 +90,22 @@
        return baseMapper.lazyMenuList(parentId, param);
    }
    public static final List<Integer> list1 = Arrays.asList(1, 2, 3, 4, 5, 6, 11, null);
    public static final List<Integer> list2 = Arrays.asList(1, 11, null);
    /**
     * apache测试方法
     */
    public static void main(String[] args) {
        System.out.println("交集:" + CollectionUtils.intersection(list1, list2)); // 交集
        System.out.println("补集:" + CollectionUtils.disjunction(list1, list2)); // 补集
        System.out.println("并集:" + CollectionUtils.union(list1, list2)); // 并集
        System.out.println("list1的差集:" + CollectionUtils.subtract(list1, list2)); // list1的差集
        System.out.println("list2的差集:" + CollectionUtils.subtract(list2, list1)); // list2的差集
    }
    @Override
    public List<MenuVO> routes(String roleId, Long topMenuId) {
    public List<MenuVO> routes(String roleId, Long topMenuId, Integer labelType) {
        if (StringUtil.isBlank(roleId)) {
            return null;
        }
@@ -95,6 +118,24 @@
        // 非超级管理员并且不是顶部菜单请求则返回对应角色权限菜单
        else if (!AuthUtil.isAdministrator() && Func.isEmpty(topMenuId)) {
            roleMenus = tenantPackageMenu(baseMapper.roleMenuByRoleId(Func.toLongList(roleId)));
            UserHouseLabelDTO userHouseLabelDTO = new UserHouseLabelDTO();
            userHouseLabelDTO.setUserId(AuthUtil.getUserId());
            userHouseLabelDTO.setLableType(labelType);
            List<Integer> integers = iUserHouseLabelService.selectUserLabelList(userHouseLabelDTO);
            Iterator<Menu> iterator = roleMenus.iterator();
            while (iterator.hasNext()) {
                Menu next = iterator.next();
                if (!next.getParentId().equals(0)) {
                    if (StringUtils.isNotBlank(next.getLabelId())) {
                        String[] split = next.getLabelId().split(",");
                        List<Integer> integerList = Arrays.stream(split).map(Integer::valueOf).collect(Collectors.toList());
                        Collection<? extends Serializable> union = CollectionUtils.intersection(integerList, integers);
                        if (union.size() == 0) {
                            iterator.remove();
                        }
                    }
                }
            }
        }
        // 顶部菜单请求返回对应角色权限菜单
        else {
@@ -110,6 +151,7 @@
                routes.stream().anyMatch(route -> route.getId().longValue() == x.getId().longValue())
            ).collect(Collectors.toList());
        }
        return buildRoutes(allMenus, roleMenus);
    }
@@ -280,7 +322,7 @@
                wrapper -> wrapper.eq(Menu::getName, menu.getName()).eq(Menu::getCategory, MENU_CATEGORY)
            );
        } else {
            menuQueryWrapper.ne(Menu::getId, menu.getId()).and(
            menuQueryWrapper.ne(Menu::getId, menu.getId()).eq(Menu::getIsDeleted,0).and(
                wrapper -> wrapper.eq(Menu::getCode, menu.getCode()).or(
                    o -> o.eq(Menu::getName, menu.getName()).eq(Menu::getCategory, MENU_CATEGORY)
                )