From b2fb8da15a55e192c11a998eaa34eb1f0255a5a5 Mon Sep 17 00:00:00 2001 From: Kurisu Date: Mon, 8 Feb 2021 10:29:47 +0800 Subject: [PATCH] :bug: 修复档案不存在的时候跟进列表报错 --- fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/AbstractFollowStrategy.java | 7 +++++++ fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/FMFollowStrategy.java | 12 +++++++----- fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/IRFollowStrategy.java | 5 +++++ fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/RMFollowStrategy.java | 5 ++++- 4 files changed, 23 insertions(+), 6 deletions(-) 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 5fdc066..f3d0a58 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 @@ -794,6 +794,13 @@ public abstract class AbstractFollowStrategy implements FollowStrategy { followTaskService.updateById(task); } + protected void onCustomerIsNil(FollowRecord record) { + BackLogItemDTO dto = new BackLogItemDTO(record.getUserId(), getItemCode(record.getType()), String.valueOf(record.getId()), new Date(), record.getShopId()); + todoRpcService.complete(dto); + record.setFollowTime(new Date()); + followRecordService.updateById(record); + } + 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 c975146..31f4730 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 @@ -55,12 +55,14 @@ public class FMFollowStrategy extends AbstractFollowStrategy { vo.setCustomerId(followRecord.getCustomerId()); vo.setDeadline(followRecord.getDeadline()); CustomerDetailDto customerDetailDto = customerBizService.queryById(followRecord.getCustomerId()); - if (Objects.nonNull(customerDetailDto)) { - vo.setName(customerDetailDto.getName()); - vo.setPlateNo(customerDetailDto.getPlateNo()); - vo.setCarImage(customerDetailDto.getCarImage()); - vo.setBuyDate(customerDetailDto.getBuyDate()); + if (Objects.isNull(customerDetailDto)) { + onCustomerIsNil(followRecord); + continue; } + vo.setName(customerDetailDto.getName()); + vo.setPlateNo(customerDetailDto.getPlateNo()); + vo.setCarImage(customerDetailDto.getCarImage()); + vo.setBuyDate(customerDetailDto.getBuyDate()); Optional followTask = Optional.ofNullable(followTaskService.getById(followRecord.getTaskId())); followTask.ifPresent(task -> vo.setFMExpiration(task.getDeadline())); voList.add(vo); 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 af04cd5..8afaf40 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,6 +17,7 @@ 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; @@ -64,6 +65,10 @@ public class IRFollowStrategy extends AbstractFollowStrategy { vo.setCustomerId(followRecord.getCustomerId()); vo.setDeadline(followRecord.getDeadline()); CustomerDetailDto customerDetailDto = customerBizService.queryById(followRecord.getCustomerId()); + if (Objects.isNull(customerDetailDto)) { + onCustomerIsNil(followRecord); + continue; + } vo.setName(customerDetailDto.getName()); vo.setCarImage(customerDetailDto.getCarImage()); vo.setPlateNo(customerDetailDto.getPlateNo()); 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 de5131b..2f90110 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 @@ -76,11 +76,14 @@ public class RMFollowStrategy extends AbstractFollowStrategy { vo.setCustomerId(followRecord.getCustomerId()); vo.setDeadline(followRecord.getDeadline()); CustomerDetailDto customerDetailDto = customerBizService.queryById(followRecord.getCustomerId()); + if (Objects.isNull(customerDetailDto)) { + onCustomerIsNil(followRecord); + continue; + } vo.setName(customerDetailDto.getName()); vo.setCarImage(customerDetailDto.getCarImage()); vo.setPlateNo(customerDetailDto.getPlateNo()); vo.setLastMileage(customerDetailDto.getCurrentMileage()); - OriginalData originalData = originalDataService.getOne(Wrappers.lambdaQuery() .eq(OriginalData::getCustomerId, followRecord.getCustomerId()) .eq(OriginalData::getType, DataTypeEnum.FS) -- libgit2 0.22.2