于紫祥_1901
2020-12-15 88e4de4eabe790e97394fd020d96d045991d157e
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
package com.moral.task;
 
import java.time.LocalDateTime;
 
import javax.annotation.Resource;
 
import com.moral.service.HistoryMinutelyService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
 
import org.springframework.stereotype.Component;
 
@Component
public class HistoryMinutelySubTableTask {
    @Resource
    private HistoryMinutelyService historyMinutelyService;
    @XxlJob("createHistoryMinutelyTb")
    public ReturnT createHistoryMinutelyTb(String param){
        LocalDateTime time=LocalDateTime.now();
        LocalDateTime time1 = time.plusMonths(1);
        String year = String.valueOf(time1.getYear());
        String month = String.valueOf(time1.getMonthValue());
        if (month.length()<2){
            month="0"+month;
        }
        String yearAndMonth=year+month;
        historyMinutelyService.createHistoryMinutelyTable(yearAndMonth);
        ReturnT returnT = new ReturnT(500, "创表失败!");
        return returnT;
    }
}