package com.jiayue.insu.inclientqn.job;

import cn.hutool.core.date.DateUtil;
import com.jiayue.insu.inclientqn.service.client.RequestDataService;
import com.jiayue.insu.inclientqn.util.DateTimeUtils;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @description: 回传统计数据定时任务
 * @author: yuanhao
 * @createDate: 2022/6/17
 * @version: 1.0
 */
public class BackStatDataJob implements Job {
    @Autowired
    private RequestDataService requestDataService;

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        // 获取当前时间所在15分钟节点 例如 10:18=》10:15 、 11:29=>11:15
        long time = DateTimeUtils.get15min(DateUtil.date().getTime());
        requestDataService.requestBackStat(time);
    }
}
