wlzboy
5 天以前 fe33646ee6e2d1e57f2b51812e94983a0e9efb04
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/NotifySendLogServiceImpl.java
@@ -49,6 +49,14 @@
    }
    /**
     * 根据任务ID和用户ID查询发送记录
     */
    @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("更新通知发送状态为成功,id={}", 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("更新通知发送状态为失败,id={}, 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);
    }