微调
This commit is contained in:
@@ -52,4 +52,7 @@ public class UserVO extends UserParam implements Serializable {
|
|||||||
@ApiModelProperty("头像")
|
@ApiModelProperty("头像")
|
||||||
private String headSculpture;
|
private String headSculpture;
|
||||||
|
|
||||||
|
@ApiModelProperty("角色编码")
|
||||||
|
private List<String> roleCode;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,13 @@ public interface IRoleService extends IService<Role> {
|
|||||||
*/
|
*/
|
||||||
List<String> getIdByUserId(String id);
|
List<String> getIdByUserId(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据角色id获取角色code
|
||||||
|
* @param list
|
||||||
|
* @return 角色名集合
|
||||||
|
*/
|
||||||
|
List<String> getCodeByList(List<String> list);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询角色列表
|
* 分页查询角色列表
|
||||||
* @param queryParam
|
* @param queryParam
|
||||||
|
|||||||
@@ -98,6 +98,11 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IR
|
|||||||
return userRoleService.getUserRoleByUserId(id).stream().map(UserRole::getRoleId).distinct().collect(Collectors.toList());
|
return userRoleService.getUserRoleByUserId(id).stream().map(UserRole::getRoleId).distinct().collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getCodeByList(List<String> list) {
|
||||||
|
return this.lambdaQuery().in(Role::getId,list).list().stream().map(Role::getCode).distinct().collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<RoleVO> listRole(RoleParam.QueryParam queryParam) {
|
public Page<RoleVO> listRole(RoleParam.QueryParam queryParam) {
|
||||||
QueryWrapper<RoleVO> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<RoleVO> queryWrapper = new QueryWrapper<>();
|
||||||
|
|||||||
@@ -269,8 +269,10 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|||||||
userVO.setDeptName(deptService.getNameByDeptId(user.getDeptId()));
|
userVO.setDeptName(deptService.getNameByDeptId(user.getDeptId()));
|
||||||
userVO.setDeptLevel(dept.getPids().split(StrUtil.COMMA).length);
|
userVO.setDeptLevel(dept.getPids().split(StrUtil.COMMA).length);
|
||||||
}
|
}
|
||||||
userVO.setRoleList(roleService.getIdByUserId(id));
|
List<String> roleList = roleService.getIdByUserId(id);
|
||||||
|
userVO.setRoleList(roleList);
|
||||||
userVO.setRole(roleService.getNameByUserId(id));
|
userVO.setRole(roleService.getNameByUserId(id));
|
||||||
|
userVO.setRoleCode(roleService.getCodeByList(roleList));
|
||||||
return userVO;
|
return userVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user