From 1bc26450be9e746b3ac77a39ef36e967c61e5580 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 13 Dec 2021 10:51:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=9D=E9=A2=98=E6=80=BB?= =?UTF-8?q?=E6=95=B0=E6=8A=BD=E5=8F=96=E9=80=BB=E8=BE=91bug=EF=BC=8C?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E7=BB=B4=E5=BA=A6=E9=BB=98=E8=AE=A4=E5=89=8D?= =?UTF-8?q?=E4=B8=80=E5=A4=A9=EF=BC=9B=E5=8E=9F=E6=9D=A5=E6=98=AF=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E7=A9=BA=E6=88=AA=E6=AD=A2=E5=88=B0=E4=BA=86=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=89=A7=E8=A1=8C=E7=9A=84=E6=97=B6=E9=97=B4=E4=BA=86?= =?UTF-8?q?=20=E5=AF=BC=E8=87=B4=E6=95=B0=E6=8D=AE=E6=AF=94=E6=83=B3?= =?UTF-8?q?=E8=A6=81=E7=9A=84=E8=A6=81=E5=A4=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/topic/impl/TopicServiceImpl.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 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 a47baa85bd..4aa8d924a6 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 @@ -3,6 +3,7 @@ package com.epmet.service.topic.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.topic.TopicDao; import com.epmet.dto.AgencySubTreeDto; @@ -75,8 +76,12 @@ public class TopicServiceImpl implements TopicService { agencies.forEach(agency -> { initAgencyGridMap(agency.getAgencyId(),agency,subGridOfAgency); }); - //计算网格-组-话题映射关系 - List topics = topicDao.selectGroupOrderByGrid(targetDate,customerId); + //计算网格-组-话题映射关系 如果时间为空则 默认取维度里的时间(也是默认t-1天) + Date breforeDate = targetDate; + if (targetDate == null){ + breforeDate = DateUtils.parse(timeDimension.getDateId(),DateUtils.DATE_PATTERN_YYYYMMDD); + } + List topics = topicDao.selectGroupOrderByGrid(breforeDate,customerId); topics.forEach(groupTopic -> { if(null != groupTopic.getTopics() && groupTopic.getTopics().size() == NumConstant.ONE && StringUtils.isBlank(groupTopic.getTopics().get(NumConstant.ZERO).getTopicId())){ groupTopic.setTopics(new ArrayList<>()); @@ -287,7 +292,8 @@ public class TopicServiceImpl implements TopicService { * @author wangc * @date 2020.06.22 13:13 **/ - TopicStatisticalData calculateAndSummarizeTopicStatisticalData(Map> subGridOfAgency, List agencies, Map> gridGroupMap, Date targetDate,List statusDimension ,DimIdGenerator.DimIdBean timeDimension ,String customerId){ + TopicStatisticalData calculateAndSummarizeTopicStatisticalData(Map> subGridOfAgency, List agencies, Map> gridGroupMap, + Date targetDate,List statusDimension ,DimIdGenerator.DimIdBean timeDimension ,String customerId){ if(null == subGridOfAgency || subGridOfAgency.size() <= NumConstant.ZERO){ return null; } @@ -306,8 +312,7 @@ public class TopicServiceImpl implements TopicService { //参数:gridGroupMap 所有网格的组以及组内话题 //[所有]话题当日的操作记录 - List operations = - topicDao.selectTopicOperationRecord(targetDate); + List operations = topicDao.selectTopicOperationRecord(targetDate); //key:话题Id value:这个话题在当日的操作记录 //操作类型有: ①discussing(发布) ②hidden(屏蔽) ③hidden_cancelled(取消屏蔽) ④closed(关闭) ⑤shift_issue(转议题) //注意不要把【发布】和【取消屏蔽】混淆!!!