|
@@ -3,6 +3,7 @@ package com.platform.service.wechat.util;
|
|
import com.platform.common.cache.ConfigCache;
|
|
import com.platform.common.cache.ConfigCache;
|
|
import com.platform.common.exception.DeniedException;
|
|
import com.platform.common.exception.DeniedException;
|
|
import com.platform.common.util.DateUtils;
|
|
import com.platform.common.util.DateUtils;
|
|
|
|
+import com.platform.common.util.JsonUtils;
|
|
import com.platform.common.util.SpringContextHolder;
|
|
import com.platform.common.util.SpringContextHolder;
|
|
import com.platform.common.util.StringUtils;
|
|
import com.platform.common.util.StringUtils;
|
|
import com.platform.dao.dto.repair.RepairApplicationFormDTO;
|
|
import com.platform.dao.dto.repair.RepairApplicationFormDTO;
|
|
@@ -12,6 +13,7 @@ import com.platform.dao.vo.sb.SbInfoVO;
|
|
import com.platform.service.event.WechatEvent;
|
|
import com.platform.service.event.WechatEvent;
|
|
import com.platform.service.wechat.model.request.WechatTemplateRequestBuilder;
|
|
import com.platform.service.wechat.model.request.WechatTemplateRequestBuilder;
|
|
import com.platform.service.wechat.model.request.template.WechatTemplateRequest;
|
|
import com.platform.service.wechat.model.request.template.WechatTemplateRequest;
|
|
|
|
+import com.platform.service.wechat.service.WeChatConnectService;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
@@ -151,10 +153,14 @@ public class WeChatMessageUtil {
|
|
if(StringUtils.isBlank(url)){
|
|
if(StringUtils.isBlank(url)){
|
|
throw new DeniedException("跳转详情url不能为空");
|
|
throw new DeniedException("跳转详情url不能为空");
|
|
}
|
|
}
|
|
|
|
+ log.info("isSend========" + isSend() + ",openId=====" + openId);
|
|
if (isSend() && StringUtils.isNotBlank(openId)) {
|
|
if (isSend() && StringUtils.isNotBlank(openId)) {
|
|
String[] colors = getColors(values.length);
|
|
String[] colors = getColors(values.length);
|
|
WechatTemplateRequest request = WechatTemplateRequestBuilder.getAuditRequest(url, wechatTemplateId,openId, values, colors);
|
|
WechatTemplateRequest request = WechatTemplateRequestBuilder.getAuditRequest(url, wechatTemplateId,openId, values, colors);
|
|
- SpringContextHolder.publishEvent(new WechatEvent(request));
|
|
|
|
|
|
+ log.info("request============" + JsonUtils.objectToJson(request));
|
|
|
|
+ log.info("微信通知事件执行");
|
|
|
|
+ WeChatConnectService.postTemplate(request);
|
|
|
|
+ //SpringContextHolder.publishEvent(new WechatEvent(request));
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.error("发送微信消息失败", e);
|
|
log.error("发送微信消息失败", e);
|