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");