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