动态按钮修改;

This commit is contained in:
王奎兴
2026-03-28 16:54:47 +08:00
parent 5d9cf9f216
commit 37b3301ddd
6 changed files with 93 additions and 5 deletions
@@ -152,7 +152,7 @@ public class MenuApplicationService {
}
}
}
return menuDomainService.queryButtonlistById(menuPo);
return menuDomainService.queryOrgButtonlistById(menuPo);
}
/**
@@ -26,6 +26,8 @@ public interface MenuRepositoryInterface extends IService<Menu> {
public List<MenuPo> queryButtonlistById(MenuPo menuPo);
public List<MenuPo> queryOrgButtonlistById(MenuPo menuPo);
/**
* 查询菜单树集合
*
@@ -29,6 +29,8 @@ public interface MenuMapper extends BaseMapper<Menu> {
public List<MenuPo> queryButtonlistById(MenuPo menuPo);
public List<MenuPo> queryOrgButtonlistById(MenuPo menuPo);
/**
* 查询菜单树集合
*
@@ -52,6 +52,11 @@ public class MenuRepositoryImpl extends ServiceImpl<MenuMapper,Menu> implements
return menuMapper.queryButtonlistById(menuPo);
}
@Override
public List<MenuPo> queryOrgButtonlistById(MenuPo menuPo){
return menuMapper.queryOrgButtonlistById(menuPo);
}
/**
* 查询菜单树集合
*
@@ -53,6 +53,10 @@ public class MenuDomainService {
return menuRepositoryImpl.queryButtonlistById(menuPo);
}
public List<MenuPo> queryOrgButtonlistById(MenuPo menuPo){
return menuRepositoryImpl.queryOrgButtonlistById(menuPo);
}
/**
* 查询菜单前端组件集合
*
@@ -38,6 +38,53 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectMenuVo">
SELECT
me.menu_id,
me.parent_menu_id,
me.modules_id,
mo.modules_name,
me.product_id,
me.menu_client,
me.menu_type,
me.menu_name,
me.menu_show_name,
me.menu_path,
me.micro_service_path,
me.menu_component,
me.menu_redirect_path,
me.menu_icon,
me.menu_sort,
me.menu_avatar,
me.app_location_code,
me.app_location_name,
me.menu_hidden,
me.menu_visible,
me.menu_cache_status,
me.menu_always_show,
me.menu_internal_or_external,
me.menu_remark,
me.menu_linkage,
me.menu_show,
me.menu_perms,
me.create_time,
me.create_by,
me.update_time,
me.update_by,
me.source_id,
me.del_flag,
so.organization_name,
me.top_organization_id,
me.home_show_flag
FROM
sys_menu me
LEFT JOIN
sys_modules mo
ON me.modules_id = mo.modules_id
LEFT JOIN sys_organization so ON me.top_organization_id = so.organization_id
AND so.del_flag = 1
</sql>
<sql id="selectOrgMenuVo">
SELECT
me.menu_id,
me.parent_menu_id,
@@ -126,6 +173,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="queryButtonlistById" parameterType="com.linke.product.domain.menu.repository.po.MenuPo" resultMap="MenuResult">
<include refid="selectMenuVo"/>
<where>
me.del_flag = 1 and me.menu_type=3
<if test="modulesId != null and modulesId != '-1'.toString()">
and mo.modules_id = #{modulesId}
</if>
<if test="menuId != null">
and me.parent_menu_id = #{menuId}
</if>
<if test="topOrganizationId != null">
and me.top_organization_id = #{topOrganizationId}
</if>
<if test="moduleIdList != null and moduleIdList.size > 0">
and mo.modules_id in
<foreach item="modulesId" collection="moduleIdList" open="(" separator="," close=")">
#{modulesId}
</foreach>
</if>
<if test="menuIdList != null and menuIdList.size > 0">
and me.menu_id in
<foreach item="menuId" collection="menuIdList" open="(" separator="," close=")">
#{menuId}
</foreach>
</if>
</where>
</select>
<select id="queryOrgButtonlistById" parameterType="com.linke.product.domain.menu.repository.po.MenuPo" resultMap="MenuResult">
<include refid="selectOrgMenuVo"/>
<where>
me.del_flag = 1 and me.menu_type=3
<if test="modulesId != null and modulesId != '-1'.toString()">