|
@@ -1100,6 +1100,7 @@ public class SysUserController {
|
|
@PostMapping(value = "/selectUserList")
|
|
@PostMapping(value = "/selectUserList")
|
|
public R<?> pageUsers(@Validated @RequestBody SysUserDTO.OnPage query) {
|
|
public R<?> pageUsers(@Validated @RequestBody SysUserDTO.OnPage query) {
|
|
|
|
|
|
|
|
+ HnqzUser user = SecurityUtils.getUser();
|
|
|
|
|
|
// 获取全部的可用角色
|
|
// 获取全部的可用角色
|
|
Map<Integer, SysRole> roleId2RoleMap = roleService.list().stream().collect(Collectors.toMap(SysRole::getRoleId, Function.identity()));
|
|
Map<Integer, SysRole> roleId2RoleMap = roleService.list().stream().collect(Collectors.toMap(SysRole::getRoleId, Function.identity()));
|
|
@@ -1137,6 +1138,7 @@ public class SysUserController {
|
|
// 服务商管理员
|
|
// 服务商管理员
|
|
else if (operatorRoleIds.contains(37)) {
|
|
else if (operatorRoleIds.contains(37)) {
|
|
role = roleId2RoleMap.get(37);
|
|
role = roleId2RoleMap.get(37);
|
|
|
|
+ query.setDeptId(user.getDeptId());
|
|
needArea = true;
|
|
needArea = true;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1175,14 +1177,14 @@ public class SysUserController {
|
|
List<Long> areas = query.getAreaCodes();
|
|
List<Long> areas = query.getAreaCodes();
|
|
|
|
|
|
if (CollUtil.isEmpty(areas) && needArea) {
|
|
if (CollUtil.isEmpty(areas) && needArea) {
|
|
- areas = userAreaService.listUserAreas(Long.valueOf(SecurityUtils.getUser().getId()));
|
|
|
|
|
|
+ areas = userAreaService.listUserAreas(Long.valueOf(user.getId()));
|
|
}
|
|
}
|
|
|
|
|
|
// 如果实际三级区域于查询三级区域相等,也就是全国的时候,默认直接查询全国
|
|
// 如果实际三级区域于查询三级区域相等,也就是全国的时候,默认直接查询全国
|
|
query.setAreaCodes((areaEntities.size() == (CollUtil.isNotEmpty(areas) ? areas.size() : 0)) ? Collections.emptyList() : new LinkedList<>(CollUtil.intersectionDistinct(areaEntities, areas)));
|
|
query.setAreaCodes((areaEntities.size() == (CollUtil.isNotEmpty(areas) ? areas.size() : 0)) ? Collections.emptyList() : new LinkedList<>(CollUtil.intersectionDistinct(areaEntities, areas)));
|
|
query.setRole(new LinkedList<>(targetRoleIds));
|
|
query.setRole(new LinkedList<>(targetRoleIds));
|
|
|
|
|
|
- Page<?> userVosPage = userService.pageUser(query, SecurityUtils.getUser());
|
|
|
|
|
|
+ Page<?> userVosPage = userService.pageUser(query, user);
|
|
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(userVosPage.getRecords())) {
|
|
if (CollUtil.isNotEmpty(userVosPage.getRecords())) {
|
|
@@ -1217,9 +1219,9 @@ public class SysUserController {
|
|
|
|
|
|
// 角色
|
|
// 角色
|
|
List<SysRole> roles = new LinkedList<>();
|
|
List<SysRole> roles = new LinkedList<>();
|
|
- for (SysRole r : vo.getRoleList()){
|
|
|
|
|
|
+ for (SysRole r : vo.getRoleList()) {
|
|
SysRole role1 = roleId2RoleMap.get(r.getRoleId());
|
|
SysRole role1 = roleId2RoleMap.get(r.getRoleId());
|
|
- if (role1 == null){
|
|
|
|
|
|
+ if (role1 == null) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
roles.add(role1);
|
|
roles.add(role1);
|