From 04c5da6081e592087e7c8e5ecfb4b400676430c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=B6=E4=B8=9C?= <1654135867@qq.com> Date: Tue, 27 Aug 2024 10:59:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=95=99=E5=B8=88=E5=BA=93?= =?UTF-8?q?=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/controller/SysUserController.java | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) 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; + } + + /** * 获取系统用户数据(查询全部用户,不做租户隔离) *