Blame view

fw-valhalla-service/src/main/java/cn/fw/valhalla/component/producer/CustomerChangeProducer.java 1.46 KB
2a40e3f8   张志伟   feature(*): 续保跟进调整
1
  package cn.fw.valhalla.component.producer;
6c848e1d   张志伟   :art:
2
  
bdbae7e3   张志伟   :bug:
3
  import cn.fw.valhalla.domain.vo.customer.CustomerDetailVO;
6c848e1d   张志伟   :art:
4
  import cn.fw.valhalla.sdk.result.CustomerInfoDto;
bdbae7e3   张志伟   :bug:
5
  import cn.fw.valhalla.service.bus.cust.CustomerBizService;
6c848e1d   张志伟   :art:
6
7
  import lombok.extern.slf4j.Slf4j;
  import org.apache.rocketmq.spring.core.RocketMQTemplate;
bdbae7e3   张志伟   :bug:
8
  import org.springframework.beans.BeanUtils;
6c848e1d   张志伟   :art:
9
10
11
12
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.stereotype.Component;
  import org.springframework.web.bind.annotation.RequestMapping;
  
bdbae7e3   张志伟   :bug:
13
14
  import java.util.Objects;
  
6c848e1d   张志伟   :art:
15
16
17
18
19
20
21
22
  /**
   * @author kurisu
   */
  @Slf4j
  @Component
  public class CustomerChangeProducer {
      @Autowired
      private RocketMQTemplate rocketMQTemplate;
bdbae7e3   张志伟   :bug:
23
24
      @Autowired
      private CustomerBizService customerBizService;
6c848e1d   张志伟   :art:
25
  
6c848e1d   张志伟   :art:
26
27
28
29
      @RequestMapping(value = "send")
      public void send(CustomerInfoDto customerInfoDto) {
          try {
              log.info("售后保有客信息变更mq: body:[{}]", customerInfoDto);
bdbae7e3   张志伟   :bug:
30
31
32
33
34
35
              if (Objects.isNull(customerInfoDto.getGroupId())) {
                  log.warn("售后保有客信息变更mq集团id为空");
                  return;
              }
              CustomerDetailVO detailByVin = customerBizService.getDetailByVin(customerInfoDto.getFrameNo(), customerInfoDto.getGroupId());
              BeanUtils.copyProperties(detailByVin, customerInfoDto);
8cd965a1   张志伟   feature(*): 续保跟进调整
36
              rocketMQTemplate.syncSend(CustomerInfoDto.TOPIC + ":*", customerInfoDto);
6c848e1d   张志伟   :art:
37
38
39
40
41
          } catch (Exception e) {
              e.printStackTrace();
          }
      }
  }