commit for pull

This commit is contained in:
caixiang 2023-04-03 11:13:18 +08:00
parent 18c1c6cc15
commit cabed052a1

View File

@ -55,29 +55,11 @@ public class SysRoleServiceImpl extends BaseServiceImpl<SysRoleDao, SysRoleEntit
@Override
public List<SysRoleDTO> list(Map<String, Object> params) {
List<SysRoleEntity> entityList = baseDao.selectList(getWrapper2(params));
List<SysRoleEntity> entityList = baseDao.selectList(getWrapper(params));
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){
String name = (String)params.get("name");