Browse Source

定时任务

傅行帆 5 years ago
parent
commit
aefc76a002

+ 2
- 1
src/main/java/com/huiju/estateagents/job/JudglActivityTimeJob.java View File

9
 import org.springframework.beans.factory.annotation.Autowired;
9
 import org.springframework.beans.factory.annotation.Autowired;
10
 import org.springframework.context.annotation.Configuration;
10
 import org.springframework.context.annotation.Configuration;
11
 import org.springframework.scheduling.annotation.EnableScheduling;
11
 import org.springframework.scheduling.annotation.EnableScheduling;
12
+import org.springframework.scheduling.annotation.Scheduled;
12
 import org.springframework.stereotype.Component;
13
 import org.springframework.stereotype.Component;
13
 
14
 
14
 import java.time.LocalDateTime;
15
 import java.time.LocalDateTime;
53
     /**
54
     /**
54
      * 开启定时任务,每天12:30执行
55
      * 开启定时任务,每天12:30执行
55
      */
56
      */
56
-//    @Scheduled(cron = "* 0/5 * * * ?")
57
+    @Scheduled(cron = "* 0/5 * * * ?")
57
     private void configureTasks() {
58
     private void configureTasks() {
58
         String time = DateUtils.cutSecond(LocalDateTime.now());
59
         String time = DateUtils.cutSecond(LocalDateTime.now());
59
 
60
 

+ 2
- 1
src/main/java/com/huiju/estateagents/job/OrgOrderTimeJob.java View File

11
 import org.springframework.beans.factory.annotation.Autowired;
11
 import org.springframework.beans.factory.annotation.Autowired;
12
 import org.springframework.context.annotation.Configuration;
12
 import org.springframework.context.annotation.Configuration;
13
 import org.springframework.scheduling.annotation.EnableScheduling;
13
 import org.springframework.scheduling.annotation.EnableScheduling;
14
+import org.springframework.scheduling.annotation.Scheduled;
14
 import org.springframework.stereotype.Component;
15
 import org.springframework.stereotype.Component;
15
 
16
 
16
 import java.time.LocalDateTime;
17
 import java.time.LocalDateTime;
31
     /**
32
     /**
32
      * 处理过期订单
33
      * 处理过期订单
33
      */
34
      */
34
-//    @Scheduled(cron = "0 0/5 * * * ?")
35
+    @Scheduled(cron = "0 0/5 * * * ?")
35
     private void dealExpireOrder() {
36
     private void dealExpireOrder() {
36
         logger.info("处理过期订单 定时任务开始");
37
         logger.info("处理过期订单 定时任务开始");
37
 
38