From 159d78c2cef06d8bc56fa1c6003494f3bdc05268 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Jun 2020 17:29:34 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/voice/ArticlePublishRangeDao.java | 56 ------- .../voice/ArticlePublishRangeEntity.java | 85 ----------- .../impl/StatsPublicityServiceImpl.java | 142 ++++++++---------- .../voice/ArticlePublishRangeService.java | 59 -------- .../impl/ArticlePublishRangeServiceImpl.java | 67 --------- .../mapper/voice/ArticlePublishRangeDao.xml | 57 ------- 6 files changed, 60 insertions(+), 406 deletions(-) delete mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticlePublishRangeDao.java delete mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticlePublishRangeEntity.java delete mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java delete mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java delete mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticlePublishRangeDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticlePublishRangeDao.java deleted file mode 100644 index f8ff0e359b..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticlePublishRangeDao.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.dao.voice; - -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; -import com.epmet.entity.voice.ArticlePublishRangeEntity; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.Date; -import java.util.List; - -/** - * 文章发布范围表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-17 - */ -@Mapper -public interface ArticlePublishRangeDao extends BaseDao { - - /** - * desc:查询网格发布文章总数及状态为发布中的文章总数 - * - * @param customerId - * @param createDate - * @return - */ - List getAllPublishedCount(@Param("customerId") String customerId, @Param("createDate") Date createDate); - - /** - * desc: 根据客户Id、创建日期查询某一天的 文章发布数据 - * - * @param customerId - * @param startDate - * @param endDate - * @return: List - */ - List getOneDayPublishedCount(@Param("customerId") String customerId, @Param("startDate") Date startDate, @Param("endDate") Date endDate); -} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticlePublishRangeEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticlePublishRangeEntity.java deleted file mode 100644 index 1aac103337..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticlePublishRangeEntity.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.entity.voice; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.epmet.commons.mybatis.entity.BaseEpmetEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.util.Date; - -/** - * 文章发布范围表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-17 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("article_publish_range") -public class ArticlePublishRangeEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 客户ID - */ - private String customerId; - - /** - * 文章ID - */ - private String articleId; - - /** - * 网格ID - */ - private String gridId; - - /** - * 组织-网格名称 - */ - private String agencyGridName; - - /** - * 组织ID - */ - private String agencyId; - - /** - * 所有上级组织机构ID 以英文:隔开 - */ - private String pids; - - /** - * 所有上级名称 以横杠隔开 - */ - private String allParentName; - - /** - * 下线时间 - */ - private Date offLineTime; - - /** - * 发布状态 已发布:published;已下线:offline - */ - private String publishStatus; - -} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java index c3827206b3..31b48152f3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java @@ -29,7 +29,6 @@ import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.concurrent.ExecutorService; import java.util.stream.Collectors; /** @@ -104,21 +103,19 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { private FactTagViewedGridYearlyService factTagViewedGridYearlyService; @Autowired private FactTagViewedAgencyYearlyService factTagViewedAgencyYearlyService; - @Autowired - private ExecutorService executorService; @Override public Boolean articleSummaryDailyStatsjob(Date statsDate) { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { //查询的是昨天及以前的数据 - statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, -1), DateUtils.DATE_PATTERN); + statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, -NumConstant.ONE), DateUtils.DATE_PATTERN); } else { statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); } DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); - int pageNo = 1; - int pageSize = 100; + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; List customerIdList = null; String statsDateStr = DateUtils.format(statsDate); do { @@ -147,13 +144,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { //当天的凌晨时间 即为今天之前的数据 - statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -1), DateUtils.DATE_PATTERN); + statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -NumConstant.ONE), DateUtils.DATE_PATTERN); } else { statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); } DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); - int pageNo = 1; - int pageSize = 100; + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; List customerIdList = null; do { customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); @@ -177,13 +174,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { //当天的凌晨时间 即为今天之前的数据 - statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -1), DateUtils.DATE_PATTERN); + statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -NumConstant.ONE), DateUtils.DATE_PATTERN); } else { statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); } DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); - int pageNo = 1; - int pageSize = 100; + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; List customerIdList = null; do { customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); @@ -192,7 +189,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { try { statsTagUsedMonthly(dimIdBean.getMonthId(), customerId); } catch (Exception e) { - log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "按月统计标签被使用次数", customerId, dimIdBean.getMonthId()), e); + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagUsedMonthlyStatsjob", customerId, dimIdBean.getMonthId()), e); } } } @@ -206,13 +203,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { //当天的凌晨时间 即为今天之前的数据 - statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -1), DateUtils.DATE_PATTERN); + statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -NumConstant.ONE), DateUtils.DATE_PATTERN); } else { statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); } DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); - int pageNo = 1; - int pageSize = 100; + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; List customerIdList = null; do { customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); @@ -234,13 +231,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { //当天的凌晨时间 即为今天之前的数据 - statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -1), DateUtils.DATE_PATTERN); + statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -NumConstant.ONE), DateUtils.DATE_PATTERN); } else { statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); } DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); - int pageNo = 1; - int pageSize = 100; + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; List customerIdList = null; do { customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); @@ -262,13 +259,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { //当天的凌晨时间 即为今天之前的数据 - statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -1), DateUtils.DATE_PATTERN); + statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -NumConstant.ONE), DateUtils.DATE_PATTERN); } else { statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); } DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); - int pageNo = 1; - int pageSize = 100; + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; List customerIdList = null; do { customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); @@ -297,13 +294,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { //当天的凌晨时间 即为今天之前的数据 - statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -1), DateUtils.DATE_PATTERN); + statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -NumConstant.ONE), DateUtils.DATE_PATTERN); } else { statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); } DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); - int pageNo = 1; - int pageSize = 100; + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; List customerIdList = null; do { customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); @@ -318,8 +315,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { try { log.debug("start === statsTagViewedYearly "); statsTagViewedYearly(dimIdBean.getYearId(), customerId); - - } catch (Exception e) { log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagViewedQuarterly", customerId, dimIdBean.getYearId()), e); } @@ -357,7 +352,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { buildAgencySummaryData(agencySummaryMap, summaryDTO); } } - boolean b = factArticlePublishedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), departmentDailyEntityMap.values()); + factArticlePublishedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), departmentDailyEntityMap.values()); } catch (Exception e) { log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsPublishedDepartmentDaily", customerId, statsDate), e); } @@ -430,8 +425,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { e.printStackTrace(); log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsPublishedGridDaily", customerId, statsDate), e); } - - } private void statsPublishedAgencyDaily(String statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { @@ -460,9 +453,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); gridDailyEntities.setPublishedCount(summaryDTO.getPublishedCount()); - haveDataAgencyDailyMap.put(summaryDTO.getAgencyId(), gridDailyEntities); - //构建机关自己的数据 FactArticlePublishedAgencyDailyEntity selfDaily = ConvertUtils.sourceToTarget(dimIdBean, FactArticlePublishedAgencyDailyEntity.class); selfDaily.setCustomerId(gridDailyEntities.getCustomerId()); @@ -506,9 +497,8 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { agencyDailyEntityMap.putAll(haveDataAgencyDailySelfMap); } log.debug("statsPublishedAgencyDaily insert:{}", JSON.toJSONString(agencyDailyEntityMap.values())); - boolean b = factArticlePublishedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), agencyDailyEntityMap.values()); + factArticlePublishedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), agencyDailyEntityMap.values()); } catch (Exception e) { - e.printStackTrace(); log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsPublishedAgencyDaily", customerId, statsDate), e); } } @@ -558,7 +548,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //KEY 文章Id Map articleMap = publishedArticleList.stream().collect(Collectors.toMap(ArticleEntity::getId, o -> o)); Date startTime = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); - Date endTime = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); + Date endTime = DateUtils.integrate(DateUtils.addDateDays(statsDate, NumConstant.ONE), DateUtils.DATE_PATTERN); //2 获取文章标签 List articleTagsList = articleTagsService.getArticleTagsByCreateTime(customerId, startTime, endTime); if (!CollectionUtils.isEmpty(articleTagsList)) { @@ -586,14 +576,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } } - factTagUsedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagUsedGridDailyMap.values()); factTagUsedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagUsedDeptDailyMap.values()); //向上级机关递归添加 数据 Map finalTagUsedAgencyDailyMap = new HashMap<>(); finalTagUsedAgencyDailyMap.putAll(tagUsedAgencyDailyMap); - List agencyDailyEntities = tagUsedAgencyDailyMap.values().stream().filter(uesedTag -> uesedTag.getUsedCount() > 0).collect(Collectors.toList()); - log.debug("===tagUsedAgencyDailyMap:"+JSON.toJSONString(tagUsedAgencyDailyMap.values().stream().filter(o->o.getUsedCount()>0).collect(Collectors.toList()))); + List agencyDailyEntities = tagUsedAgencyDailyMap.values().stream().filter(uesedTag -> uesedTag.getUsedCount() > NumConstant.ZERO).collect(Collectors.toList()); + log.debug("===tagUsedAgencyDailyMap:" + JSON.toJSONString(tagUsedAgencyDailyMap.values().stream().filter(o -> o.getUsedCount() > NumConstant.ZERO).collect(Collectors.toList()))); for (FactTagUsedAgencyDailyEntity entry : agencyDailyEntities) { DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(entry.getAgencyId()); if (dimAgencyEntity == null) { @@ -602,11 +591,11 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } setTagUsedData2ParentAgency(dimAgencyEntityMap, finalTagUsedAgencyDailyMap, entry, dimIdBean); } - log.debug("===finalTagUsedAgencyDailyMap:"+JSON.toJSONString(finalTagUsedAgencyDailyMap.values().stream().filter(o->o.getUsedCount()>0).collect(Collectors.toList()))); + log.debug("===finalTagUsedAgencyDailyMap:" + JSON.toJSONString(finalTagUsedAgencyDailyMap.values().stream().filter(o -> o.getUsedCount() > NumConstant.ZERO).collect(Collectors.toList()))); if (!CollectionUtils.isEmpty(tagUsedAgencyDailySelfMap)) { finalTagUsedAgencyDailyMap.putAll(tagUsedAgencyDailySelfMap); } - log.debug("===finalTagUsedAgencyDailyMap:"+JSON.toJSONString(finalTagUsedAgencyDailyMap.values().stream().filter(o->o.getUsedCount()>0).collect(Collectors.toList()))); + log.debug("===finalTagUsedAgencyDailyMap:" + JSON.toJSONString(finalTagUsedAgencyDailyMap.values().stream().filter(o -> o.getUsedCount() > NumConstant.ZERO).collect(Collectors.toList()))); factTagUsedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), finalTagUsedAgencyDailyMap.values()); } @@ -624,7 +613,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setGridId(grid.getId()); entity.setTagId(tag.getId()); entity.setTagName(tag.getTagName()); - entity.setUsedCount(0); + entity.setUsedCount(NumConstant.ZERO); tagUsedGridDailyMap.put(grid.getId().concat(StrConstant.UNDER_LINE).concat(tag.getId()), entity); }); @@ -639,7 +628,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setDepartmentId(dept.getId()); entity.setTagId(tag.getId()); entity.setTagName(tag.getTagName()); - entity.setUsedCount(0); + entity.setUsedCount(NumConstant.ZERO); tagUsedDeptDailyMap.put(dept.getId().concat(StrConstant.UNDER_LINE).concat(tag.getId()), entity); }); }); @@ -651,7 +640,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setAgencyId(agency.getId()); entity.setTagId(tag.getId()); entity.setTagName(tag.getTagName()); - entity.setUsedCount(0); + entity.setUsedCount(NumConstant.ZERO); tagUsedAgencyDailyMap.put(agency.getId().concat(StrConstant.UNDER_LINE).concat(tag.getId()), entity); }); tagDefaultList.forEach(tag -> { @@ -662,7 +651,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setAgencyId(agencyId); entity.setTagId(tag.getId()); entity.setTagName(tag.getTagName()); - entity.setUsedCount(0); + entity.setUsedCount(NumConstant.ZERO); tagUsedAgencyDailySelfMap.put(agencyId.concat(StrConstant.UNDER_LINE).concat(tag.getId()), entity); }); }); @@ -708,7 +697,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //获取当天的业务数据 //1获取今天文章的阅读记录数 Date startTime = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); - Date endTime = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); + Date endTime = DateUtils.integrate(DateUtils.addDateDays(statsDate, NumConstant.ONE), DateUtils.DATE_PATTERN); List visitRecordList = articleVisitRecordService.getArticleVisitByCreateTime(customerId, startTime, endTime); if (!CollectionUtils.isEmpty(visitRecordList)) { for (ArticleViewedSummaryDTO viewedSummaryDTO : visitRecordList) { @@ -747,7 +736,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //向上级机关递归添加 数据 Map finalTagUsedAgencyDailyMap = new HashMap<>(); finalTagUsedAgencyDailyMap.putAll(tagViewedAgencyDailyMap); - List tagViewedList = tagViewedAgencyDailyMap.values().stream().filter(tagViewed -> tagViewed.getTagReadCount() > 0).collect(Collectors.toList()); + List tagViewedList = tagViewedAgencyDailyMap.values().stream().filter(tagViewed -> tagViewed.getTagReadCount() > NumConstant.ZERO).collect(Collectors.toList()); for (FactTagViewedAgencyDailyEntity entry : tagViewedList) { DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(entry.getAgencyId()); if (dimAgencyEntity == null) { @@ -775,10 +764,9 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setGridId(grid.getId()); entity.setTagId(tag.getId()); entity.setTagName(tag.getTagName()); - entity.setTagReadCount(0); + entity.setTagReadCount(NumConstant.ZERO); tagViewedGridDailyMap.put(grid.getId().concat(StrConstant.UNDER_LINE).concat(tag.getId()), entity); }); - }); } tagDefaultList.forEach(tag -> { @@ -788,7 +776,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setAgencyId(agency.getId()); entity.setTagId(tag.getId()); entity.setTagName(tag.getTagName()); - entity.setTagReadCount(0); + entity.setTagReadCount(NumConstant.ZERO); tagViewedAgencyDailyMap.put(agency.getId().concat(StrConstant.UNDER_LINE).concat(tag.getId()), entity); }); tagDefaultList.forEach(tag -> { @@ -799,7 +787,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setAgencyId(agencyId); entity.setTagId(tag.getId()); entity.setTagName(tag.getTagName()); - entity.setTagReadCount(0); + entity.setTagReadCount(NumConstant.ZERO); tagViewedAgencyDailySelfMap.put(agencyId.concat(StrConstant.UNDER_LINE).concat(tag.getId()), entity); }); }); @@ -837,7 +825,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { * @param customerId */ private void statsTagViewedMonthly(String monthId, String customerId) { - List gridDailyList = factTagViewedGridDailyService.getTagViewedCountByMonth(customerId, monthId); if (!CollectionUtils.isEmpty(gridDailyList)) { List gridMonthlyList = ConvertUtils.sourceToTarget(gridDailyList, FactTagViewedGridMonthlyEntity.class); @@ -849,7 +836,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { List agencyMonthlyList = ConvertUtils.sourceToTarget(agencyDailyList, FactTagViewedAgencyMonthlyEntity.class); factTagViewedAgencyMonthlyService.deleteAndInsertByMonthId(customerId, monthId, (agencyMonthlyList)); } - } /** @@ -859,7 +845,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { * @param customerId */ private void statsTagUsedQuarterly(String quarterId, String customerId) { - List gridMonthlyList = factTagUsedGridMonthlyService.getTagUsedCountByQuarterId(customerId, quarterId); if (!CollectionUtils.isEmpty(gridMonthlyList)) { List gridQuarterlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagUsedGridQuarterlyEntity.class); @@ -875,7 +860,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { List agencyQuarterlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagUsedAgencyQuarterlyEntity.class); factTagUsedAgencyQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, agencyQuarterlyList); } - } /** @@ -885,19 +869,16 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { * @param customerId */ private void statsTagViewedQuarterly(String quarterId, String customerId) { - List gridMonthlyList = factTagViewedGridMonthlyService.getTagViewedCountByQuarterId(customerId, quarterId); if (!CollectionUtils.isEmpty(gridMonthlyList)) { List gridQuarterlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagViewedGridQuarterlyEntity.class); factTagViewedGridQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, gridQuarterlyList); } - List agencyMonthlyList = factTagViewedAgencyMonthlyService.getTagViewedCountByQuarterId(customerId, quarterId); if (!CollectionUtils.isEmpty(agencyMonthlyList)) { List agencyQuarterlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagViewedAgencyQuarterlyEntity.class); factTagViewedAgencyQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, agencyQuarterlyList); } - } /** @@ -907,7 +888,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { * @param customerId */ private void statsTagUsedYearly(String yearId, String customerId) { - List gridMonthlyList = factTagUsedGridMonthlyService.getTagUsedCountByYearId(customerId, yearId); if (!CollectionUtils.isEmpty(gridMonthlyList)) { List gridYearlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagUsedGridYearlyEntity.class); @@ -923,7 +903,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { List agencyYearlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagUsedAgencyYearlyEntity.class); factTagUsedAgencyYearlyService.deleteAndInsertByYearId(customerId, yearId, agencyYearlyList); } - } /** @@ -933,8 +912,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { * @param customerId */ private void statsTagViewedYearly(String yearId, String customerId) { - - List gridMonthlyList = factTagViewedGridMonthlyService.getTagViewedCountByYearId(customerId, yearId); if (!CollectionUtils.isEmpty(gridMonthlyList)) { List gridYearlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagViewedGridYearlyEntity.class); @@ -945,7 +922,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { List agencyYearlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagViewedAgencyYearlyEntity.class); factTagViewedAgencyYearlyService.deleteAndInsertByYearId(customerId, yearId, agencyYearlyList); } - } private void setTagUsedData2ParentAgency(Map dimAgencyEntityMap, Map agencyDailyEntityMap, FactTagUsedAgencyDailyEntity currentEntity, DimIdGenerator.DimIdBean dimIdBean) { @@ -982,6 +958,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { FactTagViewedAgencyDailyEntity parentAgencyDailyEntity = agencyDailyEntityMap.get(key); DimAgencyEntity currentDimAgency = dimAgencyEntityMap.get(pid); if (currentDimAgency == null) { + log.error("setTagViewedData2ParentAgency pid:{} not exist in dimAgency", pid); return; } if (parentAgencyDailyEntity == null) { @@ -1006,6 +983,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { String pid = summary.getPid(); FactArticlePublishedAgencyDailyEntity parentAgency = agencyDailyEntityMap.get(pid); if (parentAgency == null) { + log.error("setPublishedData2ParentAgency pid:{} not exist in dimAgency", pid); return; } parentAgency.setArticleTotalCount(parentAgency.getArticleTotalCount() + agencySummary.getArticleTotalCount()); @@ -1031,9 +1009,9 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setCustomerId(dimGridEntity.getCustomerId()); entity.setAgencyId(dimGridEntity.getAgencyId()); entity.setGridId(dimGridEntity.getId()); - entity.setArticleTotalCount(0); - entity.setArticlePublishedCount(0); - entity.setPublishedCount(0); + entity.setArticleTotalCount(NumConstant.ZERO); + entity.setArticlePublishedCount(NumConstant.ZERO); + entity.setPublishedCount(NumConstant.ZERO); result.put(dimGridEntity.getId(), entity); }); return result; @@ -1053,9 +1031,9 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setCustomerId(dimGridEntity.getCustomerId()); entity.setAgencyId(dimGridEntity.getAgencyId()); entity.setDepartmentId(dimGridEntity.getId()); - entity.setArticleTotalCount(0); - entity.setArticlePublishedCount(0); - entity.setPublishedCount(0); + entity.setArticleTotalCount(NumConstant.ZERO); + entity.setArticlePublishedCount(NumConstant.ZERO); + entity.setPublishedCount(NumConstant.ZERO); result.put(dimGridEntity.getId(), entity); }); return result; @@ -1075,9 +1053,9 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setCustomerId(dimGridEntity.getCustomerId()); entity.setPid(dimGridEntity.getPid()); entity.setAgencyId(dimGridEntity.getId()); - entity.setArticleTotalCount(0); - entity.setArticlePublishedCount(0); - entity.setPublishedCount(0); + entity.setArticleTotalCount(NumConstant.ZERO); + entity.setArticlePublishedCount(NumConstant.ZERO); + entity.setPublishedCount(NumConstant.ZERO); result.put(dimGridEntity.getId(), entity); }); return result; @@ -1102,10 +1080,10 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setGridId(gridId); entity.setTagId(tagId); entity.setTagName(tagEntity.getTagName()); - entity.setUsedCount(1); + entity.setUsedCount(NumConstant.ONE); result.put(key, entity); } else { - entity.setUsedCount(entity.getUsedCount() + 1); + entity.setUsedCount(entity.getUsedCount() + NumConstant.ONE); } } @@ -1121,10 +1099,10 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setDepartmentId(publisherId); entity.setTagId(tagId); entity.setTagName(tagEntity.getTagName()); - entity.setUsedCount(1); + entity.setUsedCount(NumConstant.ONE); result.put(key, entity); } else { - entity.setUsedCount(entity.getUsedCount() + 1); + entity.setUsedCount(entity.getUsedCount() + NumConstant.ONE); } } @@ -1140,10 +1118,10 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setAgencyId(agencyId); entity.setTagId(tagId); entity.setTagName(tagEntity.getTagName()); - entity.setUsedCount(1); + entity.setUsedCount(NumConstant.ONE); result.put(key, entity); } else { - entity.setUsedCount(entity.getUsedCount() + 1); + entity.setUsedCount(entity.getUsedCount() + NumConstant.ONE); } } @@ -1159,10 +1137,10 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setAgencyId(agencyId); entity.setTagId(tagId); entity.setTagName(tagEntity.getTagName()); - entity.setUsedCount(1); + entity.setUsedCount(NumConstant.ONE); result.put(key, entity); } else { - entity.setUsedCount(entity.getUsedCount() + 1); + entity.setUsedCount(entity.getUsedCount() + NumConstant.ONE); } } @@ -1171,7 +1149,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { String gridId = viewedSummaryDTO.getGridId(); String tagId = tagEntity.getTagId(); String key = gridId.concat(StrConstant.UNDER_LINE).concat(tagId); - Integer viewedCount = viewedSummaryDTO.getViewedCount() == null ? 0 : viewedSummaryDTO.getViewedCount(); + Integer viewedCount = viewedSummaryDTO.getViewedCount() == null ? NumConstant.ZERO : viewedSummaryDTO.getViewedCount(); FactTagViewedGridDailyEntity entity = result.get(key); if (entity == null) { entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagViewedGridDailyEntity.class); @@ -1192,7 +1170,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { String agencyId = dimAgencyEntity.getId(); String tagId = tagEntity.getTagId(); String key = agencyId.concat(StrConstant.UNDER_LINE).concat(tagId); - Integer viewedCount = viewedSummaryDTO.getViewedCount() == null ? 0 : viewedSummaryDTO.getViewedCount(); + Integer viewedCount = viewedSummaryDTO.getViewedCount() == null ? NumConstant.ZERO : viewedSummaryDTO.getViewedCount(); FactTagViewedAgencyDailyEntity entity = result.get(key); if (entity == null) { entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagViewedAgencyDailyEntity.class); @@ -1213,7 +1191,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { String agencyId = dimAgencyEntity.getId().concat(DimAgencyConstant.TYPE_SELF_ID_SUFFIX); String tagId = tagEntity.getTagId(); String key = agencyId.concat(StrConstant.UNDER_LINE).concat(tagId); - Integer viewedCount = viewedSummaryDTO.getViewedCount() == null ? 0 : viewedSummaryDTO.getViewedCount(); + Integer viewedCount = viewedSummaryDTO.getViewedCount() == null ? NumConstant.ZERO : viewedSummaryDTO.getViewedCount(); FactTagViewedAgencyDailyEntity entity = result.get(key); if (entity == null) { entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagViewedAgencyDailyEntity.class); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java deleted file mode 100644 index 125e46e962..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.service.voice; - -import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; -import com.epmet.entity.voice.ArticlePublishRangeEntity; - -import java.util.Date; -import java.util.List; - -/** - * 文章发布范围表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-17 - */ -public interface ArticlePublishRangeService extends BaseService { - - /** - * desc: 根据客户Id 、创建日期查询 有史以来所有的发布文章总数 - * - * @param customerId - * @param createDate - * @return: List - * @date: 2020/6/17 16:59 - * @author: jianjun liu - * email:liujianjun@git.elinkit.com.cn - */ - List getAllPublishedCount(String customerId, Date createDate); - - /** - * desc: 根据客户Id、创建日期查询某一天的 文章发布数据 - * - * @param customerId - * @param startDate - * @param endDate - * @return: List - * @date: 2020/6/17 21:43 - * @author: jianjun liu - * email:liujianjun@git.elinkit.com.cn - */ - List getOneDayPublishedCount(String customerId, Date startDate, Date endDate); -} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java deleted file mode 100644 index 8fc2f430cd..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.service.voice.impl; - -import com.epmet.commons.dynamic.datasource.annotation.DataSource; -import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.constant.DataSourceConstant; -import com.epmet.dao.voice.ArticlePublishRangeDao; -import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; -import com.epmet.entity.voice.ArticlePublishRangeEntity; -import com.epmet.service.voice.ArticlePublishRangeService; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Service; - -import java.util.Date; -import java.util.List; - -/** - * 文章发布范围表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-17 - */ -@Slf4j -@Service -@DataSource(DataSourceConstant.GOV_VOICE) -public class ArticlePublishRangeServiceImpl extends BaseServiceImpl implements ArticlePublishRangeService { - - - @Override - public List getAllPublishedCount(String customerId, Date createDate) { - log.debug("getAllPublishedCount param customerId:{},createDate:{}", customerId, createDate); - return baseDao.getAllPublishedCount(customerId, createDate); - } - - /** - * desc: 根据客户Id、创建日期查询某一天的 文章发布数据 - * - * @param customerId - * @param startDate - * @param endDate - * @return: List - * @date: 2020/6/17 21:43 - * @author: jianjun liu - * email:liujianjun@git.elinkit.com.cn - */ - @Override - public List getOneDayPublishedCount(String customerId, Date startDate, Date endDate) { - log.debug("getOneDayPublishedCount param startDate:{},endDate:{}", startDate, endDate); - return baseDao.getOneDayPublishedCount(customerId, startDate, endDate); - } -} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml deleted file mode 100644 index 154d617001..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 5dac3312efaf897dd41581d54023338d05097bac Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Jun 2020 18:28:52 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/user/impl/UserAnalysisServiceImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java index 8c3f008f55..bedde8bf91 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java @@ -289,8 +289,7 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { break; } } - logger.info(String.format("找到当前网格(gridId=%s,gridName=%s)对应的数据,当前循环",dimInitResultDto.getGridId(),dimInitResultDto.getName())); - break; + logger.debug(String.format("找到当前网格(gridId=%s,gridName=%s)对应的数据,当前循环",dimInitResultDto.getGridId(),dimInitResultDto.getName())); } if(!flag){ logger.error(String.format("直属网格注册用户数缺少记录:date_id=%s,gridId=%s",formDTO.getDateId(),dimInitResultDto.getGridId())); From 5888b39a86ca568268138e46fdcdef91d30cb4ab Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Wed, 1 Jul 2020 09:17:53 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E5=8A=A0=E4=BA=86=E4=B8=AA=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/StatsGroupServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java index b9735e489c..1571c6b3fe 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -154,7 +154,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { //机关下的所有网格(包括直属网格) List allGrid = this.getAllGrid(agencyId,customerId); if (allGrid.size() != NumConstant.ZERO) { - // 1. 机关下有多少网格 + // 1. 机关下有多少网格 (this.getAllGrid拿的是当前机关下所有网格,以下方法是根据“dateId”来拿的,两者过滤) List customerGridIdList = customerGridService.getCustomerGridIdList(customerId, dateId); AtomicReference gridSize = new AtomicReference<>(NumConstant.ZERO); if (customerGridIdList.size() != NumConstant.ZERO) { From 740409ef3302141d16eaef482247a348a49f2a57 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 1 Jul 2020 09:50:17 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/StatsIssueServiceImpl.java | 2 ++ .../main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml | 2 ++ .../src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml | 1 + 3 files changed, 5 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java index 8fc548d4c2..a4d845ab90 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java @@ -227,6 +227,7 @@ public class StatsIssueServiceImpl implements StatsIssueService { FactIssueAgencyMonthlyDTO dto = issueAgencyMonthlyIncList.get(i); if (agency.getId().equals(dto.getAgencyId())) { monthly.setIssueIncr(dto.getIssueIncr()); + monthly.setVotingIncr(dto.getVotingIncr()); monthly.setShiftProjectIncr(dto.getShiftProjectIncr()); monthly.setClosedIncr(dto.getClosedIncr()); monthly.setClosedResolvedIncr(dto.getClosedResolvedIncr()); @@ -430,6 +431,7 @@ public class StatsIssueServiceImpl implements StatsIssueService { FactIssueGridMonthlyDTO dto = gridMonthlyIncListList.get(i); if (grid.getId().equals(dto.getGridId())) { monthly.setIssueIncr(dto.getIssueIncr()); + monthly.setVotingIncr(dto.getVotingIncr()); monthly.setShiftProjectIncr(dto.getShiftProjectIncr()); monthly.setClosedIncr(dto.getClosedIncr()); monthly.setClosedResolvedIncr(dto.getClosedResolvedIncr()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml index 430abbd36c..45f53d10cc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml @@ -51,6 +51,7 @@ SELECT da.ID AS "agencyId", SUM(IFNULL(ISSUE_INCR, 0)) AS "issueIncr", + SUM(IFNULL(VOTING_INCR, 0)) AS "votingIncr", SUM(IFNULL(SHIFT_PROJECT_INCR, 0)) AS "shiftProjectIncr", SUM(IFNULL(CLOSED_INCR, 0)) AS "closedIncr", SUM(IFNULL(CLOSED_RESOLVED_INCR, 0)) AS "closedResolvedIncr", @@ -64,6 +65,7 @@ AND MONTH_ID = #{monthId} WHERE da.DEL_FLAG = '0' + AND da.AGENCY_DIM_TYPE= 'all' AND da.CUSTOMER_ID = #{customerId} GROUP BY da.ID diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml index cbcc5b4276..35ca051fa1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml @@ -57,6 +57,7 @@ dg.AGENCY_ID AS "agencyId", dg.ID AS "gridId", SUM(IFNULL(ISSUE_INCR, 0)) AS "issueIncr", + SUM(IFNULL(VOTING_INCR, 0)) AS "votingIncr", SUM(IFNULL(SHIFT_PROJECT_INCR, 0)) AS "shiftProjectIncr", SUM(IFNULL(CLOSED_INCR, 0)) AS "closedIncr", SUM(IFNULL(CLOSED_RESOLVED_INCR, 0)) AS "closedResolvedIncr", From 5385badfb783cc7ecb0c94ebf60a8bdc5564a66f Mon Sep 17 00:00:00 2001 From: jiangyuying Date: Wed, 1 Jul 2020 09:57:26 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E5=AE=A3=E4=BC=A0=E8=83=BD=E5=8A=9B--?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4=E4=B8=BAt-1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../publicity/impl/PublicityServiceImpl.java | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) 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 990cc97916..902bfdee3f 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 @@ -45,6 +45,8 @@ public class PublicityServiceImpl implements PublicityService { private PublicityDao publicityDao;//机关每日发文 @Autowired private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + private Date dateFact = DateUtils.addDateDays( new Date(),-1); + /** * @param tokenDto @@ -66,16 +68,15 @@ public class PublicityServiceImpl implements PublicityService { @Override public List tagviewed(TokenDto tokenDto, Integer pageSize, String type) { String agencyId = this.getLoginUserDetails(tokenDto); - Date date = new Date(); - String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN); + String strDate = DateUtils.format(dateFact, DateUtils.DATE_PATTERN_YYYYMMDD); String yearId = strDate.substring(0, 4); + String monthId = strDate.substring(0, 6); if (StringUtils.equals("month", type)) {//当月 - String monthId = strDate.substring(0, 4) + strDate.substring(5, 7); return publicityDao.getViewedMonthlyCountByTag(agencyId, monthId, pageSize); } else if (StringUtils.equals("quarter", type)) {//当季 - String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); + String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(dateFact); return publicityDao.getViewedQuarterlyCountByTag(agencyId, quarterId, pageSize); } else if (StringUtils.equals("year", type)) {//当年 @@ -94,16 +95,15 @@ public class PublicityServiceImpl implements PublicityService { @Override public List tagused(TokenDto tokenDto, Integer pageSize, String type) { String agencyId = this.getLoginUserDetails(tokenDto); - Date date = new Date(); - String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN); + String strDate = DateUtils.format(dateFact, DateUtils.DATE_PATTERN_YYYYMMDD); String yearId = strDate.substring(0, 4); + String monthId = strDate.substring(0, 6); if (StringUtils.equals("month", type)) {//当月 - String monthId = strDate.substring(0, 4) + strDate.substring(5, 7); return publicityDao.getUsedMonthlyCountByTag(agencyId, monthId, pageSize); } else if (StringUtils.equals("quarter", type)) {//当季 - String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); + String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(dateFact); return publicityDao.getUsedQuarterlyCountByTag(agencyId, quarterId, pageSize); } else if (StringUtils.equals("year", type)) {//当年 @@ -122,8 +122,8 @@ public class PublicityServiceImpl implements PublicityService { @Override public List subagencyPublishedarticle(TokenDto tokenDto, String type) { String agencyId = this.getLoginUserDetails(tokenDto); - Date date = new Date(); - String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD); +// Date date = new Date(); + String strDate = DateUtils.format(dateFact, DateUtils.DATE_PATTERN_YYYYMMDD); String yearId = strDate.substring(0, 4); String monthId = strDate.substring(0, 6); @@ -131,7 +131,7 @@ public class PublicityServiceImpl implements PublicityService { return publicityDao.getSubAgencyPublishedMonth(agencyId, monthId); } else if (StringUtils.equals("quarter", type)) {//当季 - String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); + String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(dateFact); return publicityDao.getSubAgencyPublishedQuarter(agencyId, quarterId); } else if (StringUtils.equals("year", type)) {//当年 @@ -150,8 +150,8 @@ public class PublicityServiceImpl implements PublicityService { @Override public List departmentPublishedarticle(TokenDto tokenDto, String type) { String agencyId = this.getLoginUserDetails(tokenDto); - Date date = new Date(); - String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD); +// Date date = new Date(); + String strDate = DateUtils.format(dateFact, DateUtils.DATE_PATTERN_YYYYMMDD); String yearId = strDate.substring(0, 4); String monthId = strDate.substring(0, 6); @@ -159,7 +159,7 @@ public class PublicityServiceImpl implements PublicityService { return publicityDao.getSubDepartPublishedMonth(agencyId, monthId); } else if (StringUtils.equals("quarter", type)) {//当季 - String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); + String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(dateFact); return publicityDao.getSubDepartPublishedQuarter(agencyId, quarterId); } else if (StringUtils.equals("year", type)) {//当年 @@ -178,8 +178,8 @@ public class PublicityServiceImpl implements PublicityService { @Override public List subgridPublishedarticle(TokenDto tokenDto, String type) { String agencyId = this.getLoginUserDetails(tokenDto); - Date date = new Date(); - String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD); +// Date date = new Date(); + String strDate = DateUtils.format(dateFact, DateUtils.DATE_PATTERN_YYYYMMDD); String yearId = strDate.substring(0, 4); String monthId = strDate.substring(0, 6); @@ -187,7 +187,7 @@ public class PublicityServiceImpl implements PublicityService { return publicityDao.getSubGridPublishedMonth(agencyId, monthId); } else if (StringUtils.equals("quarter", type)) {//当季 - String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); + String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(dateFact); return publicityDao.getSubGridPublishedQuarter(agencyId, quarterId); } else if (StringUtils.equals("year", type)) {//当年 From f0ed21f83872b514d3ab6be1fa9c8937cf9dfb72 Mon Sep 17 00:00:00 2001 From: jiangyuying Date: Wed, 1 Jul 2020 10:15:16 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=AE=A3=E4=BC=A0=E8=83=BD=E5=8A=9B--?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/publicity/impl/PublicityServiceImpl.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 902bfdee3f..234e4afeee 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 @@ -45,7 +45,7 @@ public class PublicityServiceImpl implements PublicityService { private PublicityDao publicityDao;//机关每日发文 @Autowired private EpmetUserOpenFeignClient epmetUserOpenFeignClient; - private Date dateFact = DateUtils.addDateDays( new Date(),-1); + /** @@ -68,6 +68,7 @@ public class PublicityServiceImpl implements PublicityService { @Override public List tagviewed(TokenDto tokenDto, Integer pageSize, String type) { String agencyId = this.getLoginUserDetails(tokenDto); + 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(0, 6); @@ -95,6 +96,7 @@ public class PublicityServiceImpl implements PublicityService { @Override public List tagused(TokenDto tokenDto, Integer pageSize, String type) { String agencyId = this.getLoginUserDetails(tokenDto); + 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(0, 6); @@ -122,7 +124,7 @@ public class PublicityServiceImpl implements PublicityService { @Override public List subagencyPublishedarticle(TokenDto tokenDto, String type) { String agencyId = this.getLoginUserDetails(tokenDto); -// Date date = new Date(); + 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(0, 6); @@ -150,7 +152,7 @@ public class PublicityServiceImpl implements PublicityService { @Override public List departmentPublishedarticle(TokenDto tokenDto, String type) { String agencyId = this.getLoginUserDetails(tokenDto); -// Date date = new Date(); + 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(0, 6); @@ -178,7 +180,7 @@ public class PublicityServiceImpl implements PublicityService { @Override public List subgridPublishedarticle(TokenDto tokenDto, String type) { String agencyId = this.getLoginUserDetails(tokenDto); -// Date date = new Date(); + 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(0, 6);