fix
This commit is contained in:
@@ -114,16 +114,29 @@ public class WxCustomMpService {
|
||||
}
|
||||
}
|
||||
|
||||
public void sendOrderMessage(String openId, String tenantId, String nickName, String orderNo, String amount) {
|
||||
/**
|
||||
* 通过微信公众号发送消息
|
||||
*
|
||||
* @param tenantId 租户ID
|
||||
* @param openId 消息接收人openID
|
||||
* @param userType 用户类型,0:顾客,1:店员
|
||||
* @param nickName 消息内容-消息接收人昵称
|
||||
* @param orderNo 消息内容-订单编号
|
||||
* @param orderId 消息内容-订单ID
|
||||
* @param orderAmount 消息内容-订单金额
|
||||
* @author 杭州世平信息科技有限公司-xuhq
|
||||
* @since 2024/7/31 10:51
|
||||
**/
|
||||
public void sendOrderMessage(String tenantId, String openId, String userType, String nickName, String orderNo, String orderId, String orderAmount) {
|
||||
String template_id = "d08mieMwK8w9o0bJkA9NtsStPFecz8iV_dOD3_6t0mM";
|
||||
String tenantKey = tenantService.selectSysTenantByTenantId(tenantId).getTenantKey();
|
||||
String url = "http://" + tenantKey + ".july.hucs.top/clerk/";
|
||||
String url = "http://" + tenantKey + ".july.hucs.top/" + ("0".equals(userType) ? "user/#/orderDetail/" : "clerk/#/orderDetail/") + orderId;
|
||||
WxMpTemplateMessage templateMessage = new WxMpTemplateMessage();
|
||||
templateMessage.setTemplateId(template_id);
|
||||
templateMessage.setToUser(openId);
|
||||
templateMessage.setUrl(url);
|
||||
List<WxMpTemplateData> data = new ArrayList<>();
|
||||
data.add(new WxMpTemplateData("amount2", amount));
|
||||
data.add(new WxMpTemplateData("amount2", orderAmount));
|
||||
data.add(new WxMpTemplateData("thing12", nickName));
|
||||
data.add(new WxMpTemplateData("character_string5", orderNo));
|
||||
data.add(new WxMpTemplateData("time4", DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss")));
|
||||
|
||||
Reference in New Issue
Block a user