| | |
| | | import com.iailab.module.data.arc.service.ArcDataService; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Calendar; |
| | | |
| | | /** |
| | | * @description: Point归档月 |
| | | * @author: dyk |
| | | * @date: 2025/2/20 16:30 |
| | | **/ |
| | | @Component("pointArchivingTaskNetMonth") |
| | | public class PointArchivingTaskNetMonth implements ITask { |
| | | private Logger logger = LoggerFactory.getLogger(getClass()); |
| | | |
| | | private final String NET = "1h"; |
| | | |
| | | @Resource |
| | | private ArcDataService arcPointDataService; |
| | |
| | | public void run(String params){ |
| | | logger.debug("PointArchivingTaskNetMonth定时任务正在执行,参数为:{}", params); |
| | | try { |
| | | arcPointDataService.archiving(ArcTypeEnum.MONTH.getCode()); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | | calendar.set(Calendar.SECOND, 0); |
| | | arcPointDataService.archiving(ArcTypeEnum.MONTH.getCode(), calendar); |
| | | logger.info("PointArchivingTaskNetMonth定时任务完成时间:" + LocalDateTime.now()); |
| | | } catch (Exception ex) { |
| | | ex.printStackTrace(); |