diff --git a/bms-back/bms-system/src/main/java/com/bms/price/task/TabOrderExportAsyncRunner.java b/bms-back/bms-system/src/main/java/com/bms/price/task/TabOrderExportAsyncRunner.java index 0c6e193f..8ee8e0bc 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/task/TabOrderExportAsyncRunner.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/task/TabOrderExportAsyncRunner.java @@ -37,7 +37,8 @@ public class TabOrderExportAsyncRunner public static final String CACHE_KEY_PREFIX = "monitor:orderSource:export:task:"; public static final int TTL_MINUTES = 60; public static final String REL_DIR = "orderSourceExport"; - public static final int PAGE_SIZE = 500; + /** Must stay <= TabOrderMonitorService.normalizePage max (200). */ + public static final int PAGE_SIZE = 200; /** 单次导出行数上限(防 OOM) */ public static final int EXPORT_MAX = 20000; @@ -103,7 +104,9 @@ public class TabOrderExportAsyncRunner int pct = Math.min(70, 5 + (int) ((all.size() * 65L) / Math.max(total, 1L))); put(taskId, TabOrderExportTask.STATUS_RUNNING, pct, "querying " + all.size() + "/" + total, null, fileName, null, all.size()); - if (all.size() >= total || rows.size() < PAGE_SIZE || all.size() >= EXPORT_MAX) + // Do not compare rows.size() to PAGE_SIZE: searchPage caps pageSize at 200. + // Stop only when all matched rows are collected or hard limit hit. + if (all.size() >= total || all.size() >= EXPORT_MAX) { break; }