parent
ec13813c6d
commit
b2aeefc5e8
@ -1,55 +0,0 @@ |
|||||||
package com.cweb.config; |
|
||||||
|
|
||||||
import cn.binarywang.wx.miniapp.api.WxMaMsgService; |
|
||||||
import cn.binarywang.wx.miniapp.api.WxMaService; |
|
||||||
import cn.binarywang.wx.miniapp.bean.WxMaSubscribeMessage; |
|
||||||
import com.hfkj.common.utils.DateUtil; |
|
||||||
import org.slf4j.Logger; |
|
||||||
import org.slf4j.LoggerFactory; |
|
||||||
|
|
||||||
import java.util.*; |
|
||||||
|
|
||||||
public class WxMsgConfig { |
|
||||||
|
|
||||||
private static Logger log = LoggerFactory.getLogger(WxMsgConfig.class); |
|
||||||
|
|
||||||
public static void pushOneUser(String orderName , String price , String orderNo , Date payTime , String remark , Long orderId , String openId) { |
|
||||||
|
|
||||||
try { |
|
||||||
List<WxMaSubscribeMessage.Data> list = new ArrayList<>(); |
|
||||||
|
|
||||||
Map<String, String> m = new HashMap<>(); |
|
||||||
|
|
||||||
m.put("thing1", orderName); |
|
||||||
m.put("amount2", price + "元"); |
|
||||||
m.put("character_string3", orderNo); |
|
||||||
m.put("time4", DateUtil.date2String(payTime , "yyyy年MM月dd日 HH:mm:ss")); |
|
||||||
m.put("thing6", remark); |
|
||||||
|
|
||||||
for (String key: m.keySet()) { |
|
||||||
WxMaSubscribeMessage.Data msgElement = new WxMaSubscribeMessage.Data(); |
|
||||||
msgElement.setName(key); |
|
||||||
msgElement.setValue(m.get(key)); |
|
||||||
list.add(msgElement); |
|
||||||
} |
|
||||||
|
|
||||||
WxMaSubscribeMessage subscribeMessage = new WxMaSubscribeMessage(); |
|
||||||
subscribeMessage.setToUser(openId); // 小程序openId
|
|
||||||
subscribeMessage.setTemplateId("oUvaCPeeOg4wH6HTvCcSabU6FnzXUXOBXsqBYAPOV-U"); |
|
||||||
subscribeMessage.setData(list); |
|
||||||
subscribeMessage.setPage("pages/user/order_details/order_details?id=" + orderId); |
|
||||||
subscribeMessage.setMiniprogramState("developer"); |
|
||||||
|
|
||||||
final WxMaService wxService = WxMaConfiguration.getMaService(); |
|
||||||
WxMaMsgService maMsgService = wxService.getMsgService(); |
|
||||||
maMsgService.sendSubscribeMsg(subscribeMessage); |
|
||||||
} catch (Exception e) { |
|
||||||
log.error(String.valueOf(e)); |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} |
|
@ -1,6 +1,10 @@ |
|||||||
filesystem=/home/project/oil/filesystem |
filesystem=/home/project/oil/filesystem |
||||||
huiPayPreorderNotifyUrl=https://oil.dctpay.com/crest/notify/huipay |
huiPayPreorderNotifyUrl=https://oil.dctpay.com/crest/notify/huipay |
||||||
domainName=https://oil.dctpay.com |
domainName=https://oil.dctpay.com |
||||||
|
|
||||||
|
wxMaAppId=wx8d49e2f83025229d |
||||||
|
wxMaAppSecret=d8d6dcaef77d3b659258a01b5ddba5df |
||||||
|
|
||||||
newLinkReqUrl=https://hcs.czb365.com |
newLinkReqUrl=https://hcs.czb365.com |
||||||
newLinkAppKey=305490138943968 |
newLinkAppKey=305490138943968 |
||||||
newLinkAppSecret=dbf7dca3de20c2f2a41fd64cfb682be8 |
newLinkAppSecret=dbf7dca3de20c2f2a41fd64cfb682be8 |
||||||
|
Loading…
Reference in new issue