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},'%'))