Commit 76d60437e6076d7c6891c54b304950ecc83fedeb
1 parent
e524f8b0
跟进任务详情增加客户等级和进站次数等
Showing
8 changed files
with
32 additions
and
1 deletions
fw-valhalla-dao/src/main/resources/mapper/FollowTaskMapper.xml
fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/dto/FollowPoolDTO.java
fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/follow/FollowDetailVO.java
fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/pool/FollowPoolListVO.java
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 | ... | ... |