瀏覽代碼

会员管理代码

wwh 1 周之前
父節點
當前提交
4d372b7f5e

+ 1 - 0
baqing-shop/src/main/java/com/ruoyi/web/modules/order/job/OrderAutoConfirmReceiveJob.java

@@ -32,6 +32,7 @@ public class OrderAutoConfirmReceiveJob
32 32
 
33 33
     public void autoConfirmReceive()
34 34
     {
35
+        log.info("--------------------OrderAutoConfirmReceiveJob.autoConfirmReceive() enter--------------------------");
35 36
         int days = mallConfigFacade.getAutoConfirmDays();
36 37
         List<BizOrder> orders = orderMapper.selectShippedForAutoConfirm(days, BATCH_SIZE);
37 38
         if (orders == null || orders.isEmpty())

+ 1 - 1
doc/平台后台/商城设置/商城设置技术方案.md

@@ -306,7 +306,7 @@ memberFacade.refreshConsumption(memberId)
306 306
 
307 307
 **Bean:** `@Component("orderAutoConfirmReceiveJob")`  
308 308
 **方法:** `autoConfirmReceive()`  
309
-**Quartz:** 建议 cron `0 0 1 * * ?`(每日 1:00)或 `0 0/30 * * * ?`(每 30 分钟
309
+**Quartz:** cron `0 0 1 * * ?`(每日 1:00);初始化 SQL 见 **`sql/sys_job_order_auto_confirm_receive.sql`**(幂等,status=0 启用
310 310
 
311 311
 **扫描 SQL(自然日 · 发货日起算):**
312 312
 

+ 34 - 0
sql/sys_job_order_auto_confirm_receive.sql

@@ -0,0 +1,34 @@
1
+-- =============================================================================
2
+-- 定时任务:已发货超时自动确认收货
3
+-- 调用:orderAutoConfirmReceiveJob.autoConfirmReceive
4
+-- 天数:每次执行读取 biz_mall_config.auto_confirm_days(默认 7 自然日)
5
+-- 前置:已执行 sql/biz_mall_config.sql;应用已部署 OrderAutoConfirmReceiveJob
6
+-- 说明:幂等插入;status=0 启用;部署后重启应用或于「定时任务」点执行一次生效
7
+-- =============================================================================
8
+
9
+INSERT INTO sys_job (
10
+    job_name,
11
+    job_group,
12
+    invoke_target,
13
+    cron_expression,
14
+    misfire_policy,
15
+    concurrent,
16
+    status,
17
+    create_by,
18
+    create_time,
19
+    remark
20
+)
21
+SELECT
22
+    '订单自动确认收货',
23
+    'DEFAULT',
24
+    'orderAutoConfirmReceiveJob.autoConfirmReceive',
25
+    '0 0 1 * * ?',
26
+    '3',
27
+    '1',
28
+    '0',
29
+    'admin',
30
+    sysdate(),
31
+    '已发货订单按商城设置 auto_confirm_days 自然日自动确认收货;与买家手动确认等价'
32
+WHERE NOT EXISTS (
33
+    SELECT 1 FROM sys_job WHERE invoke_target = 'orderAutoConfirmReceiveJob.autoConfirmReceive'
34
+);