From 76d60437e6076d7c6891c54b304950ecc83fedeb Mon Sep 17 00:00:00 2001 From: Kurisu Date: Tue, 23 Feb 2021 15:57:29 +0800 Subject: [PATCH] :sparkles: 跟进任务详情增加客户等级和进站次数等 --- fw-valhalla-dao/src/main/resources/mapper/FollowTaskMapper.xml | 1 + fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/dto/FollowPoolDTO.java | 4 ++++ fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/follow/FollowDetailVO.java | 4 ++++ fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/pool/FollowPoolListVO.java | 4 ++++ fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/AbstractFollowStrategy.java | 12 ++++++++++++ fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/FMFollowStrategy.java | 1 + fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/IRFollowStrategy.java | 4 +++- fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/RMFollowStrategy.java | 3 +++ 8 files changed, 32 insertions(+), 1 deletion(-) diff --git a/fw-valhalla-dao/src/main/resources/mapper/FollowTaskMapper.xml b/fw-valhalla-dao/src/main/resources/mapper/FollowTaskMapper.xml index 835991a..35c8d74 100644 --- a/fw-valhalla-dao/src/main/resources/mapper/FollowTaskMapper.xml +++ b/fw-valhalla-dao/src/main/resources/mapper/FollowTaskMapper.xml @@ -9,6 +9,7 @@ SELECT t1.id, if(t1.type=3 , t4.plate_no, t3.plate_no)plate_no, if(t1.type=3 , t4.frame_no, t3.frame_no)frame_no, + t3.cus_level cus_level, t2.expires loan_expires, t1.type type, t1.follow_user user_id, diff --git a/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/dto/FollowPoolDTO.java b/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/dto/FollowPoolDTO.java index 5c35250..66cb86a 100644 --- a/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/dto/FollowPoolDTO.java +++ b/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/dto/FollowPoolDTO.java @@ -17,6 +17,10 @@ public class FollowPoolDTO { */ private String plateNo; /** + * 客户星级 + */ + private Integer cusLevel; + /** * 车架号 */ private String frameNo; diff --git a/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/follow/FollowDetailVO.java b/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/follow/FollowDetailVO.java index 49a1297..23fd7aa 100644 --- a/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/follow/FollowDetailVO.java +++ b/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/follow/FollowDetailVO.java @@ -53,6 +53,10 @@ public class FollowDetailVO { */ private String tags; /** + * 跟进次数 + */ + private Integer times; + /** * 客户星级 */ private Integer cusLevel; diff --git a/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/pool/FollowPoolListVO.java b/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/pool/FollowPoolListVO.java index 8a59d09..b0e3697 100644 --- a/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/pool/FollowPoolListVO.java +++ b/fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/pool/FollowPoolListVO.java @@ -19,6 +19,10 @@ public class FollowPoolListVO { */ private String plateNo; /** + * 客户星级 + */ + private Integer cusLevel; + /** * 车架号 */ private String frameNo; diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/AbstractFollowStrategy.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/AbstractFollowStrategy.java index d582afe..8906e25 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/AbstractFollowStrategy.java +++ b/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 { followRecordService.updateById(record); } + protected void queryTimes(Long clueId, FollowDetailVO vo) { + List list = followTaskService.list(Wrappers.lambdaQuery() + .eq(FollowTask::getClueId, clueId) + ); + if (CollectionUtils.isEmpty(list)) { + vo.setTimes(0); + return; + } + int sum = list.stream().filter(r -> Objects.nonNull(r.getTimes())).mapToInt(FollowTask::getTimes).sum(); + vo.setTimes(sum); + } + private void onStopClue(CustomerCluePool clue, TaskDefeatTypeEnum defeatTypeEnum) { clue.setClueStatus(ClueStatusEnum.FAILURE); clue.setCloseTime(new Date()); diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/FMFollowStrategy.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/FMFollowStrategy.java index e2c8694..3102b44 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/FMFollowStrategy.java +++ b/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 { vo.setId(followRecord.getId()); vo.setTaskId(followRecord.getTaskId()); vo.setFMExpiration(followTask.getDeadline()); + queryTimes(followTask.getClueId(), vo); int count = followRecordLogService.count(Wrappers.lambdaQuery() .eq(FollowRecordLog::getTaskId, followRecord.getTaskId()) .eq(FollowRecordLog::getAttType, AttTypeEnum.SMART_PHONE) diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/IRFollowStrategy.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/IRFollowStrategy.java index f0e8bcb..b54029f 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/IRFollowStrategy.java +++ b/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.*; import cn.fw.valhalla.domain.vo.follow.*; import cn.fw.valhalla.domain.vo.setting.SettingVO; import cn.fw.valhalla.rpc.angel.dto.InsuranceDTO; -import cn.fw.valhalla.rpc.erp.dto.BackLogItemDTO; import cn.fw.valhalla.rpc.erp.dto.PostUserDTO; import cn.fw.valhalla.rpc.erp.dto.UserInfoDTO; import cn.fw.valhalla.rpc.oop.dto.ShopDTO; @@ -86,7 +85,10 @@ public class IRFollowStrategy extends AbstractFollowStrategy { public FollowDetailVO getDetail(Long id) { FollowRecord followRecord = followRecordService.getById(id); BV.notNull(followRecord, "跟进记录不存在"); + FollowTask followTask = followTaskService.getById(followRecord.getTaskId()); + BV.notNull(followTask, "跟进信息不存在"); IRDetailVO vo = assemble(followRecord.getCustomerId()); + queryTimes(followTask.getClueId(), vo); int count = followRecordLogService.count(Wrappers.lambdaQuery() .eq(FollowRecordLog::getTaskId, followRecord.getTaskId()) .eq(FollowRecordLog::getAttType, AttTypeEnum.SMART_PHONE) diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/RMFollowStrategy.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/RMFollowStrategy.java index e8e026a..75bbca9 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/RMFollowStrategy.java +++ b/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 { public FollowDetailVO getDetail(Long id) { FollowRecord followRecord = followRecordService.getById(id); BV.notNull(followRecord, "跟进记录不存在"); + FollowTask followTask = followTaskService.getById(followRecord.getTaskId()); + BV.notNull(followTask, "跟进信息不存在"); RMDetailVO vo = assemble(followRecord.getCustomerId()); int count = followRecordLogService.count(Wrappers.lambdaQuery() .eq(FollowRecordLog::getAttType, AttTypeEnum.SMART_PHONE) @@ -112,6 +114,7 @@ public class RMFollowStrategy extends AbstractFollowStrategy { vo.setId(followRecord.getId()); vo.setTaskId(followRecord.getTaskId()); vo.setDeadline(followRecord.getDeadline()); + queryTimes(followTask.getClueId(), vo); return vo; } -- libgit2 0.22.2