Browse Source

Merge branch 'dev_bugfix' into dev

dev_shibei_match
wxz 5 years ago
parent
commit
836bf3fd49
  1. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java
  2. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java

@ -154,9 +154,6 @@ public class StatsDimServiceImpl implements StatsDimService {
List<CustomerDepartmentEntity> departments = departmentService.listDepartmentsByCreatedTime(statsStartTime, statsEndTime);
if (!CollectionUtils.isEmpty(departments)) {
dimDepartmentService.initDepartmentDims(departments);
lastExecRecord.setExecTime(new Date());
// 记录最后一次统计时间
lastExecRecordService.updateById(lastExecRecord);
}
}
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java

@ -115,20 +115,19 @@ public class DimDateServiceImpl extends BaseServiceImpl<DimDateDao, DimDateEntit
Date now = new Date();
Date targetDate = DateUtils.addDateDays(DateUtils.parse(
DateUtils.format(now, DateUtils.DATE_PATTERN_YYYYMMDD),
DateUtils.DATE_PATTERN_YYYYMMDD), -1);
Date targetDate = DateUtils.integrate(now, DateUtils.DATE_PATTERN_YYYYMMDD);
Date lastDimDate = null;
Date lastExecTime = null;
if ((lastDimDate = lastExecRecord.getExecTime()) == null) {
if ((lastExecTime = lastExecRecord.getExecTime()) == null) {
// 首次初始化按日维度
initDimDate(targetDate);
lastExecRecord.setExecTime(now);
lastExecRecordService.updateById(lastExecRecord);
} else {
if (targetDate.equals(lastDimDate) || targetDate.after(lastDimDate)) {
initDimDate(lastDimDate, targetDate);
Date lastDimDate = DateUtils.integrate(lastExecTime, DateUtils.DATE_PATTERN_YYYYMMDD);
if (targetDate.after(lastDimDate)) {
initDimDate(DateUtils.addDateDays(lastDimDate, 1), targetDate);
lastExecRecord.setExecTime(now);
lastExecRecordService.updateById(lastExecRecord);
}

Loading…
Cancel
Save