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