package com.reptileclient.jlifeapp.schedule;

import com.reptileclient.jlifeapp.service.HmSalesOrderService;
import com.reptileclient.jlifeapp.util.DateUtils;
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.Date;

/**
 *  抓盒马  销售单 数据
 * @author lu
 *
 */
@Async
@Component
public class TaskHmTableData {

	@Autowired
	HmSalesOrderService hmSalesOrderService;
	 

	@Scheduled(cron = "0 0 7 * * ?") // 每天7点执行一次
	public void runTask() {
		
		
		System.out.println("开始  银联商交易及销售数据抓取.........................");
		try {
			hmSalesOrderService.fetchingData(DateUtils.getFrontDay(new Date()), DateUtils.getFrontDay(new Date()));
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		

	}

	 
	 

}
