From 7dce415c0bc618c5473bcc1486da5af5f5b13e69 Mon Sep 17 00:00:00 2001 From: Leo Date: Wed, 4 Feb 2026 23:24:08 +0800 Subject: [PATCH] 1 --- .../TencentDocDelayedPushServiceImpl.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/ruoyi-system/src/main/java/com/ruoyi/jarvis/service/impl/TencentDocDelayedPushServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/jarvis/service/impl/TencentDocDelayedPushServiceImpl.java index bfa752b..dfee3f2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/jarvis/service/impl/TencentDocDelayedPushServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/jarvis/service/impl/TencentDocDelayedPushServiceImpl.java @@ -321,6 +321,34 @@ public class TencentDocDelayedPushServiceImpl implements ITencentDocDelayedPushS log.info("✓ 批量同步执行完成,结果: {}", result); + // 将接口返回的 nextStartRow 写回 Redis,下次定时执行从新起始行开始(否则会一直从配置的 99 开始) + if (result instanceof java.util.Map) { + @SuppressWarnings("unchecked") + java.util.Map resultMap = (java.util.Map) result; + Object data = resultMap.get("data"); + if (data instanceof java.util.Map) { + @SuppressWarnings("unchecked") + java.util.Map dataMap = (java.util.Map) data; + Object nextStartRowObj = dataMap.get("nextStartRow"); + if (nextStartRowObj != null) { + int nextStartRow; + if (nextStartRowObj instanceof Number) { + nextStartRow = ((Number) nextStartRowObj).intValue(); + } else { + try { + nextStartRow = Integer.parseInt(nextStartRowObj.toString()); + } catch (NumberFormatException e) { + nextStartRow = -1; + } + } + if (nextStartRow >= 1) { + redisCache.setCacheObject(CONFIG_KEY_PREFIX + "startRow", nextStartRow, 180, TimeUnit.DAYS); + log.info("✓ 已更新下次起始行到 Redis: startRow={}(下次定时同步从第 {} 行开始)", nextStartRow, nextStartRow); + } + } + } + } + } catch (Exception ex) { log.error("批量同步调用失败", ex); if (batchId != null) {