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 279 return true;
280 280 }
281 281 Long adviserId = changeAdviserReq.getAdviserId();
282   - if (changeAdviserReq.getAdviserId().equals(customer.getAdviserId())) {
  282 + if (adviserId.equals(customer.getAdviserId())) {
283 283 return true;
284 284 }
285 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 17 import cn.fw.valhalla.rpc.erp.dto.UserInfoDTO;
18 18 import cn.fw.valhalla.rpc.oop.dto.ShopDTO;
19 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 22 import cn.fw.valhalla.service.bus.follow.strategy.AbstractFollowStrategy;
21 23 import cn.fw.valhalla.service.data.OriginalDataService;
22 24 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
... ... @@ -44,10 +46,13 @@ import static cn.fw.common.businessvalidator.Validator.BV;
44 46 @Component
45 47 public class RMFollowStrategy extends AbstractFollowStrategy {
46 48 private final OriginalDataService originalDataService;
  49 + private final CustomerChangeBizService changeBizService;
47 50  
48 51 @Autowired
49   - public RMFollowStrategy(final OriginalDataService originalDataService) {
  52 + public RMFollowStrategy(final OriginalDataService originalDataService,
  53 + final CustomerChangeBizService changeBizService) {
50 54 this.originalDataService = originalDataService;
  55 + this.changeBizService = changeBizService;
51 56 }
52 57  
53 58 @Override
... ... @@ -155,7 +160,18 @@ public class RMFollowStrategy extends AbstractFollowStrategy {
155 160 CustomerCluePool cluePool = customerCluePoolService.queryByRefererId(customer.getId(), customer.getGroupId(), getFollowType());
156 161 completeClue(cluePool, originalData);
157 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 173 BV.isFalse(bool, () -> "档案信息不完整");
  174 +
159 175 CustomerCluePool clue = createClueInfo(originalData, getFollowType(), customer);
160 176 customerCluePoolService.save(clue);
161 177 createFirstNotice(clue, originalData.getGenerateTime());
... ...