用户管理

This commit is contained in:
lihongbiao 2025-07-19 22:29:21 +08:00
parent 141c300518
commit 9e120fd1d7

View File

@ -86,20 +86,7 @@ public class UserController {
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);
}
} else {
// 否则取并集
criteria.getDeptIds().addAll(dataScopes);
return new ResponseEntity<>(userService.queryAll(criteria,page),HttpStatus.OK);
}
return new ResponseEntity<>(PageUtil.noData(),HttpStatus.OK);
return new ResponseEntity<>(userService.queryAll(criteria,page),HttpStatus.OK);
}
@Log("新增用户")