From 0e95d8c1d28f9954df061bc477d71c8a2dea86fd Mon Sep 17 00:00:00 2001 From: caixiang <939387484@qq.com> Date: Mon, 3 Apr 2023 10:59:34 +0800 Subject: [PATCH] commit for pull --- .../service/impl/SysRoleServiceImpl.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/ym-admin/src/main/java/com/cnbm/admin/service/impl/SysRoleServiceImpl.java b/ym-admin/src/main/java/com/cnbm/admin/service/impl/SysRoleServiceImpl.java index ae553db..cef33a3 100644 --- a/ym-admin/src/main/java/com/cnbm/admin/service/impl/SysRoleServiceImpl.java +++ b/ym-admin/src/main/java/com/cnbm/admin/service/impl/SysRoleServiceImpl.java @@ -55,11 +55,29 @@ public class SysRoleServiceImpl extends BaseServiceImpl list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); + List entityList = baseDao.selectList(getWrapper2(params)); return ConvertUtils.sourceToTarget(entityList, SysRoleDTO.class); } + private QueryWrapper getWrapper2(Map params){ + String name = (String)params.get("name"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.like(StringUtils.isNotBlank(name), "name", name); + +// //普通管理员,只能查询所属部门及子部门的数据 +// UsernamePasswordAuthenticationToken authentication = (UsernamePasswordAuthenticationToken) SecurityContextHolder.getContext().getAuthentication(); +// LoginUser loginUser = (LoginUser) authentication.getPrincipal(); +// SysUserEntity user = loginUser.getSysUserEntity(); +// if(!Objects.isNull(user.getSuperAdmin()) && (user.getSuperAdmin() == SuperAdminEnum.NO.value() || )) { +// List deptIdList = sysDeptService.getSubDeptIdList(user.getDeptId()); +// wrapper.in(deptIdList != null, "dept_id", deptIdList); +// } + + return wrapper; + } + private QueryWrapper getWrapper(Map params){ String name = (String)params.get("name");