package com.moral.task;
|
|
import com.moral.service.HistoryMinutelyService;
|
import com.xxl.job.core.biz.model.ReturnT;
|
import org.springframework.format.datetime.joda.LocalDateTimeParser;
|
import org.springframework.stereotype.Component;
|
|
import javax.annotation.Resource;
|
import java.time.LocalDateTime;
|
|
@Component
|
public class HistoryMinutelySubTableTask {
|
@Resource
|
private HistoryMinutelyService historyMinutelyService;
|
public ReturnT createHistoryMinutelyTb(){
|
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();
|
return returnT;
|
}
|
}
|