diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerChangeBizService.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerChangeBizService.java index dcbc3c8..e15371c 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerChangeBizService.java +++ b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerChangeBizService.java @@ -279,7 +279,7 @@ public class CustomerChangeBizService extends AbstractCustomerService { return true; } Long adviserId = changeAdviserReq.getAdviserId(); - if (changeAdviserReq.getAdviserId().equals(customer.getAdviserId())) { + if (adviserId.equals(customer.getAdviserId())) { return true; } List dataRange = userService.getUserRoleDataRange(adviserId, RoleCode.FWGW); 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 0affec6..9e6238c 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 @@ -17,6 +17,8 @@ import cn.fw.valhalla.domain.vo.setting.SettingVO; import cn.fw.valhalla.rpc.erp.dto.UserInfoDTO; import cn.fw.valhalla.rpc.oop.dto.ShopDTO; import cn.fw.valhalla.sdk.enums.DataTypeEnum; +import cn.fw.valhalla.sdk.param.ChangeAdviserReq; +import cn.fw.valhalla.service.bus.cust.CustomerChangeBizService; import cn.fw.valhalla.service.bus.follow.strategy.AbstractFollowStrategy; import cn.fw.valhalla.service.data.OriginalDataService; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -44,10 +46,13 @@ import static cn.fw.common.businessvalidator.Validator.BV; @Component public class RMFollowStrategy extends AbstractFollowStrategy { private final OriginalDataService originalDataService; + private final CustomerChangeBizService changeBizService; @Autowired - public RMFollowStrategy(final OriginalDataService originalDataService) { + public RMFollowStrategy(final OriginalDataService originalDataService, + final CustomerChangeBizService changeBizService) { this.originalDataService = originalDataService; + this.changeBizService = changeBizService; } @Override @@ -155,7 +160,18 @@ public class RMFollowStrategy extends AbstractFollowStrategy { CustomerCluePool cluePool = customerCluePoolService.queryByRefererId(customer.getId(), customer.getGroupId(), getFollowType()); completeClue(cluePool, originalData); boolean bool = Objects.isNull(customer.getAdviserId()) || Objects.isNull(customer.getShopId()); + if (Objects.nonNull(originalData.getShopId()) && Objects.nonNull(originalData.getUserId()) && bool) { + ChangeAdviserReq req = new ChangeAdviserReq(); + req.setAdviserId(originalData.getUserId()); + req.setCusId(customer.getId()); + if (changeBizService.changeAdviser(req)) { + customer.setAdviserId(originalData.getUserId()); + customer.setShopId(originalData.getShopId()); + bool = false; + } + } BV.isFalse(bool, () -> "档案信息不完整"); + CustomerCluePool clue = createClueInfo(originalData, getFollowType(), customer); customerCluePoolService.save(clue); createFirstNotice(clue, originalData.getGenerateTime());