提交 d55bec62 作者: 沈振路

客服消息发文替换链接的时候判空

上级 d34ae129
...@@ -161,11 +161,12 @@ public class WeChatServiceImpl implements WeChatService{ ...@@ -161,11 +161,12 @@ public class WeChatServiceImpl implements WeChatService{
customerMessageTransferDTO.setOpenid(crowdPackageUserVO.getOpenId()); customerMessageTransferDTO.setOpenid(crowdPackageUserVO.getOpenId());
customerMessageTransferDTO.setCustomerRequestEntity(customerRequest); customerMessageTransferDTO.setCustomerRequestEntity(customerRequest);
rabbitTemplate.convertAndSend(RabbitCommonNameConstant.CUSTOMER_SERVICE_EXCHANGE, RabbitCommonNameConstant.CUSTOMER_MESSAGE_ROUTE_KEY,JSONObject.toJSONString(customerMessageTransferDTO)); // rabbitTemplate.convertAndSend(RabbitCommonNameConstant.CUSTOMER_SERVICE_EXCHANGE, RabbitCommonNameConstant.CUSTOMER_MESSAGE_ROUTE_KEY,JSONObject.toJSONString(customerMessageTransferDTO));
/*if (Boolean.TRUE.equals(redisTemplate.hasKey("CUSTOMER_MESSAGE_SEND_DEBUG"))) {
if (Boolean.TRUE.equals(redisTemplate.hasKey("CUSTOMER_MESSAGE_SEND_DEBUG"))) {
log.info("发送消息:{} ", JSONUtil.toJsonStr(customerMessageTransferDTO)); log.info("发送消息:{} ", JSONUtil.toJsonStr(customerMessageTransferDTO));
} }*/
log.info("发送消息:{} ", JSONUtil.toJsonStr(customerMessageTransferDTO));
} finally { } finally {
latch.countDown(); latch.countDown();
} }
...@@ -238,9 +239,9 @@ public class WeChatServiceImpl implements WeChatService{ ...@@ -238,9 +239,9 @@ public class WeChatServiceImpl implements WeChatService{
ReferralEntityVo referralEntityVo = replaceReferral.getValue(); ReferralEntityVo referralEntityVo = replaceReferral.getValue();
String url = referralEntityVo.getReferral(); String url = referralEntityVo.getReferral();
//替换占位符 //替换占位符
content = content.replace(CustomerCommonConstant.CUSTOMER_TEXT_URL_PLACEHOLDER + sort, url) content = content.replace(CustomerCommonConstant.CUSTOMER_TEXT_URL_PLACEHOLDER + sort, StringUtils.isBlank(url) ? StringUtils.EMPTY : url)
.replace(CustomerCommonConstant.CUSTOMER_TEXT_MP_APPID_PLACEHOLDER, referralEntityVo.getMpAppId()) .replace(CustomerCommonConstant.CUSTOMER_TEXT_MP_APPID_PLACEHOLDER, StringUtils.isBlank(referralEntityVo.getMpAppId()) ? StringUtils.EMPTY : referralEntityVo.getMpAppId())
.replace(CustomerCommonConstant.CUSTOMER_TEXT_MP_PATH_PLACEHOLDER + sort, referralEntityVo.getMpPath()) .replace(CustomerCommonConstant.CUSTOMER_TEXT_MP_PATH_PLACEHOLDER + sort, StringUtils.isBlank(referralEntityVo.getMpPath()) ? StringUtils.EMPTY : referralEntityVo.getMpPath())
; ;
} }
return new WeChatCustomerRequestEntity(CUSTOMER_TEXT,content); return new WeChatCustomerRequestEntity(CUSTOMER_TEXT,content);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论