package com.jjt.task;

import com.jjt.biz.service.IApiAllService;
import com.jjt.biz.service.IApiService;
import com.jjt.biz.service.IApiYrService;
import com.jjt.calc.service.ITwinCalcHourYhjService;
import com.jjt.rz.service.ITwinCalcHourRzService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 首页定时任务
 *
 * @author wukai
 * @date 2025-1-17 23:27:26
 */
@Component("index")
public class IndexTask {
    @Resource
    private IApiService apiService;
    @Resource
    private ITwinCalcHourYhjService yhjService;
    @Resource
    private IApiAllService apiAllService;
    @Resource
    private IApiYrService apiYrService;

    /**
     * 统计当前数据
     */
    public void curr() {
        apiService.curr();
    }

    /**
     * 统计当天数据
     */

    public void today() {
        try {
            yhjService.today();
        } catch (Exception e) {
            e.printStackTrace();
        }
        try {
            apiYrService.mock();
        } catch (Exception e) {
            e.printStackTrace();
        }
        try {
            apiAllService.mock();
        } catch (Exception e) {
            e.printStackTrace();
        }
        apiService.today();
    }

}
