From a211f066630d2d05d8d41b4644bbbf4c7c9d4628 Mon Sep 17 00:00:00 2001 From: wuweihua <88888888> Date: Wed, 11 Nov 2026 09:29:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=9A=E6=97=B6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bms-admin/src/main/resources/application.yml | 8 ++++---- .../com/bms/price/config/BillingProperties.java | 10 +++++----- .../price/task/PrcBillingTaskNightRetryTask.java | 14 +++++++------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/bms-back/bms-admin/src/main/resources/application.yml b/bms-back/bms-admin/src/main/resources/application.yml index 29427a10..b04a644e 100644 --- a/bms-back/bms-admin/src/main/resources/application.yml +++ b/bms-back/bms-admin/src/main/resources/application.yml @@ -42,14 +42,14 @@ bms: order-source-sync-threads: 16 # Order-list local rebill workers (2~24). Pair with Druid maxActive >= threads + 8. local-rebill-threads: 16 - # Night auto-rebill: hours 0-8, pull 500 (all statuses) -> bill -> next 500 until empty / 09:00. - # Empty page => no billing. + # Auto-rebill: every hour all day, pull 500 (all statuses) -> bill -> next 500 until empty. + # Empty page => no billing. Window [start-hour, end-hour). night-retry: enabled: true start-hour: 0 - end-hour: 9 + end-hour: 24 batch-size: 500 - cron: "0 0/1 0-8 * * ?" + cron: "0 0 * * * ?" oracle: # SLAVE datasource Oracle main-order table (schema.table allowed) order-table: WEISHI_USER.TAB_ORDER diff --git a/bms-back/bms-system/src/main/java/com/bms/price/config/BillingProperties.java b/bms-back/bms-system/src/main/java/com/bms/price/config/BillingProperties.java index 7dd9c9c0..9fb43987 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/config/BillingProperties.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/config/BillingProperties.java @@ -25,7 +25,7 @@ public class BillingProperties * Keep below Druid maxActive with headroom for other traffic. */ private int localRebillThreads = 16; - /** Night window auto-retry of prc_billing_task (all statuses) */ + /** Hourly auto-retry of prc_billing_task (all statuses) */ private NightRetry nightRetry = new NightRetry(); private Oracle oracle = new Oracle(); @@ -120,8 +120,8 @@ public class BillingProperties } /** - * Overnight rebill window: pull prc_billing_task (all success_status) and retryTask. - * Default hours [0, 9) local time; empty result skips billing. + * Auto rebill window: pull prc_billing_task (all success_status) and retryTask. + * Default hours [0, 24) local time (all day); empty result skips billing. */ public static class NightRetry { @@ -129,8 +129,8 @@ public class BillingProperties private boolean enabled = true; /** Inclusive start hour (0 = 00:00) */ private int startHour = 0; - /** Exclusive end hour (9 = stop at 09:00) */ - private int endHour = 9; + /** Exclusive end hour (24 = all day) */ + private int endHour = 24; /** Page size: bill this many then pull next page (default 500) */ private int batchSize = 500; diff --git a/bms-back/bms-system/src/main/java/com/bms/price/task/PrcBillingTaskNightRetryTask.java b/bms-back/bms-system/src/main/java/com/bms/price/task/PrcBillingTaskNightRetryTask.java index 41affb3d..340913bd 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/task/PrcBillingTaskNightRetryTask.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/task/PrcBillingTaskNightRetryTask.java @@ -16,13 +16,13 @@ import com.bms.price.mapper.PrcBillingTaskMapper; import com.bms.price.service.IPrcBillingTaskService; /** - * 夜间窗口按 prc_billing_task 自动重计费。 + * Auto retry prc_billing_task on a schedule. * - *

在 [startHour, endHour) 内(默认 00:00-09:00):最多拉取 {@value #DEFAULT_BATCH} - * 条任务 id(不限 success_status)-> 全部计费 -> 立刻拉下一页。 - * 空页则跳过计费并结束本轮(下次 cron 再处理新数据)。

+ *

Within [startHour, endHour) (default all day 00:00-24:00): pull up to {@value #DEFAULT_BATCH} + * task ids (any success_status) -> bill all -> pull next page. + * Empty page skips billing and ends this tick (next cron handles new rows).

* - *

与监控手工重试 / 条件重试同一条重计费路径(先重置为 WAITING 再处理)。

+ *

Same path as monitor manual / filter retry (reset to WAITING then process).

*/ @Component public class PrcBillingTaskNightRetryTask @@ -52,10 +52,10 @@ public class PrcBillingTaskNightRetryTask private IPrcBillingTaskService billingTaskService; /** - * Fire every minute; if a previous run is still paging batches, skip. + * Fire every hour by default; if a previous run is still paging batches, skip. * Hour gate uses bms.billing.night-retry start/end. */ - @Scheduled(cron = "${bms.billing.night-retry.cron:0 0/1 0-8 * * ?}") + @Scheduled(cron = "${bms.billing.night-retry.cron:0 0 * * * ?}") public void scheduledTick() { BillingProperties.NightRetry cfg = billingProperties == null ? null : billingProperties.getNightRetry();