Browse Source

定时任务修改

skyline 1 year ago
parent
commit
41c7178e35

+ 2 - 3
car-wash-admin/src/main/java/com/kym/admin/jobs/MpUserRelationJob.java

@@ -4,6 +4,7 @@ import com.kym.service.MpRelationService;
 import jakarta.annotation.PostConstruct;
 import lombok.extern.slf4j.Slf4j;
 import me.chanjar.weixin.common.error.WxErrorException;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
 /**
@@ -22,9 +23,7 @@ public class MpUserRelationJob {
     }
 
     // 每天凌晨1点执行一次
-//    @Scheduled(cron = "0 0 1 * * ?")
-
-    @PostConstruct
+    @Scheduled(cron = "0 0 1 * * ?")
     public void executeMpUserRelationJob() throws WxErrorException {
         log.info("公众号用户关联处理启动...");
         mpRelationService.batchBindMpUser();