| | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.zy.asrs.entity.Order; |
| | | import com.zy.asrs.service.ApiLogService; |
| | | import com.zy.asrs.service.OrderService; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.asrs.task.handler.OrderSyncHandler; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * Created by vincent on 2020/7/7 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | //@Component |
| | | public class OrderSyncScheduler { |
| | | |
| | | @Autowired |
| | | private OrderSyncHandler orderSyncHandler; |
| | | @Autowired |
| | | private OrderService orderService; |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | |
| | | @Scheduled(cron = "0 0 1 * * ? ") |
| | | public void clearApiLog(){ |
| | | try { |
| | | apiLogService.clearWeekBefore(); |
| | | } catch (Exception e) { |
| | | log.error("第三方接口日志自动清除失败(范围:一周之前", e); |
| | | } |
| | | } |
| | | |
| | | @Scheduled(cron = "0/5 * * * * ? ") |
| | | @Async("orderThreadPool") |