双重预防项目-国泰新华二开定制版
heheng
2025-06-06 2b9d73629912d3982af1d96da8f9d50b7863cd58
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package com.ruoyi.doublePrevention.scheduls;
 
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.doublePrevention.repository.PreventCJReportCheckRecordFromTaskRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
 
import java.time.DayOfWeek;
import java.time.LocalDate;
 
@Component
@Slf4j
public class RePushDataSchedule {
 
 
 
    @Autowired
    private PreventCJReportCheckRecordFromTaskRepository preventCJReportCheckRecordFromTaskRepository;
 
    @Transactional
    @Scheduled(cron = "0 0 12 * * 4 ")
    public void repushDataV1(){
        log.info("周四【双重预防】重新推送数据..."+ DateUtils.dateTimeNow());
        // 获取当前日期
        LocalDate currentDate = LocalDate.now();
 
        // 计算当前周的周一日期
        LocalDate mondayDate = currentDate.with(DayOfWeek.MONDAY);
        log.info("当前周的周一日期:" + mondayDate);
        String startTime = mondayDate + " 00:00:00";
        String endTime = DateUtils.getDate() + " 12:00:00";
 
        int i = preventCJReportCheckRecordFromTaskRepository.updateTaskReportStatusForRePushV1(startTime, endTime);
 
        log.info("执行更新了:"+i+"条数据,结束周四【双重预防】重新推送数据..."+ DateUtils.dateTimeNow());
    }
 
 
//update prevent_cj_report_check_record_from_task set  id=concat(substring(id,1,length(id)-4),'ccab'),report_status=1 where check_time>="2024-11-04 00:00:00" ;
    @Transactional
    @Scheduled(cron = "0 0 16 * * 0 ")
    public void repushDataV2(){
        log.info("周日【双重预防】重新推送数据..."+ DateUtils.dateTimeNow());
        // 获取当前日期
        LocalDate currentDate = LocalDate.now();
 
        // 计算当前周的周一日期
        LocalDate mondayDate = currentDate.with(DayOfWeek.THURSDAY);
        log.info("当前周的周四日期:" + mondayDate);
        String startTime = mondayDate + " 12:00:00";
        String endTime = DateUtils.getDate() + " 16:00:00";
 
        int i = preventCJReportCheckRecordFromTaskRepository.updateTaskReportStatusForRePushV2(startTime, endTime);
        log.info("执行更新了:"+i+"条数据,结束周四【双重预防】重新推送数据..."+ DateUtils.dateTimeNow());
    }
 
}