Commit 76d60437e6076d7c6891c54b304950ecc83fedeb

Authored by 张志伟
1 parent e524f8b0

:sparkles: 跟进任务详情增加客户等级和进站次数等

fw-valhalla-dao/src/main/resources/mapper/FollowTaskMapper.xml
... ... @@ -9,6 +9,7 @@
9 9 SELECT t1.id,
10 10 if(t1.type=3 , t4.plate_no, t3.plate_no)plate_no,
11 11 if(t1.type=3 , t4.frame_no, t3.frame_no)frame_no,
  12 + t3.cus_level cus_level,
12 13 t2.expires loan_expires,
13 14 t1.type type,
14 15 t1.follow_user user_id,
... ...
fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/dto/FollowPoolDTO.java
... ... @@ -17,6 +17,10 @@ public class FollowPoolDTO {
17 17 */
18 18 private String plateNo;
19 19 /**
  20 + * 客户星级
  21 + */
  22 + private Integer cusLevel;
  23 + /**
20 24 * 车架号
21 25 */
22 26 private String frameNo;
... ...
fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/follow/FollowDetailVO.java
... ... @@ -53,6 +53,10 @@ public class FollowDetailVO {
53 53 */
54 54 private String tags;
55 55 /**
  56 + * 跟进次数
  57 + */
  58 + private Integer times;
  59 + /**
56 60 * 客户星级
57 61 */
58 62 private Integer cusLevel;
... ...
fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/pool/FollowPoolListVO.java
... ... @@ -19,6 +19,10 @@ public class FollowPoolListVO {
19 19 */
20 20 private String plateNo;
21 21 /**
  22 + * 客户星级
  23 + */
  24 + private Integer cusLevel;
  25 + /**
22 26 * 车架号
23 27 */
24 28 private String frameNo;
... ...
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/AbstractFollowStrategy.java
... ... @@ -825,6 +825,18 @@ public abstract class AbstractFollowStrategy implements FollowStrategy {
825 825 followRecordService.updateById(record);
826 826 }
827 827  
  828 + protected void queryTimes(Long clueId, FollowDetailVO vo) {
  829 + List<FollowTask> list = followTaskService.list(Wrappers.<FollowTask>lambdaQuery()
  830 + .eq(FollowTask::getClueId, clueId)
  831 + );
  832 + if (CollectionUtils.isEmpty(list)) {
  833 + vo.setTimes(0);
  834 + return;
  835 + }
  836 + int sum = list.stream().filter(r -> Objects.nonNull(r.getTimes())).mapToInt(FollowTask::getTimes).sum();
  837 + vo.setTimes(sum);
  838 + }
  839 +
828 840 private void onStopClue(CustomerCluePool clue, TaskDefeatTypeEnum defeatTypeEnum) {
829 841 clue.setClueStatus(ClueStatusEnum.FAILURE);
830 842 clue.setCloseTime(new Date());
... ...
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/FMFollowStrategy.java
... ... @@ -80,6 +80,7 @@ public class FMFollowStrategy extends AbstractFollowStrategy {
80 80 vo.setId(followRecord.getId());
81 81 vo.setTaskId(followRecord.getTaskId());
82 82 vo.setFMExpiration(followTask.getDeadline());
  83 + queryTimes(followTask.getClueId(), vo);
83 84 int count = followRecordLogService.count(Wrappers.<FollowRecordLog>lambdaQuery()
84 85 .eq(FollowRecordLog::getTaskId, followRecord.getTaskId())
85 86 .eq(FollowRecordLog::getAttType, AttTypeEnum.SMART_PHONE)
... ...
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/IRFollowStrategy.java
... ... @@ -17,7 +17,6 @@ import cn.fw.valhalla.domain.enums.*;
17 17 import cn.fw.valhalla.domain.vo.follow.*;
18 18 import cn.fw.valhalla.domain.vo.setting.SettingVO;
19 19 import cn.fw.valhalla.rpc.angel.dto.InsuranceDTO;
20   -import cn.fw.valhalla.rpc.erp.dto.BackLogItemDTO;
21 20 import cn.fw.valhalla.rpc.erp.dto.PostUserDTO;
22 21 import cn.fw.valhalla.rpc.erp.dto.UserInfoDTO;
23 22 import cn.fw.valhalla.rpc.oop.dto.ShopDTO;
... ... @@ -86,7 +85,10 @@ public class IRFollowStrategy extends AbstractFollowStrategy {
86 85 public FollowDetailVO getDetail(Long id) {
87 86 FollowRecord followRecord = followRecordService.getById(id);
88 87 BV.notNull(followRecord, "跟进记录不存在");
  88 + FollowTask followTask = followTaskService.getById(followRecord.getTaskId());
  89 + BV.notNull(followTask, "跟进信息不存在");
89 90 IRDetailVO vo = assemble(followRecord.getCustomerId());
  91 + queryTimes(followTask.getClueId(), vo);
90 92 int count = followRecordLogService.count(Wrappers.<FollowRecordLog>lambdaQuery()
91 93 .eq(FollowRecordLog::getTaskId, followRecord.getTaskId())
92 94 .eq(FollowRecordLog::getAttType, AttTypeEnum.SMART_PHONE)
... ...
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/RMFollowStrategy.java
... ... @@ -103,6 +103,8 @@ public class RMFollowStrategy extends AbstractFollowStrategy {
103 103 public FollowDetailVO getDetail(Long id) {
104 104 FollowRecord followRecord = followRecordService.getById(id);
105 105 BV.notNull(followRecord, "跟进记录不存在");
  106 + FollowTask followTask = followTaskService.getById(followRecord.getTaskId());
  107 + BV.notNull(followTask, "跟进信息不存在");
106 108 RMDetailVO vo = assemble(followRecord.getCustomerId());
107 109 int count = followRecordLogService.count(Wrappers.<FollowRecordLog>lambdaQuery()
108 110 .eq(FollowRecordLog::getAttType, AttTypeEnum.SMART_PHONE)
... ... @@ -112,6 +114,7 @@ public class RMFollowStrategy extends AbstractFollowStrategy {
112 114 vo.setId(followRecord.getId());
113 115 vo.setTaskId(followRecord.getTaskId());
114 116 vo.setDeadline(followRecord.getDeadline());
  117 + queryTimes(followTask.getClueId(), vo);
115 118 return vo;
116 119 }
117 120  
... ...