From a820e1bb3c5bfeef213fa98d8cefb63c6b136040 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期五, 15 五月 2026 13:42:49 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
ruoyi-common/src/main/java/com/ruoyi/common/utils/WxMpUtils.java | 18 ++++++------------
1 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/WxMpUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/WxMpUtils.java
index 89cc4ef..b6d51db 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/WxMpUtils.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/WxMpUtils.java
@@ -8,6 +8,7 @@
import me.chanjar.weixin.mp.bean.kefu.WxMpKefuMessage;
import me.chanjar.weixin.mp.bean.template.WxMpTemplateData;
import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage;
+import org.springframework.stereotype.Component;
import java.util.Map;
@@ -56,10 +57,7 @@
return false;
}
try {
- WxMpKefuMessage message = WxMpKefuMessage.TEXT()
- .toUser(openid)
- .content(content)
- .build();
+ WxMpKefuMessage message = WxMpKefuMessage.TEXT().toUser(openid).content(content).build();
boolean result = wxMpService.getKefuService().sendKefuMessage(message);
log.info("銆怶xMpUtils銆戞枃鏈鏈嶆秷鎭彂閫亄}锛宱penid锛歿}", result ? "鎴愬姛" : "澶辫触", openid);
return result;
@@ -83,8 +81,7 @@
* 绀轰緥锛歿"first": new WxMpTemplateData("first", "浣犲ソ", "#173177"), ...}
* @return 鍙戦�佹垚鍔熻繑鍥炲井淇¤繑鍥炵殑 msgid锛屽け璐ヨ繑鍥� null
*/
- public String sendTemplateMessage(String openid, String templateId, String url,
- Map<String, WxMpTemplateData> dataMap) {
+ public String sendTemplateMessage(String openid, String templateId, String url, Map<String, WxMpTemplateData> dataMap) {
if (StringUtils.isEmpty(openid)) {
log.warn("銆怶xMpUtils銆憇endTemplateMessage 澶辫触锛歰penid 涓虹┖");
return null;
@@ -109,8 +106,7 @@
log.info("銆怶xMpUtils銆戞ā鏉挎秷鎭彂閫佹垚鍔燂紝openid锛歿}锛宮sgId锛歿}", openid, msgId);
return msgId;
} catch (WxErrorException e) {
- log.error("銆怶xMpUtils銆戞ā鏉挎秷鎭彂閫佸紓甯革紝openid锛歿}锛宼emplateId锛歿}锛岄敊璇細{}",
- openid, templateId, e.getError(), e);
+ log.error("銆怶xMpUtils銆戞ā鏉挎秷鎭彂閫佸紓甯革紝openid锛歿}锛宼emplateId锛歿}锛岄敊璇細{}", openid, templateId, e.getError(), e);
return null;
}
}
@@ -125,8 +121,7 @@
* 绀轰緥锛歿"first": "浣犲ソ", "keyword1": "2024-01-01", "remark": "鎰熻阿浣跨敤"}
* @return 鍙戦�佹垚鍔熻繑鍥炲井淇¤繑鍥炵殑 msgid锛屽け璐ヨ繑鍥� null
*/
- public String sendTemplateMessage(String openid, String templateId, String url,
- Map<String, String> dataMap, String defaultColor) {
+ public String sendTemplateMessage(String openid, String templateId, String url, Map<String, String> dataMap, String defaultColor) {
if (StringUtils.isEmpty(openid)) {
log.warn("銆怶xMpUtils銆憇endTemplateMessage 澶辫触锛歰penid 涓虹┖");
return null;
@@ -152,8 +147,7 @@
log.info("銆怶xMpUtils銆戞ā鏉挎秷鎭彂閫佹垚鍔燂紝openid锛歿}锛宮sgId锛歿}", openid, msgId);
return msgId;
} catch (WxErrorException e) {
- log.error("銆怶xMpUtils銆戞ā鏉挎秷鎭彂閫佸紓甯革紝openid锛歿}锛宼emplateId锛歿}锛岄敊璇細{}",
- openid, templateId, e.getError(), e);
+ log.error("銆怶xMpUtils銆戞ā鏉挎秷鎭彂閫佸紓甯革紝openid锛歿}锛宼emplateId锛歿}锛岄敊璇細{}", openid, templateId, e.getError(), e);
return null;
}
}
--
Gitblit v1.9.3