Commit 4f9f73d8 authored by mlchun's avatar mlchun

1.添加微信消息模板推送

parent e60bcc72
......@@ -19,4 +19,6 @@ public class WechatAccountConfig {
private String mpAppSecret;
private String templateId;
}
package io.hmit.service.impl;
import io.hmit.config.WeChatMpConfig;
import io.hmit.config.WechatAccountConfig;
import io.hmit.modules.serviceOrder.dto.PensionOrderDTO;
import io.hmit.service.PushMessage;
import lombok.extern.slf4j.Slf4j;
......@@ -27,10 +29,13 @@ public class PushMessageImpl implements PushMessage {
@Autowired
private WxMpService wxMpService;
@Autowired
private WechatAccountConfig wechatAccountConfig;
@Override
public void sendMsg(PensionOrderDTO pensionOrderDTO, String openId) {
WxMpTemplateMessage templateMessage = new WxMpTemplateMessage();
templateMessage.setTemplateId("GsGydVGl-vzOv5aA0LaIdA-FcMM88TEpe37U-lZ6HJ8");
templateMessage.setTemplateId(wechatAccountConfig.getTemplateId());
templateMessage.setToUser(openId);
List<WxMpTemplateData> data = Arrays.asList(
......
......@@ -77,3 +77,4 @@ QR:
wechat:
mpAppId: wxfa2386639794d998
mpAppSecret: 8f624f83c9585baa9d1697e24fdffd81
templateId: GsGydVGl-vzOv5aA0LaIdA-FcMM88TEpe37U-lZ6HJ8
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment