Merge remote-tracking branch 'upstream/master'

This commit is contained in:
“zyj” 2021-12-08 11:04:02 +08:00
commit 47c4166327
14 changed files with 21 additions and 29 deletions

View File

@ -26,7 +26,7 @@ public interface SysDeptMapper
* @param deptCheckStrictly 部门树选择项是否关联显示
* @return 选中部门列表
*/
public List<Integer> selectDeptListByRoleId(@Param("roleId") Long roleId, @Param("deptCheckStrictly") boolean deptCheckStrictly);
public List<Long> selectDeptListByRoleId(@Param("roleId") Long roleId, @Param("deptCheckStrictly") boolean deptCheckStrictly);
/**
* 根据部门ID查询信息

View File

@ -64,7 +64,7 @@ public interface SysMenuMapper
* @param menuCheckStrictly 菜单树选择项是否关联显示
* @return 选中菜单列表
*/
public List<Integer> selectMenuListByRoleId(@Param("roleId") Long roleId, @Param("menuCheckStrictly") boolean menuCheckStrictly);
public List<Long> selectMenuListByRoleId(@Param("roleId") Long roleId, @Param("menuCheckStrictly") boolean menuCheckStrictly);
/**
* 根据菜单ID查询信息

View File

@ -39,7 +39,7 @@ public interface SysPostMapper
* @param userId 用户ID
* @return 选中岗位ID列表
*/
public List<Integer> selectPostListByUserId(Long userId);
public List<Long> selectPostListByUserId(Long userId);
/**
* 查询用户所属岗位组

View File

@ -41,7 +41,7 @@ public interface ISysDeptService
* @param roleId 角色ID
* @return 选中部门列表
*/
public List<Integer> selectDeptListByRoleId(Long roleId);
public List<Long> selectDeptListByRoleId(Long roleId);
/**
* 根据部门ID查询信息

View File

@ -52,7 +52,7 @@ public interface ISysMenuService
* @param roleId 角色ID
* @return 选中菜单列表
*/
public List<Integer> selectMenuListByRoleId(Long roleId);
public List<Long> selectMenuListByRoleId(Long roleId);
/**
* 构建前端路由所需要的菜单

View File

@ -39,7 +39,7 @@ public interface ISysPostService
* @param userId 用户ID
* @return 选中岗位ID列表
*/
public List<Integer> selectPostListByUserId(Long userId);
public List<Long> selectPostListByUserId(Long userId);
/**
* 校验岗位名称

View File

@ -100,7 +100,7 @@ public class SysDeptServiceImpl implements ISysDeptService
* @return 选中部门列表
*/
@Override
public List<Integer> selectDeptListByRoleId(Long roleId)
public List<Long> selectDeptListByRoleId(Long roleId)
{
SysRole role = roleMapper.selectRoleById(roleId);
return deptMapper.selectDeptListByRoleId(roleId, role.isDeptCheckStrictly());

View File

@ -128,7 +128,7 @@ public class SysMenuServiceImpl implements ISysMenuService
* @return 选中菜单列表
*/
@Override
public List<Integer> selectMenuListByRoleId(Long roleId)
public List<Long> selectMenuListByRoleId(Long roleId)
{
SysRole role = roleMapper.selectRoleById(roleId);
return menuMapper.selectMenuListByRoleId(roleId, role.isMenuCheckStrictly());

View File

@ -67,7 +67,7 @@ public class SysPostServiceImpl implements ISysPostService
* @return 选中岗位ID列表
*/
@Override
public List<Integer> selectPostListByUserId(Long userId)
public List<Long> selectPostListByUserId(Long userId)
{
return postMapper.selectPostListByUserId(userId);
}

View File

@ -2,11 +2,13 @@ package com.ruoyi.system.service.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.domain.entity.SysRole;
@ -127,16 +129,11 @@ public class SysUserServiceImpl implements ISysUserService
public String selectUserRoleGroup(String userName)
{
List<SysRole> list = roleMapper.selectRolesByUserName(userName);
StringBuffer idsStr = new StringBuffer();
for (SysRole role : list)
if (CollectionUtils.isEmpty(list))
{
idsStr.append(role.getRoleName()).append(",");
return StringUtils.EMPTY;
}
if (StringUtils.isNotEmpty(idsStr.toString()))
{
return idsStr.substring(0, idsStr.length() - 1);
}
return idsStr.toString();
return list.stream().map(SysRole::getRoleName).collect(Collectors.joining(","));
}
/**
@ -149,16 +146,11 @@ public class SysUserServiceImpl implements ISysUserService
public String selectUserPostGroup(String userName)
{
List<SysPost> list = postMapper.selectPostsByUserName(userName);
StringBuffer idsStr = new StringBuffer();
for (SysPost post : list)
if (CollectionUtils.isEmpty(list))
{
idsStr.append(post.getPostName()).append(",");
return StringUtils.EMPTY;
}
if (StringUtils.isNotEmpty(idsStr.toString()))
{
return idsStr.substring(0, idsStr.length() - 1);
}
return idsStr.toString();
return list.stream().map(SysPost::getPostName).collect(Collectors.joining(","));
}
/**

View File

@ -47,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by d.parent_id, d.order_num
</select>
<select id="selectDeptListByRoleId" resultType="Integer">
<select id="selectDeptListByRoleId" resultType="Long">
select d.dept_id
from sys_dept d
left join sys_role_dept rd on d.dept_id = rd.dept_id

View File

@ -84,7 +84,7 @@
order by m.parent_id, m.order_num
</select>
<select id="selectMenuListByRoleId" resultType="Integer">
<select id="selectMenuListByRoleId" resultType="Long">
select m.menu_id
from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id

View File

@ -46,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where post_id = #{postId}
</select>
<select id="selectPostListByUserId" parameterType="Long" resultType="Integer">
<select id="selectPostListByUserId" parameterType="Long" resultType="Long">
select p.post_id
from sys_post p
left join sys_user_post up on up.post_id = p.post_id

View File

@ -9,7 +9,7 @@
</el-form-item>
</el-col>
<el-col :span="8" :offset="2">
<el-form-item label="登录账号" prop="phonenumber">
<el-form-item label="登录账号" prop="userName">
<el-input v-model="form.userName" disabled />
</el-form-item>
</el-col>