|
@@ -5,6 +5,8 @@ import com.iamberry.wechat.tools.ResultInfo;
|
|
|
import com.iamberry.wechat.tools.WeixinUtil;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
/**
|
|
|
* @company 深圳爱贝源科技有限公司
|
|
@@ -100,6 +102,12 @@ public class SendMessageUtil {
|
|
|
case 12:
|
|
|
WeixinUtil.sendTemplateMessage(NameUtils.getConfig("appId"), NameUtils.getConfig("appSecret"), openId, ResultInfo.member_activation, date, url);
|
|
|
break;
|
|
|
+ case 13: //推荐用户注册会员
|
|
|
+ WeixinUtil.sendTemplateMessage(NameUtils.getConfig("appId"), NameUtils.getConfig("appSecret"), openId, ResultInfo.register_member, date, url);
|
|
|
+ break;
|
|
|
+ case 14: //推荐用户使用优惠券
|
|
|
+ WeixinUtil.sendTemplateMessage(NameUtils.getConfig("appId"), NameUtils.getConfig("appSecret"), openId, ResultInfo.recommend_use_coupon, date, url);
|
|
|
+ break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
@@ -107,6 +115,9 @@ public class SendMessageUtil {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ public static void main(String[] args) {
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 支付成功
|
|
@@ -118,12 +129,13 @@ public class SendMessageUtil {
|
|
|
* @param openId
|
|
|
* @param url
|
|
|
*/
|
|
|
- public void probationPaySuccess(String first,String keyword1,String keyword2,String keyword3,String remark,String openId,String url){
|
|
|
+ public void probationPaySuccess(String first,String keyword1,String keyword2,String keyword3,String keyword4,String remark,String openId,String url){
|
|
|
String temp = ResultInfo.PROBATIONPAYSUCCESS;
|
|
|
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,5);
|
|
@@ -184,13 +196,14 @@ public class SendMessageUtil {
|
|
|
* @param openId
|
|
|
* @param url
|
|
|
*/
|
|
|
- public void orderApplyReturn(String first,String keyword1,String keyword2,String keyword3,String keyword4,String remark,String openId,String url){
|
|
|
+ public void orderApplyReturn(String first,String keyword1,String keyword2,String keyword3,String keyword4,String keyword5,String remark,String openId,String url){
|
|
|
String temp = ResultInfo.APPLYRETURN;
|
|
|
temp = temp.replaceFirst("firstValueIamberry", first)
|
|
|
.replaceFirst("keyword1Value",keyword1)
|
|
|
.replaceFirst("keyword2Value",keyword2)
|
|
|
.replaceFirst("keyword3Value",keyword3)
|
|
|
.replaceFirst("keyword4Value",keyword4)
|
|
|
+ .replaceFirst("keyword5Value",keyword5)
|
|
|
.replaceFirst("colorValue","#1C86EE")
|
|
|
.replaceFirst("remarkValue",remark);
|
|
|
sendTemplateMessageToOpenid(temp, openId, url,7);
|
|
@@ -274,4 +287,42 @@ public class SendMessageUtil {
|
|
|
.replaceFirst("remarkValue",remark);
|
|
|
sendTemplateMessageToOpenid(temp, openId, url,12);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 注册成为会员
|
|
|
+ * @param first
|
|
|
+ * @param keyword1
|
|
|
+ * @param keyword2
|
|
|
+ * @param remark
|
|
|
+ * @param openId
|
|
|
+ * @param url
|
|
|
+ */
|
|
|
+ public void registerMember(String first,String keyword1,String keyword2,String remark,String openId,String url){
|
|
|
+ String temp = ResultInfo.REGISTERMEMBER;
|
|
|
+ temp = temp.replaceFirst("firstValueIamberry", first)
|
|
|
+ .replaceFirst("keyword1Value",keyword1)
|
|
|
+ .replaceFirst("keyword2Value",keyword2)
|
|
|
+ .replaceFirst("remarkValue",remark);
|
|
|
+ sendTemplateMessageToOpenid(temp, openId, url,13);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 推荐用户使用优惠券
|
|
|
+ * @param first
|
|
|
+ * @param keyword1
|
|
|
+ * @param keyword2
|
|
|
+ * @param remark
|
|
|
+ * @param openId
|
|
|
+ * @param url
|
|
|
+ */
|
|
|
+ public void recommendUseCoupon(String first,String keyword1,String keyword2,String remark,String openId,String url){
|
|
|
+ String temp = ResultInfo.RECOMMENDUSECOUPON;
|
|
|
+ temp = temp.replaceFirst("firstValueIamberry", first)
|
|
|
+ .replaceFirst("keyword1Value",keyword1)
|
|
|
+ .replaceFirst("keyword2Value",keyword2)
|
|
|
+ .replaceFirst("remarkValue",remark);
|
|
|
+ sendTemplateMessageToOpenid(temp, openId, url,14);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|