Commit 1fbe9582 by 吕明尚

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

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