燕山石化溯源三维电子沙盘-【后端】-服务
1
13693261870
2023-09-07 6c9fa99a97bd493576d4f2a50c8dea1643bf9c43
1
已修改2个文件
36 ■■■■■ 文件已修改
src/main/java/com/yssh/config/InitConfig.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/config/ScheduleConfig.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/config/InitConfig.java
@@ -55,6 +55,7 @@
    }
    private void test() {
        //config.createMonthReport();
        //config.corpReserveDataSync();
        //task.corpReserveDataSync();
src/main/java/com/yssh/config/ScheduleConfig.java
@@ -188,7 +188,16 @@
     */
    @Scheduled(cron = "0 1 0 * * ?")
    public void createDayReport() {
        xlsReportService.createDayReport(new Date());
        Calendar calendar = getCalendar(1);
        for (int i = 0; i < 31; i++) {
            try {
                calendar.add(Calendar.DATE, -1);
                xlsReportService.createDayReport(calendar.getTime());
                // System.out.println(DateUtils.getYyyyMmDd(calendar.getTime()));
            } catch (Exception ex) {
                logger.error(ex.getMessage(), ex);
            }
        }
    }
    /**
@@ -196,7 +205,16 @@
     */
    @Scheduled(cron = "0 5 0 ? * MON")
    public void createWeekReport() {
        xlsReportService.createWeekReport(new Date());
        Calendar calendar = getCalendar(7 * 24);
        for (int i = 1; i < 8; i++) {
            try {
                calendar.add(Calendar.DATE, -7);
                xlsReportService.createWeekReport(calendar.getTime());
                // System.out.println(DateUtils.getYyyyMmDd(calendar.getTime()));
            } catch (Exception ex) {
                logger.error(ex.getMessage(), ex);
            }
        }
    }
    /**
@@ -204,6 +222,17 @@
     */
    @Scheduled(cron = "0 9 0 1 * ?")
    public void createMonthReport() {
        xlsReportService.createMonthReport(new Date());
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(new Date());
        calendar.add(Calendar.MONTH, 1);
        for (int i = 0; i < 6; i++) {
            try {
                calendar.add(Calendar.MONTH, -1);
                xlsReportService.createMonthReport(calendar.getTime());
                // System.out.println(DateUtils.getYyyyMmDd(calendar.getTime()));
            } catch (Exception ex) {
                logger.error(ex.getMessage(), ex);
            }
        }
    }
}