私海列表返回会销面试中的线索

This commit is contained in:
feng.li
2023-12-27 13:51:21 +08:00
parent 4c783589da
commit 4b4e2f94dc
7 changed files with 48 additions and 25 deletions

View File

@@ -3,7 +3,6 @@ package com.cool.store.dao;
import com.cool.store.dto.exhibition.ExhibitionLineBaseDTO;
import com.cool.store.dto.exhibition.ExhibitionLineDTO;
import com.cool.store.dto.exhibition.PartnerSignUpDTO;
import com.cool.store.entity.HyExhibitionDO;
import com.cool.store.entity.HyPartnerExhibitionDO;
import com.cool.store.entity.HyPartnerExhibitionInterviewDO;
import com.cool.store.mapper.HyPartnerExhibitionMapper;
@@ -111,7 +110,7 @@ public class HyPartnerExhibitionDAO {
return hyPartnerExhibitionMapper.queryListByInterviewPlanIds(interviewPlanIds);
}
public List<Long> queryListByLineIds(List<Long> lindIds) {
public List<HyPartnerExhibitionDO> queryListByLineIds(List<Long> lindIds) {
if (ObjectUtils.isEmpty(lindIds)) {
return new ArrayList<>();
}

View File

@@ -81,7 +81,7 @@ public interface HyPartnerExhibitionMapper {
* @param lindIds
* @return
*/
List<Long> queryListByLineIds(@Param("lineIds") List<Long> lindIds);
List<HyPartnerExhibitionDO> queryListByLineIds(@Param("lineIds") List<Long> lindIds);
/**
* 查询线索参加的会销面试相关信息

View File

@@ -377,10 +377,10 @@
)
</select>
<select id="queryListByLineIds" resultType="java.lang.Long">
SELECT partner_line_id
<select id="queryListByLineIds" resultMap="BaseResultMap">
SELECT partner_line_id, exhibition_id, t3.name AS exhibitionCreatorName, t3.mobile AS exhibitionCreatorMobile
FROM (
SELECT partner_line_id, exhibition_id
SELECT partner_line_id, exhibition_id, creator
FROM hy_partner_exhibition
WHERE partner_line_id IN (
<foreach collection="lineIds" item="lineId" separator=",">
@@ -388,14 +388,16 @@
</foreach>
)
AND deleted = 0
-- 面试中状态
AND participation_status = 4
) t1
LEFT JOIN (
INNER JOIN (
SELECT id, closed_type
FROM hy_exhibition
WHERE deleted = 0
AND closed_type = 0
) t2 ON t1.exhibition_id = t2.id
INNER JOIN enterprise_user t3 ON t1.creator = t3.user_id
WHERE closed_type = 0
</select>
<select id="queryPartnerExhibitionInterviewInfo"

View File

@@ -1,14 +1,15 @@
package com.cool.store.entity;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
*
* @author zhangchenbiao
@@ -26,6 +27,12 @@ public class HyPartnerExhibitionDO implements Serializable {
@ApiModelProperty("报名的展会idhy_exhibition.id")
private Integer exhibitionId;
@ApiModelProperty("进行面试的会销创建人姓名")
private String exhibitionCreatorName;
@ApiModelProperty("进行面试的会销创建人手机号")
private String exhibitionCreatorMobile;
@ApiModelProperty("线索idhy_partner_line_info.id")
private Long partnerLineId;

View File

@@ -1,20 +1,22 @@
package com.cool.store.vo;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import com.cool.store.dto.partner.PrivateSeaLineDTO;
import com.cool.store.entity.HyPartnerExhibitionDO;
import com.cool.store.entity.HyPartnerInterviewPlanDO;
import com.cool.store.utils.CoolDateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Author suzhuhong
@@ -90,6 +92,12 @@ public class PrivateSeaLineListVo {
@ApiModelProperty("是否处于会销面试中")
private Boolean whetherExhibitionInterview;
@ApiModelProperty("进行面试的会销创建人姓名")
private String exhibitionCreatorName;
@ApiModelProperty("进行面试的会销创建人手机号")
private String exhibitionCreatorMobile;
@ApiModelProperty("推荐加盟商ID")
private String recommendPartnerId;
@@ -114,9 +122,10 @@ public class PrivateSeaLineListVo {
public static List<PrivateSeaLineListVo> convertList(List<PrivateSeaLineDTO> list, Map<String, String> finalDevManagerMap, Map<String, String> wantShopAreaNameMap,
Map<Long, HyPartnerInterviewPlanDO> hyPartnerInterviewPlanDOMap,Map<Integer, String> channelMap,Map<Long, String> userPortraitMap,
List<Long> exhibitionInterviewLines){
Map<Long, HyPartnerInterviewPlanDO> hyPartnerInterviewPlanDOMap, Map<Integer, String> channelMap, Map<Long, String> userPortraitMap,
List<HyPartnerExhibitionDO> partnerExhibitions){
List<PrivateSeaLineListVo> resultList = new ArrayList<>();
Map<Long, HyPartnerExhibitionDO> lineIdPartnerExhibitionMap = partnerExhibitions.stream().collect(Collectors.toMap(HyPartnerExhibitionDO::getPartnerLineId, data -> data));
for (PrivateSeaLineDTO x : list) {
PrivateSeaLineListVo privateSeaLineListVo = new PrivateSeaLineListVo();
privateSeaLineListVo.setLineId(x.getLineId());
@@ -171,10 +180,11 @@ public class PrivateSeaLineListVo {
}
//在会销面试中的线索
privateSeaLineListVo.setWhetherExhibitionInterview(Boolean.FALSE);
if (privateSeaLineListVo.getWhetherInExhibition()
&& ObjectUtils.isNotEmpty(exhibitionInterviewLines)
&& exhibitionInterviewLines.contains(x.getLineId())) {
if (CollUtil.isNotEmpty(partnerExhibitions)
&& lineIdPartnerExhibitionMap.containsKey(x.getLineId())) {
privateSeaLineListVo.setWhetherExhibitionInterview(Boolean.TRUE);
privateSeaLineListVo.setExhibitionCreatorName(lineIdPartnerExhibitionMap.get(x.getLineId()).getExhibitionCreatorName());
privateSeaLineListVo.setExhibitionCreatorMobile(lineIdPartnerExhibitionMap.get(x.getLineId()).getExhibitionCreatorMobile());
}
privateSeaLineListVo.setUserPortraitList(userPortraitList);
resultList.add(privateSeaLineListVo);

View File

@@ -1,6 +1,7 @@
package com.cool.store.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.CommonConstants;
@@ -665,8 +666,12 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
return privateLineList;
}
List<Long> lindIds = list.stream().map(PrivateSeaLineDTO::getLineId).collect(Collectors.toList());
List<Long> exhibitionLineIds = list.stream().filter(PrivateSeaLineDTO::getWhetherInExhibition).map(PrivateSeaLineDTO::getLineId).collect(Collectors.toList());
//查询处在会销面试中的线索
List<Long> exhibitionInterviewLines = partnerExhibitionDAO.queryListByLineIds(lindIds);
List<HyPartnerExhibitionDO> partnerExhibitions = new ArrayList<>();
if (CollUtil.isNotEmpty(exhibitionLineIds)) {
partnerExhibitions = partnerExhibitionDAO.queryListByLineIds(exhibitionLineIds);
}
List<HyPartnerInterviewPlanDO> hyPartnerInterviewPlanDOS = hyPartnerInterviewPlanDAO.getHyPartnerInterviewPlanByLineIds(lindIds);
Map<Long, HyPartnerInterviewPlanDO> hyPartnerInterviewPlanDOMap = hyPartnerInterviewPlanDOS.stream().collect(Collectors.toMap(HyPartnerInterviewPlanDO::getPartnerLineId, data -> data));
@@ -685,7 +690,7 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
List<String> userPortraitList = list.stream().filter(x -> StringUtils.isNotEmpty(x.getUserPortrait())).map(PrivateSeaLineDTO::getUserPortrait).collect(Collectors.toList());
Map<Long, String> userPortraitMap = labelService.getUserPortraitMap(userPortraitList);
List<PrivateSeaLineListVo> result = PrivateSeaLineListVo.convertList(list, devManagerMap, wantShopAreaNameMap, hyPartnerInterviewPlanDOMap, channelMap, userPortraitMap, exhibitionInterviewLines);
List<PrivateSeaLineListVo> result = PrivateSeaLineListVo.convertList(list, devManagerMap, wantShopAreaNameMap, hyPartnerInterviewPlanDOMap, channelMap, userPortraitMap, partnerExhibitions);
privateLineList.setList(result);
return privateLineList;
}

View File

@@ -64,29 +64,29 @@ class EventRequestTest extends AbstractJUnit4SpringContextTests {
String testPhone = "13739417741";
String testDate = "2023-11-05 10:00:00";
String randomStr = RandomUtil.randomString(12);
String WxUrlPrefix = "https://wxaurl.cn/";
String testWXUrl = WxUrlPrefix + randomStr;
String wxUrlPrefix = "https://wxaurl.cn/";
String testWXUrl = wxUrlPrefix + randomStr;
//1. 意向申请通过
eventCenterHttpRequest.sendSmsVariable(testPhone, SMSMsgEnum.INTENTION_APPLY_PASS, testDate, testWXUrl);
//2. 预约面试通过通知
randomStr = RandomUtil.randomString(12);
testWXUrl = WxUrlPrefix + randomStr;
testWXUrl = wxUrlPrefix + randomStr;
eventCenterHttpRequest.sendSmsVariable(testPhone, SMSMsgEnum.INTERVIEW_APPOINTMENT_PASS, testDate, testWXUrl);
//3. 面试通过通知
randomStr = RandomUtil.randomString(12);
testWXUrl = WxUrlPrefix + randomStr;
testWXUrl = wxUrlPrefix + randomStr;
eventCenterHttpRequest.sendSmsVariable(testPhone, SMSMsgEnum.INTERVIEW_PASS, testWXUrl);
//4. 面试开始前一天
randomStr = RandomUtil.randomString(12);
testWXUrl = WxUrlPrefix + randomStr;
testWXUrl = wxUrlPrefix + randomStr;
eventCenterHttpRequest.sendSmsVariable(testPhone, SMSMsgEnum.INTERVIEW_BEGIN_IN_DAY, "10", testDate, testWXUrl);
//5. 面试开始前30分钟
randomStr = RandomUtil.randomString(12);
testWXUrl = WxUrlPrefix + randomStr;
testWXUrl = wxUrlPrefix + randomStr;
eventCenterHttpRequest.sendSmsVariable(testPhone, SMSMsgEnum.INTERVIEW_BEGIN_IN_MINUTES, testWXUrl);
//6. 短信邀约
randomStr = RandomUtil.randomString(12);
testWXUrl = WxUrlPrefix + randomStr;
testWXUrl = wxUrlPrefix + randomStr;
eventCenterHttpRequest.sendSmsVariable(testPhone, SMSMsgEnum.SMS_INVATE, testWXUrl);
//8. 展会结束
eventCenterHttpRequest.sendSmsVariable(testPhone, SMSMsgEnum.EXHIBITION_CLOSE, "");