diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java index bcd0beaed9..301099d52b 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java @@ -23,10 +23,20 @@ public class ArticleGridPublishedSummaryDTO implements Serializable { * 客户id */ private String customerId; + + /** + * 机关id + */ + private String agencyId; /** * 网格Id */ private String gridId; + /** + * 发布者Id publish_type类型为 部门时 是部门id;类型为 机关时 是机关Id + */ + private String publisherId; + /** * 发布文章总数 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java index 3d55c8436c..0df16681dc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -30,5 +30,17 @@ public interface ProjectConstant { * 项目处理进展-结案 */ String CLOSE = "close"; + /** + * 发布单位类型 机关:agency + */ + String PUBLISH_TYPE_AGENCY = "agency"; + /** + * 发布单位类型 部门:department + */ + String PUBLISH_TYPE_DEPT = "department"; + /** + * 发布单位类型 网格:grid + */ + String PUBLISH_TYPE_GRID = "grid"; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDepartmentDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDepartmentDao.java index 42ec2905b8..c7848dffcb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDepartmentDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDepartmentDao.java @@ -20,6 +20,9 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.DimDepartmentEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 客户部门维度 @@ -30,4 +33,11 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface DimDepartmentDao extends BaseDao { int insertOne(DimDepartmentEntity dim); + + /** + * desc:根据客户Id获取所有的部门信息 + * @param customerId + * @return + */ + List getDepartmentListByCustomerId(@Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedDepartmentDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedDepartmentDailyDao.java index eb09ed6ce3..1cff4fa1a8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedDepartmentDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedDepartmentDailyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 文章发布数量【部门】日统计表 @@ -29,5 +30,12 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactArticlePublishedDepartmentDailyDao extends BaseDao { - + + /** + * desc:根据客户id,日期 删除数据 + * @param customerId + * @param dateId + * @return + */ + int deleteByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java index 4609722502..6622ffe700 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java @@ -18,8 +18,13 @@ package com.epmet.dao.voice; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; import com.epmet.entity.voice.ArticleEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; /** * 文章表 @@ -29,5 +34,14 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ArticleDao extends BaseDao { - + + /** + * desc:根据客户Id 和发布时间 获取文章总数 + * + * @param customerId + * @param publishDate + * @param publishType + * @return + */ + List getAllPublishedCount(@Param("customerId") String customerId, @Param("publishDate") Date publishDate, @Param("publishType") String publishType); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedDepartmentDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedDepartmentDailyEntity.java index c91d318a87..96e8ae407f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedDepartmentDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedDepartmentDailyEntity.java @@ -48,7 +48,7 @@ public class FactArticlePublishedDepartmentDailyEntity extends BaseEpmetEntity { /** * 部门ID */ - private String depsartmentId; + private String departmentId; /** * 文章累计发文数量 文章数量 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 4e182db209..cd230fc4f3 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 @@ -3,11 +3,11 @@ package com.epmet.service.impl; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; -import com.epmet.entity.stats.DimGridEntity; -import com.epmet.entity.stats.FactArticlePublishedGridDailyEntity; +import com.epmet.entity.stats.*; import com.epmet.service.StatsPublicityService; import com.epmet.service.stats.*; import com.epmet.service.voice.ArticlePublishRangeService; +import com.epmet.service.voice.ArticleService; import com.epmet.util.DimIdGenerator; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -46,11 +46,17 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { private DimCustomerService dimCustomerService; @Autowired private DimGridService dimGridService; + @Autowired + private DimDepartmentService dimDepartmentService; + @Autowired + private ArticleService articleService; @Autowired private ArticlePublishRangeService articlePublishRangeService; @Autowired private FactArticlePublishedGridDailyService factArticlePublishedGridDailyService; + @Autowired + private FactArticlePublishedDepartmentDailyService factArticlePublishedDepartmentDailyService; @Autowired private ExecutorService executorService; @@ -71,21 +77,78 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { /*executorService.submit(()->{ });*/ - statsPublishedGridDaily(statsDate, dimIdBean, customerId); + //key:所在机关Id + Map agencySummaryMap = new HashMap<>(); + statsPublishedGridDaily(statsDate, dimIdBean, customerId,agencySummaryMap); + statsPublishedDepartmentDaily(statsDate, dimIdBean, customerId,agencySummaryMap); + statsPublishedAgencyDaily(statsDate, dimIdBean, customerId,agencySummaryMap); } } } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() >= pageSize); return true; } + private void statsPublishedDepartmentDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { + //获取所有客户 + List departmentDTOList = dimDepartmentService.getDepartmentListByCustomerId(customerId); + if (CollectionUtils.isEmpty(departmentDTOList)) { + log.warn("publicitySummary getDepartmentListByCustomerId return empty,customerId:{}", customerId); + return; + } + //转换为 需要插入的Entity + Map departmentDailyEntityMap = convertDepartmentDailyEntity(departmentDTOList, dimIdBean); + //获取当天的业务数据 + List publishedArticleCount = articleService.getAllPublishedCount(customerId,DateUtils.integrate(statsDate,DateUtils.DATE_PATTERN)); + + if (!CollectionUtils.isEmpty(publishedArticleCount)) { + for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { + FactArticlePublishedDepartmentDailyEntity gridDailyEntities = departmentDailyEntityMap.get(summaryDTO.getPublisherId()); + if (gridDailyEntities == null) { + log.error("publicitySummary bizData departmentId:{} not exist in dimDepartment", summaryDTO.getGridId()); + continue; + } + gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount()); + gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); + //同一个机关下数据累加 + buildAgencySummaryData(agencySummaryMap, summaryDTO); + } + } + boolean b = factArticlePublishedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), departmentDailyEntityMap.values()); + } + + /** + * desc:同一个机关下的数据进行类型处理 + * @param result + * @param summaryDTO + */ + private void buildAgencySummaryData(Map result, ArticleGridPublishedSummaryDTO summaryDTO) { + //同一个机关下数据累加 + ArticleGridPublishedSummaryDTO publishedSummaryDTO = result.get(summaryDTO.getAgencyId()); + if (publishedSummaryDTO == null) { + ArticleGridPublishedSummaryDTO summary = new ArticleGridPublishedSummaryDTO(); + summary.setCustomerId(summaryDTO.getCustomerId()); + summary.setAgencyId(summaryDTO.getAgencyId()); + summary.setGridId(summaryDTO.getGridId()); + summary.setPublisherId(summaryDTO.getPublisherId()); + summary.setArticleTotalCount(summaryDTO.getArticleTotalCount()); + summary.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); + result.put(summaryDTO.getPublisherId(),summaryDTO); + }else{ + publishedSummaryDTO.setArticlePublishedCount(publishedSummaryDTO.getArticlePublishedCount()+summaryDTO.getArticlePublishedCount()); + publishedSummaryDTO.setArticleTotalCount(publishedSummaryDTO.getArticleTotalCount()+summaryDTO.getArticlePublishedCount()); + } + } + /** * desc:按日统计 网格纬度的 文章总数数据 - * - * @param statsDate + * @param statsDate * @param dimIdBean * @param customerId + * @param agencySummaryMap */ - private void statsPublishedGridDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId) { + private void statsPublishedGridDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { + //key:所在机关Id + Map result = new HashMap<>(); //获取所有网格 List gridDTOList = dimGridService.getGridListByCustomerId(customerId); if (CollectionUtils.isEmpty(gridDTOList)) { @@ -106,11 +169,41 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount()); gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); + //同一个机关下数据累加 + buildAgencySummaryData(agencySummaryMap, summaryDTO); } } boolean b = factArticlePublishedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), gridDailyEntityMap.values()); } + private void statsPublishedAgencyDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { + //获取所有客户 + List departmentDTOList = dimAgencyService.getAgencyListByCustomerId(customerId); + if (CollectionUtils.isEmpty(departmentDTOList)) { + log.warn("publicitySummary getAgencyListByCustomerId return empty,customerId:{}", customerId); + return; + } + //转换为 需要插入的Entity + Map departmentDailyEntityMap = convertDepartmentDailyEntity(departmentDTOList, dimIdBean); + //获取当天的业务数据 + List publishedArticleCount = articleService.getAllPublishedCount(customerId,DateUtils.integrate(statsDate,DateUtils.DATE_PATTERN)); + + if (!CollectionUtils.isEmpty(publishedArticleCount)) { + for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { + FactArticlePublishedDepartmentDailyEntity gridDailyEntities = departmentDailyEntityMap.get(summaryDTO.getPublisherId()); + if (gridDailyEntities == null) { + log.error("publicitySummary bizData departmentId:{} not exist in dimDepartment", summaryDTO.getGridId()); + continue; + } + gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount()); + gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); + //同一个机关下数据累加 + buildAgencySummaryData(agencySummaryMap, summaryDTO); + } + } + boolean b = factArticlePublishedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), departmentDailyEntityMap.values()); + } + /** * desc:将网格对象构建为 gridDaily 对象 * @@ -131,4 +224,25 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { }); return result; } + + /** + * desc:将网格对象构建为 gridDaily 对象 + * + * @param dimDepartmentEntities + * @param dimIdBean + * @return + */ + private Map convertDepartmentDailyEntity(List dimDepartmentEntities, DimIdGenerator.DimIdBean dimIdBean) { + Map result = new HashMap<>(); + dimDepartmentEntities.forEach(dimGridEntity -> { + FactArticlePublishedDepartmentDailyEntity entity = ConvertUtils.sourceToTarget(dimIdBean, FactArticlePublishedDepartmentDailyEntity.class); + entity.setCustomerId(dimGridEntity.getCustomerId()); + entity.setAgencyId(dimGridEntity.getAgencyId()); + entity.setDepartmentId(dimGridEntity.getId()); + entity.setArticleTotalCount(0); + entity.setArticlePublishedCount(0); + result.put(dimGridEntity.getId(), entity); + }); + return result; + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedDepartmentDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedDepartmentDailyService.java index 26f2c2089c..40ae1d8002 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedDepartmentDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedDepartmentDailyService.java @@ -20,6 +20,8 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity; +import java.util.Collection; + /** * 文章发布数量【部门】日统计表 * @@ -28,4 +30,15 @@ import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity; */ public interface FactArticlePublishedDepartmentDailyService extends BaseService { + /** + * desc: 删除并插入数据 + * + * @param dateId + * @param values + * @return: + * @date: 2020/6/18 14:54 + * @author: jianjun liu + */ + boolean deleteAndInsertBatch(String customerId, String dateId, Collection values); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDepartmentServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDepartmentServiceImpl.java index ac58403913..567b211aa3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDepartmentServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDepartmentServiceImpl.java @@ -20,16 +20,16 @@ package com.epmet.service.stats.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.stats.DimDepartmentDao; import com.epmet.dto.stats.DimDepartmentDTO; import com.epmet.entity.org.CustomerDepartmentEntity; import com.epmet.entity.stats.DimDepartmentEntity; import com.epmet.service.stats.DimDepartmentService; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -44,6 +44,7 @@ import java.util.Map; * @author generator generator@elink-cn.com * @since v1.0.0 2020-06-16 */ +@Slf4j @Service public class DimDepartmentServiceImpl extends BaseServiceImpl implements DimDepartmentService { @@ -118,4 +119,12 @@ public class DimDepartmentServiceImpl extends BaseServiceImpl getDepartmentListByCustomerId(String customerId) { + if (StringUtils.isBlank(customerId)){ + log.warn("getDepartmentListByCustomerId param is blank "); + } + return baseDao.getDepartmentListByCustomerId(customerId); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedDepartmentDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedDepartmentDailyServiceImpl.java index 47c9667c59..cf40d35c1e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedDepartmentDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedDepartmentDailyServiceImpl.java @@ -21,16 +21,27 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.dao.stats.FactArticlePublishedDepartmentDailyDao; import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity; import com.epmet.service.stats.FactArticlePublishedDepartmentDailyService; +import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; +import java.util.Collection; + /** * 文章发布数量【部门】日统计表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-06-18 */ +@Slf4j @Service public class FactArticlePublishedDepartmentDailyServiceImpl extends BaseServiceImpl implements FactArticlePublishedDepartmentDailyService { + @Override + public boolean deleteAndInsertBatch(String customerId, String dateId, Collection values) { + int i = baseDao.deleteByDateId(customerId, dateId); + log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId,i); + this.insertBatch(values, 100); + return true; + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java index 366e167ad1..3a1c321c9c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java @@ -18,8 +18,12 @@ package com.epmet.service.voice; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; import com.epmet.entity.voice.ArticleEntity; +import java.util.Date; +import java.util.List; + /** * desc: 数据统计文章service * @@ -30,4 +34,11 @@ import com.epmet.entity.voice.ArticleEntity; */ public interface ArticleService extends BaseService { + /** + * desc:根据客户id、发布时间 获取文章总数 + * @param customerId + * @param publishDate + * @return + */ + List getAllPublishedCount(String customerId, Date publishDate); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java index f1a788fc30..27821e8a41 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java @@ -19,13 +19,20 @@ 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.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.ProjectConstant; import com.epmet.dao.voice.ArticleDao; +import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; import com.epmet.entity.voice.ArticleEntity; import com.epmet.service.voice.ArticleService; -import org.springframework.beans.factory.annotation.Autowired; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; +import java.util.Date; +import java.util.List; + /** * 项目表 * @@ -35,7 +42,12 @@ import org.springframework.stereotype.Service; @Service @DataSource(DataSourceConstant.GOV_VOICE) public class ArticleServiceImpl extends BaseServiceImpl implements ArticleService { - @Autowired - private ArticleDao articleDao; + @Override + public List getAllPublishedCount(String customerId, Date publishDate) { + if (StringUtils.isBlank(customerId) || publishDate == null){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getAllPublishedCount(customerId,publishDate, ProjectConstant.PUBLISH_TYPE_DEPT); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql index adeeac3769..f188d95e6a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql @@ -56,7 +56,7 @@ CREATE TABLE `fact_article_published_department_daily` ( `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发布文章单位所属机关ID 发布文章单位所属机关ID', - `DEPSARTMENT_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门ID', + `DEPARTMENT_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门ID', `ARTICLE_TOTAL_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章累计发文数量 文章数量', `ARTICLE_PUBLISHED_COUNT` int(11) NULL DEFAULT NULL COMMENT '当前发文数量 当前未下线的文章数量', `DATE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期ID 日期ID', diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml index c1c6c56899..8941d496fd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml @@ -8,4 +8,15 @@ updated_by, updated_time) VALUE (#{id}, #{departmentName}, #{agencyId}, #{customerId}, #{delFlag}, #{revision}, #{createdBy}, #{createdTime}, #{updatedBy}, #{updatedTime}) + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedDepartmentDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedDepartmentDailyDao.xml index 1dd50f6c6c..abe5fafc0a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedDepartmentDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedDepartmentDailyDao.xml @@ -7,7 +7,7 @@ - + @@ -22,6 +22,9 @@ + + DELETE FROM fact_article_published_department_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleDao.xml index d411b3513e..69f1ddc5e3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleDao.xml @@ -29,6 +29,23 @@ + \ 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 index 6330c003b8..4b7f1cfc9b 100644 --- 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 @@ -23,6 +23,7 @@