commit for pull

This commit is contained in:
caixiang 2023-04-03 10:59:34 +08:00
parent 3ff7d7c178
commit 0e95d8c1d2

View File

@ -55,11 +55,29 @@ public class SysRoleServiceImpl extends BaseServiceImpl<SysRoleDao, SysRoleEntit
@Override @Override
public List<SysRoleDTO> list(Map<String, Object> params) { public List<SysRoleDTO> list(Map<String, Object> params) {
List<SysRoleEntity> entityList = baseDao.selectList(getWrapper(params)); List<SysRoleEntity> entityList = baseDao.selectList(getWrapper2(params));
return ConvertUtils.sourceToTarget(entityList, SysRoleDTO.class); return ConvertUtils.sourceToTarget(entityList, SysRoleDTO.class);
} }
private QueryWrapper<SysRoleEntity> getWrapper2(Map<String, Object> params){
String name = (String)params.get("name");
QueryWrapper<SysRoleEntity> 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<Long> deptIdList = sysDeptService.getSubDeptIdList(user.getDeptId());
// wrapper.in(deptIdList != null, "dept_id", deptIdList);
// }
return wrapper;
}
private QueryWrapper<SysRoleEntity> getWrapper(Map<String, Object> params){ private QueryWrapper<SysRoleEntity> getWrapper(Map<String, Object> params){
String name = (String)params.get("name"); String name = (String)params.get("name");