|
@ -108,7 +108,7 @@ public class CurrentMysqlToEsQuotaJob implements Job {
|
|
this.endTime = DateUtil.getStringDate("yyyy-MM-dd HH:mm:ss");
|
|
this.endTime = DateUtil.getStringDate("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
//初始化统计年份
|
|
//初始化统计年份
|
|
this.year = getNowYearByDate(endTime);
|
|
|
|
|
|
this.year = getNowYearByDate();
|
|
|
|
|
|
//初始化开始时间
|
|
//初始化开始时间
|
|
if ("2".equals(timeLevel)) {
|
|
if ("2".equals(timeLevel)) {
|
|
@ -116,11 +116,7 @@ public class CurrentMysqlToEsQuotaJob implements Job {
|
|
startTime = this.year + "-06-30 17:00:00";
|
|
startTime = this.year + "-06-30 17:00:00";
|
|
}else{
|
|
}else{
|
|
//增量
|
|
//增量
|
|
if (StringUtils.isEmpty(startTime)) {
|
|
|
|
this.startTime = new LocalDate(new DateTime().minusDays(1)).toString("yyyy-MM-dd") + " 17:00:00"; //2017-06-01 17:00:00
|
|
|
|
} else {
|
|
|
|
startTime = startTime + " 17:00:00";
|
|
|
|
}
|
|
|
|
|
|
this.startTime = new LocalDate(new DateTime().minusDays(1)).toString("yyyy-MM-dd") + " 17:00:00"; //2017-06-01 17:00:00
|
|
}
|
|
}
|
|
|
|
|
|
this.quotaDate = DateUtil.strToDate(endTime, "yyyy-MM-dd");
|
|
this.quotaDate = DateUtil.strToDate(endTime, "yyyy-MM-dd");
|
|
@ -311,10 +307,9 @@ public class CurrentMysqlToEsQuotaJob implements Job {
|
|
/**
|
|
/**
|
|
* 获取现在时间属于那个年度
|
|
* 获取现在时间属于那个年度
|
|
*
|
|
*
|
|
* @param date
|
|
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public static String getNowYearByDate(String date) throws Exception {
|
|
|
|
|
|
public static String getNowYearByDate() throws Exception {
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
Date today = new Date();
|
|
Date today = new Date();
|
|
String todayString = simpleDateFormat.format(today);
|
|
String todayString = simpleDateFormat.format(today);
|