Browse Source

Merge remote-tracking branch 'remotes/origin/dev'

dev
jianjun 4 years ago
parent
commit
edd2f28263
  1. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java

15
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<ResiGroupTopicResultDTO> topics = topicDao.selectGroupOrderByGrid(targetDate,customerId);
//计算网格-组-话题映射关系 如果时间为空则 默认取维度里的时间(也是默认t-1天)
Date breforeDate = targetDate;
if (targetDate == null){
breforeDate = DateUtils.parse(timeDimension.getDateId(),DateUtils.DATE_PATTERN_YYYYMMDD);
}
List<ResiGroupTopicResultDTO> 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<String, Set<String>> subGridOfAgency, List<AgencySubTreeDto> agencies, Map<String,List<ResiGroupTopicResultDTO>> gridGroupMap, Date targetDate,List<DimTopicStatusDTO> statusDimension ,DimIdGenerator.DimIdBean timeDimension ,String customerId){
TopicStatisticalData calculateAndSummarizeTopicStatisticalData(Map<String, Set<String>> subGridOfAgency, List<AgencySubTreeDto> agencies, Map<String,List<ResiGroupTopicResultDTO>> gridGroupMap,
Date targetDate,List<DimTopicStatusDTO> 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<ResiTopicOperationResultDTO> operations =
topicDao.selectTopicOperationRecord(targetDate);
List<ResiTopicOperationResultDTO> operations = topicDao.selectTopicOperationRecord(targetDate);
//key:话题Id value:这个话题在当日的操作记录
//操作类型有: ①discussing(发布) ②hidden(屏蔽) ③hidden_cancelled(取消屏蔽) ④closed(关闭) ⑤shift_issue(转议题)
//注意不要把【发布】和【取消屏蔽】混淆!!!

Loading…
Cancel
Save