From 1aff2f1fc20c60799a33e6a169974b58a6c1ae02 Mon Sep 17 00:00:00 2001 From: Gitea Date: Sat, 9 Nov 2024 17:49:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E6=96=B0=E5=88=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/controller/SysUserController.java | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java index 75a60d1..6d14a6e 100644 --- a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java +++ b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java @@ -163,6 +163,26 @@ public class SysUserController { return sysUserService.queryPageList(req, queryWrapper, pageSize, pageNo); } + /** + * @description: 根据用户角色查询下属用户 + * @param: [user, pageNo, pageSize, req] + * @return: org.jeecg.common.api.vo.Result> + * @author: z.h.c + * @date: 24/11/8 15:19 + */ +// @RequiresPermissions("system:user:listAll") + @RequestMapping(value = "/listByRollCode", method = RequestMethod.GET) + public Result> listByRollCode(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()); + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); +// SysDepart sysDepart = sysDepartService.getById(loginUser.getOrgId()); + + queryWrapper.likeRight("org_code", loginUser.getOrgCode()); + return sysUserService.queryPageList(req, queryWrapper, pageSize, pageNo); + } + /** * @description: 根据用户权限查询申报人列表 * @param: [user, pageNo, pageSize, req] @@ -172,7 +192,7 @@ public class SysUserController { */ @RequestMapping(value = "/getDeclarantList", method = RequestMethod.GET) public Result> getDeclarantList(SysUser user, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); String roleCode = loginUser.getRoleCode(); List userIds = new LinkedList<>(); @@ -1759,7 +1779,7 @@ public class SysUserController { * @return */ @PostMapping("/login/setting/userEdit") - //@RequiresPermissions("system:user:setting:edit") +// @RequiresPermissions("system:user:setting:edit") public Result userEdit(@RequestBody SysUser sysUser, HttpServletRequest request) { String username = JwtUtil.getUserNameByToken(request); SysUser user = sysUserService.getById(sysUser.getId());