|  | @@ -3,6 +3,7 @@ package com.fs.qw.service.impl;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import com.alibaba.fastjson.JSON;
 | 
	
		
			
				|  |  |  import com.alibaba.fastjson.JSONException;
 | 
	
		
			
				|  |  | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 | 
	
		
			
				|  |  |  import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 | 
	
		
			
				|  |  |  import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
	
		
			
				|  |  |  import com.fs.ad.enums.AdUploadType;
 | 
	
	
		
			
				|  | @@ -11,6 +12,8 @@ import com.fs.common.core.domain.R;
 | 
	
		
			
				|  |  |  import com.fs.common.core.redis.RedisCache;
 | 
	
		
			
				|  |  |  import com.fs.common.utils.PubFun;
 | 
	
		
			
				|  |  |  import com.fs.common.utils.StringUtils;
 | 
	
		
			
				|  |  | +import com.fs.company.cache.ICompanyCacheService;
 | 
	
		
			
				|  |  | +import com.fs.company.cache.ICompanyUserCacheService;
 | 
	
		
			
				|  |  |  import com.fs.company.service.ICompanyConfigService;
 | 
	
		
			
				|  |  |  import com.fs.course.config.CourseConfig;
 | 
	
		
			
				|  |  |  import com.fs.course.domain.FsCourseSop;
 | 
	
	
		
			
				|  | @@ -24,7 +27,9 @@ import com.fs.course.param.FsCourseLinkCreateParam;
 | 
	
		
			
				|  |  |  import com.fs.course.service.IFsCourseLinkService;
 | 
	
		
			
				|  |  |  import com.fs.crm.domain.CrmCustomer;
 | 
	
		
			
				|  |  |  import com.fs.crm.mapper.CrmCustomerMapper;
 | 
	
		
			
				|  |  | +import com.fs.qw.converter.QwExternalContactConverter;
 | 
	
		
			
				|  |  |  import com.fs.qw.domain.*;
 | 
	
		
			
				|  |  | +import com.fs.qw.dto.GetQwRepeatDataDTO;
 | 
	
		
			
				|  |  |  import com.fs.qw.mapper.*;
 | 
	
		
			
				|  |  |  import com.fs.qw.param.*;
 | 
	
		
			
				|  |  |  import com.fs.qw.param.newparam.ExternalContactPageListParam;
 | 
	
	
		
			
				|  | @@ -4499,6 +4504,52 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
 | 
	
		
			
				|  |  |          return qwExternalContactMapper.selectQwExternalContactListVOByUserIds(ids);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private ICompanyCacheService companyCacheService;
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private ICompanyUserCacheService companyUserCacheService;
 | 
	
		
			
				|  |  | +    @Override
 | 
	
		
			
				|  |  | +    public List<GetQwRepeatDataVO> getQwRepeatData(GetQwRepeatDataDTO dto) {
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        List<QwExternalContact> externalContactList = qwExternalContactMapper
 | 
	
		
			
				|  |  | +                .selectList(buildQuery(dto));
 | 
	
		
			
				|  |  | +        List<GetQwRepeatDataVO> result = new ArrayList<>();
 | 
	
		
			
				|  |  | +        for (QwExternalContact qwExternalContact : externalContactList) {
 | 
	
		
			
				|  |  | +            GetQwRepeatDataVO getQwRepeatDataVO = new GetQwRepeatDataVO();
 | 
	
		
			
				|  |  | +            getQwRepeatDataVO.setCompanyId(qwExternalContact.getCompanyId());
 | 
	
		
			
				|  |  | +            if(qwExternalContact.getCompanyId() != null) {
 | 
	
		
			
				|  |  | +                String companyName = companyCacheService.selectCompanyNameById(qwExternalContact.getCompanyId());
 | 
	
		
			
				|  |  | +                getQwRepeatDataVO.setCompanyName(companyName);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            getQwRepeatDataVO.setCompanyUserId(qwExternalContact.getCompanyUserId());
 | 
	
		
			
				|  |  | +            if(qwExternalContact.getCompanyUserId() != null) {
 | 
	
		
			
				|  |  | +                String companyUserName = companyUserCacheService.selectCompanyUserNameUserById(qwExternalContact.getCompanyUserId());
 | 
	
		
			
				|  |  | +                getQwRepeatDataVO.setCompanyUserName(companyUserName);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            getQwRepeatDataVO.setSaleerWx(qwExternalContact.getQwUserId());
 | 
	
		
			
				|  |  | +            result.add(getQwRepeatDataVO);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        return result;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    public LambdaQueryWrapper<QwExternalContact> buildQuery(GetQwRepeatDataDTO dto){
 | 
	
		
			
				|  |  | +        Long corpId = dto.getCorpId();
 | 
	
		
			
				|  |  | +        Long externalUserID = dto.getExternalUserID();
 | 
	
		
			
				|  |  | +        LambdaQueryWrapper<QwExternalContact> eq = new LambdaQueryWrapper<QwExternalContact>()
 | 
	
		
			
				|  |  | +                .select(QwExternalContact::getFsUserId,
 | 
	
		
			
				|  |  | +                        QwExternalContact::getCompanyId,
 | 
	
		
			
				|  |  | +                        QwExternalContact::getCompanyUserId,
 | 
	
		
			
				|  |  | +                        QwExternalContact::getName,
 | 
	
		
			
				|  |  | +                        QwExternalContact::getQwUserId
 | 
	
		
			
				|  |  | +                )
 | 
	
		
			
				|  |  | +                .eq(QwExternalContact::getExternalUserId, externalUserID)
 | 
	
		
			
				|  |  | +                .eq(QwExternalContact::getCorpId, corpId);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        return eq;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public Integer selectQwIsRepeat(Long id) {
 | 
	
		
			
				|  |  |          return qwExternalContactMapper.selectQwIsRepeat(id);
 |