Changes提交修改
This commit is contained in:
@@ -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查询菜单
|
||||
*
|
||||
|
||||
@@ -57,4 +57,6 @@ public interface SysNoticeMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNoticeByIds(Long[] noticeIds);
|
||||
|
||||
List<SysNotice> selectNoticeIndexList(SysNotice notice);
|
||||
}
|
||||
|
||||
@@ -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查询菜单树信息
|
||||
*
|
||||
|
||||
@@ -57,4 +57,6 @@ public interface ISysNoticeService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNoticeByIds(Long[] noticeIds);
|
||||
|
||||
List<SysNotice> selectNoticeIndexList(SysNotice notice);
|
||||
}
|
||||
|
||||
@@ -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查询菜单
|
||||
*
|
||||
|
||||
@@ -42,6 +42,11 @@ public class SysNoticeServiceImpl implements ISysNoticeService
|
||||
return noticeMapper.selectNoticeList(notice);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysNotice> selectNoticeIndexList(SysNotice notice)
|
||||
{
|
||||
return noticeMapper.selectNoticeIndexList(notice);
|
||||
}
|
||||
/**
|
||||
* 新增公告
|
||||
*
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user