|
|
|
@ -99,7 +99,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<String> getDepartByuserId(String id) { |
|
|
|
|
|
|
|
|
|
return userMapper.getDepartByuserId(id); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1326,10 +1325,25 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl |
|
|
|
|
Result<IPage<SysUser>> result = new Result<IPage<SysUser>>(); |
|
|
|
|
|
|
|
|
|
LoginUser user= (LoginUser)SecurityUtils.getSubject().getPrincipal(); |
|
|
|
|
List<String> dep_ids=getDepartByuserId(user.getId()); |
|
|
|
|
//TODO 外部模拟登陆临时账号,列表不显示
|
|
|
|
|
queryWrapper.ne("username", "_reserve_user_external"); |
|
|
|
|
queryWrapper.like("org_code", user.getOrgCode()+"%"); |
|
|
|
|
queryWrapper.eq("username",user.getUsername()); |
|
|
|
|
//queryWrapper.like("org_code", user.getOrgCode());
|
|
|
|
|
|
|
|
|
|
if (oConvertUtils.isNotEmpty(dep_ids)) { |
|
|
|
|
LambdaQueryWrapper<SysUserDepart> query = new LambdaQueryWrapper<>(); |
|
|
|
|
query.eq(SysUserDepart::getDepId, dep_ids.get(0)); |
|
|
|
|
List<SysUserDepart> list = sysUserDepartMapper.selectList(query); |
|
|
|
|
List<String> userIds = list.stream().map(SysUserDepart::getUserId).collect(Collectors.toList()); |
|
|
|
|
//update-begin---author:wangshuai ---date:20220322 for:[issues/I4XTYB]查询用户时,当部门id 下没有分配用户时接口报错------------
|
|
|
|
|
if (oConvertUtils.listIsNotEmpty(userIds)) { |
|
|
|
|
queryWrapper.in("id", userIds); |
|
|
|
|
} else { |
|
|
|
|
return Result.OK(); |
|
|
|
|
} |
|
|
|
|
//update-end---author:wangshuai ---date:20220322 for:[issues/I4XTYB]查询用户时,当部门id 下没有分配用户时接口报错------------
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Page<SysUser> page = new Page<SysUser>(pageNo, pageSize); |
|
|
|
|
IPage<SysUser> pageList = this.page(page, queryWrapper); |
|
|
|
|
//批量查询用户的所属部门
|
|
|
|
|