|
|
@ -192,6 +192,44 @@ public class SysUserController { |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 用于教师库管理 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param user |
|
|
|
|
|
|
|
* @param pageNo |
|
|
|
|
|
|
|
* @param pageSize |
|
|
|
|
|
|
|
* @param req |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
//@RequiresPermissions("system:user:listAll")
|
|
|
|
|
|
|
|
@RequestMapping(value = "/listTEAAll", method = RequestMethod.GET) |
|
|
|
|
|
|
|
public Result<IPage<SysUser>> listTEAAll(SysUser user, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
|
|
|
|
|
|
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { |
|
|
|
|
|
|
|
QueryWrapper<SysUser> queryWrapper = QueryGenerator.initQueryWrapper(user, req.getParameterMap()); |
|
|
|
|
|
|
|
Result<IPage<SysUser>> result = new Result<IPage<SysUser>>(); |
|
|
|
|
|
|
|
Page<SysUser> page = new Page<SysUser>(pageNo, pageSize); |
|
|
|
|
|
|
|
// String roleId = req.getParameter("roleId");
|
|
|
|
|
|
|
|
String roleId = "1731948288626339844"; |
|
|
|
|
|
|
|
String username = req.getParameter("username"); |
|
|
|
|
|
|
|
IPage<SysUser> pageList = sysUserService.getUserByRoleId(page,roleId,username); |
|
|
|
|
|
|
|
//批量查询用户的所属部门
|
|
|
|
|
|
|
|
//step.1 先拿到全部的 useids
|
|
|
|
|
|
|
|
//step.2 通过 useids,一次性查询用户的所属部门名字
|
|
|
|
|
|
|
|
List<String> userIds = pageList.getRecords().stream().map(SysUser::getId).collect(Collectors.toList()); |
|
|
|
|
|
|
|
if (userIds != null && userIds.size() > 0) { |
|
|
|
|
|
|
|
Map<String, String> useDepNames = sysUserService.getDepNamesByUserIds(userIds); |
|
|
|
|
|
|
|
pageList.getRecords().forEach(item -> |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
item.setOrgCodeTxt(useDepNames.get(item.getId())); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
result.setSuccess(true); |
|
|
|
|
|
|
|
result.setResult(pageList); |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 获取系统用户数据(查询全部用户,不做租户隔离) |
|
|
|
* 获取系统用户数据(查询全部用户,不做租户隔离) |
|
|
|
* |
|
|
|
* |
|
|
|