From 9fef5e91afa0073f95dd203159b5eccf68555536 Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Tue, 19 Aug 2025 11:20:12 +0800
Subject: [PATCH] refactor(mall): 修改 WxxcxJob 类的条件加载配置- 将 @ConditionalOnProperty 注解的 havingValue 属性从 "true" 改为 "false"- 此修改改变了 WxxcxJob 类的加载条件,根据配置项 system.job 的值来决定是否加载该类

---
 src/main/java/cc/mrbird/febs/mall/quartz/WxxcxJob.java |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/src/main/java/cc/mrbird/febs/mall/quartz/WxxcxJob.java b/src/main/java/cc/mrbird/febs/mall/quartz/WxxcxJob.java
index 0522c4b..10dffe2 100644
--- a/src/main/java/cc/mrbird/febs/mall/quartz/WxxcxJob.java
+++ b/src/main/java/cc/mrbird/febs/mall/quartz/WxxcxJob.java
@@ -6,6 +6,7 @@
 import cc.mrbird.febs.common.utils.SpringContextHolder;
 import cc.mrbird.febs.mall.entity.MallMemberCoupon;
 import cc.mrbird.febs.mall.mapper.MallMemberCouponMapper;
+import cc.mrbird.febs.mall.service.MallInvoiceService;
 import cc.mrbird.febs.pay.util.WechatConfigure;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
@@ -28,7 +29,7 @@
 
 @Slf4j
 @Component
-@ConditionalOnProperty(prefix = "system", name = "job", havingValue = "true")
+@ConditionalOnProperty(prefix = "system", name = "job", havingValue = "false")
 public class WxxcxJob {
 
     private final XcxProperties xcxProperties = SpringContextHolder.getBean(XcxProperties.class);
@@ -37,6 +38,8 @@
     private RedisUtils redisUtils;
     @Autowired
     private MallMemberCouponMapper mallMemberCouponMapper;
+    @Autowired
+    private MallInvoiceService mallInvoiceService;
     @Resource
     RestTemplate restTemplate;
 //    @Autowired
@@ -47,6 +50,7 @@
      */
     @Scheduled(cron = "0 0 0/1 * * ? ")
     public void getAccessToken() throws IOException {
+        log.info("执行access_token刷新");
         String appId = xcxProperties.getXcxAppid();
         String appSecret = xcxProperties.getXcxSecret();
         String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + appId + "&secret=" + appSecret;
@@ -86,4 +90,14 @@
 
     }
 
+    /**
+     * 更新发票记录表数据
+     * 定时,每天凌晨一点
+     * 已完成的订单,更新到发票记录中
+     */
+    @Scheduled(cron = "0 0 1 * * ?")
+    public void mallInvoiceJob() {
+        mallInvoiceService.mallInvoiceJob();
+    }
+
 }

--
Gitblit v1.9.1