Changes提交修改

This commit is contained in:
15666619788
2025-07-27 22:23:59 +08:00
parent a9895296f0
commit 34d3a965d7
35 changed files with 894 additions and 26 deletions

View File

@@ -42,7 +42,7 @@ public interface SysMenuMapper
* @return 权限列表
*/
public List<String> selectMenuPermsByRoleId(Long roleId);
public List<String> selectMenuPermsByRoleIdF(Long roleId);
/**
* 根据用户ID查询权限
*
@@ -50,7 +50,7 @@ public interface SysMenuMapper
* @return 权限列表
*/
public List<String> selectMenuPermsByUserId(Long userId);
public List<String> selectMenuPermsByUserIdF(Long userId);
/**
* 根据用户ID查询菜单
*

View File

@@ -57,4 +57,6 @@ public interface SysNoticeMapper
* @return 结果
*/
public int deleteNoticeByIds(Long[] noticeIds);
List<SysNotice> selectNoticeIndexList(SysNotice notice);
}

View File

@@ -38,7 +38,7 @@ public interface ISysMenuService
* @return 权限列表
*/
public Set<String> selectMenuPermsByUserId(Long userId);
public Set<String> selectMenuPermsByUserIdF(Long userId);
/**
* 根据角色ID查询权限
*
@@ -46,7 +46,7 @@ public interface ISysMenuService
* @return 权限列表
*/
public Set<String> selectMenuPermsByRoleId(Long roleId);
public Set<String> selectMenuPermsByRoleIdF(Long roleId);
/**
* 根据用户ID查询菜单树信息
*

View File

@@ -57,4 +57,6 @@ public interface ISysNoticeService
* @return 结果
*/
public int deleteNoticeByIds(Long[] noticeIds);
List<SysNotice> selectNoticeIndexList(SysNotice notice);
}

View File

@@ -134,6 +134,21 @@ public class SysMenuServiceImpl implements ISysMenuService
return permsSet;
}
@Override
public Set<String> selectMenuPermsByUserIdF(Long userId)
{
List<String> perms = menuMapper.selectMenuPermsByUserIdF(userId);
Set<String> permsSet = new HashSet<>();
for (String perm : perms)
{
if (StringUtils.isNotEmpty(perm))
{
permsSet.addAll(Arrays.asList(perm.trim().split(",")));
}
}
return permsSet;
}
/**
* 根据角色ID查询权限
*
@@ -155,6 +170,21 @@ public class SysMenuServiceImpl implements ISysMenuService
return permsSet;
}
@Override
public Set<String> selectMenuPermsByRoleIdF(Long roleId)
{
List<String> perms = menuMapper.selectMenuPermsByRoleIdF(roleId);
Set<String> permsSet = new HashSet<>();
for (String perm : perms)
{
if (StringUtils.isNotEmpty(perm))
{
permsSet.addAll(Arrays.asList(perm.trim().split(",")));
}
}
return permsSet;
}
/**
* 根据用户ID查询菜单
*

View File

@@ -42,6 +42,11 @@ public class SysNoticeServiceImpl implements ISysNoticeService
return noticeMapper.selectNoticeList(notice);
}
@Override
public List<SysNotice> selectNoticeIndexList(SysNotice notice)
{
return noticeMapper.selectNoticeIndexList(notice);
}
/**
* 新增公告
*

View File

@@ -48,7 +48,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
</where>
</select>
<select id="selectNoticeIndexList" parameterType="SysNotice" resultMap="SysNoticeResult">
<include refid="selectNoticeVo"/>
<where>
<if test="deptId != null and deptId != 0 ">
and n.dept_id in (
SELECT #{deptId} AS dept_id
UNION ALL
SELECT DISTINCT CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(ancestors, ',', n.n), ',', -1) AS SIGNED) AS dept_id
FROM sys_dept d
JOIN (
SELECT 1 AS n UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5
UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL SELECT 10
) n ON CHAR_LENGTH(ancestors) - CHAR_LENGTH(REPLACE(ancestors, ',', '')) >= n.n - 1
WHERE d.dept_id = #{deptId}
AND SUBSTRING_INDEX(SUBSTRING_INDEX(ancestors, ',', n.n), ',', -1) != ''
)
</if>
</where>
</select>
<insert id="insertNotice" parameterType="SysNotice">
insert into sys_notice (
<if test="deptId != null and deptId != 0">dept_id,</if>