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/voice/ArticleGridPublishedSummaryDTO.java similarity index 96% rename from epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java rename to epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/ArticleGridPublishedSummaryDTO.java index c1bd1e7043..ec57f7d823 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/voice/ArticleGridPublishedSummaryDTO.java @@ -1,4 +1,4 @@ -package com.epmet.dto.stats; +package com.epmet.dto.voice; /** * @author jianjun liu * @email liujianjun@yunzongnet.com diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/PublisherPublishedCountDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/PublisherPublishedCountDTO.java new file mode 100644 index 0000000000..a7794e97e3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/PublisherPublishedCountDTO.java @@ -0,0 +1,44 @@ +package com.epmet.dto.voice; +/** + * @author jianjun liu + * @email liujianjun@yunzongnet.com + * @date 2020-06-17 16:43 + **/ + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:每个发布者发布的文章数 返回结果 dto + * + * @author liujianjun + * @date 2020/6/19 10:43 + */ +@Data +public class PublisherPublishedCountDTO implements Serializable { + private static final long serialVersionUID = 6755654148306711602L; + + /** + * 客户id + */ + private String customerId; + /** + * 机关id + */ + private String agencyId; + /** + * 网格Id + */ + private String gridId; + /** + * 发布者Id publish_type类型为 部门时 是部门id;类型为 机关时 是机关Id + */ + private String publisherId; + + /** + * 发布文章数 + */ + private Integer publishedCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java index 78ee2a3f11..c233fd1e1e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java @@ -31,6 +31,28 @@ public class StatsPublicityController { */ @PostMapping(value = "publicitySummaryStatsjob") public Result publicitySummaryStatsjob(Date statsDate) { - return new Result().ok(statsPublicityService.publicitySummary(statsDate)); + return new Result().ok(statsPublicityService.articlePublishedCountDayStats(statsDate)); + } + + /** + * desc:【日】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 + * @return + */ + @PostMapping(value = "tagUsedDayStatsjob") + public Result tagUsedDayStatsjob(Date statsDate) { + return new Result().ok(statsPublicityService.tagUsedDayStatsjob(statsDate)); + } + + /** + * desc:【月】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 + * @return + */ + @PostMapping(value = "tagUsedMonthStatsjob") + public Result tagUsedMonthStatsjob(Date statsDate) { + return new Result().ok(statsPublicityService.tagUsedMonthStatsjob(statsDate)); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyDailyDao.java index 9163b9a587..12569eb8cc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyDailyDao.java @@ -19,7 +19,11 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagUsedAgencyDailyEntity; +import com.epmet.entity.stats.FactTagUsedGridDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 标签【机关】日统计表 @@ -29,5 +33,15 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagUsedAgencyDailyDao extends BaseDao { - + + int deleteByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * desc:根据客户Id 和月份id 获取月的统计数 + * + * @param customerId + * @param monthId + * @return + */ + List getTagUsedCountByMonth(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyMonthlyDao.java index 74676b13e6..17ded89e6c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyMonthlyDao.java @@ -19,7 +19,11 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagUsedAgencyMonthlyEntity; +import com.epmet.entity.stats.FactTagUsedGridMonthlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 标签【机关】月统计表 @@ -29,5 +33,10 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagUsedAgencyMonthlyDao extends BaseDao { - + + List getTagUsedCountByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); + + List getTagUsedCountByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); + + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyQuarterlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyQuarterlyDao.java index 05a61832b8..9d51f34d49 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyQuarterlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyQuarterlyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagUsedAgencyQuarterlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 标签【机关】季度统计表 @@ -29,5 +30,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagUsedAgencyQuarterlyDao extends BaseDao { - + + int deleteByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyYearlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyYearlyDao.java index 83bb23460a..0d8c942e5a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyYearlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyYearlyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagUsedAgencyYearlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 标签【机关】年度统计表 @@ -29,5 +30,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagUsedAgencyYearlyDao extends BaseDao { - + + int deleteByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentDailyDao.java index d0a2bfcfe3..2c74977270 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentDailyDao.java @@ -20,6 +20,9 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagUsedDepartmentDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 标签【部门】日统计表 @@ -29,5 +32,14 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagUsedDepartmentDailyDao extends BaseDao { - + + int deleteByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * desc:获取部门月 统计数 + * @param customerId + * @param monthId + * @return + */ + List getTagUsedCountByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentMonthlyDao.java index 9f8d4efb02..9b6a3b89cb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentMonthlyDao.java @@ -20,6 +20,9 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagUsedDepartmentMonthlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 标签【部门】月统计表 @@ -29,5 +32,10 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagUsedDepartmentMonthlyDao extends BaseDao { - + + List getTagUsedCountByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); + + List getTagUsedCountByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); + + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentQuarterlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentQuarterlyDao.java index 4a0b782090..6ac52ec583 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentQuarterlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentQuarterlyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagUsedDepartmentQuarterlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 标签【部门】季度统计表 @@ -29,5 +30,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagUsedDepartmentQuarterlyDao extends BaseDao { - + + int deleteByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentYearlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentYearlyDao.java index 77e61837dc..d6908b860e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentYearlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentYearlyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagUsedDepartmentYearlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 标签【部门】年度统计表 @@ -29,5 +30,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagUsedDepartmentYearlyDao extends BaseDao { - + + int deleteByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridDailyDao.java index 1139dfe31f..423d8baea0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridDailyDao.java @@ -20,6 +20,9 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagUsedGridDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 标签【网格】日统计表 @@ -29,5 +32,15 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagUsedGridDailyDao extends BaseDao { - + + /** + * desc:根据dateId 删除数据 + * + * @param customerId + * @param dateId + * @return + */ + int deleteByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId); + + List getTagUsedCountByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridMonthlyDao.java index a9c34c0110..b8eb0d9095 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridMonthlyDao.java @@ -20,6 +20,9 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagUsedGridMonthlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 标签【网格】月统计表 @@ -29,5 +32,10 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagUsedGridMonthlyDao extends BaseDao { - + + List getTagUsedCountByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); + + List getTagUsedCountByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); + + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridQuarterlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridQuarterlyDao.java index 49f5172fbd..f23190191c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridQuarterlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridQuarterlyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagUsedGridQuarterlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 标签【网格】季度统计表 @@ -29,5 +30,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagUsedGridQuarterlyDao extends BaseDao { - + + int deleteByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridYearlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridYearlyDao.java index 218b643eb8..eb76936645 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridYearlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridYearlyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagUsedGridYearlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 标签【网格】年度统计表 @@ -29,5 +30,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagUsedGridYearlyDao extends BaseDao { - + + int deleteByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); } \ 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 2b23d16345..df01214d40 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,7 +18,7 @@ package com.epmet.dao.voice; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; +import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; import com.epmet.entity.voice.ArticleEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -44,4 +44,14 @@ public interface ArticleDao extends BaseDao { * @return */ List getAllPublishedCount(@Param("customerId") String customerId, @Param("publishDate") Date publishDate, @Param("publisherType") String publisherType); + + /** + * desc:根据客户Id 和发布时间 获取文章数据 + * + * @param customerId + * @param publishDate + * @param publisherType + * @return + */ + List getPublishedArticleByDay(@Param("customerId") String customerId, @Param("publishDate") Date publishDate, @Param("publisherType") String publisherType); } \ No newline at end of file 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 index f70feecf13..f8ff0e359b 100644 --- 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 @@ -18,7 +18,7 @@ package com.epmet.dao.voice; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; +import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; import com.epmet.entity.voice.ArticlePublishRangeEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleTagsDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleTagsDao.java new file mode 100644 index 0000000000..3fa6d061da --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleTagsDao.java @@ -0,0 +1,46 @@ +/** + * 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.entity.voice.ArticleTagsEntity; +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 ArticleTagsDao extends BaseDao { + + /** + * desc:根据客户id 创建时间 获取文章标签数据 + * + * @param customerId + * @param startTime + * @param endTime + * @return + */ + List getArticleTagsByDay(@Param("customerId") String customerId, @Param("startTime") Date startTime, @Param("endTime") Date endTime); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyMonthlyEntity.java index 1e27d21287..992db40143 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyMonthlyEntity.java @@ -70,4 +70,14 @@ public class FactTagUsedAgencyMonthlyEntity extends BaseEpmetEntity { */ private String monthId; + /** + * 季度ID + */ + private String quarterId; + + /** + * 年D + */ + private String yearId; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyQuarterlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyQuarterlyEntity.java index b68c76a874..60de929fde 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyQuarterlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyQuarterlyEntity.java @@ -70,4 +70,9 @@ public class FactTagUsedAgencyQuarterlyEntity extends BaseEpmetEntity { */ private String quarterId; + /** + * 年D + */ + private String yearId; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentMonthlyEntity.java index 29ecd87dae..d2309ee1fd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentMonthlyEntity.java @@ -70,4 +70,13 @@ public class FactTagUsedDepartmentMonthlyEntity extends BaseEpmetEntity { */ private String monthId; + /** + * 季度ID + */ + private String quarterId; + + /** + * 年D + */ + private String yearId; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentQuarterlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentQuarterlyEntity.java index ceac4e9d86..61050668a0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentQuarterlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentQuarterlyEntity.java @@ -70,4 +70,9 @@ public class FactTagUsedDepartmentQuarterlyEntity extends BaseEpmetEntity { */ private String quarterId; + /** + * 年D + */ + private String yearId; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridMonthlyEntity.java index eecc92bb6d..8315bfe68d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridMonthlyEntity.java @@ -70,4 +70,14 @@ public class FactTagUsedGridMonthlyEntity extends BaseEpmetEntity { */ private String monthId; + /** + * 季度ID + */ + private String quarterId; + + /** + * 年D + */ + private String yearId; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridQuarterlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridQuarterlyEntity.java index fbe54ea535..cf7f435b2d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridQuarterlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridQuarterlyEntity.java @@ -70,4 +70,9 @@ public class FactTagUsedGridQuarterlyEntity extends BaseEpmetEntity { */ private String quarterId; + /** + * 年D + */ + private String yearId; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyMonthlyEntity.java index 1b357bbfc4..204cd7016a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyMonthlyEntity.java @@ -70,4 +70,14 @@ public class FactTagViewedAgencyMonthlyEntity extends BaseEpmetEntity { */ private String monthId; + /** + * 季度ID + */ + private String quarterId; + + /** + * 年D + */ + private String yearId; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyQuarterlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyQuarterlyEntity.java index dadd68ae40..089be76e1d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyQuarterlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyQuarterlyEntity.java @@ -70,4 +70,9 @@ public class FactTagViewedAgencyQuarterlyEntity extends BaseEpmetEntity { */ private String quarterId; + /** + * 年D + */ + private String yearId; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridMonthlyEntity.java index 49cb7ba97c..949e60222a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridMonthlyEntity.java @@ -70,4 +70,14 @@ public class FactTagViewedGridMonthlyEntity extends BaseEpmetEntity { */ private String monthId; + /** + * 季度ID + */ + private String quarterId; + + /** + * 年D + */ + private String yearId; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridQuarterlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridQuarterlyEntity.java index e48167f458..b6b3c57a61 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridQuarterlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridQuarterlyEntity.java @@ -70,4 +70,9 @@ public class FactTagViewedGridQuarterlyEntity extends BaseEpmetEntity { */ private String quarterId; + /** + * 年D + */ + private String yearId; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleTagsEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleTagsEntity.java new file mode 100644 index 0000000000..be590e8b19 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleTagsEntity.java @@ -0,0 +1,58 @@ +/** + * 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; + +/** + * 文章标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("article_tags") +public class ArticleTagsEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 标签ID + */ + private String tagId; + + /** + * 标签名称 + */ + private String tagName; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java index 6574563a45..79fc0d24d1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java @@ -12,6 +12,27 @@ public interface StatsPublicityService { * @author: jianjun liu * email:liujianjun@git.elinkit.com.cn */ - Boolean publicitySummary(Date statsDate); + Boolean articlePublishedCountDayStats(Date statsDate); + + /** + * desc: 按日 统计每个标签被引用的使用文章数 + * + * @return: Boolean + * @date: 2020/6/17 16:11 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ + Boolean tagUsedDayStatsjob(Date statsDate); + + /** + * desc: 按月 统计每个标签被引用的使用文章数 + * + * @param + * @return: + * @date: 2020/6/19 18:44 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ + Boolean tagUsedMonthStatsjob(Date statsDate); } 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 c5dd27ec08..06eec21543 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 @@ -1,14 +1,20 @@ package com.epmet.service.impl; +import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; +import com.epmet.constant.ProjectConstant; +import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; import com.epmet.entity.stats.*; +import com.epmet.entity.voice.ArticleEntity; +import com.epmet.entity.voice.ArticleTagsEntity; 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.service.voice.ArticleTagsService; import com.epmet.util.DimIdGenerator; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -19,7 +25,9 @@ import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; +import java.util.stream.Collectors; /** * desc: 宣传能力数据统计 service @@ -49,7 +57,8 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { private DimGridService dimGridService; @Autowired private DimDepartmentService dimDepartmentService; - + @Autowired + private ArticleTagsService articleTagsService; @Autowired private ArticleService articleService; @Autowired @@ -60,19 +69,77 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { private FactArticlePublishedDepartmentDailyService factArticlePublishedDepartmentDailyService; @Autowired private FactArticlePublishedAgencyDailyService factArticlePublishedAgencyDailyService; - - + @Autowired + private FactTagUsedGridDailyService factTagUsedGridDailyService; + @Autowired + private FactTagUsedDepartmentDailyService factTagUsedDepartmentDailyService; + @Autowired + private FactTagUsedAgencyDailyService factTagUsedAgencyDailyService; + @Autowired + private FactTagUsedGridMonthlyService factTagUsedGridMonthlyService; + @Autowired + private FactTagUsedDepartmentMonthlyService factTagUsedDepartmentMonthlyService; + @Autowired + private FactTagUsedAgencyMonthlyService factTagUsedAgencyMonthlyService; + @Autowired + private FactTagUsedGridQuarterlyService factTagUsedGridQuarterlyService; + @Autowired + private FactTagUsedDepartmentQuarterlyService factTagUsedDepartmentQuarterlyService; + @Autowired + private FactTagUsedAgencyQuarterlyService factTagUsedAgencyQuarterlyService; + @Autowired + private FactTagUsedGridYearlyService factTagUsedGridYearlyService; + @Autowired + private FactTagUsedDepartmentYearlyService factTagUsedDepartmentYearlyService; + @Autowired + private FactTagUsedAgencyYearlyService factTagUsedAgencyYearlyService; @Autowired private ExecutorService executorService; @Override - public Boolean publicitySummary(Date statsDate) { + public Boolean articlePublishedCountDayStats(Date statsDate) { + //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 + if (statsDate == null) { + //当天的凌晨时间 即为今天之前的数据 + statsDate = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN); + } else { + statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); + } + DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + Date finalStatsDate = statsDate; + executorService.submit(() -> { + try { + //key:所在机关Id + Map agencySummaryMap = new HashMap<>(); + statsPublishedGridDaily(finalStatsDate, dimIdBean, customerId, agencySummaryMap); + statsPublishedDepartmentDaily(finalStatsDate, dimIdBean, customerId, agencySummaryMap); + statsPublishedAgencyDaily(finalStatsDate, dimIdBean, customerId, agencySummaryMap); + } catch (Exception e) { + log.error("articlePublishedCountDayStats exception", e); + } + }); + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() >= pageSize); + return true; + } + + @Override + public Boolean tagUsedDayStatsjob(Date statsDate) { + //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { //当天的凌晨时间 即为今天之前的数据 - statsDate = DateUtils.integrate(new Date(),DateUtils.DATE_PATTERN); - }else{ - statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate,1),DateUtils.DATE_PATTERN); + statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -1), DateUtils.DATE_PATTERN); + } else { + statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); } DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); int pageNo = 1; @@ -82,14 +149,69 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); if (!CollectionUtils.isEmpty(customerIdList)) { for (String customerId : customerIdList) { - /*executorService.submit(()->{ + Date finalStatsDate = statsDate; + executorService.submit(() -> { + //key:所在机关Id + Map agencySummaryMap = new HashMap<>(); + //统计 + statsTagUsedDaily(finalStatsDate, dimIdBean, customerId, agencySummaryMap); + }); + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() >= pageSize); + return true; + } - });*/ - //key:所在机关Id - Map agencySummaryMap = new HashMap<>(); - statsPublishedGridDaily(statsDate, dimIdBean, customerId,agencySummaryMap); - statsPublishedDepartmentDaily(statsDate, dimIdBean, customerId,agencySummaryMap); - statsPublishedAgencyDaily(statsDate, dimIdBean, customerId,agencySummaryMap); + @Override + public Boolean tagUsedMonthStatsjob(Date statsDate) { + //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 + if (statsDate == null) { + //当天的凌晨时间 即为今天之前的数据 + statsDate = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN); + } else { + statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); + } + DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + CountDownLatch countDownLatch = new CountDownLatch(1); + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + executorService.submit(() -> { + try { + statsTagUsedMonthly(dimIdBean.getMonthId(), customerId); + //statsTagUsedQuarterly(dimIdBean.getQuarterId(), customerId); + //statsTagUsedYearly(dimIdBean.getYearId(), customerId); + countDownLatch.countDown(); + } catch (Exception e) { + log.error("statsTagUsedMonthly exception", e); + } + }); + log.debug("start === statsTagUsedQuarterly "); + try { + countDownLatch.await(); + } catch (InterruptedException e) { + log.error("countDownLatch.await() interrupted", e); + } + executorService.submit(() -> { + try { + log.debug("start === statsTagUsedQuarterly "); + statsTagUsedQuarterly(dimIdBean.getQuarterId(), customerId); + } catch (Exception e) { + log.error("statsTagUsedQuarterly exception", e); + } + }); + executorService.submit(() -> { + try { + log.debug("start === statsTagUsedQuarterly "); + statsTagUsedYearly(dimIdBean.getYearId(), customerId); + } catch (Exception e) { + log.error("statsTagUsedYearly exception", e); + } + }); } } } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() >= pageSize); @@ -106,7 +228,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //转换为 需要插入的Entity Map departmentDailyEntityMap = convertDepartmentDailyEntity(departmentDTOList, dimIdBean); //获取当天的业务数据 - List publishedArticleCount = articleService.getAllDepartmentPublishedCount(customerId,DateUtils.integrate(statsDate,DateUtils.DATE_PATTERN)); + List publishedArticleCount = articleService.getAllDepartmentPublishedCount(customerId, DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN)); if (!CollectionUtils.isEmpty(publishedArticleCount)) { for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { @@ -126,6 +248,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { /** * desc:同一个机关下的数据进行类型处理 + * * @param result * @param summaryDTO */ @@ -140,23 +263,24 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { 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()); + 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, Map agencySummaryMap) { //key:所在机关Id - Map result = new HashMap<>(); + Map result = new HashMap<>(); //获取所有网格 List gridDTOList = dimGridService.getGridListByCustomerId(customerId); if (CollectionUtils.isEmpty(gridDTOList)) { @@ -170,13 +294,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { List publishedArticleCount = articleService.getAllGridPublishedCount(customerId, statsDate); if (!CollectionUtils.isEmpty(publishedArticleCount)) { for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { - FactArticlePublishedGridDailyEntity gridDailyEntities = gridDailyEntityMap.get(summaryDTO.getGridId()); - if (gridDailyEntities == null) { + FactArticlePublishedGridDailyEntity gridDailyEntity = gridDailyEntityMap.get(summaryDTO.getGridId()); + if (gridDailyEntity == null) { log.error("publicitySummary getAllGridPublishedCount gridId:{} not exist in dimGrid", summaryDTO.getGridId()); continue; } - gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount()); - gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); + gridDailyEntity.setArticleTotalCount(summaryDTO.getArticleTotalCount()); + gridDailyEntity.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); //同一个机关下数据累加 buildAgencySummaryData(agencySummaryMap, summaryDTO); } @@ -194,8 +318,8 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //转换为 需要插入的Entity Map agencyDailyEntityMap = convertAgencyDailyEntity(agencyDTOList, dimIdBean); //获取当天的业务数据 - List publishedArticleCount = articleService.getAllAgencyPublishedCount(customerId,statsDate); - + List publishedArticleCount = articleService.getAllAgencyPublishedCount(customerId, statsDate); + Map haveDataAgencyDailyMap = new HashMap<>(); if (!CollectionUtils.isEmpty(publishedArticleCount)) { for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { FactArticlePublishedAgencyDailyEntity gridDailyEntities = agencyDailyEntityMap.get(summaryDTO.getPublisherId()); @@ -207,36 +331,220 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); //同一个机关下数据累加 buildAgencySummaryData(agencySummaryMap, summaryDTO); + haveDataAgencyDailyMap.put(summaryDTO.getAgencyId(), gridDailyEntities); } } //数据向上级机关添加 - if (!CollectionUtils.isEmpty(agencySummaryMap)){ - for (Map.Entry entry : agencySummaryMap.entrySet()) { + if (!CollectionUtils.isEmpty(haveDataAgencyDailyMap)) { + for (Map.Entry entry : haveDataAgencyDailyMap.entrySet()) { String agencyId = entry.getKey(); - ArticleGridPublishedSummaryDTO summary = entry.getValue(); + FactArticlePublishedAgencyDailyEntity summary = entry.getValue(); FactArticlePublishedAgencyDailyEntity dailyEntity = agencyDailyEntityMap.get(agencyId); if (dailyEntity == null) { log.error("publicitySummary bizData agencyId:{} not exist in dimAgency", agencyId); continue; } - setData2ParentAgency(agencyDailyEntityMap,summary, dailyEntity); + setPublishedData2ParentAgency(agencyDailyEntityMap, summary, dailyEntity); } } boolean b = factArticlePublishedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), agencyDailyEntityMap.values()); } - private void setData2ParentAgency(Map agencyDailyEntityMap, ArticleGridPublishedSummaryDTO agencySummary, FactArticlePublishedAgencyDailyEntity summary) { + /** + * desc:按日统计 网格纬度的 标签被使用的次数 + * + * @param statsDate + * @param dimIdBean + * @param customerId + * @param agencySummaryMap + */ + private void statsTagUsedDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { + //1.业务数据来源 发布时间为统计时间的 + // 因为一个客户的发布文章数在同一天不会特别的多,所以以客户为单位查询今天发布的所有带有标签的文章 根据发布单位类型进行拆分 + // 1.1查出今天所有的文章标签 根据网格Id + // 1.2 + //获取所有网格 + List agencyDTOList = dimAgencyService.getAgencyListByCustomerId(customerId); + if (CollectionUtils.isEmpty(agencyDTOList)) { + log.warn("publicitySummary getAgencyListByCustomerId return empty,customerId:{}", customerId); + return; + } + //转换为 需要插入的Entity + Map dimAgencyEntityMap = agencyDTOList.stream().collect(Collectors.toMap(DimAgencyEntity::getId, o -> o)); + //转换为 需要插入的Entity key gridId_tagId + Map tagUsedGridDailyMap = new HashMap<>(); + Map tagUsedDeptDailyMap = new HashMap<>(); + Map tagUsedAgencyDailyMap = new HashMap<>(); + //获取当天的业务数据 + //1获取文章及机关id,网格Id + List publishedArticleList = articleService.getPublishedArticleByPublishTime(customerId, statsDate); + if (CollectionUtils.isEmpty(publishedArticleList)) { + return; + } + //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); + //2 获取文章标签 + List articleTagsList = articleTagsService.getArticleTagsByCreateTime(customerId, startTime, endTime); + if (CollectionUtils.isEmpty(articleTagsList)) { + log.error("publicitySummary getArticleTagsByCreateTime customerId:{} have not articleTags,publishedArticleList:{}", customerId, JSON.toJSONString(publishedArticleList)); + return; + } + //tagId + for (ArticleTagsEntity tagEntity : articleTagsList) { + ArticleEntity articleEntity = articleMap.get(tagEntity.getArticleId()); + if (articleEntity == null) { + log.error("publicitySummary articleMap articleId:{} ", tagEntity.getArticleId()); + return; + } + DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(articleEntity.getOrgId()); + convertTagUsedAgencyDailyEntity(dimAgencyEntity.getPid(), tagUsedAgencyDailyMap, articleEntity, tagEntity, dimIdBean); + switch (articleEntity.getPublisherType()) { + case ProjectConstant.PUBLISHER_TYPE_GRID: + convertTagUsedGridDailyEntity(tagUsedGridDailyMap, articleEntity, tagEntity, dimIdBean); + break; + case ProjectConstant.PUBLISHER_TYPE_DEPT: + convertTagUsedDepartmentDailyEntity(tagUsedDeptDailyMap, articleEntity, tagEntity, dimIdBean); + break; + } + convertTagUsedGridDailyEntity(tagUsedGridDailyMap, articleEntity, tagEntity, dimIdBean); + } + + factTagUsedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagUsedGridDailyMap.values()); + factTagUsedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagUsedDeptDailyMap.values()); + //向上级机关递归添加 数据 + Map finalTagUsedAgencyDailyMap = new HashMap<>(); + finalTagUsedAgencyDailyMap.putAll(tagUsedAgencyDailyMap); + for (Map.Entry entry : tagUsedAgencyDailyMap.entrySet()) { + String agencyId = entry.getKey(); + FactTagUsedAgencyDailyEntity currentEntity = entry.getValue(); + DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(currentEntity.getAgencyId()); + if (dimAgencyEntity == null) { + log.error("dimAgencyEntityMap bizData agencyId:{} not exist in dimAgency", agencyId); + continue; + } + setTagUsedData2ParentAgency(dimAgencyEntityMap, finalTagUsedAgencyDailyMap, currentEntity, dimIdBean); + } + factTagUsedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), finalTagUsedAgencyDailyMap.values()); + } + + /** + * desc:按月统计 标签使用数 + * + * @param monthId + * @param customerId + */ + private void statsTagUsedMonthly(String monthId, String customerId) { + List gridDailyList = factTagUsedGridDailyService.getTagUsedCountByMonth(customerId, monthId); + if (!CollectionUtils.isEmpty(gridDailyList)) { + List gridMonthlyList = ConvertUtils.sourceToTarget(gridDailyList, FactTagUsedGridMonthlyEntity.class); + factTagUsedGridMonthlyService.deleteAndInsertByMonthId(customerId,monthId,gridMonthlyList); + } + List deptDailyList = factTagUsedDepartmentDailyService.getTagUsedCountByMonth(customerId, monthId); + if (!CollectionUtils.isEmpty(deptDailyList)) { + List gridMonthlyList = ConvertUtils.sourceToTarget(deptDailyList, FactTagUsedDepartmentMonthlyEntity.class); + factTagUsedDepartmentMonthlyService.deleteAndInsertByMonthId(customerId,monthId,gridMonthlyList); + } + List agencyDailyList = factTagUsedAgencyDailyService.getTagUsedCountByMonth(customerId, monthId); + if (!CollectionUtils.isEmpty(agencyDailyList)) { + List agencyMonthlyList = ConvertUtils.sourceToTarget(agencyDailyList, FactTagUsedAgencyMonthlyEntity.class); + factTagUsedAgencyMonthlyService.deleteAndInsertByMonthId(customerId,monthId,(agencyMonthlyList)); + } + } + + /** + * desc:按季统计 标签使用数 + * + * @param quarterId + * @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); + factTagUsedGridQuarterlyService.deleteAndInsertByQuarterId(customerId,quarterId,gridQuarterlyList); + } + List deptMonthlyList = factTagUsedDepartmentMonthlyService.getTagUsedCountByQuarterId(customerId, quarterId); + if (!CollectionUtils.isEmpty(deptMonthlyList)) { + List deptQuarterlyList = ConvertUtils.sourceToTarget(deptMonthlyList, FactTagUsedDepartmentQuarterlyEntity.class); + factTagUsedDepartmentQuarterlyService.deleteAndInsertByQuarterId(customerId,quarterId,deptQuarterlyList); + } + //TODO 机关的需要添加 pid + List agencyMonthlyList = factTagUsedAgencyMonthlyService.getTagUsedCountByQuarterId(customerId, quarterId); + if (!CollectionUtils.isEmpty(agencyMonthlyList)) { + List agencyQuarterlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagUsedAgencyQuarterlyEntity.class); + factTagUsedAgencyQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId,agencyQuarterlyList); + } + } + + /** + * desc:按年统计 标签使用数 + * + * @param yearId + * @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); + //TODO 改为一个方法 添加事务 + factTagUsedGridYearlyService.deleteByYearId(customerId, yearId); + factTagUsedGridYearlyService.insertBatch(gridYearlyList); + } + List deptMonthlyList = factTagUsedDepartmentMonthlyService.getTagUsedCountByYearId(customerId, yearId); + if (!CollectionUtils.isEmpty(deptMonthlyList)) { + List gridYearlyList = ConvertUtils.sourceToTarget(deptMonthlyList, FactTagUsedDepartmentYearlyEntity.class); + factTagUsedDepartmentYearlyService.deleteByYearId(customerId, yearId); + factTagUsedDepartmentYearlyService.insertBatch(gridYearlyList); + } + List agencyMonthlyList = factTagUsedAgencyMonthlyService.getTagUsedCountByYearId(customerId, yearId); + if (!CollectionUtils.isEmpty(agencyMonthlyList)) { + List agencyYearlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagUsedAgencyYearlyEntity.class); + factTagUsedAgencyYearlyService.deleteByYearId(customerId, yearId); + factTagUsedAgencyYearlyService.insertBatch(agencyYearlyList); + } + } + + private void setTagUsedData2ParentAgency(Map dimAgencyEntityMap, Map agencyDailyEntityMap, FactTagUsedAgencyDailyEntity currentEntity, DimIdGenerator.DimIdBean dimIdBean) { + String pid = currentEntity.getPid(); + String tagId = currentEntity.getTagId(); + String key = pid.concat(StrConstant.UNDER_LINE).concat(tagId); + FactTagUsedAgencyDailyEntity parentAgencyDailyEntity = agencyDailyEntityMap.get(key); + DimAgencyEntity currentDimAgency = dimAgencyEntityMap.get(pid); + if (currentDimAgency == null) { + return; + } + if (parentAgencyDailyEntity == null) { + parentAgencyDailyEntity = ConvertUtils.sourceToTarget(dimIdBean, FactTagUsedAgencyDailyEntity.class); + parentAgencyDailyEntity.setCustomerId(currentEntity.getCustomerId()); + parentAgencyDailyEntity.setPid(currentDimAgency.getPid()); + parentAgencyDailyEntity.setAgencyId(currentDimAgency.getId()); + parentAgencyDailyEntity.setTagId(currentEntity.getTagId()); + parentAgencyDailyEntity.setTagName(currentEntity.getTagName()); + parentAgencyDailyEntity.setUsedCount(currentEntity.getUsedCount()); + agencyDailyEntityMap.put(key, parentAgencyDailyEntity); + } else { + parentAgencyDailyEntity.setUsedCount(parentAgencyDailyEntity.getUsedCount() + currentEntity.getUsedCount()); + } + pid = currentDimAgency.getPid(); + if (!NumConstant.ZERO_STR.equals(pid)) { + setTagUsedData2ParentAgency(dimAgencyEntityMap, agencyDailyEntityMap, parentAgencyDailyEntity, dimIdBean); + } + } + + private void setPublishedData2ParentAgency(Map agencyDailyEntityMap, FactArticlePublishedAgencyDailyEntity agencySummary, FactArticlePublishedAgencyDailyEntity summary) { String pid = summary.getPid(); FactArticlePublishedAgencyDailyEntity parentAgency = agencyDailyEntityMap.get(pid); - if (parentAgency == null){ + if (parentAgency == null) { return; } - parentAgency.setArticleTotalCount(parentAgency.getArticleTotalCount()+agencySummary.getArticleTotalCount()); - parentAgency.setArticlePublishedCount(parentAgency.getArticlePublishedCount()+agencySummary.getArticlePublishedCount()); + parentAgency.setArticleTotalCount(parentAgency.getArticleTotalCount() + agencySummary.getArticleTotalCount()); + parentAgency.setArticlePublishedCount(parentAgency.getArticlePublishedCount() + agencySummary.getArticlePublishedCount()); pid = parentAgency.getPid(); - if (!NumConstant.ZERO_STR.equals(pid)){ - setData2ParentAgency(agencyDailyEntityMap, agencySummary,parentAgency); + if (!NumConstant.ZERO_STR.equals(pid)) { + setPublishedData2ParentAgency(agencyDailyEntityMap, agencySummary, parentAgency); } } @@ -302,4 +610,84 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { }); return result; } + + + /** + * desc:将网格对象构建为 tagUsedGridDaily 对象 + * + * @param dimGridEntities + * @param dimIdBean + * @return + */ + private Map convertTagUsedGridDailyEntity(List dimGridEntities, DimIdGenerator.DimIdBean dimIdBean) { + Map result = new HashMap<>(); + dimGridEntities.forEach(dimGridEntity -> { + FactTagUsedGridDailyEntity entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagUsedGridDailyEntity.class); + entity.setCustomerId(dimGridEntity.getCustomerId()); + entity.setAgencyId(dimGridEntity.getAgencyId()); + entity.setGridId(dimGridEntity.getId()); + entity.setTagId(""); + entity.setTagName(""); + entity.setUsedCount(0); + result.put(dimGridEntity.getId(), entity); + }); + return result; + } + + private void convertTagUsedGridDailyEntity(Map result, ArticleEntity articleEntity, ArticleTagsEntity tagEntity, DimIdGenerator.DimIdBean dimIdBean) { + String gridId = articleEntity.getPublisherId(); + String tagId = tagEntity.getTagId(); + String key = gridId.concat(StrConstant.UNDER_LINE).concat(tagId); + FactTagUsedGridDailyEntity entity = result.get(key); + if (entity == null) { + entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagUsedGridDailyEntity.class); + entity.setCustomerId(articleEntity.getCustomerId()); + entity.setAgencyId(articleEntity.getOrgId()); + entity.setGridId(gridId); + entity.setTagId(tagId); + entity.setTagName(tagEntity.getTagName()); + entity.setUsedCount(1); + result.put(key, entity); + } else { + entity.setUsedCount(entity.getUsedCount() + 1); + } + } + + private void convertTagUsedDepartmentDailyEntity(Map result, ArticleEntity articleEntity, ArticleTagsEntity tagEntity, DimIdGenerator.DimIdBean dimIdBean) { + String publisherId = articleEntity.getPublisherId(); + String tagId = tagEntity.getTagId(); + String key = publisherId.concat(StrConstant.UNDER_LINE).concat(tagId); + FactTagUsedDepartmentDailyEntity entity = result.get(key); + if (entity == null) { + entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagUsedDepartmentDailyEntity.class); + entity.setCustomerId(articleEntity.getCustomerId()); + entity.setAgencyId(articleEntity.getOrgId()); + entity.setDepartmentId(publisherId); + entity.setTagId(tagId); + entity.setTagName(tagEntity.getTagName()); + entity.setUsedCount(1); + result.put(key, entity); + } else { + entity.setUsedCount(entity.getUsedCount() + 1); + } + } + + private void convertTagUsedAgencyDailyEntity(String pid, Map result, ArticleEntity articleEntity, ArticleTagsEntity tagEntity, DimIdGenerator.DimIdBean dimIdBean) { + String publisherId = articleEntity.getPublisherId(); + String tagId = tagEntity.getTagId(); + String key = publisherId.concat(StrConstant.UNDER_LINE).concat(tagId); + FactTagUsedAgencyDailyEntity entity = result.get(key); + if (entity == null) { + entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagUsedAgencyDailyEntity.class); + entity.setPid(pid); + entity.setCustomerId(articleEntity.getCustomerId()); + entity.setAgencyId(publisherId); + entity.setTagId(tagId); + entity.setTagName(tagEntity.getTagName()); + entity.setUsedCount(1); + result.put(key, entity); + } else { + entity.setUsedCount(entity.getUsedCount() + 1); + } + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyDailyService.java new file mode 100644 index 0000000000..1dfa4bd1f3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyDailyService.java @@ -0,0 +1,50 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedAgencyDailyEntity; +import com.epmet.entity.stats.FactTagUsedGridDailyEntity; + +import java.util.Collection; +import java.util.List; + +/** + * 标签【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedAgencyDailyService extends BaseService { + /** + * desc:删除并插入数据 + * @param customerId + * @param dateId + * @param values + * @return + */ + boolean deleteAndInsertBatch(String customerId, String dateId, Collection values); + + /** + * desc:根据月份获取 机关汇总数据 + * @param customerId + * @param monthId + * @return + */ + List getTagUsedCountByMonth(String customerId, String monthId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyMonthlyService.java new file mode 100644 index 0000000000..98568ee385 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyMonthlyService.java @@ -0,0 +1,39 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedAgencyMonthlyEntity; +import com.epmet.entity.stats.FactTagUsedGridMonthlyEntity; + +import java.util.List; + +/** + * 标签【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedAgencyMonthlyService extends BaseService { + + List getTagUsedCountByYearId(String customerId, String monthId); + + List getTagUsedCountByQuarterId(String customerId, String quarterId); + + Boolean deleteAndInsertByMonthId(String customerId, String monthId, List agencyMonthlyList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyQuarterlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyQuarterlyService.java new file mode 100644 index 0000000000..81c04f9735 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyQuarterlyService.java @@ -0,0 +1,35 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedAgencyQuarterlyEntity; + +import java.util.List; + +/** + * 标签【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedAgencyQuarterlyService extends BaseService { + + + boolean deleteAndInsertByQuarterId(String customerId, String quarterId, List agencyQuarterlyList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyYearlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyYearlyService.java new file mode 100644 index 0000000000..c3102ab786 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyYearlyService.java @@ -0,0 +1,33 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedAgencyYearlyEntity; + +/** + * 标签【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedAgencyYearlyService extends BaseService { + + int deleteByYearId(String customerId,String yearId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentDailyService.java new file mode 100644 index 0000000000..c13158859e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentDailyService.java @@ -0,0 +1,49 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedDepartmentDailyEntity; + +import java.util.Collection; +import java.util.List; + +/** + * 标签【部门】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedDepartmentDailyService extends BaseService { + /** + * desc:删除并插入数据 + * @param customerId + * @param dateId + * @param values + * @return + */ + boolean deleteAndInsertBatch(String customerId, String dateId, Collection values); + + /** + * desc:根据客户Id,月份Id 按照部门Id 标签Id分组 + * @param customerId + * @param monthId + * @return + */ + List getTagUsedCountByMonth(String customerId, String monthId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentMonthlyService.java new file mode 100644 index 0000000000..3eae455daa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentMonthlyService.java @@ -0,0 +1,38 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedDepartmentMonthlyEntity; + +import java.util.List; + +/** + * 标签【部门】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedDepartmentMonthlyService extends BaseService { + + List getTagUsedCountByYearId(String customerId, String monthId); + + List getTagUsedCountByQuarterId(String customerId, String quarterId); + + Boolean deleteAndInsertByMonthId(String customerId, String monthId, List gridMonthlyList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentQuarterlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentQuarterlyService.java new file mode 100644 index 0000000000..849a7c3d4e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentQuarterlyService.java @@ -0,0 +1,35 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedDepartmentQuarterlyEntity; + +import java.util.List; + +/** + * 标签【部门】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedDepartmentQuarterlyService extends BaseService { + + + Boolean deleteAndInsertByQuarterId(String customerId, String quarterId, List deptQuarterlyList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentYearlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentYearlyService.java new file mode 100644 index 0000000000..0e5e152fa6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentYearlyService.java @@ -0,0 +1,33 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedDepartmentYearlyEntity; + +/** + * 标签【部门】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedDepartmentYearlyService extends BaseService { + + + Integer deleteByYearId(String customerId, String yearId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridDailyService.java new file mode 100644 index 0000000000..b86c537b27 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridDailyService.java @@ -0,0 +1,50 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedGridDailyEntity; + +import java.util.Collection; +import java.util.List; + +/** + * 标签【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedGridDailyService extends BaseService { + + /** + * desc:删除并插入数据 + * @param customerId + * @param dateId + * @param values + * @return + */ + boolean deleteAndInsertBatch(String customerId, String dateId, Collection values); + + /** + * desc:根据客户Id 获取网格 某月数据,按照网格分组 + * @param customerId + * @param monthId + * @return + */ + List getTagUsedCountByMonth(String customerId, String monthId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridMonthlyService.java new file mode 100644 index 0000000000..36917fcba2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridMonthlyService.java @@ -0,0 +1,38 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedGridMonthlyEntity; + +import java.util.List; + +/** + * 标签【网格】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedGridMonthlyService extends BaseService { + + List getTagUsedCountByYearId(String customerId, String monthId); + + List getTagUsedCountByQuarterId(String customerId, String quarterId); + + Boolean deleteAndInsertByMonthId(String customerId, String monthId, List gridMonthlyList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridQuarterlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridQuarterlyService.java new file mode 100644 index 0000000000..468c28a2de --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridQuarterlyService.java @@ -0,0 +1,34 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedGridQuarterlyEntity; + +import java.util.List; + +/** + * 标签【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedGridQuarterlyService extends BaseService { + + Boolean deleteAndInsertByQuarterId(String customerId, String quarterId, List gridQuarterlyList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridYearlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridYearlyService.java new file mode 100644 index 0000000000..f9f5b35510 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridYearlyService.java @@ -0,0 +1,32 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedGridYearlyEntity; + +/** + * 标签【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedGridYearlyService extends BaseService { + + Integer deleteByYearId(String customerId, String yearId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyDailyService.java new file mode 100644 index 0000000000..a2b2ca57e7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyDailyService.java @@ -0,0 +1,32 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagViewedAgencyDailyEntity; + +/** + * 文章引用标签阅读数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagViewedAgencyDailyService extends BaseService { + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyMonthlyService.java new file mode 100644 index 0000000000..1838e6dc72 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyMonthlyService.java @@ -0,0 +1,31 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagViewedAgencyMonthlyEntity; + +/** + * 文章引用标签阅读数量【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagViewedAgencyMonthlyService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyQuarterlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyQuarterlyService.java new file mode 100644 index 0000000000..ef86491926 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyQuarterlyService.java @@ -0,0 +1,31 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagViewedAgencyQuarterlyEntity; + +/** + * 文章引用标签阅读数量【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagViewedAgencyQuarterlyService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyYearlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyYearlyService.java new file mode 100644 index 0000000000..2bf9bc345e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyYearlyService.java @@ -0,0 +1,32 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagViewedAgencyYearlyEntity; + +/** + * 文章引用标签阅读数量【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagViewedAgencyYearlyService extends BaseService { + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridDailyService.java new file mode 100644 index 0000000000..4b07728ae9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridDailyService.java @@ -0,0 +1,31 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagViewedGridDailyEntity; + +/** + * 文章引用标签阅读数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagViewedGridDailyService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridMonthlyService.java new file mode 100644 index 0000000000..149364fc8d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridMonthlyService.java @@ -0,0 +1,31 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagViewedGridMonthlyEntity; + +/** + * 文章引用标签阅读数量【网格】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagViewedGridMonthlyService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridQuarterlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridQuarterlyService.java new file mode 100644 index 0000000000..481bed7ee6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridQuarterlyService.java @@ -0,0 +1,31 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagViewedGridQuarterlyEntity; + +/** + * 文章引用标签阅读数量【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagViewedGridQuarterlyService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridYearlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridYearlyService.java new file mode 100644 index 0000000000..a62c431a0e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridYearlyService.java @@ -0,0 +1,31 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagViewedGridYearlyEntity; + +/** + * 文章引用标签阅读数量【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagViewedGridYearlyService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java index 601d8110a9..48d8bbe0f7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java @@ -24,6 +24,7 @@ import com.epmet.service.stats.FactArticlePublishedAgencyDailyService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import java.util.Collection; @@ -41,6 +42,9 @@ public class FactArticlePublishedAgencyDailyServiceImpl extends BaseServiceImpl< @Override @Transactional(rollbackFor = Exception.class) public boolean deleteAndInsertBatch(String customerId, String dateId, Collection values) { + if (CollectionUtils.isEmpty(values)){ + return false; + } int i = baseDao.deleteByDateId(customerId, dateId); log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId,i); this.insertBatch(values, 100); 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 cf40d35c1e..6f9e172dce 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 @@ -23,6 +23,7 @@ import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity; import com.epmet.service.stats.FactArticlePublishedDepartmentDailyService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import java.util.Collection; @@ -39,6 +40,9 @@ public class FactArticlePublishedDepartmentDailyServiceImpl extends BaseServiceI @Override public boolean deleteAndInsertBatch(String customerId, String dateId, Collection values) { + if (CollectionUtils.isEmpty(values)){ + return false; + } int i = baseDao.deleteByDateId(customerId, dateId); log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId,i); this.insertBatch(values, 100); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedGridDailyServiceImpl.java index 38688c191a..c13a282916 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedGridDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedGridDailyServiceImpl.java @@ -28,6 +28,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import java.util.Collection; import java.util.List; @@ -45,18 +46,21 @@ public class FactArticlePublishedGridDailyServiceImpl extends BaseServiceImpl getByBeforeDay(String customerId, String dateId) { - log.debug("getByBeforeDay param customerId:{},dateId:{}",customerId,dateId); - if (StringUtils.isBlank(customerId) || StringUtils.isBlank(dateId)){ - throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + log.debug("getByBeforeDay param customerId:{},dateId:{}", customerId, dateId); + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(dateId)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); } - return baseDao.getByBeforeDay(customerId,dateId); + return baseDao.getByBeforeDay(customerId, dateId); } @Override @Transactional(rollbackFor = Exception.class) - public boolean deleteAndInsertBatch(String customerId,String dateId, Collection values) { + public boolean deleteAndInsertBatch(String customerId, String dateId, Collection values) { + if (CollectionUtils.isEmpty(values)) { + return false; + } int i = baseDao.deleteByDateId(customerId, dateId); - log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId,i); + log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId, i); this.insertBatch(values, 100); return true; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..97961d6b0b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyDailyServiceImpl.java @@ -0,0 +1,65 @@ +/** + * 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.stats.impl; + +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.dao.stats.FactTagUsedAgencyDailyDao; +import com.epmet.entity.stats.FactTagUsedAgencyDailyEntity; +import com.epmet.entity.stats.FactTagUsedGridDailyEntity; +import com.epmet.service.stats.FactTagUsedAgencyDailyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.Collection; +import java.util.List; + +/** + * 标签【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactTagUsedAgencyDailyServiceImpl extends BaseServiceImpl implements FactTagUsedAgencyDailyService { + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean deleteAndInsertBatch(String customerId, String dateId, Collection values) { + if (CollectionUtils.isEmpty(values)){ + return false; + } + int i = baseDao.deleteByDateId(customerId, dateId); + log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId, i); + this.insertBatch(values, 100); + return true; + } + + @Override + public List getTagUsedCountByMonth(String customerId, String monthId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByMonth(customerId,monthId); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyMonthlyServiceImpl.java new file mode 100644 index 0000000000..eb54c6b93b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyMonthlyServiceImpl.java @@ -0,0 +1,70 @@ +/** + * 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.stats.impl; + +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.dao.stats.FactTagUsedAgencyMonthlyDao; +import com.epmet.entity.stats.FactTagUsedAgencyMonthlyEntity; +import com.epmet.entity.stats.FactTagUsedGridMonthlyEntity; +import com.epmet.service.stats.FactTagUsedAgencyMonthlyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 标签【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactTagUsedAgencyMonthlyServiceImpl extends BaseServiceImpl implements FactTagUsedAgencyMonthlyService { + + @Override + public List getTagUsedCountByYearId(String customerId, String monthId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByYearId(customerId,monthId); + } + + @Override + public List getTagUsedCountByQuarterId(String customerId, String quarterId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(quarterId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByQuarterId(customerId,quarterId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean deleteAndInsertByMonthId(String customerId, String monthId, List agencyMonthlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId) || CollectionUtils.isEmpty(agencyMonthlyList)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByMonthId(customerId,monthId); + return this.insertBatch(agencyMonthlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyQuarterlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyQuarterlyServiceImpl.java new file mode 100644 index 0000000000..ec83b4b9b6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyQuarterlyServiceImpl.java @@ -0,0 +1,53 @@ +/** + * 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.stats.impl; + +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.dao.stats.FactTagUsedAgencyQuarterlyDao; +import com.epmet.entity.stats.FactTagUsedAgencyQuarterlyEntity; +import com.epmet.service.stats.FactTagUsedAgencyQuarterlyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 标签【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactTagUsedAgencyQuarterlyServiceImpl extends BaseServiceImpl implements FactTagUsedAgencyQuarterlyService { + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean deleteAndInsertByQuarterId(String customerId, String quarterId, List agencyQuarterlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(quarterId) || CollectionUtils.isEmpty(agencyQuarterlyList)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByQuarterId(customerId,quarterId); + return this.insertBatch(agencyQuarterlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyYearlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyYearlyServiceImpl.java new file mode 100644 index 0000000000..ebe9603a35 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyYearlyServiceImpl.java @@ -0,0 +1,47 @@ +/** + * 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.stats.impl; + +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.dao.stats.FactTagUsedAgencyYearlyDao; +import com.epmet.entity.stats.FactTagUsedAgencyYearlyEntity; +import com.epmet.service.stats.FactTagUsedAgencyYearlyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +/** + * 标签【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactTagUsedAgencyYearlyServiceImpl extends BaseServiceImpl implements FactTagUsedAgencyYearlyService { + + @Override + public int deleteByYearId(String customerId, String yearId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.deleteByYearId(customerId,yearId); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentDailyServiceImpl.java new file mode 100644 index 0000000000..f88f1f330a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentDailyServiceImpl.java @@ -0,0 +1,64 @@ +/** + * 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.stats.impl; + +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.dao.stats.FactTagUsedDepartmentDailyDao; +import com.epmet.entity.stats.FactTagUsedDepartmentDailyEntity; +import com.epmet.service.stats.FactTagUsedDepartmentDailyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.Collection; +import java.util.List; + +/** + * 标签【部门】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactTagUsedDepartmentDailyServiceImpl extends BaseServiceImpl implements FactTagUsedDepartmentDailyService { + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean deleteAndInsertBatch(String customerId, String dateId, Collection values) { + if (CollectionUtils.isEmpty(values)){ + return false; + } + int i = baseDao.deleteByDateId(customerId, dateId); + log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId,i); + this.insertBatch(values, 100); + return true; + } + + @Override + public List getTagUsedCountByMonth(String customerId, String monthId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByMonthId(customerId,monthId); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentMonthlyServiceImpl.java new file mode 100644 index 0000000000..e0411038be --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentMonthlyServiceImpl.java @@ -0,0 +1,70 @@ +/** + * 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.stats.impl; + +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.dao.stats.FactTagUsedDepartmentMonthlyDao; +import com.epmet.entity.stats.FactTagUsedDepartmentMonthlyEntity; +import com.epmet.service.stats.FactTagUsedDepartmentMonthlyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 标签【部门】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactTagUsedDepartmentMonthlyServiceImpl extends BaseServiceImpl implements FactTagUsedDepartmentMonthlyService { + + + @Override + public List getTagUsedCountByYearId(String customerId, String yearId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByYearId(customerId,yearId); + } + + @Override + public List getTagUsedCountByQuarterId(String customerId, String quarterId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(quarterId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByQuarterId(customerId,quarterId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean deleteAndInsertByMonthId(String customerId, String monthId, List gridMonthlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId) || CollectionUtils.isEmpty(gridMonthlyList)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByMonthId(customerId,monthId); + return this.insertBatch(gridMonthlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentQuarterlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentQuarterlyServiceImpl.java new file mode 100644 index 0000000000..bb51750412 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentQuarterlyServiceImpl.java @@ -0,0 +1,51 @@ +/** + * 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.stats.impl; + +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.dao.stats.FactTagUsedDepartmentQuarterlyDao; +import com.epmet.entity.stats.FactTagUsedDepartmentQuarterlyEntity; +import com.epmet.service.stats.FactTagUsedDepartmentQuarterlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 标签【部门】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Service +public class FactTagUsedDepartmentQuarterlyServiceImpl extends BaseServiceImpl implements FactTagUsedDepartmentQuarterlyService { + + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean deleteAndInsertByQuarterId(String customerId, String quarterId, List deptQuarterlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(quarterId) || CollectionUtils.isEmpty(deptQuarterlyList)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByQuarterId(customerId,quarterId); + return this.insertBatch(deptQuarterlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentYearlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentYearlyServiceImpl.java new file mode 100644 index 0000000000..d80eb5102c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentYearlyServiceImpl.java @@ -0,0 +1,47 @@ +/** + * 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.stats.impl; + +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.dao.stats.FactTagUsedDepartmentYearlyDao; +import com.epmet.entity.stats.FactTagUsedDepartmentYearlyEntity; +import com.epmet.service.stats.FactTagUsedDepartmentYearlyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +/** + * 标签【部门】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactTagUsedDepartmentYearlyServiceImpl extends BaseServiceImpl implements FactTagUsedDepartmentYearlyService { + + @Override + public Integer deleteByYearId(String customerId, String yearId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.deleteByYearId(customerId,yearId); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridDailyServiceImpl.java new file mode 100644 index 0000000000..95081992f2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridDailyServiceImpl.java @@ -0,0 +1,65 @@ +/** + * 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.stats.impl; + +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.dao.stats.FactTagUsedGridDailyDao; +import com.epmet.entity.stats.FactTagUsedGridDailyEntity; +import com.epmet.service.stats.FactTagUsedGridDailyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.Collection; +import java.util.List; + +/** + * 标签【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactTagUsedGridDailyServiceImpl extends BaseServiceImpl implements FactTagUsedGridDailyService { + + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean deleteAndInsertBatch(String customerId, String dateId, Collection values) { + if (CollectionUtils.isEmpty(values)){ + return false; + } + int i = baseDao.deleteByDateId(customerId, dateId); + log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId,i); + this.insertBatch(values, 100); + return true; + } + + @Override + public List getTagUsedCountByMonth(String customerId, String monthId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByMonthId(customerId,monthId); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridMonthlyServiceImpl.java new file mode 100644 index 0000000000..05dc9a8942 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridMonthlyServiceImpl.java @@ -0,0 +1,67 @@ +/** + * 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.stats.impl; + +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.dao.stats.FactTagUsedGridMonthlyDao; +import com.epmet.entity.stats.FactTagUsedGridMonthlyEntity; +import com.epmet.service.stats.FactTagUsedGridMonthlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 标签【网格】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Service +public class FactTagUsedGridMonthlyServiceImpl extends BaseServiceImpl implements FactTagUsedGridMonthlyService { + + @Override + public List getTagUsedCountByYearId(String customerId, String yearId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByYearId(customerId,yearId); + } + + @Override + public List getTagUsedCountByQuarterId(String customerId, String quarterId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(quarterId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByQuarterId(customerId,quarterId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean deleteAndInsertByMonthId(String customerId, String monthId, List gridMonthlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId) || CollectionUtils.isEmpty(gridMonthlyList)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByMonthId(customerId,monthId); + return this.insertBatch(gridMonthlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridQuarterlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridQuarterlyServiceImpl.java new file mode 100644 index 0000000000..4e6bf21e2c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridQuarterlyServiceImpl.java @@ -0,0 +1,52 @@ +/** + * 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.stats.impl; + +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.dao.stats.FactTagUsedGridQuarterlyDao; +import com.epmet.entity.stats.FactTagUsedGridQuarterlyEntity; +import com.epmet.service.stats.FactTagUsedGridQuarterlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 标签【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Service +public class FactTagUsedGridQuarterlyServiceImpl extends BaseServiceImpl implements FactTagUsedGridQuarterlyService { + + + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean deleteAndInsertByQuarterId(String customerId, String quarterId, List gridQuarterlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(quarterId) || CollectionUtils.isEmpty(gridQuarterlyList)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByQuarterId(customerId,quarterId); + return this.insertBatch(gridQuarterlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridYearlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridYearlyServiceImpl.java new file mode 100644 index 0000000000..e25d32852f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridYearlyServiceImpl.java @@ -0,0 +1,46 @@ +/** + * 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.stats.impl; + +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.dao.stats.FactTagUsedGridYearlyDao; +import com.epmet.entity.stats.FactTagUsedGridYearlyEntity; +import com.epmet.service.stats.FactTagUsedGridYearlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +/** + * 标签【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Service +public class FactTagUsedGridYearlyServiceImpl extends BaseServiceImpl implements FactTagUsedGridYearlyService { + + @Override + public Integer deleteByYearId(String customerId, String yearId) { + + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.deleteByYearId(customerId,yearId); + } +} \ No newline at end of file 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 index 040f126cd8..125e46e962 100644 --- 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 @@ -18,7 +18,7 @@ package com.epmet.service.voice; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; +import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; import com.epmet.entity.voice.ArticlePublishRangeEntity; import java.util.Date; 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 e1aee5a20a..5477d54cd2 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,7 +18,7 @@ package com.epmet.service.voice; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; +import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; import com.epmet.entity.voice.ArticleEntity; import java.util.Date; @@ -55,4 +55,12 @@ public interface ArticleService extends BaseService { * @return */ List getAllGridPublishedCount(String customerId, Date publishDate); + + /** + * desc:根据客户id,发布时间 获取文章数据 + * @param customerId + * @param statsDate + * @return + */ + List getPublishedArticleByPublishTime(String customerId, Date statsDate); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleTagsService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleTagsService.java new file mode 100644 index 0000000000..43c0518792 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleTagsService.java @@ -0,0 +1,42 @@ +/** + * 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.entity.voice.ArticleTagsEntity; + +import java.util.Date; +import java.util.List; + +/** + * 文章标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface ArticleTagsService extends BaseService { + + /** + * desc:根据客户Id 创建时间获取 文章便签数据 + * @param customerId + * @param startTime + * @param endTime + * @return + */ + List getArticleTagsByCreateTime(String customerId, Date startTime, Date endTime); +} \ 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 index 372ee5de50..8fc2f430cd 100644 --- 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 @@ -21,7 +21,7 @@ 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.stats.ArticleGridPublishedSummaryDTO; +import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; import com.epmet.entity.voice.ArticlePublishRangeEntity; import com.epmet.service.voice.ArticlePublishRangeService; import lombok.extern.slf4j.Slf4j; 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 82166605ed..08ce42e396 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 @@ -24,7 +24,7 @@ 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.dto.voice.ArticleGridPublishedSummaryDTO; import com.epmet.entity.voice.ArticleEntity; import com.epmet.service.voice.ArticleService; import org.apache.commons.lang3.StringUtils; @@ -45,25 +45,33 @@ public class ArticleServiceImpl extends BaseServiceImpl getAllDepartmentPublishedCount(String customerId, Date publishDate) { - if (StringUtils.isBlank(customerId) || publishDate == null){ - throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); - } + checkParam(customerId, publishDate); return baseDao.getAllPublishedCount(customerId,publishDate, ProjectConstant.PUBLISHER_TYPE_DEPT); } @Override public List getAllAgencyPublishedCount(String customerId, Date publishDate) { - if (StringUtils.isBlank(customerId) || publishDate == null){ - throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); - } + checkParam(customerId, publishDate); return baseDao.getAllPublishedCount(customerId,publishDate, ProjectConstant.PUBLISHER_TYPE_AGENCY); } @Override public List getAllGridPublishedCount(String customerId, Date publishDate) { - if (StringUtils.isBlank(customerId) || publishDate == null){ - throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); - } + checkParam(customerId, publishDate); return baseDao.getAllPublishedCount(customerId,publishDate, ProjectConstant.PUBLISHER_TYPE_GRID); } + + + + @Override + public List getPublishedArticleByPublishTime(String customerId, Date publishDate) { + checkParam(customerId, publishDate); + return baseDao.getPublishedArticleByDay(customerId,publishDate, ProjectConstant.PUBLISHER_TYPE_GRID); + } + + private void checkParam(String customerId, Date publishDate) { + if (StringUtils.isBlank(customerId) || publishDate == null) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleTagsServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleTagsServiceImpl.java new file mode 100644 index 0000000000..d34e2f9e06 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleTagsServiceImpl.java @@ -0,0 +1,56 @@ +/** + * 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.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.voice.ArticleTagsDao; +import com.epmet.entity.voice.ArticleTagsEntity; +import com.epmet.service.voice.ArticleTagsService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +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 ArticleTagsServiceImpl extends BaseServiceImpl implements ArticleTagsService { + + @Override + public List getArticleTagsByCreateTime(String customerId, Date startTime, Date endTime) { + this.checkParam(customerId,endTime,endTime); + return baseDao.getArticleTagsByDay(customerId,startTime, endTime); + } + private void checkParam(String customerId, Date starTime,Date endTime) { + if (StringUtils.isBlank(customerId) || starTime == null || endTime == null) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml index a8ea896aa1..bd19d31fd0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml @@ -3,26 +3,31 @@ - - - - - - - - - - - - - - - - - - - - + + DELETE FROM fact_tag_used_agency_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/stats/FactTagUsedAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml index 5fd7739c25..156a284376 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml @@ -3,22 +3,52 @@ - - - - - - - - - - - - - - - - + + + + DELETE FROM fact_tag_used_agency_monthly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND MONTH_ID = #{monthId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyQuarterlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyQuarterlyDao.xml index 8bdf8f1947..ccd42622a4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyQuarterlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyQuarterlyDao.xml @@ -3,22 +3,7 @@ - - - - - - - - - - - - - - - - - - + + DELETE FROM fact_tag_used_agency_quarterly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND QUARTER_ID = #{quarterId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyYearlyDao.xml index 55b6b6d481..b3851f7b5a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyYearlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyYearlyDao.xml @@ -3,22 +3,7 @@ - - - - - - - - - - - - - - - - - - + + DELETE FROM fact_tag_used_agency_yearly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND YEAR_ID = #{yearId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentDailyDao.xml index 8b2352e685..8e8fb7e9b3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentDailyDao.xml @@ -3,27 +3,32 @@ - - - - - - - - - - - - - - - - - - - - - + + DELETE FROM fact_tag_used_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/stats/FactTagUsedDepartmentMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentMonthlyDao.xml index 58cfb41a8d..af8efb5266 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentMonthlyDao.xml @@ -3,22 +3,53 @@ - - - - - - - - - - - - - - - - + + + + DELETE FROM fact_tag_used_department_monthly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND MONTH_ID = #{monthId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentQuarterlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentQuarterlyDao.xml index 669cc48e5e..fab6a6b6f4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentQuarterlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentQuarterlyDao.xml @@ -3,22 +3,8 @@ - - - - - - - - - - - - - - - - - + + DELETE FROM fact_tag_used_department_quarterly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND QUARTER_ID = #{quarterId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentYearlyDao.xml index 223c11d725..e17b6fdf3d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentYearlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentYearlyDao.xml @@ -3,22 +3,7 @@ - - - - - - - - - - - - - - - - - - + + DELETE FROM fact_tag_used_department_yearly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND YEAR_ID = #{yearId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridDailyDao.xml index 8a7e9a0508..1970dc22a7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridDailyDao.xml @@ -2,27 +2,29 @@ - - - - - - - - - - - - - - - - - - - - - - - + + DELETE FROM fact_tag_used_grid_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/stats/FactTagUsedGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridMonthlyDao.xml index 24e1248529..67974a20e2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridMonthlyDao.xml @@ -3,22 +3,54 @@ - - - - - - - - - - - - - - - - + + + + + DELETE FROM fact_tag_used_grid_monthly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND MONTH_ID = #{monthId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridQuarterlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridQuarterlyDao.xml index 5ce90cf523..dc35b17d52 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridQuarterlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridQuarterlyDao.xml @@ -3,22 +3,9 @@ - - - - - - - - - - - - - - - - + + DELETE FROM fact_tag_used_grid_quarterly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND QUARTER_ID = #{quarterId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridYearlyDao.xml index b9a1ab68ac..e2501f4f3d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridYearlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridYearlyDao.xml @@ -2,23 +2,9 @@ - - - - - - - - - - - - - - - - - + + DELETE FROM fact_tag_used_grid_yearly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND YEAR_ID = #{yearId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridDailyDao.xml index 5d419f1683..22a4e138c6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridDailyDao.xml @@ -3,26 +3,5 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridMonthlyDao.xml index ae0f963af5..363a48027b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridMonthlyDao.xml @@ -3,22 +3,4 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridQuarterlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridQuarterlyDao.xml index 9c456d703e..fc6b5d4b11 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridQuarterlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridQuarterlyDao.xml @@ -3,22 +3,4 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridYearlyDao.xml index 3e6f1bfff7..a2dc843964 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridYearlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridYearlyDao.xml @@ -3,22 +3,4 @@ - - - - - - - - - - - - - - - - - - \ 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 ee9e94a49d..a5fca9a9dc 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,7 +29,7 @@ - SELECT ORG_ID AS agencyId, PUBLISHER_ID, @@ -38,14 +38,30 @@ FROM article WHERE - DEL_FLAG = 0 - AND CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} - AND PUBLISHER_TYPE = #{publisherType,jdbcType=VARCHAR} + CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND PUBLISH_DATE + AND DEL_FLAG = 0 + AND PUBLISHER_TYPE = #{publisherType,jdbcType=VARCHAR} GROUP BY CUSTOMER_ID, PUBLISHER_ID + \ 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 4b7f1cfc9b..154d617001 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 @@ -21,7 +21,7 @@ - SELECT AGENCY_ID, GRID_ID, @@ -37,7 +37,7 @@ CUSTOMER_ID, GRID_ID - SELECT GRID_ID, count(ID) publishedCount, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleTagsDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleTagsDao.xml new file mode 100644 index 0000000000..94202f337a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleTagsDao.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file