|
|
@@ -1,7 +1,9 @@
|
|
|
package com.fs.qw.service.impl;
|
|
|
|
|
|
-import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.Objects;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.utils.DateUtils;
|
|
|
@@ -11,9 +13,11 @@ import com.fs.his.domain.FsSopDoctorTask;
|
|
|
import com.fs.his.mapper.FsSopDoctorTaskMapper;
|
|
|
import com.fs.his.utils.PhoneUtil;
|
|
|
import com.fs.qw.domain.QwExternalContact;
|
|
|
+import com.fs.qw.domain.QwExternalContactInfo;
|
|
|
import com.fs.qw.mapper.QwExternalContactMapper;
|
|
|
import com.fs.qw.param.FsDoctorMemberSalesQueryParam;
|
|
|
import com.fs.qw.param.MemberSalesParam;
|
|
|
+import com.fs.qw.service.IQwExternalContactInfoService;
|
|
|
import com.fs.qw.vo.FsDoctorMemberSalesVO;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -42,6 +46,9 @@ public class FsDoctorMemberSalesServiceImpl extends ServiceImpl<FsDoctorMemberSa
|
|
|
@Autowired
|
|
|
private QwExternalContactMapper externalContactMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IQwExternalContactInfoService externalContactInfoService;
|
|
|
+
|
|
|
@Transactional
|
|
|
@Override
|
|
|
public R push(MemberSalesParam param) {
|
|
|
@@ -84,9 +91,12 @@ public class FsDoctorMemberSalesServiceImpl extends ServiceImpl<FsDoctorMemberSa
|
|
|
|
|
|
@Override
|
|
|
public List<FsDoctorMemberSalesVO> selectFsDoctorMemberSalesVOList(FsDoctorMemberSalesQueryParam param) {
|
|
|
- //1.搭销会员信息
|
|
|
+ //1.跟进会员信息
|
|
|
List<FsDoctorMemberSalesVO> voList = memberSalesMapper.selectFsDoctorMemberSalesVOList(param);
|
|
|
-
|
|
|
+ //2.获取填写的会员信息
|
|
|
+ List<Long> exIds=voList.stream().map(FsDoctorMemberSalesVO::getExId).filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
+ List<QwExternalContactInfo> externalContactInfos = externalContactInfoService.selectQwExternalContactInfoListByExternalContactIds(exIds);
|
|
|
+ Map<Long, QwExternalContactInfo> externalContactInfoMap=externalContactInfos.stream().collect(Collectors.toMap(QwExternalContactInfo::getExternalContactId,v->v));
|
|
|
if (!CollectionUtils.isEmpty(voList)) {
|
|
|
for (FsDoctorMemberSalesVO vo : voList) {
|
|
|
if (!StringUtils.isEmpty(vo.getPhone())) {
|
|
|
@@ -97,9 +107,11 @@ public class FsDoctorMemberSalesServiceImpl extends ServiceImpl<FsDoctorMemberSa
|
|
|
vo.setPhone(decryptPhone);
|
|
|
}
|
|
|
}
|
|
|
- //2.获取搭销会员待处理的总数
|
|
|
+ //2.获取跟进会员待处理的总数
|
|
|
Long unprocessedDoctorTaskCount = sopDoctorTaskMapper.selectUnprocessedDoctorTaskCount(vo.getId());
|
|
|
vo.setUnprocessed(unprocessedDoctorTaskCount);
|
|
|
+ //3.获取会员信息
|
|
|
+ vo.setBaseInfo(externalContactInfoMap.get(vo.getExId()));
|
|
|
}
|
|
|
}
|
|
|
return voList;
|