From bdbae7e351aa6cbdb4adc8dabd6a03cdd274f674 Mon Sep 17 00:00:00 2001 From: Kurisu Date: Tue, 16 May 2023 15:01:12 +0800 Subject: [PATCH] :bug: feature(*): 修复bug --- fw-valhalla-service/src/main/java/cn/fw/valhalla/component/producer/CustomerChangeProducer.java | 13 +++++++++++++ fw-valhalla-service/src/main/java/cn/fw/valhalla/component/producer/RenewalSwitchProducer.kt | 3 +-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/component/producer/CustomerChangeProducer.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/component/producer/CustomerChangeProducer.java index 3d93669..54e7e19 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/component/producer/CustomerChangeProducer.java +++ b/fw-valhalla-service/src/main/java/cn/fw/valhalla/component/producer/CustomerChangeProducer.java @@ -1,12 +1,17 @@ package cn.fw.valhalla.component.producer; +import cn.fw.valhalla.domain.vo.customer.CustomerDetailVO; import cn.fw.valhalla.sdk.result.CustomerInfoDto; +import cn.fw.valhalla.service.bus.cust.CustomerBizService; import lombok.extern.slf4j.Slf4j; import org.apache.rocketmq.spring.core.RocketMQTemplate; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.RequestMapping; +import java.util.Objects; + /** * @author kurisu */ @@ -15,11 +20,19 @@ import org.springframework.web.bind.annotation.RequestMapping; public class CustomerChangeProducer { @Autowired private RocketMQTemplate rocketMQTemplate; + @Autowired + private CustomerBizService customerBizService; @RequestMapping(value = "send") public void send(CustomerInfoDto customerInfoDto) { try { log.info("售后保有客信息变更mq: body:[{}]", customerInfoDto); + if (Objects.isNull(customerInfoDto.getGroupId())) { + log.warn("售后保有客信息变更mq集团id为空"); + return; + } + CustomerDetailVO detailByVin = customerBizService.getDetailByVin(customerInfoDto.getFrameNo(), customerInfoDto.getGroupId()); + BeanUtils.copyProperties(detailByVin, customerInfoDto); rocketMQTemplate.syncSend(CustomerInfoDto.TOPIC + ":*", customerInfoDto); } catch (Exception e) { e.printStackTrace(); diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/component/producer/RenewalSwitchProducer.kt b/fw-valhalla-service/src/main/java/cn/fw/valhalla/component/producer/RenewalSwitchProducer.kt index bfafab3..5b6f656 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/component/producer/RenewalSwitchProducer.kt +++ b/fw-valhalla-service/src/main/java/cn/fw/valhalla/component/producer/RenewalSwitchProducer.kt @@ -4,7 +4,6 @@ import cn.fw.valhalla.common.utils.DateUtil import cn.fw.valhalla.domain.enums.FollowTypeEnum import cn.fw.valhalla.domain.enums.SettingTypeEnum import cn.fw.valhalla.domain.vo.setting.SettingVO -import cn.fw.valhalla.sdk.result.CustomerDistributedMQ import cn.fw.valhalla.sdk.result.RenewalSwitchMQ import cn.fw.valhalla.service.bus.setting.SettingBizService import cn.fw.valhalla.service.bus.setting.strategy.SettingStrategy @@ -51,7 +50,7 @@ class RenewalSwitchProducer( log.info("发送续保跟进切换mq消息。vin:{}", vin) try { val mq = RenewalSwitchMQ(FollowTypeEnum.IR.value, vin, DateUtil.localDate2Date(deadline), groupId) - rocketMQTemplate.syncSend(CustomerDistributedMQ.TOPIC + ":*", mq) + rocketMQTemplate.syncSend(RenewalSwitchMQ.TOPIC + ":*", mq) } catch (e: Exception) { log.info("发送保有客分配结束mq消息失败!", e) } -- libgit2 0.22.2