package com.mosty.sjzx.task;

import com.mosty.common.base.util.DateUtils;
import com.mosty.sjzx.mapper.TbSjMapper;
import com.mosty.sjzx.service.TbSjService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

/**
 * 每天凌晨0点计算所有的警情、预警、
 * 盘查数据，获取经纬度信息
 *
 * @author dw
 * @since 2022/8/6
 **/
@Slf4j
@Component
@AllArgsConstructor
public class BxdCreateTask {

    private final TbSjService tbSjService;

    @Scheduled(cron = "0 0 0 * * ?")
    @Transactional
    public void run() {
        this.tbSjService.bxdCreate();
    }
}
