diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java index a23dfa1a62..27d195e832 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java @@ -8,6 +8,8 @@ public interface ProjectConstant { String DAY = "day"; String MONTH = "month"; + String PENDING = "处理中"; + String CLOSED = "已结案"; /** * 根据Token获取组织信息失败 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java index 26302753eb..072516c6dc 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java @@ -3,6 +3,7 @@ package com.epmet.service.project.impl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dao.project.ProjectDao; import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO; @@ -20,6 +21,7 @@ import java.math.BigDecimal; import java.math.RoundingMode; import java.text.NumberFormat; import java.util.ArrayList; +import java.util.Date; import java.util.List; /** @@ -54,6 +56,15 @@ public class ProjectServiceImpl implements ProjectService { //将小数转成百分比 resultDTO.setPendingRatio(percent.format(pendingRatio.doubleValue())); resultDTO.setClosedRatio(percent.format(resultDTO.getClosedRatioInt().setScale(4, RoundingMode.HALF_UP).doubleValue())); + } else { + resultDTO.setAgencyId(agencyId); + Date date = DateUtils.getBeforeDay(new Date()); + resultDTO.setDateName(DateUtils.format(date, "yyyy.MM.dd")); + resultDTO.setProjectTotal(NumConstant.ZERO); + resultDTO.setPendingTotal(NumConstant.ZERO); + resultDTO.setPendingRatio("0%"); + resultDTO.setClosedTotal(NumConstant.ZERO); + resultDTO.setClosedRatio("0%"); } return resultDTO; } @@ -78,6 +89,17 @@ public class ProjectServiceImpl implements ProjectService { //先四舍五入保留四位小数再把小数转成百分比 sum.setRatio(percent.format(sum.getRatioInt().setScale(4, RoundingMode.HALF_UP).doubleValue())); }); + } else { + ProjectSummaryInfoResultDTO pending = new ProjectSummaryInfoResultDTO(); + pending.setName(ProjectConstant.PENDING); + pending.setValue(NumConstant.ZERO); + pending.setRatio("0%"); + resultList.add(pending); + ProjectSummaryInfoResultDTO closed = new ProjectSummaryInfoResultDTO(); + closed.setName(ProjectConstant.CLOSED); + closed.setValue(NumConstant.ZERO); + closed.setRatio("0%"); + resultList.add(closed); } return resultList; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java index 234e4afeee..b01f9339bc 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java @@ -56,7 +56,20 @@ public class PublicityServiceImpl implements PublicityService { @Override public FactPublishedAgencyDailyDTO summaryInfo(TokenDto tokenDto) { String agencyId = this.getLoginUserDetails(tokenDto); - return publicityDao.summaryInfo(agencyId); + FactPublishedAgencyDailyDTO factPublishedAgencyDailyDTO = publicityDao.summaryInfo(agencyId); + if (null == factPublishedAgencyDailyDTO) { + factPublishedAgencyDailyDTO = new FactPublishedAgencyDailyDTO(); + Date dateFact = DateUtils.addDateDays(new Date(), -1); + String strDate = DateUtils.format(dateFact, DateUtils.DATE_PATTERN_YYYYMMDD); + String yearId = strDate.substring(0, 4); + String monthId = strDate.substring(5, 6); + String dayId = strDate.substring(7, 8); + factPublishedAgencyDailyDTO.setPublishedTotal(0); + factPublishedAgencyDailyDTO.setPublishingTotal(0); + factPublishedAgencyDailyDTO.setDateName(yearId + "." + monthId + "." + dayId); + } + + return factPublishedAgencyDailyDTO; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index b4d298fcc4..0bc3aacd65 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -347,7 +347,7 @@ public class TopicServiceImpl implements TopicService { gridDistinct.put(k,false); }); - List topicsBetweenTimeRange = topicDao.selectGroupOrderByGridBetweenTimeRange(calendar.getTime(),targetDate,dataPacket.getCustomerId()); + List topicsBetweenTimeRange = topicDao.selectGroupOrderByGridBetweenTimeRange(calendar.getTime(),targetDateCheck,dataPacket.getCustomerId()); Map> GridGroupMapBetweenTimeRange = topicsBetweenTimeRange.stream().collect(Collectors.groupingBy(ResiGroupTopicResultDTO::getGridId)); List groupListBetweenTimeRange = new LinkedList<>(); @@ -357,7 +357,7 @@ public class TopicServiceImpl implements TopicService { groupListBetweenTimeRange.addAll(entryBetweenTimeRange.getValue()); } List operationsBetweenTimeRange = - topicDao.selectTopicOperationRecordBetweenTimeRange(calendar.getTime(),targetDate); + topicDao.selectTopicOperationRecordBetweenTimeRange(calendar.getTime(),targetDateCheck); Map> topicOperationMapBetweenTimeRange = operationsBetweenTimeRange.stream().collect(Collectors.groupingBy(ResiTopicOperationResultDTO::getTopicId)); @@ -1127,7 +1127,7 @@ public class TopicServiceImpl implements TopicService { gridDistinct.put(k,false); }); - List topicsBetweenTimeRange = topicDao.selectGroupOrderByGridBetweenTimeRange(calendar.getTime(),targetDate,dataPacket.getCustomerId()); + List topicsBetweenTimeRange = topicDao.selectGroupOrderByGridBetweenTimeRange(calendar.getTime(),targetDateCheck,dataPacket.getCustomerId()); //key : gridId Map> GridGroupMapBetweenTimeRange = topicsBetweenTimeRange.stream().collect(Collectors.groupingBy(ResiGroupTopicResultDTO::getGridId));