From ea873911fb9b1a61a9ee8cb97cf324fbe1e1703c Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 2 Jul 2020 13:26:25 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=AF=9D=E9=A2=98=E7=BB=9F=E8=AE=A1-?= =?UTF-8?q?=E6=9C=88=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/topic/impl/TopicServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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)); From 3125108308b6ed8a78244e294ead093ed66c4073 Mon Sep 17 00:00:00 2001 From: jiangyuying Date: Thu, 2 Jul 2020 13:50:27 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=AE=A3=E4=BC=A0=E8=83=BD=E5=8A=9B--?= =?UTF-8?q?=E6=97=A0=E6=95=B0=E6=8D=AE=E9=BB=98=E8=AE=A4=E5=80=BC=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../publicity/impl/PublicityServiceImpl.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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; } From 331e7ccb812b69d636993b55200130df71d5729b Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 2 Jul 2020 13:57:58 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=97=A0=E6=95=B0=E6=8D=AE=E7=BB=99=E5=88=B0?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project/constant/ProjectConstant.java | 2 ++ .../project/impl/ProjectServiceImpl.java | 22 +++++++++++++++++++ 2 files changed, 24 insertions(+) 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; }