|
|
@ -99,7 +99,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<String> getDepartByuserId(String id) { |
|
|
|
public List<String> getDepartByuserId(String id) { |
|
|
|
|
|
|
|
|
|
|
|
return userMapper.getDepartByuserId(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>>(); |
|
|
|
Result<IPage<SysUser>> result = new Result<IPage<SysUser>>(); |
|
|
|
|
|
|
|
|
|
|
|
LoginUser user= (LoginUser)SecurityUtils.getSubject().getPrincipal(); |
|
|
|
LoginUser user= (LoginUser)SecurityUtils.getSubject().getPrincipal(); |
|
|
|
|
|
|
|
List<String> dep_ids=getDepartByuserId(user.getId()); |
|
|
|
//TODO 外部模拟登陆临时账号,列表不显示
|
|
|
|
//TODO 外部模拟登陆临时账号,列表不显示
|
|
|
|
queryWrapper.ne("username", "_reserve_user_external"); |
|
|
|
queryWrapper.ne("username", "_reserve_user_external"); |
|
|
|
queryWrapper.like("org_code", user.getOrgCode()+"%"); |
|
|
|
//queryWrapper.like("org_code", user.getOrgCode());
|
|
|
|
queryWrapper.eq("username",user.getUsername()); |
|
|
|
|
|
|
|
|
|
|
|
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); |
|
|
|
Page<SysUser> page = new Page<SysUser>(pageNo, pageSize); |
|
|
|
IPage<SysUser> pageList = this.page(page, queryWrapper); |
|
|
|
IPage<SysUser> pageList = this.page(page, queryWrapper); |
|
|
|
//批量查询用户的所属部门
|
|
|
|
//批量查询用户的所属部门
|
|
|
|