角色配置按钮权限根据菜单查询按钮修改;

This commit is contained in:
王奎兴
2026-03-27 16:49:04 +08:00
parent e7768babec
commit 1c9fbf6622
3 changed files with 21 additions and 3 deletions
@@ -140,6 +140,19 @@ public class MenuApplicationService {
return menuDomainService.queryButtonlistById(menuPo); return menuDomainService.queryButtonlistById(menuPo);
} }
public List<MenuPo> queryOrgButtonlistById(MenuPo menuPo){
//获取登录人信息
LoginUser loginUser = SecurityUtils.getLoginUser();
if (loginUser != null){
UserPo userPo = loginUser.getUserPo();
if (userPo != null){
menuPo.setTopOrganizationId(userPo.getTopOrganizationId());
menuPo.setOrganizationId(userPo.getOrganizationId());
}
}
return menuDomainService.queryButtonlistById(menuPo);
}
/** /**
* 根据id查询菜单信息 * 根据id查询菜单信息
* *
@@ -77,6 +77,8 @@ public class MenuPo extends BaseVOEntity implements Serializable {
private Long sourceId; private Long sourceId;
@ApiModelProperty(name = "一级组织ID") @ApiModelProperty(name = "一级组织ID")
private Long topOrganizationId; private Long topOrganizationId;
@ApiModelProperty(name = "组织ID")
private Long organizationId;
@ApiModelProperty(name = "一级组织名称") @ApiModelProperty(name = "一级组织名称")
private Long topOrganizationName; private Long topOrganizationName;
@@ -92,4 +94,3 @@ public class MenuPo extends BaseVOEntity implements Serializable {
@ApiModelProperty(name = "首页展示标记(1-是,2-否)") @ApiModelProperty(name = "首页展示标记(1-是,2-否)")
private Integer homeShowFlag; private Integer homeShowFlag;
} }
@@ -82,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ON me.modules_id = mo.modules_id ON me.modules_id = mo.modules_id
LEFT JOIN sys_organization so ON me.top_organization_id = so.organization_id LEFT JOIN sys_organization so ON me.top_organization_id = so.organization_id
AND so.del_flag = 1 AND so.del_flag = 1
left join ORGANIZATION_MENU om on me.menu_id = om.menu_id
</sql> </sql>
<select id="selectMenuList" parameterType="com.linke.product.domain.menu.repository.po.MenuPo" resultMap="MenuResult"> <select id="selectMenuList" parameterType="com.linke.product.domain.menu.repository.po.MenuPo" resultMap="MenuResult">
@@ -136,6 +137,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="topOrganizationId != null"> <if test="topOrganizationId != null">
and me.top_organization_id = #{topOrganizationId} and me.top_organization_id = #{topOrganizationId}
</if> </if>
<if test="organizationId != null">
and om.organization_id = #{organizationId}
</if>
<if test="moduleIdList != null and moduleIdList.size > 0"> <if test="moduleIdList != null and moduleIdList.size > 0">
and mo.modules_id in and mo.modules_id in
<foreach item="modulesId" collection="moduleIdList" open="(" separator="," close=")"> <foreach item="modulesId" collection="moduleIdList" open="(" separator="," close=")">