|
|
@ -1,5 +1,6 @@ |
|
|
|
package com.epmet.dataaggre.service.datastats.impl; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
@ -1487,26 +1488,25 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
|
} |
|
|
|
String startDate = null; |
|
|
|
String actulStartDate = null; |
|
|
|
String endDate = null; |
|
|
|
String endDate = formDTO.getDateId(); |
|
|
|
Date dateIdDate = DateUtils.parse(formDTO.getDateId(), DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
|
boolean isYesterday = DateUtils.getBeforeNDay(1,DateUtils.DATE_PATTERN_YYYYMMDD).equals(formDTO.getDateId()); |
|
|
|
switch (formDTO.getType()){ |
|
|
|
case "yesterday": |
|
|
|
startDate = DateUtils.getBeforeNDay(formDTO.getDateId(),1); |
|
|
|
endDate = formDTO.getDateId(); |
|
|
|
actulStartDate = formDTO.getDateId(); |
|
|
|
break; |
|
|
|
case "thisWeek": |
|
|
|
actulStartDate = DateUtils.getWeekStart(formDTO.getDateId()); |
|
|
|
startDate = DateUtils.getBeforeNDay(actulStartDate,1); |
|
|
|
DateUtils.format(DateUtils.addDateDays(yesterday, -1),DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
|
startDate = DateUtils.getWeekStart(formDTO.getDateId()); |
|
|
|
//startDate = DateUtils.getBeforeNDay(actulStartDate,1);
|
|
|
|
//DateUtils.format(DateUtils.addDateDays(yesterday, -1),DateUtils.DATE_PATTERN_YYYYMMDD);
|
|
|
|
if (!isYesterday){ |
|
|
|
endDate = DateUtils.getWeekEnd(formDTO.getDateId()); |
|
|
|
} |
|
|
|
break; |
|
|
|
case "thisMonth": |
|
|
|
actulStartDate = DateUtils.format(DateUtils.getMonthStart(dateIdDate),DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
|
startDate = DateUtils.getBeforeNDay(actulStartDate,1); |
|
|
|
startDate = DateUtils.format(DateUtils.getMonthStart(dateIdDate),DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
|
//startDate = DateUtils.getBeforeNDay(actulStartDate,1);
|
|
|
|
if (!isYesterday) { |
|
|
|
endDate = DateUtils.format(DateUtils.getMonthEnd(dateIdDate), DateUtils.DATE_PATTERN_YYYYMMDD); |
|
|
|
} |
|
|
@ -1516,6 +1516,7 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
|
} |
|
|
|
formDTO.setStartDateId(startDate); |
|
|
|
formDTO.setEndDateId(endDate); |
|
|
|
log.info("getSubWorkFact do select param:{}", JSON.toJSONString(formDTO)); |
|
|
|
List<WorkFactResultDTO> result = new ArrayList<>(); |
|
|
|
//如果是社区 则下级是网格 查询网格的数据
|
|
|
|
if (OrgLevelEnum.COMMUNITY.getCode().equals(formDTO.getAgencyLevel())){ |
|
|
|