Browse Source

修改查询客户下所有用户包括陌生人

master
zxc 4 years ago
parent
commit
e69fd4d564
  1. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserWechatDao.java
  2. 20
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java
  3. 4
      epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml

2
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserWechatDao.java

@ -74,7 +74,7 @@ public interface UserWechatDao extends BaseDao<UserWechatEntity>{
* @author wangc * @author wangc
* @date 2020.07.27 00:58 * @date 2020.07.27 00:58
**/ **/
List<CustomerUser4PointResultDTO> selectResiAndStrangerInfo(@Param("userIds") List<String> userIds, @Param("realName")String realName); List<CustomerUser4PointResultDTO> selectResiAndStrangerInfo(@Param("customerId") String customerId, @Param("realName")String realName);
//临时用下in //临时用下in
List<UserWechatDTO> selectNotInUserBaseInfoTemp(); List<UserWechatDTO> selectNotInUserBaseInfoTemp();

20
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.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -190,23 +191,10 @@ public class GridLatestServiceImpl extends BaseServiceImpl<GridLatestDao, GridLa
**/ **/
@Override @Override
public List<CustomerUser4PointResultDTO> getCustomerUsers(CustomerUserFormDTO customerUserFormDTO) { public List<CustomerUser4PointResultDTO> getCustomerUsers(CustomerUserFormDTO customerUserFormDTO) {
List<CustomerUser4PointResultDTO> allData = new LinkedList<>();
List<String> userIds = baseDao.selectAllUserByCustomerId(customerUserFormDTO.getCustomerId());
if(null == userIds) userIds = new LinkedList<>();
CommonCustomerFormDTO customerParam = new CommonCustomerFormDTO();
customerParam.setCustomerId(customerUserFormDTO.getCustomerId());
Result<List<String>> 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()); PageHelper.startPage(customerUserFormDTO.getPageNo(),customerUserFormDTO.getPageSize());
allData = userWechatDao.selectResiAndStrangerInfo(userIds,customerUserFormDTO.getName()); List<CustomerUser4PointResultDTO> allData = userWechatDao.selectResiAndStrangerInfo(customerUserFormDTO.getCustomerId(),customerUserFormDTO.getName());
if(null == allData || allData.isEmpty()){ if (!CollectionUtils.isEmpty(allData)){
return allData; return new ArrayList<>();
} }
allData.forEach(info -> { allData.forEach(info -> {
if(StringUtils.isNotBlank(info.getUserId())){ if(StringUtils.isNotBlank(info.getUserId())){

4
epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml

@ -125,9 +125,7 @@
wechat.DEL_FLAG = '0' wechat.DEL_FLAG = '0'
AND (wechat.NICKNAME IS NOT NULL OR wechat.NICKNAME <![CDATA[ <> ]]> '') AND (wechat.NICKNAME IS NOT NULL OR wechat.NICKNAME <![CDATA[ <> ]]> '')
AND (base.SURNAME IS NOT NULL OR base.SURNAME <![CDATA[ <> ]]> '') AND (base.SURNAME IS NOT NULL OR base.SURNAME <![CDATA[ <> ]]> '')
<foreach collection="userIds" item="item" open="AND (" separator=" OR " close=" )"> AND wechat.CUSTOMER_ID = #{customerId}
wechat.USER_ID = #{item}
</foreach>
<if test='null != realName and "" != realName'> <if test='null != realName and "" != realName'>
AND (base.REAL_NAME LIKE concat('%',#{realName},'%') OR wechat.NICKNAME LIKE concat('%',#{realName},'%')) AND (base.REAL_NAME LIKE concat('%',#{realName},'%') OR wechat.NICKNAME LIKE concat('%',#{realName},'%'))
</if> </if>

Loading…
Cancel
Save