|
@ -119,6 +119,17 @@ public class CurrentMysqlToEsQuotaJob implements Job {
|
|
|
this.incrementInterval = map.get("incrementInterval")!=null?String.valueOf(map.get("incrementInterval")):"1";
|
|
|
//初始化统计年份
|
|
|
this.year = getNowYearByDate();
|
|
|
|
|
|
if (StringUtils.isEmpty(endTime)) {
|
|
|
endTime = new LocalDate(new DateTime().minusDays(1)).toString("yyyy-MM-dd") + " 17:00:00"; //2017-06-01 17:00:00
|
|
|
} else if (endTime.length()==10){
|
|
|
endTime = endTime + " 17:00:00";
|
|
|
}
|
|
|
if("2".equals(incrementInterval)){
|
|
|
endTime = DateUtil.getSundayOfThisDate(DateUtil.strToDateLong(endTime));
|
|
|
}else if("3".equals(incrementInterval)){
|
|
|
endTime= DateUtil.getLastDayOfMonth((DateUtil.strToDateLong(endTime)));
|
|
|
}
|
|
|
//初始化开始时间
|
|
|
if ("2".equals(timeLevel)) {
|
|
|
//按年度到达量
|
|
@ -424,7 +435,7 @@ public class CurrentMysqlToEsQuotaJob implements Job {
|
|
|
public void getStartTime() throws Exception{
|
|
|
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
if("1".equals(this.incrementInterval)){//日
|
|
|
startTime = new LocalDate(new DateTime().minusDays(2)).toString("yyyy-MM-dd") + " 17:00:00";
|
|
|
startTime = new LocalDate(new DateTime().minusDays(1)).toString("yyyy-MM-dd") + " 17:00:00";
|
|
|
}else if("2".equals(this.incrementInterval)){//周
|
|
|
Date monday = DateUtil.getMondayOfThisDayToDate(sf.parse(endTime));
|
|
|
// startTime =sf.format(monday)+ " 17:00:00";
|