Commit b2fb8da15a55e192c11a998eaa34eb1f0255a5a5

Authored by 张志伟
1 parent 5588019f

:bug: 修复档案不存在的时候跟进列表报错

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 { @@ -794,6 +794,13 @@ public abstract class AbstractFollowStrategy implements FollowStrategy {
794 followTaskService.updateById(task); 794 followTaskService.updateById(task);
795 } 795 }
796 796
  797 + protected void onCustomerIsNil(FollowRecord record) {
  798 + BackLogItemDTO dto = new BackLogItemDTO(record.getUserId(), getItemCode(record.getType()), String.valueOf(record.getId()), new Date(), record.getShopId());
  799 + todoRpcService.complete(dto);
  800 + record.setFollowTime(new Date());
  801 + followRecordService.updateById(record);
  802 + }
  803 +
797 private void onStopClue(CustomerCluePool clue, TaskDefeatTypeEnum defeatTypeEnum) { 804 private void onStopClue(CustomerCluePool clue, TaskDefeatTypeEnum defeatTypeEnum) {
798 clue.setClueStatus(ClueStatusEnum.FAILURE); 805 clue.setClueStatus(ClueStatusEnum.FAILURE);
799 clue.setCloseTime(new Date()); 806 clue.setCloseTime(new Date());
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 { @@ -55,12 +55,14 @@ public class FMFollowStrategy extends AbstractFollowStrategy {
55 vo.setCustomerId(followRecord.getCustomerId()); 55 vo.setCustomerId(followRecord.getCustomerId());
56 vo.setDeadline(followRecord.getDeadline()); 56 vo.setDeadline(followRecord.getDeadline());
57 CustomerDetailDto customerDetailDto = customerBizService.queryById(followRecord.getCustomerId()); 57 CustomerDetailDto customerDetailDto = customerBizService.queryById(followRecord.getCustomerId());
58 - if (Objects.nonNull(customerDetailDto)) {  
59 - vo.setName(customerDetailDto.getName());  
60 - vo.setPlateNo(customerDetailDto.getPlateNo());  
61 - vo.setCarImage(customerDetailDto.getCarImage());  
62 - vo.setBuyDate(customerDetailDto.getBuyDate()); 58 + if (Objects.isNull(customerDetailDto)) {
  59 + onCustomerIsNil(followRecord);
  60 + continue;
63 } 61 }
  62 + vo.setName(customerDetailDto.getName());
  63 + vo.setPlateNo(customerDetailDto.getPlateNo());
  64 + vo.setCarImage(customerDetailDto.getCarImage());
  65 + vo.setBuyDate(customerDetailDto.getBuyDate());
64 Optional<FollowTask> followTask = Optional.ofNullable(followTaskService.getById(followRecord.getTaskId())); 66 Optional<FollowTask> followTask = Optional.ofNullable(followTaskService.getById(followRecord.getTaskId()));
65 followTask.ifPresent(task -> vo.setFMExpiration(task.getDeadline())); 67 followTask.ifPresent(task -> vo.setFMExpiration(task.getDeadline()));
66 voList.add(vo); 68 voList.add(vo);
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.*; @@ -17,6 +17,7 @@ import cn.fw.valhalla.domain.enums.*;
17 import cn.fw.valhalla.domain.vo.follow.*; 17 import cn.fw.valhalla.domain.vo.follow.*;
18 import cn.fw.valhalla.domain.vo.setting.SettingVO; 18 import cn.fw.valhalla.domain.vo.setting.SettingVO;
19 import cn.fw.valhalla.rpc.angel.dto.InsuranceDTO; 19 import cn.fw.valhalla.rpc.angel.dto.InsuranceDTO;
  20 +import cn.fw.valhalla.rpc.erp.dto.BackLogItemDTO;
20 import cn.fw.valhalla.rpc.erp.dto.PostUserDTO; 21 import cn.fw.valhalla.rpc.erp.dto.PostUserDTO;
21 import cn.fw.valhalla.rpc.erp.dto.UserInfoDTO; 22 import cn.fw.valhalla.rpc.erp.dto.UserInfoDTO;
22 import cn.fw.valhalla.rpc.oop.dto.ShopDTO; 23 import cn.fw.valhalla.rpc.oop.dto.ShopDTO;
@@ -64,6 +65,10 @@ public class IRFollowStrategy extends AbstractFollowStrategy { @@ -64,6 +65,10 @@ public class IRFollowStrategy extends AbstractFollowStrategy {
64 vo.setCustomerId(followRecord.getCustomerId()); 65 vo.setCustomerId(followRecord.getCustomerId());
65 vo.setDeadline(followRecord.getDeadline()); 66 vo.setDeadline(followRecord.getDeadline());
66 CustomerDetailDto customerDetailDto = customerBizService.queryById(followRecord.getCustomerId()); 67 CustomerDetailDto customerDetailDto = customerBizService.queryById(followRecord.getCustomerId());
  68 + if (Objects.isNull(customerDetailDto)) {
  69 + onCustomerIsNil(followRecord);
  70 + continue;
  71 + }
67 vo.setName(customerDetailDto.getName()); 72 vo.setName(customerDetailDto.getName());
68 vo.setCarImage(customerDetailDto.getCarImage()); 73 vo.setCarImage(customerDetailDto.getCarImage());
69 vo.setPlateNo(customerDetailDto.getPlateNo()); 74 vo.setPlateNo(customerDetailDto.getPlateNo());
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 { @@ -76,11 +76,14 @@ public class RMFollowStrategy extends AbstractFollowStrategy {
76 vo.setCustomerId(followRecord.getCustomerId()); 76 vo.setCustomerId(followRecord.getCustomerId());
77 vo.setDeadline(followRecord.getDeadline()); 77 vo.setDeadline(followRecord.getDeadline());
78 CustomerDetailDto customerDetailDto = customerBizService.queryById(followRecord.getCustomerId()); 78 CustomerDetailDto customerDetailDto = customerBizService.queryById(followRecord.getCustomerId());
  79 + if (Objects.isNull(customerDetailDto)) {
  80 + onCustomerIsNil(followRecord);
  81 + continue;
  82 + }
79 vo.setName(customerDetailDto.getName()); 83 vo.setName(customerDetailDto.getName());
80 vo.setCarImage(customerDetailDto.getCarImage()); 84 vo.setCarImage(customerDetailDto.getCarImage());
81 vo.setPlateNo(customerDetailDto.getPlateNo()); 85 vo.setPlateNo(customerDetailDto.getPlateNo());
82 vo.setLastMileage(customerDetailDto.getCurrentMileage()); 86 vo.setLastMileage(customerDetailDto.getCurrentMileage());
83 -  
84 OriginalData originalData = originalDataService.getOne(Wrappers.<OriginalData>lambdaQuery() 87 OriginalData originalData = originalDataService.getOne(Wrappers.<OriginalData>lambdaQuery()
85 .eq(OriginalData::getCustomerId, followRecord.getCustomerId()) 88 .eq(OriginalData::getCustomerId, followRecord.getCustomerId())
86 .eq(OriginalData::getType, DataTypeEnum.FS) 89 .eq(OriginalData::getType, DataTypeEnum.FS)