From e69fd4d56408656b61610dfae7f2adef576a6770 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 23 Jul 2021 14:10:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9F=A5=E8=AF=A2=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E4=B8=8B=E6=89=80=E6=9C=89=E7=94=A8=E6=88=B7=E5=8C=85?= =?UTF-8?q?=E6=8B=AC=E9=99=8C=E7=94=9F=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dao/UserWechatDao.java | 2 +- .../service/impl/GridLatestServiceImpl.java | 20 ++++--------------- .../main/resources/mapper/UserWechatDao.xml | 4 +--- 3 files changed, 6 insertions(+), 20 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserWechatDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserWechatDao.java index bd6839ac59..b225205a4b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserWechatDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserWechatDao.java @@ -74,7 +74,7 @@ public interface UserWechatDao extends BaseDao{ * @author wangc * @date 2020.07.27 00:58 **/ - List selectResiAndStrangerInfo(@Param("userIds") List userIds, @Param("realName")String realName); + List selectResiAndStrangerInfo(@Param("customerId") String customerId, @Param("realName")String realName); //临时用下in List selectNotInUserBaseInfoTemp(); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java index e25a4600eb..a5501439cc 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java @@ -49,6 +49,7 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import java.util.*; import java.util.stream.Collectors; @@ -190,23 +191,10 @@ public class GridLatestServiceImpl extends BaseServiceImpl getCustomerUsers(CustomerUserFormDTO customerUserFormDTO) { - List allData = new LinkedList<>(); - List userIds = baseDao.selectAllUserByCustomerId(customerUserFormDTO.getCustomerId()); - if(null == userIds) userIds = new LinkedList<>(); - CommonCustomerFormDTO customerParam = new CommonCustomerFormDTO(); - customerParam.setCustomerId(customerUserFormDTO.getCustomerId()); - Result> volunteer = epmetHeartOpenFeignClient.volunteerUserIds(customerParam); - if(volunteer.success() && null != volunteer.getData() && !volunteer.getData().isEmpty()){ - userIds.addAll(volunteer.getData()); - userIds = userIds.stream().distinct().collect(Collectors.toList()); - } - if(null == userIds || userIds.isEmpty()){ - return allData; - } PageHelper.startPage(customerUserFormDTO.getPageNo(),customerUserFormDTO.getPageSize()); - allData = userWechatDao.selectResiAndStrangerInfo(userIds,customerUserFormDTO.getName()); - if(null == allData || allData.isEmpty()){ - return allData; + List allData = userWechatDao.selectResiAndStrangerInfo(customerUserFormDTO.getCustomerId(),customerUserFormDTO.getName()); + if (!CollectionUtils.isEmpty(allData)){ + return new ArrayList<>(); } allData.forEach(info -> { if(StringUtils.isNotBlank(info.getUserId())){ diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml index f3498237a6..06cbd5f02c 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml @@ -125,9 +125,7 @@ wechat.DEL_FLAG = '0' AND (wechat.NICKNAME IS NOT NULL OR wechat.NICKNAME ]]> '') AND (base.SURNAME IS NOT NULL OR base.SURNAME ]]> '') - - wechat.USER_ID = #{item} - + AND wechat.CUSTOMER_ID = #{customerId} AND (base.REAL_NAME LIKE concat('%',#{realName},'%') OR wechat.NICKNAME LIKE concat('%',#{realName},'%'))