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) { } }