|
@@ -44,37 +44,16 @@ public class SendMessageUtil {
|
|
|
public boolean sendTemplateMessageToOpenid(String date,String openId, String url,Integer type) {
|
|
|
boolean result = false;
|
|
|
switch (type) {
|
|
|
- case 1: //1,收益成功通知
|
|
|
- WeixinUtil.sendTemplateMessage(NameUtils.getConfig("appId"), NameUtils.getConfig("appSecret"), openId,ResultInfo.rewards_template_id, date, url);
|
|
|
- break;
|
|
|
- case 2: // 2,发货提醒通知
|
|
|
- WeixinUtil.sendTemplateMessage(NameUtils.getConfig("appId"), NameUtils.getConfig("appSecret"), openId, ResultInfo.Shipment_template_id, date, url);
|
|
|
- break;
|
|
|
- case 3: //3、收入提醒通知
|
|
|
- WeixinUtil.sendTemplateMessage(NameUtils.getConfig("appId"), NameUtils.getConfig("appSecret"), openId, ResultInfo.Income_template_id, date, url);
|
|
|
- break;
|
|
|
case 4: //4、订单未支付通知
|
|
|
WeixinUtil.sendTemplateMessage(NameUtils.getConfig("appId"), NameUtils.getConfig("appSecret"), openId, ResultInfo.Order_template_id, date, url);
|
|
|
break;
|
|
|
- case 5: //5、试用进度提醒
|
|
|
- WeixinUtil.sendTemplateMessage(NameUtils.getConfig("appId"), NameUtils.getConfig("appSecret"), openId, ResultInfo.trial_progress_remind, date, url);
|
|
|
- break;
|
|
|
- case 6: //6、试用申请通知
|
|
|
- WeixinUtil.sendTemplateMessage(NameUtils.getConfig("appId"), NameUtils.getConfig("appSecret"), openId, ResultInfo.probation_apply_notice, date, url);
|
|
|
- break;
|
|
|
- case 7: //7、试用申请成功通知
|
|
|
- WeixinUtil.sendTemplateMessage(NameUtils.getConfig("appId"), NameUtils.getConfig("appSecret"), openId, ResultInfo.probation_apply_success, date, url);
|
|
|
- break;
|
|
|
case 8: //8、订单支付成功
|
|
|
WeixinUtil.sendTemplateMessage(NameUtils.getConfig("appId"), NameUtils.getConfig("appSecret"), openId, ResultInfo.probation_pay_success, date, url);
|
|
|
break;
|
|
|
case 9: //9、订单关闭成功
|
|
|
WeixinUtil.sendTemplateMessage(NameUtils.getConfig("appId"), NameUtils.getConfig("appSecret"), openId, ResultInfo.probation_shut_down, date, url);
|
|
|
break;
|
|
|
- case 10: //10、奖品领取通知
|
|
|
- WeixinUtil.sendTemplateMessage(NameUtils.getConfig("appId"), NameUtils.getConfig("appSecret"), openId, ResultInfo.prize_receive_push, date, url);
|
|
|
- break;
|
|
|
- case 11: //11、更换电动牙刷通知
|
|
|
+ case 11: //11、服务进度
|
|
|
WeixinUtil.sendTemplateMessage(NameUtils.getConfig("appId"), NameUtils.getConfig("appSecret"), openId, ResultInfo.update_tooth_hint, date, url);
|
|
|
break;
|
|
|
case 12: //12、用户申请退款提醒
|
|
@@ -107,10 +86,13 @@ public class SendMessageUtil {
|
|
|
case 21: //21参与成功
|
|
|
WeixinUtil.sendTemplateMessage(NameUtils.getConfig("appId"), NameUtils.getConfig("appSecret"), openId, ResultInfo.participate_in_success, date, url);
|
|
|
break;
|
|
|
- case 22: //23助力成功
|
|
|
- WeixinUtil.sendTemplateMessage(NameUtils.getConfig("appId"), NameUtils.getConfig("appSecret"), openId, ResultInfo.helping_success, date, url);
|
|
|
+ case 22: //积分变更
|
|
|
+ WeixinUtil.sendTemplateMessage(NameUtils.getConfig("appId"), NameUtils.getConfig("appSecret"), openId, ResultInfo.point_change, date, url);
|
|
|
+ break;
|
|
|
+ case 23: //生日赠送
|
|
|
+ WeixinUtil.sendTemplateMessage(NameUtils.getConfig("appId"), NameUtils.getConfig("appSecret"), openId, ResultInfo.birthday_gift, date, url);
|
|
|
break;
|
|
|
- default:
|
|
|
+ default:
|
|
|
break;
|
|
|
}
|
|
|
result = true;
|
|
@@ -158,69 +140,7 @@ public class SendMessageUtil {
|
|
|
// System.out.println("发送成功");
|
|
|
// }
|
|
|
|
|
|
- /**
|
|
|
- * 试用进度提醒推送
|
|
|
- * @param first 标题
|
|
|
- * @param keyword1 商品名称
|
|
|
- * @param keyword2 订单编号
|
|
|
- * @param keyword3 申请时间
|
|
|
- * @param keyword4 截止时间
|
|
|
- * @param remark 全部内容
|
|
|
- * @param openId 用户openid
|
|
|
- * @param url 地址
|
|
|
- */
|
|
|
- public void probationPush(String first,String keyword1,String keyword2,String keyword3,String keyword4,String remark,String openId,String url){
|
|
|
- String temp = ResultInfo.PROBATIONPUSH;
|
|
|
- temp = temp.replaceFirst("firstValueIamberry", first)
|
|
|
- .replaceFirst("keyword1Value",keyword1)
|
|
|
- .replaceFirst("keyword2Value",keyword2)
|
|
|
- .replaceFirst("keyword3Value",keyword3)
|
|
|
- .replaceFirst("keyword4Value",keyword4)
|
|
|
- .replaceFirst("remarkValue",remark);
|
|
|
- sendTemplateMessageToOpenid(temp, openId, url,5);
|
|
|
- temp = ResultInfo.PROBATIONPUSH;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 试用开始通知
|
|
|
- * @param first 标题
|
|
|
- * @param keyword1 商品信息
|
|
|
- * @param keyword2 申请时间
|
|
|
- * @param remark 全部内容
|
|
|
- * @param openId 用户openid
|
|
|
- * @param url 地址
|
|
|
- */
|
|
|
- public void probationApplyNotice(String first,String keyword1,String keyword2,String remark,String openId,String url){
|
|
|
- String temp = ResultInfo.PROBATIONAPPLYNOTICE;
|
|
|
- temp = temp.replaceFirst("firstValueIamberry", first)
|
|
|
- .replaceFirst("keyword1Value",keyword1)
|
|
|
- .replaceFirst("keyword2Value",keyword2)
|
|
|
- .replaceFirst("remarkValue",remark);
|
|
|
- sendTemplateMessageToOpenid(temp, openId, url,6);
|
|
|
- }
|
|
|
- /**
|
|
|
- * 派送成功通知
|
|
|
- * @param first 标题
|
|
|
- * @param keyword1 申请单号
|
|
|
- * @param keyword2 申请时间
|
|
|
- * @param keyword3 应付金额
|
|
|
- * @param keyword4 应付积分
|
|
|
- * @param keyword5 支付方式
|
|
|
- * @param remark 全部内容
|
|
|
- * @param openId 用户openid
|
|
|
- * @param url 地址
|
|
|
- */
|
|
|
- public void probationApplySuccess(String first,String keyword1,String keyword2,String keyword3,String keyword4,String keyword5,String remark,String openId,String url){
|
|
|
- String temp = ResultInfo.PROBATIONAPPLYSUCCESS;
|
|
|
- temp = temp.replaceFirst("firstValueIamberry", first)
|
|
|
- .replaceFirst("keyword1Value",keyword1)
|
|
|
- .replaceFirst("keyword2Value",keyword2)
|
|
|
- .replaceFirst("keyword3Value",keyword3)
|
|
|
- .replaceFirst("keyword4Value",keyword4)
|
|
|
- .replaceFirst("keyword5Value",keyword5)
|
|
|
- .replaceFirst("remarkValue",remark);
|
|
|
- sendTemplateMessageToOpenid(temp, openId, url,7);
|
|
|
- }
|
|
|
+
|
|
|
/**
|
|
|
* 试用订单支付成功
|
|
|
* @param first 标题
|
|
@@ -257,32 +177,9 @@ public class SendMessageUtil {
|
|
|
sendTemplateMessageToOpenid(temp, openId, url,9);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 推荐人领取通知
|
|
|
- * @param first 标题
|
|
|
- * @param keyword1 被推荐人
|
|
|
- * @param keyword2 消费商家
|
|
|
- * @param keyword3 消费金额
|
|
|
- * @param keyword4 消费时间
|
|
|
- * @param keyword4 推荐奖励
|
|
|
- * @param remark 全部内容
|
|
|
- * @param openId 用户openid
|
|
|
- * @param url 跳转地址
|
|
|
- */
|
|
|
- public void prizeReceivePush(String first,String keyword1,String keyword2,String keyword3,String keyword4,String keyword5,String remark,String openId,String url){
|
|
|
- String temp = ResultInfo.PRIZERECEIVEPUSH;
|
|
|
- temp = temp.replaceFirst("firstValueIamberry", first)
|
|
|
- .replaceFirst("keyword1Value",keyword1)
|
|
|
- .replaceFirst("keyword2Value",keyword2)
|
|
|
- .replaceFirst("keyword3Value",keyword3)
|
|
|
- .replaceFirst("keyword4Value",keyword4)
|
|
|
- .replaceFirst("keyword5Value",keyword5)
|
|
|
- .replaceFirst("remarkValue",remark);
|
|
|
- sendTemplateMessageToOpenid(temp, openId, url,10);
|
|
|
- }
|
|
|
|
|
|
/**
|
|
|
- * 更换牙刷刷头提示信息
|
|
|
+ * 服务进度
|
|
|
* @param first
|
|
|
* @param keyword1
|
|
|
* @param keyword2
|
|
@@ -290,7 +187,7 @@ public class SendMessageUtil {
|
|
|
* @param openId
|
|
|
* @param url
|
|
|
*/
|
|
|
- public void updateToothHint(String first,String keyword1,String keyword2,String remark,String openId,String url){
|
|
|
+ public void serviceProgress(String first,String keyword1,String keyword2,String remark,String openId,String url){
|
|
|
String temp = ResultInfo.UPDATETOOTHHINT;
|
|
|
temp = temp.replaceFirst("firstValueIamberry", first)
|
|
|
.replaceFirst("keyword1Value",keyword1)
|
|
@@ -490,13 +387,14 @@ public class SendMessageUtil {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 618活动 助力成功
|
|
|
+ * 积分变更
|
|
|
* @param first
|
|
|
+ * @param remark
|
|
|
* @param openId
|
|
|
* @param url
|
|
|
*/
|
|
|
- public void helpingSuccess(String first,String keyword1,String keyword2,String remark,String openId,String url){
|
|
|
- String temp = ResultInfo.HELPINGSUCCESS;
|
|
|
+ public void pointChange(String first,String keyword1,String keyword2,String remark,String openId,String url){
|
|
|
+ String temp = ResultInfo.POINTCHANGE;
|
|
|
temp = temp.replaceFirst("firstValueIamberry", first)
|
|
|
.replaceFirst("keyword1Value",keyword1)
|
|
|
.replaceFirst("keyword2Value",keyword2)
|
|
@@ -505,4 +403,23 @@ public class SendMessageUtil {
|
|
|
sendTemplateMessageToOpenid(temp, openId, url,22);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 积分变更
|
|
|
+ * @param first
|
|
|
+ * @param remark
|
|
|
+ * @param openId
|
|
|
+ * @param url
|
|
|
+ */
|
|
|
+ public void birthdayGift(String first,String keyword1,String keyword2,String keyword3,String keyword4,String remark,String openId,String url){
|
|
|
+ String temp = ResultInfo.BIRTHDAYGIFT;
|
|
|
+ temp = temp.replaceFirst("firstValueIamberry", first)
|
|
|
+ .replaceFirst("keyword1Value",keyword1)
|
|
|
+ .replaceFirst("keyword2Value",keyword2)
|
|
|
+ .replaceFirst("keyword3Value",keyword3)
|
|
|
+ .replaceFirst("keyword4Value",keyword4)
|
|
|
+ .replaceFirst("colorValue","#1C86EE")
|
|
|
+ .replaceFirst("remarkValue",remark);
|
|
|
+ sendTemplateMessageToOpenid(temp, openId, url,23);
|
|
|
+ }
|
|
|
+
|
|
|
}
|