package cn.pluss.platform.job;

import cn.pluss.platform.platformData.PlatformDataService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Scheduled;

import javax.annotation.Resource;

/**
 *
 *@description:统计首页昨日交易数据
 *@author: bzg
 *@time: 2021/10/20 15:16
 */
@Configuration
@ConditionalOnProperty(prefix = "scheduling", name = "enabled", havingValue = "true")
public class CensusPlatformDataJob {

    private Logger log = LoggerFactory.getLogger(this.getClass());

    @Resource
    private PlatformDataService platformDataService;


    //每天凌晨执行统计昨日交易数据
    @Scheduled(cron = "0 02 0 1/1 * ? ")
    public void task() {
        log.info("统计首页数据定时任务开始~~~");
        platformDataService.censusPlatformData();
        log.info("统计首页数据执行成功，定时任务结束！");
    }
}
