|
|
@@ -476,11 +476,19 @@ public class CusFollowService extends BaseService<CusFollow> {
|
|
|
// mapMessage.put("publicOpenId", user.get("publicOpenId"));
|
|
|
mapMessage.put("userWxId", user.get("userWxId"));
|
|
|
mapMessage.put("first", "客户跟进提醒");
|
|
|
-// mapMessage.put("keywordList", list);
|
|
|
- mapMessage.put("keywordMap", keywordMap);
|
|
|
+// mapMessage.put("keywordList", list);
|
|
|
+// mapMessage.put("keywordMap", keywordMap);
|
|
|
mapMessage.put("remark", "客户跟进备注");
|
|
|
-// sendUniformMessage(mapMessage);
|
|
|
- wxMessagePush(mapMessage);
|
|
|
+// sendUniformMessage(mapMessage);
|
|
|
+ String[] miniMessageModelIds = config.getMiniMessageModelIds();
|
|
|
+ // 构造对应的显示信息 和模板数据结构对应
|
|
|
+ JSONObject data = new JSONObject();
|
|
|
+ data.put("time4", createDataItem("value", String.valueOf(keywordMap.get("followTime"))));
|
|
|
+ data.put("thing1", createDataItem("value", String.valueOf(keywordMap.get("cusName"))));
|
|
|
+ data.put("phone_number2", createDataItem("value", String.valueOf(keywordMap.get("cusPhone"))));
|
|
|
+ data.put("thing6", createDataItem("value", String.valueOf(keywordMap.get("remark"))));
|
|
|
+ data.put("thing5", createDataItem("value", String.valueOf(mapMessage.get("remark"))));
|
|
|
+ wxMessagePush(miniMessageModelIds[0], data, mapMessage);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -558,14 +566,14 @@ public class CusFollowService extends BaseService<CusFollow> {
|
|
|
* @author : 刘尧
|
|
|
* @date : 2024-07-19 08:56
|
|
|
* */
|
|
|
- public ResponseResultVO<?> wxMessagePush(Map<String, Object> map) {
|
|
|
+ public ResponseResultVO<?> wxMessagePush(String messId, JSONObject data, Map<String, Object> map) {
|
|
|
// 获取微信Token
|
|
|
String wxToken = getWxToken();
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
// 接口调用凭证
|
|
|
params.put("access_token", wxToken);
|
|
|
// 所需下发的订阅模板id
|
|
|
- params.put("template_id", "z3REuwft6NLPxVW8s5HN1UgWjFstWjD0QfCXNLTa0LA");
|
|
|
+ params.put("template_id", messId);
|
|
|
// 点击模板卡片后的跳转页面
|
|
|
if (map.containsKey("otherParam")) {
|
|
|
params.put("page", "pages/welcome/welcome?loginType=" + map.get("loginType").toString() + "&otherParam=" + map.get("otherParam").toString());
|
|
|
@@ -576,18 +584,7 @@ public class CusFollowService extends BaseService<CusFollow> {
|
|
|
params.put("touser", map.get("userWxId"));
|
|
|
// 跳转小程序类型:developer为开发版;trial为体验版;formal为正式版;
|
|
|
params.put("miniprogram_state", "trial");
|
|
|
-
|
|
|
- // 获取客户信息
|
|
|
- Object keywordMap = map.get("keywordMap");
|
|
|
- Map<String, Object> personMap = BeanUtil.beanToMap(keywordMap);
|
|
|
-
|
|
|
- // 构造对应的显示信息 和模板数据结构对应
|
|
|
- JSONObject data = new JSONObject();
|
|
|
- data.put("time4", createDataItem("value", String.valueOf(personMap.get("followTime"))));
|
|
|
- data.put("thing1", createDataItem("value", String.valueOf(personMap.get("cusName"))));
|
|
|
- data.put("phone_number2", createDataItem("value", String.valueOf(personMap.get("cusPhone"))));
|
|
|
- data.put("thing6", createDataItem("value", String.valueOf(personMap.get("remark"))));
|
|
|
- data.put("thing5", createDataItem("value", String.valueOf(map.get("remark"))));
|
|
|
+ // 配置模板中明细值
|
|
|
params.put("data", data);
|
|
|
|
|
|
ResponseResultVO<JSONObject> post = HttpUtils.post("https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=" + wxToken, params);
|