From 99a91d01a22c09beda04885d4f0eda5bdebb4079 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 2 Jul 2021 09:50:24 +0800 Subject: [PATCH] candidateList --- .../service/resigroup/impl/ResiGroupServiceImpl.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java index a2f853dd2f..4a9cd89119 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java @@ -68,13 +68,12 @@ public class ResiGroupServiceImpl implements ResiGroupService { @Override public List candidateList(CandidateListFormDTO formDTO) { // 根据小组ID查询组员信息身份【不包括组长自己】 - PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> resiGroupDao.candidateList(formDTO.getGroupId())); - List result = pageInfo.getList(); + List result=resiGroupDao.candidateList(formDTO.getGroupId()); // 没有直接返回空集合 if (CollectionUtils.isEmpty(result)){ return new ArrayList<>(); } - // 获取userIds + // 获取userIds- 所有组员的id List userIds = result.stream().map(m -> m.getUserId()).collect(Collectors.toList()); // 查询用户信息【名字 头像】 List userInfos = epmetUserService.selectUserInfosByUserIds(userIds); @@ -97,7 +96,9 @@ public class ResiGroupServiceImpl implements ResiGroupService { List badgeInfo = resiGroupRedis.getBadgeInfoByUserId(formDTO.getCustomerId(), r.getUserId()); r.setBadgeList(null==badgeInfo ? new ArrayList<>() : badgeInfo); }); - List showUsers = epmetUserService.selectUserIdByCustomerId(userIds); + //应该在这分页..... + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> epmetUserService.selectUserIdByCustomerId(userIds)); + List showUsers = pageInfo.getList(); if (CollectionUtils.isEmpty(showUsers)){ return new ArrayList<>(); }