接口调整
This commit is contained in:
@@ -15,6 +15,7 @@ import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 污区数据
|
||||
@@ -35,6 +36,40 @@ public class HarmPollutionJob {
|
||||
String date = CommonExecutorUtils.prepareTimeDeal(command);
|
||||
log.info("执行日期harmPollutionJob。。。。。。。。。。"+date);
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.DAY_OF_MONTH,-1);
|
||||
|
||||
Date temDate = calendar.getTime();
|
||||
|
||||
String begin = null;
|
||||
String end = null;
|
||||
|
||||
switch (command){
|
||||
case BizParamConstant.STAT_BIZ_DAY:
|
||||
begin = sdf.format(DateUtil.beginOfDay(temDate));
|
||||
end = sdf.format(DateUtil.endOfDay(temDate));
|
||||
case BizParamConstant.STAT_BIZ_WEEK:
|
||||
begin = sdf.format(DateUtil.beginOfWeek(temDate));
|
||||
end = sdf.format(DateUtil.endOfWeek(temDate));
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
begin = sdf.format(DateUtil.beginOfMonth(temDate));
|
||||
end = sdf.format(DateUtil.endOfMonth(temDate));
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
begin = sdf.format(DateUtil.beginOfQuarter(temDate));
|
||||
end = sdf.format(DateUtil.endOfQuarter(temDate));
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
begin = sdf.format(DateUtil.beginOfYear(temDate));
|
||||
end = sdf.format(DateUtil.endOfYear(temDate));
|
||||
default:
|
||||
begin = sdf.format(DateUtil.beginOfDay(temDate));
|
||||
end = sdf.format(DateUtil.endOfDay(temDate));
|
||||
}
|
||||
lineParam.setBeginTime(begin);
|
||||
lineParam.setEndTime(end);
|
||||
|
||||
|
||||
//测试数据部署时注释
|
||||
//date = "2022-10-21";
|
||||
lineParam.setDataDate(date);
|
||||
|
||||
@@ -26,6 +26,7 @@ public class CommonExecutorUtils {
|
||||
}
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.DAY_OF_MONTH,-1);
|
||||
if (Objects.equals(BizParamConstant.STAT_BIZ_DAY,command)){
|
||||
calendar.add(Calendar.DAY_OF_MONTH,-1);
|
||||
} else if (Objects.equals(BizParamConstant.STAT_BIZ_MONTH,command)){
|
||||
|
||||
Reference in New Issue
Block a user