Commit 1fbe9582 by 吕明尚

增加小程序订阅消息跳转类型

parent 42c18c3f
......@@ -22,7 +22,14 @@ wechat:
signKey: ZEKu56XCezuESfNEdM4zVZEN3cz2PuHz
certPath: /var/gxpt/wechat_ssl/apiclient_cert.p12
token: coujio
wx:
miniapp:
configs:
- appid: wxdd170b8783edf7a0
secret: 7339f117e85876a0dfe10ea1ed47340e
token: coujio
aesKey: zf8vTHbI0ZDPTkkCXHEuwh9EbtVtOn6n4vQjMb9OFrS
msgDataFormat: XML
# 开发环境配置
server:
# 服务器的HTTP端口,默认为8080
......
......@@ -25,6 +25,9 @@ public class TemplateMessageVo {
@ApiModelProperty(value = "模板跳转链接(海外帐号没有跳转能力)")
private String page;
@ApiModelProperty(value = "跳转小程序类型:developer为开发版;trial为体验版;formal为正式版;默认为正式版")
private String miniprogram_state;
@ApiModelProperty(value = "发送内容")
private HashMap<String, SendTemplateMessageItemVo> data;
}
......@@ -529,8 +529,9 @@ public class WechatNewServiceImpl implements WechatNewService {
public Boolean sendMiniSubscribeMessage(SOrder byOrderNo, MessageReminderEnum messageReminderEnum) {
//发送模板消息 预约提醒到期
TemplateMessageVo templateMessageVo = new TemplateMessageVo();
String url = "https://www.coujio.com/front-api/order/" + byOrderNo.getOrderNo();
String url = "pages/orderResult/" + byOrderNo.getOrderNo();
templateMessageVo.setPage(url);
templateMessageVo.setMiniprogram_state("trial");
HashMap<String, SendTemplateMessageItemVo> data = new HashMap<>();
SStore sStore = storeService.getById(byOrderNo.getStoreId());
SRoomVo sRoomVo = roomService.selectSRoomById(byOrderNo.getRoomId());
......@@ -543,6 +544,11 @@ public class WechatNewServiceImpl implements WechatNewService {
SConsumerToken tokenByUserId = sConsumerTokenService.getTokenByUserId(byOrderNo.getConsumerId());
String date = preStartDateStr + "~" + preEndDateStr;
templateMessageVo.setTouser(tokenByUserId.getToken());
//截取20个字符
String address = sStore.getAddress();
if (address.length() > 20) {
address = address.substring(0, 20);
}
if (messageReminderEnum.equals(MessageReminderEnum.RESERVER)) {
templateMessageVo.setTemplate_id(MessageReminderEnum.RESERVER.getValue());
//添加门店名称
......@@ -552,9 +558,7 @@ public class WechatNewServiceImpl implements WechatNewService {
//预约时间
data.put("date3", new SendTemplateMessageItemVo(date));
//地址
String address = sStore.getAddress();
String substring = address.substring(0, 20);
data.put("thing5", new SendTemplateMessageItemVo(substring));
data.put("thing5", new SendTemplateMessageItemVo(address));
} else if (messageReminderEnum.equals(MessageReminderEnum.START)) {
templateMessageVo.setTemplate_id(MessageReminderEnum.START.getValue());
//预约门店
......@@ -564,10 +568,7 @@ public class WechatNewServiceImpl implements WechatNewService {
//预约时间
data.put("time8", new SendTemplateMessageItemVo(date));
//地址
//截取20个字符
String address = sStore.getAddress();
String substring = address.substring(0, 20);
data.put("thing9", new SendTemplateMessageItemVo(substring));
data.put("thing9", new SendTemplateMessageItemVo(address));
//订单金额
data.put("amount4", new SendTemplateMessageItemVo(String.valueOf(byOrderNo.getPackPrice())));
} else if (messageReminderEnum.equals(MessageReminderEnum.END)) {
......@@ -579,10 +580,7 @@ public class WechatNewServiceImpl implements WechatNewService {
//订单时间
data.put("time7", new SendTemplateMessageItemVo(date));
//地址
//截取20个字符
String address = sStore.getAddress();
String substring = address.substring(0, 20);
data.put("thing8", new SendTemplateMessageItemVo(substring));
data.put("thing8", new SendTemplateMessageItemVo(address));
}
templateMessageVo.setData(data);
return sendMiniSubscribeMessage(templateMessageVo);
......
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