用户管理
This commit is contained in:
parent
141c300518
commit
9e120fd1d7
@ -86,21 +86,8 @@ public class UserController {
|
|||||||
criteria.getDeptIds().addAll(deptService.getDeptChildren(data));
|
criteria.getDeptIds().addAll(deptService.getDeptChildren(data));
|
||||||
}
|
}
|
||||||
// 数据权限
|
// 数据权限
|
||||||
List<Long> dataScopes = dataService.getDeptIds(userService.findByName(SecurityUtils.getCurrentUsername()));
|
|
||||||
// criteria.getDeptIds() 不为空并且数据权限不为空则取交集
|
|
||||||
if (!CollectionUtils.isEmpty(criteria.getDeptIds()) && !CollectionUtils.isEmpty(dataScopes)){
|
|
||||||
// 取交集
|
|
||||||
criteria.getDeptIds().retainAll(dataScopes);
|
|
||||||
if(!CollectionUtil.isEmpty(criteria.getDeptIds())){
|
|
||||||
return new ResponseEntity<>(userService.queryAll(criteria,page),HttpStatus.OK);
|
return new ResponseEntity<>(userService.queryAll(criteria,page),HttpStatus.OK);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// 否则取并集
|
|
||||||
criteria.getDeptIds().addAll(dataScopes);
|
|
||||||
return new ResponseEntity<>(userService.queryAll(criteria,page),HttpStatus.OK);
|
|
||||||
}
|
|
||||||
return new ResponseEntity<>(PageUtil.noData(),HttpStatus.OK);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Log("新增用户")
|
@Log("新增用户")
|
||||||
@ApiOperation("新增用户")
|
@ApiOperation("新增用户")
|
||||||
|
Loading…
Reference in New Issue
Block a user