package com.jjt.task;

import com.jjt.inventory.service.IInventoryService;
import com.jjt.inventory.service.ITwinCalcHourBpOutService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.time.LocalDate;

/**
 * 统计定时任务
 *
 * @author wukai
 * @date 2025-1-17 23:27:26
 */
@Component("ck")
public class InventoryTask {
    @Resource
    private IInventoryService inventoryService;
    @Resource
    private ITwinCalcHourBpOutService bpOutService;

    /**
     * 统计上一时段数据
     */
    public void last() {
        inventoryService.hour();
        bpOutService.hour();
    }

    /**
     * 统计昨日数据
     */

    public void day() {
        LocalDate localDate = LocalDate.now().minusDays(1);
        inventoryService.day(localDate);
    }

}
