|
|
@@ -106,4 +106,23 @@ public class RoleManage { |
|
|
|
.collect(Collectors.toList()); |
|
|
|
return userInfoService.listByIds(userIds); |
|
|
|
} |
|
|
|
|
|
|
|
public List<UserInfo> getUsersByRoleType(String roleType,String regionCode) { |
|
|
|
Role regionRole = roleService.getOne(Wrappers.lambdaQuery(Role.class) |
|
|
|
.eq(Role::getCode, roleType) |
|
|
|
.last(BizConst.LIMIT_1)); |
|
|
|
if(Objects.isNull(regionRole)){ |
|
|
|
return Collections.emptyList(); |
|
|
|
} |
|
|
|
List<UserRole> userRoles = iUserRoleService.list(Wrappers.lambdaQuery(UserRole.class) |
|
|
|
.eq(UserRole::getRoleId, regionRole.getId())); |
|
|
|
if(CollUtil.isEmpty(userRoles)){ |
|
|
|
return Collections.emptyList(); |
|
|
|
} |
|
|
|
List<Long> userIds = userRoles.stream().map(UserRole::getUserId) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
return userInfoService.list(Wrappers.lambdaQuery(UserInfo.class) |
|
|
|
.in(UserInfo::getId,userIds) |
|
|
|
.eq(UserInfo::getRegionCode,regionCode)); |
|
|
|
} |
|
|
|
} |