Commit a37fe1c7885ba3e779d70408eec4d4744e2d65df

Authored by 张志伟
1 parent 9307577e

:bug: v1.1.0 流失客户档案问题优化

fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerChangeBizService.java
@@ -279,7 +279,7 @@ public class CustomerChangeBizService extends AbstractCustomerService { @@ -279,7 +279,7 @@ public class CustomerChangeBizService extends AbstractCustomerService {
279 return true; 279 return true;
280 } 280 }
281 Long adviserId = changeAdviserReq.getAdviserId(); 281 Long adviserId = changeAdviserReq.getAdviserId();
282 - if (changeAdviserReq.getAdviserId().equals(customer.getAdviserId())) { 282 + if (adviserId.equals(customer.getAdviserId())) {
283 return true; 283 return true;
284 } 284 }
285 List<UserRoleDataRangeDTO> dataRange = userService.getUserRoleDataRange(adviserId, RoleCode.FWGW); 285 List<UserRoleDataRangeDTO> dataRange = userService.getUserRoleDataRange(adviserId, RoleCode.FWGW);
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/RMFollowStrategy.java
@@ -17,6 +17,8 @@ import cn.fw.valhalla.domain.vo.setting.SettingVO; @@ -17,6 +17,8 @@ import cn.fw.valhalla.domain.vo.setting.SettingVO;
17 import cn.fw.valhalla.rpc.erp.dto.UserInfoDTO; 17 import cn.fw.valhalla.rpc.erp.dto.UserInfoDTO;
18 import cn.fw.valhalla.rpc.oop.dto.ShopDTO; 18 import cn.fw.valhalla.rpc.oop.dto.ShopDTO;
19 import cn.fw.valhalla.sdk.enums.DataTypeEnum; 19 import cn.fw.valhalla.sdk.enums.DataTypeEnum;
  20 +import cn.fw.valhalla.sdk.param.ChangeAdviserReq;
  21 +import cn.fw.valhalla.service.bus.cust.CustomerChangeBizService;
20 import cn.fw.valhalla.service.bus.follow.strategy.AbstractFollowStrategy; 22 import cn.fw.valhalla.service.bus.follow.strategy.AbstractFollowStrategy;
21 import cn.fw.valhalla.service.data.OriginalDataService; 23 import cn.fw.valhalla.service.data.OriginalDataService;
22 import com.baomidou.mybatisplus.core.toolkit.Wrappers; 24 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -44,10 +46,13 @@ import static cn.fw.common.businessvalidator.Validator.BV; @@ -44,10 +46,13 @@ import static cn.fw.common.businessvalidator.Validator.BV;
44 @Component 46 @Component
45 public class RMFollowStrategy extends AbstractFollowStrategy { 47 public class RMFollowStrategy extends AbstractFollowStrategy {
46 private final OriginalDataService originalDataService; 48 private final OriginalDataService originalDataService;
  49 + private final CustomerChangeBizService changeBizService;
47 50
48 @Autowired 51 @Autowired
49 - public RMFollowStrategy(final OriginalDataService originalDataService) { 52 + public RMFollowStrategy(final OriginalDataService originalDataService,
  53 + final CustomerChangeBizService changeBizService) {
50 this.originalDataService = originalDataService; 54 this.originalDataService = originalDataService;
  55 + this.changeBizService = changeBizService;
51 } 56 }
52 57
53 @Override 58 @Override
@@ -155,7 +160,18 @@ public class RMFollowStrategy extends AbstractFollowStrategy { @@ -155,7 +160,18 @@ public class RMFollowStrategy extends AbstractFollowStrategy {
155 CustomerCluePool cluePool = customerCluePoolService.queryByRefererId(customer.getId(), customer.getGroupId(), getFollowType()); 160 CustomerCluePool cluePool = customerCluePoolService.queryByRefererId(customer.getId(), customer.getGroupId(), getFollowType());
156 completeClue(cluePool, originalData); 161 completeClue(cluePool, originalData);
157 boolean bool = Objects.isNull(customer.getAdviserId()) || Objects.isNull(customer.getShopId()); 162 boolean bool = Objects.isNull(customer.getAdviserId()) || Objects.isNull(customer.getShopId());
  163 + if (Objects.nonNull(originalData.getShopId()) && Objects.nonNull(originalData.getUserId()) && bool) {
  164 + ChangeAdviserReq req = new ChangeAdviserReq();
  165 + req.setAdviserId(originalData.getUserId());
  166 + req.setCusId(customer.getId());
  167 + if (changeBizService.changeAdviser(req)) {
  168 + customer.setAdviserId(originalData.getUserId());
  169 + customer.setShopId(originalData.getShopId());
  170 + bool = false;
  171 + }
  172 + }
158 BV.isFalse(bool, () -> "档案信息不完整"); 173 BV.isFalse(bool, () -> "档案信息不完整");
  174 +
159 CustomerCluePool clue = createClueInfo(originalData, getFollowType(), customer); 175 CustomerCluePool clue = createClueInfo(originalData, getFollowType(), customer);
160 customerCluePoolService.save(clue); 176 customerCluePoolService.save(clue);
161 createFirstNotice(clue, originalData.getGenerateTime()); 177 createFirstNotice(clue, originalData.getGenerateTime());