Commit bdbae7e351aa6cbdb4adc8dabd6a03cdd274f674

Authored by 张志伟
1 parent 4e1784b0

:bug: feature(*): 修复bug

- 修复bug
fw-valhalla-service/src/main/java/cn/fw/valhalla/component/producer/CustomerChangeProducer.java
1 1 package cn.fw.valhalla.component.producer;
2 2  
  3 +import cn.fw.valhalla.domain.vo.customer.CustomerDetailVO;
3 4 import cn.fw.valhalla.sdk.result.CustomerInfoDto;
  5 +import cn.fw.valhalla.service.bus.cust.CustomerBizService;
4 6 import lombok.extern.slf4j.Slf4j;
5 7 import org.apache.rocketmq.spring.core.RocketMQTemplate;
  8 +import org.springframework.beans.BeanUtils;
6 9 import org.springframework.beans.factory.annotation.Autowired;
7 10 import org.springframework.stereotype.Component;
8 11 import org.springframework.web.bind.annotation.RequestMapping;
9 12  
  13 +import java.util.Objects;
  14 +
10 15 /**
11 16 * @author kurisu
12 17 */
... ... @@ -15,11 +20,19 @@ import org.springframework.web.bind.annotation.RequestMapping;
15 20 public class CustomerChangeProducer {
16 21 @Autowired
17 22 private RocketMQTemplate rocketMQTemplate;
  23 + @Autowired
  24 + private CustomerBizService customerBizService;
18 25  
19 26 @RequestMapping(value = "send")
20 27 public void send(CustomerInfoDto customerInfoDto) {
21 28 try {
22 29 log.info("售后保有客信息变更mq: body:[{}]", customerInfoDto);
  30 + if (Objects.isNull(customerInfoDto.getGroupId())) {
  31 + log.warn("售后保有客信息变更mq集团id为空");
  32 + return;
  33 + }
  34 + CustomerDetailVO detailByVin = customerBizService.getDetailByVin(customerInfoDto.getFrameNo(), customerInfoDto.getGroupId());
  35 + BeanUtils.copyProperties(detailByVin, customerInfoDto);
23 36 rocketMQTemplate.syncSend(CustomerInfoDto.TOPIC + ":*", customerInfoDto);
24 37 } catch (Exception e) {
25 38 e.printStackTrace();
... ...
fw-valhalla-service/src/main/java/cn/fw/valhalla/component/producer/RenewalSwitchProducer.kt
... ... @@ -4,7 +4,6 @@ import cn.fw.valhalla.common.utils.DateUtil
4 4 import cn.fw.valhalla.domain.enums.FollowTypeEnum
5 5 import cn.fw.valhalla.domain.enums.SettingTypeEnum
6 6 import cn.fw.valhalla.domain.vo.setting.SettingVO
7   -import cn.fw.valhalla.sdk.result.CustomerDistributedMQ
8 7 import cn.fw.valhalla.sdk.result.RenewalSwitchMQ
9 8 import cn.fw.valhalla.service.bus.setting.SettingBizService
10 9 import cn.fw.valhalla.service.bus.setting.strategy.SettingStrategy
... ... @@ -51,7 +50,7 @@ class RenewalSwitchProducer(
51 50 log.info("发送续保跟进切换mq消息。vin:{}", vin)
52 51 try {
53 52 val mq = RenewalSwitchMQ(FollowTypeEnum.IR.value, vin, DateUtil.localDate2Date(deadline), groupId)
54   - rocketMQTemplate.syncSend(CustomerDistributedMQ.TOPIC + ":*", mq)
  53 + rocketMQTemplate.syncSend(RenewalSwitchMQ.TOPIC + ":*", mq)
55 54 } catch (e: Exception) {
56 55 log.info("发送保有客分配结束mq消息失败!", e)
57 56 }
... ...