xiaoyong931011
2021-11-19 c50f2002f8e47fae55b628caa244904018477cb7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.xzx.gc.shop.job;
 
import com.xzx.gc.shop.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
 
import javax.annotation.Resource;
 
@EnableAsync
@Slf4j
@Component
public class ShopJob {
 
    @Resource
    private OrderService orderService;
    /**
     时间是每天变动一次
     自动确认收货
     */
    @Scheduled(cron = "0 0 0 * * ? ")
    public void autoConfirmReceipt() {
        log.info("自动确认收货执行");
        orderService.autoConfirmReceipt();
    }
 
    public static void main(String[] args) {
 
    }
}