From 09e6dc3fb7266620fafb5e341808a8eb36e080a1 Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期六, 13 十二月 2025 22:51:52 +0800
Subject: [PATCH] feat:增加企业微信消息提醒

---
 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/NotifySendLogServiceImpl.java |   44 +++++++++++++++++++++++++++++++++++++-------
 1 files changed, 37 insertions(+), 7 deletions(-)

diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/NotifySendLogServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/NotifySendLogServiceImpl.java
index f671855..3d37ef3 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/NotifySendLogServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/NotifySendLogServiceImpl.java
@@ -49,6 +49,14 @@
     }
 
     /**
+     * 鏍规嵁浠诲姟ID鍜岀敤鎴稩D鏌ヨ鍙戦�佽褰�
+     */
+    @Override
+    public NotifySendLog selectNotifySendLog(Long taskId, Long userId, String notifyType, String channel) {
+        return notifySendLogMapper.selectNotifySendLog(taskId, userId, notifyType, channel);
+    }
+
+    /**
      * 妫�鏌ユ槸鍚﹀凡鍙戦�佽繃閫氱煡锛堥槻閲嶆鏌ワ級
      * 
      * @param taskId 浠诲姟ID
@@ -114,18 +122,29 @@
     }
 
     /**
-     * 鏇存柊鍙戦�佺姸鎬佷负鎴愬姛
+     * 鏇存柊鍙戦�佺姸鎬佷负鎴愬姛锛堝悜鍚庡吋瀹癸級
      * 
      * @param id 璁板綍ID
      * @param result 鍙戦�佺粨鏋滀俊鎭�
      */
-    @Override
     public void markSendSuccess(Long id, String result) {
+        markSendSuccess(id, result, null);
+    }
+
+    /**
+     * 鏇存柊鍙戦�佺姸鎬佷负鎴愬姛
+     * 
+     * @param id 璁板綍ID
+     * @param result 鍙戦�佺粨鏋滀俊鎭�
+     * @param content 鍙戦�佸唴瀹�
+     */
+    @Override
+    public void markSendSuccess(Long id, String result, String content) {
         if (id == null) {
             return;
         }
         try {
-            notifySendLogMapper.updateSendStatus(id, NotifySendLog.SEND_STATUS_SUCCESS, result);
+            notifySendLogMapper.updateSendStatus(id, NotifySendLog.SEND_STATUS_SUCCESS, result, content);
             log.debug("鏇存柊閫氱煡鍙戦�佺姸鎬佷负鎴愬姛锛宨d={}", id);
         } catch (Exception e) {
             log.error("鏇存柊閫氱煡鍙戦�佺姸鎬佸け璐ワ紝id={}", id, e);
@@ -133,13 +152,24 @@
     }
 
     /**
-     * 鏇存柊鍙戦�佺姸鎬佷负澶辫触
+     * 鏇存柊鍙戦�佺姸鎬佷负澶辫触锛堝悜鍚庡吋瀹癸級
      * 
      * @param id 璁板綍ID
      * @param errorMsg 閿欒淇℃伅
      */
-    @Override
     public void markSendFailed(Long id, String errorMsg) {
+        markSendFailed(id, errorMsg, null);
+    }
+
+    /**
+     * 鏇存柊鍙戦�佺姸鎬佷负澶辫触
+     * 
+     * @param id 璁板綍ID
+     * @param errorMsg 閿欒淇℃伅
+     * @param content 鍙戦�佸唴瀹�
+     */
+    @Override
+    public void markSendFailed(Long id, String errorMsg, String content) {
         if (id == null) {
             return;
         }
@@ -148,7 +178,7 @@
             if (errorMsg != null && errorMsg.length() > 500) {
                 errorMsg = errorMsg.substring(0, 500);
             }
-            notifySendLogMapper.updateSendStatus(id, NotifySendLog.SEND_STATUS_FAILED, errorMsg);
+            notifySendLogMapper.updateSendStatus(id, NotifySendLog.SEND_STATUS_FAILED, errorMsg, content);
             log.debug("鏇存柊閫氱煡鍙戦�佺姸鎬佷负澶辫触锛宨d={}, error={}", id, errorMsg);
         } catch (Exception e) {
             log.error("鏇存柊閫氱煡鍙戦�佺姸鎬佸け璐ワ紝id={}", id, e);
@@ -207,7 +237,7 @@
      * @param maxRetryCount 鏈�澶ч噸璇曟鏁�
      * @return 澶辫触璁板綍鍒楄〃
      */
-    @Override
+
     public List<NotifySendLog> selectFailedNotifySendLogs(Integer maxRetryCount) {
         return notifySendLogMapper.selectFailedNotifySendLogs(maxRetryCount);
     }

--
Gitblit v1.9.1