|
@@ -57,6 +57,7 @@ import com.qunzhixinxi.hnqz.common.security.util.SecurityUtils;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
+import org.apache.commons.collections4.ListUtils;
|
|
|
import org.apache.commons.collections4.SetUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
@@ -247,16 +248,20 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|
|
|
|
|
Page<SysUser> toPage = new Page<>(query.getCurrent(), query.getSize());
|
|
|
|
|
|
-
|
|
|
Set<Integer> areaUserIds = null;
|
|
|
if (CollUtil.isNotEmpty(query.getAreaCodes())) {
|
|
|
- areaUserIds = userAreaService.listAreaUser(query.getAreaCodes()).stream().map(Long::intValue).collect(Collectors.toSet());
|
|
|
- }
|
|
|
|
|
|
- if (CollUtil.isEmpty(areaUserIds)) {
|
|
|
- return toPage;
|
|
|
- }
|
|
|
+ List<List<Long>> partition = ListUtils.partition(query.getAreaCodes(), 300);
|
|
|
+ areaUserIds = new HashSet<>();
|
|
|
|
|
|
+ for (List<Long> areaIds : partition) {
|
|
|
+ Set<Integer> collect = userAreaService.listAreaUser(areaIds).stream().map(Long::intValue).collect(Collectors.toSet());
|
|
|
+ areaUserIds.addAll(collect);
|
|
|
+ }
|
|
|
+
|
|
|
+ // Set<Integer> collect = partition.parallelStream().flatMap(ac -> userAreaService.listAreaUser(ac).stream()).map(Long::intValue).collect(Collectors.toSet());
|
|
|
+ // areaUserIds = userAreaService.listAreaUser(query.getAreaCodes()).stream().map(Long::intValue).collect(Collectors.toSet());
|
|
|
+ }
|
|
|
|
|
|
List<SysUserRole> userRoles = sysUserRoleService.list(Wrappers.<SysUserRole>lambdaQuery()
|
|
|
.in(CollUtil.isNotEmpty(areaUserIds), SysUserRole::getUserId, areaUserIds)
|