From 738f97c29b85589f83a6e386d05566349a276ca0 Mon Sep 17 00:00:00 2001 From: jianjun Date: Sat, 20 Jun 2020 12:08:09 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=AE=A3=E4=BC=A0=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E4=BB=A3=E7=A0=81=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/voice/ArticleViewedSummaryDTO.java | 40 ++ .../controller/StatsPublicityController.java | 24 +- .../stats/FactTagUsedAgencyMonthlyDao.java | 5 +- .../stats/FactTagViewedAgencyDailyDao.java | 8 +- .../stats/FactTagViewedAgencyMonthlyDao.java | 10 +- .../FactTagViewedAgencyQuarterlyDao.java | 4 +- .../stats/FactTagViewedAgencyYearlyDao.java | 4 +- .../dao/stats/FactTagViewedGridDailyDao.java | 8 +- .../stats/FactTagViewedGridMonthlyDao.java | 10 +- .../stats/FactTagViewedGridQuarterlyDao.java | 4 +- .../dao/stats/FactTagViewedGridYearlyDao.java | 4 +- .../com/epmet/dao/voice/ArticleTagsDao.java | 2 + .../dao/voice/ArticleVisitRecordDao.java | 39 ++ .../voice/ArticleVisitRecordEntity.java | 58 +++ .../epmet/service/StatsPublicityService.java | 21 ++ .../impl/StatsPublicityServiceImpl.java | 352 ++++++++++++++++-- .../FactTagUsedAgencyMonthlyService.java | 5 +- .../stats/FactTagUsedAgencyYearlyService.java | 5 +- .../FactTagUsedDepartmentYearlyService.java | 4 +- .../stats/FactTagUsedGridYearlyService.java | 5 +- .../FactTagViewedAgencyDailyService.java | 6 + .../FactTagViewedAgencyMonthlyService.java | 7 + .../FactTagViewedAgencyQuarterlyService.java | 3 + .../FactTagViewedAgencyYearlyService.java | 3 + .../stats/FactTagViewedGridDailyService.java | 6 + .../FactTagViewedGridMonthlyService.java | 7 + .../FactTagViewedGridQuarterlyService.java | 3 + .../stats/FactTagViewedGridYearlyService.java | 3 + .../FactTagUsedAgencyMonthlyServiceImpl.java | 17 +- .../FactTagUsedAgencyYearlyServiceImpl.java | 20 +- ...actTagUsedDepartmentYearlyServiceImpl.java | 12 +- .../FactTagUsedGridYearlyServiceImpl.java | 15 +- .../FactTagViewedAgencyDailyServiceImpl.java | 62 +++ ...FactTagViewedAgencyMonthlyServiceImpl.java | 65 ++++ ...ctTagViewedAgencyQuarterlyServiceImpl.java | 49 +++ .../FactTagViewedAgencyYearlyServiceImpl.java | 49 +++ .../FactTagViewedGridDailyServiceImpl.java | 64 ++++ .../FactTagViewedGridMonthlyServiceImpl.java | 65 ++++ ...FactTagViewedGridQuarterlyServiceImpl.java | 49 +++ .../FactTagViewedGridYearlyServiceImpl.java | 49 +++ .../service/voice/ArticleTagsService.java | 19 +- .../voice/ArticleVisitRecordService.java | 44 +++ .../voice/impl/ArticleTagsServiceImpl.java | 15 +- .../impl/ArticleVisitRecordServiceImpl.java | 54 +++ .../stats/FactTagUsedAgencyMonthlyDao.xml | 4 +- .../stats/FactTagViewedAgencyDailyDao.xml | 45 ++- .../stats/FactTagViewedAgencyMonthlyDao.xml | 62 ++- .../stats/FactTagViewedAgencyQuarterlyDao.xml | 20 +- .../stats/FactTagViewedAgencyYearlyDao.xml | 19 +- .../stats/FactTagViewedGridDailyDao.xml | 25 ++ .../stats/FactTagViewedGridMonthlyDao.xml | 47 +++ .../stats/FactTagViewedGridQuarterlyDao.xml | 3 + .../stats/FactTagViewedGridYearlyDao.xml | 3 + .../resources/mapper/voice/ArticleTagsDao.xml | 13 + .../mapper/voice/ArticleVisitRecordDao.xml | 23 ++ 55 files changed, 1410 insertions(+), 152 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/ArticleViewedSummaryDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleVisitRecordDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleVisitRecordEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyMonthlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyQuarterlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyYearlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridMonthlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridQuarterlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridYearlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleVisitRecordService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleVisitRecordServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleVisitRecordDao.xml diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/ArticleViewedSummaryDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/ArticleViewedSummaryDTO.java new file mode 100644 index 0000000000..6db2b70ef7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/ArticleViewedSummaryDTO.java @@ -0,0 +1,40 @@ +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/17 16:43 + */ +@Data +public class ArticleViewedSummaryDTO implements Serializable { + + private static final long serialVersionUID = -6430902856772516776L; + /** + * 客户id + */ + private String customerId; + + /** + * 网格Id + */ + private String gridId; + /** + * 文章Id + */ + private String articleId; + + /** + * 该篇文章被阅读的次数和 + */ + private Integer viewedCount; +} 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 c233fd1e1e..7db6e827c0 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 @@ -24,7 +24,7 @@ public class StatsPublicityController { private ExecutorService executorService; /** - * desc:统计文章总数及在线文章总数 + * desc:【日】统计文章总数及在线文章总数 包含 机关 部门 网格 * * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 * @return @@ -55,4 +55,26 @@ public class StatsPublicityController { public Result tagUsedMonthStatsjob(Date statsDate) { return new Result().ok(statsPublicityService.tagUsedMonthStatsjob(statsDate)); } + + /** + * desc:【日】 统计阅读最多的标签 包含 机关 网格 + * + * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 + * @return + */ + @PostMapping(value = "tagViewedDayStatsjob") + public Result tagViewedDayStatsjob(Date statsDate) { + return new Result().ok(statsPublicityService.tagViewedDayStatsjob(statsDate)); + } + + /** + * desc:【月】 统计阅读最多的标签 包含 机关 网格 + * + * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 + * @return + */ + @PostMapping(value = "tagViewedMonthStatsjob") + public Result tagViewedMonthStatsjob(Date statsDate) { + return new Result().ok(statsPublicityService.tagViewedMonthStatsjob(statsDate)); + } } 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 17ded89e6c..1bc98abe5f 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,6 @@ 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; @@ -34,9 +33,9 @@ import java.util.List; @Mapper public interface FactTagUsedAgencyMonthlyDao extends BaseDao { - List getTagUsedCountByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); + List getTagUsedCountByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); - List getTagUsedCountByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); + 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/FactTagViewedAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyDailyDao.java index 0726fa3c22..4a9a248298 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyDailyDao.java @@ -20,6 +20,9 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagViewedAgencyDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 文章引用标签阅读数量【机关】日统计表 @@ -29,5 +32,8 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagViewedAgencyDailyDao extends BaseDao { - + + int deleteByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId); + + List getTagViewedCountByMonthId(@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/FactTagViewedAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyMonthlyDao.java index d41f55eabc..eea98354b6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyMonthlyDao.java @@ -20,6 +20,9 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagViewedAgencyMonthlyEntity; 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 FactTagViewedAgencyMonthlyDao extends BaseDao { - + + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); + + List getTagViewedCountByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); + + List getTagUsedCountByYearId(@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/FactTagViewedAgencyQuarterlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyQuarterlyDao.java index 7816c9b477..17c7c064a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyQuarterlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyQuarterlyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagViewedAgencyQuarterlyEntity; 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 FactTagViewedAgencyQuarterlyDao 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/FactTagViewedAgencyYearlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyYearlyDao.java index 67554b31e0..54d0564f18 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyYearlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyYearlyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagViewedAgencyYearlyEntity; 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 FactTagViewedAgencyYearlyDao 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/FactTagViewedGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridDailyDao.java index aec2bd6862..8824b13ccc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridDailyDao.java @@ -20,6 +20,9 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagViewedGridDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 文章引用标签阅读数量【网格】日统计表 @@ -29,5 +32,8 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagViewedGridDailyDao extends BaseDao { - + + int deleteByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId); + + List getTagViewedCountByMonthId(@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/FactTagViewedGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridMonthlyDao.java index eed19fc006..d504edb591 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridMonthlyDao.java @@ -20,6 +20,9 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagViewedGridMonthlyEntity; 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 FactTagViewedGridMonthlyDao extends BaseDao { - + + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); + + List getTagViewCountByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); + + List getTagUsedCountByYearId(@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/FactTagViewedGridQuarterlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridQuarterlyDao.java index 61488aa9df..8e7318fba0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridQuarterlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridQuarterlyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagViewedGridQuarterlyEntity; 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 FactTagViewedGridQuarterlyDao 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/FactTagViewedGridYearlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridYearlyDao.java index 7e4e436b42..a85ead0f93 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridYearlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridYearlyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagViewedGridYearlyEntity; 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 FactTagViewedGridYearlyDao 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/ArticleTagsDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleTagsDao.java index 3fa6d061da..b25b86e2b7 100644 --- 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 @@ -43,4 +43,6 @@ public interface ArticleTagsDao extends BaseDao { * @return */ List getArticleTagsByDay(@Param("customerId") String customerId, @Param("startTime") Date startTime, @Param("endTime") Date endTime); + + List getArticleTagsByArticleId(@Param("customerId") String customerId, @Param("articleId") String articleId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleVisitRecordDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleVisitRecordDao.java new file mode 100644 index 0000000000..174ea937ef --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleVisitRecordDao.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.dao.voice; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.voice.ArticleViewedSummaryDTO; +import com.epmet.entity.voice.ArticleVisitRecordEntity; +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 ArticleVisitRecordDao extends BaseDao { + + List getArticleVisitByCreateTime(@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/voice/ArticleVisitRecordEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleVisitRecordEntity.java new file mode 100644 index 0000000000..630b9e2685 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleVisitRecordEntity.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_visit_record") +public class ArticleVisitRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 用户ID + */ + private String userId; + +} 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 79fc0d24d1..1bd0ff46be 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 @@ -35,4 +35,25 @@ public interface StatsPublicityService { */ Boolean tagUsedMonthStatsjob(Date statsDate); + /** + * desc: 按日 统计每个标签的阅读数 + * + * @param statsDate + * @return: Boolean + * @date: 2020/6/20 8:40 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ + Boolean tagViewedDayStatsjob(Date statsDate); + + /** + * desc: + * + * @param statsDate + * @return: + * @date: 2020/6/20 10:44 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ + Boolean tagViewedMonthStatsjob(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 06eec21543..1fd8375faa 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 @@ -7,6 +7,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.ProjectConstant; import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; +import com.epmet.dto.voice.ArticleViewedSummaryDTO; import com.epmet.entity.stats.*; import com.epmet.entity.voice.ArticleEntity; import com.epmet.entity.voice.ArticleTagsEntity; @@ -15,6 +16,7 @@ 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.service.voice.ArticleVisitRecordService; import com.epmet.util.DimIdGenerator; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -64,6 +66,8 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { @Autowired private ArticlePublishRangeService articlePublishRangeService; @Autowired + private ArticleVisitRecordService articleVisitRecordService; + @Autowired private FactArticlePublishedGridDailyService factArticlePublishedGridDailyService; @Autowired private FactArticlePublishedDepartmentDailyService factArticlePublishedDepartmentDailyService; @@ -94,6 +98,22 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { @Autowired private FactTagUsedAgencyYearlyService factTagUsedAgencyYearlyService; @Autowired + private FactTagViewedGridDailyService factTagViewedGridDailyService; + @Autowired + private FactTagViewedAgencyDailyService factTagViewedAgencyDailyService; + @Autowired + private FactTagViewedGridMonthlyService factTagViewedGridMonthlyService; + @Autowired + private FactTagViewedAgencyMonthlyService factTagViewedAgencyMonthlyService; + @Autowired + private FactTagViewedGridQuarterlyService factTagViewedGridQuarterlyService; + @Autowired + private FactTagViewedAgencyQuarterlyService factTagViewedAgencyQuarterlyService; + @Autowired + private FactTagViewedGridYearlyService factTagViewedGridYearlyService; + @Autowired + private FactTagViewedAgencyYearlyService factTagViewedAgencyYearlyService; + @Autowired private ExecutorService executorService; @Override @@ -151,10 +171,8 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { for (String customerId : customerIdList) { Date finalStatsDate = statsDate; executorService.submit(() -> { - //key:所在机关Id - Map agencySummaryMap = new HashMap<>(); //统计 - statsTagUsedDaily(finalStatsDate, dimIdBean, customerId, agencySummaryMap); + statsTagUsedDaily(finalStatsDate, dimIdBean, customerId); }); } } @@ -183,21 +201,14 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { 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 { + countDownLatch.await(); log.debug("start === statsTagUsedQuarterly "); statsTagUsedQuarterly(dimIdBean.getQuarterId(), customerId); } catch (Exception e) { @@ -206,6 +217,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { }); executorService.submit(() -> { try { + countDownLatch.await(); log.debug("start === statsTagUsedQuarterly "); statsTagUsedYearly(dimIdBean.getYearId(), customerId); } catch (Exception e) { @@ -218,6 +230,89 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { return true; } + @Override + public Boolean tagViewedDayStatsjob(Date statsDate) { + + //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 + if (statsDate == null) { + //当天的凌晨时间 即为今天之前的数据 + 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; + 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(() -> { + //统计 + statsTagViewedDaily(finalStatsDate, dimIdBean, customerId); + //}); + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() >= pageSize); + return true; + } + + @Override + public Boolean tagViewedMonthStatsjob(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) { + if (!"6c8cfc2c14afeb6d3664b3e283fc9074".equals(customerId)) { + continue; + } + executorService.submit(() -> { + try { + statsTagViewedMonthly(dimIdBean.getMonthId(), customerId); + countDownLatch.countDown(); + } catch (Exception e) { + log.error("statsTagViewedMonthly exception", e); + } + }); + + executorService.submit(() -> { + try { + countDownLatch.await(); + log.debug("start === statsTagViewedQuarterly "); + statsTagViewedQuarterly(dimIdBean.getQuarterId(), customerId); + } catch (Exception e) { + log.error("statsTagUsedQuarterly exception", e); + } + }); + executorService.submit(() -> { + try { + countDownLatch.await(); + log.debug("start === statsTagViewedYearly "); + statsTagViewedYearly(dimIdBean.getYearId(), customerId); + } catch (Exception e) { + log.error("statsTagUsedYearly exception", e); + } + }); + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() >= pageSize); + return true; + } + private void statsPublishedDepartmentDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { //获取所有客户 List departmentDTOList = dimDepartmentService.getDepartmentListByCustomerId(customerId); @@ -357,9 +452,8 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { * @param statsDate * @param dimIdBean * @param customerId - * @param agencySummaryMap */ - private void statsTagUsedDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { + private void statsTagUsedDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId) { //1.业务数据来源 发布时间为统计时间的 // 因为一个客户的发布文章数在同一天不会特别的多,所以以客户为单位查询今天发布的所有带有标签的文章 根据发布单位类型进行拆分 // 1.1查出今天所有的文章标签 根据网格Id @@ -409,7 +503,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { convertTagUsedDepartmentDailyEntity(tagUsedDeptDailyMap, articleEntity, tagEntity, dimIdBean); break; } - convertTagUsedGridDailyEntity(tagUsedGridDailyMap, articleEntity, tagEntity, dimIdBean); } factTagUsedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagUsedGridDailyMap.values()); @@ -430,6 +523,82 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { factTagUsedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), finalTagUsedAgencyDailyMap.values()); } + /** + * desc:按日统计 标签被阅读的次数 + * + * @param statsDate + * @param dimIdBean + * @param customerId + */ + private void statsTagViewedDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId) { + //1.业务数据来源 发布时间为统计时间的 + // 因为一个客户的发布文章数在同一天不会特别的多,所以以客户为单位查询今天发布的所有带有标签的文章 根据发布单位类型进行拆分 + // 1.1查出今天所有的文章标签 根据网格Id + // 1.2 + //获取所有机关 用于后面想上级添加数据 + List agencyDTOList = dimAgencyService.getAgencyListByCustomerId(customerId); + if (CollectionUtils.isEmpty(agencyDTOList)) { + log.debug("statsTagViewedDaily customerId:{} have any agency", customerId); + return; + } + + List dimGridList = dimGridService.getGridListByCustomerId(customerId); + if (CollectionUtils.isEmpty(dimGridList)) { + log.debug("statsTagViewedDaily customerId:{} have any grid", customerId); + return; + } + Map dimGridEntityMap = dimGridList.stream().collect(Collectors.toMap(DimGridEntity::getId, o -> o)); + //转换为 需要插入的Entity + Map dimAgencyEntityMap = agencyDTOList.stream().collect(Collectors.toMap(DimAgencyEntity::getId, o -> o)); + //转换为 需要插入的Entity key gridId_tagId + Map tagViewedGridDailyMap = new HashMap<>(); + Map tagViewedAgencyDailyMap = new HashMap<>(); + //获取当天的业务数据 + //1获取今天文章的阅读记录数 + Date startTime = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); + Date endTime = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); + List visitRecordList = articleVisitRecordService.getArticleVisitByCreateTime(customerId, startTime, endTime); + if (CollectionUtils.isEmpty(visitRecordList)) { + return; + } + + for (ArticleViewedSummaryDTO viewedSummaryDTO : visitRecordList) { + List articleTagsList = articleTagsService.getArticleTagsByArticleId(customerId, viewedSummaryDTO.getArticleId()); + if (CollectionUtils.isEmpty(articleTagsList)) { + continue; + } + String gridId = viewedSummaryDTO.getGridId(); + DimGridEntity dimGridEntity = dimGridEntityMap.get(gridId); + + if (dimGridEntity == null) { + log.error("statsTagViewedDaily viewedRecord gridId:{} not exist in dimGridMap", gridId); + continue; + } + DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(dimGridEntity.getAgencyId()); + articleTagsList.forEach(articleTag -> { + convertTagViewedGridDailyEntity(dimAgencyEntity, tagViewedGridDailyMap, articleTag, viewedSummaryDTO, dimIdBean); + convertTagViewedAgencyDailyEntity(dimAgencyEntity, tagViewedAgencyDailyMap, articleTag, viewedSummaryDTO, dimIdBean); + }); + } + + factTagViewedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagViewedGridDailyMap.values()); + + //向上级机关递归添加 数据 + Map finalTagUsedAgencyDailyMap = new HashMap<>(); + finalTagUsedAgencyDailyMap.putAll(tagViewedAgencyDailyMap); + for (Map.Entry entry : tagViewedAgencyDailyMap.entrySet()) { + String agencyId = entry.getKey(); + FactTagViewedAgencyDailyEntity currentEntity = entry.getValue(); + DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(currentEntity.getAgencyId()); + if (dimAgencyEntity == null) { + log.error("dimAgencyEntityMap bizData agencyId:{} not exist in dimAgency", agencyId); + continue; + } + setTagViewedData2ParentAgency(dimAgencyEntityMap, finalTagUsedAgencyDailyMap, currentEntity, dimIdBean); + } + factTagViewedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), finalTagUsedAgencyDailyMap.values()); + } + /** * desc:按月统计 标签使用数 * @@ -440,17 +609,37 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { List gridDailyList = factTagUsedGridDailyService.getTagUsedCountByMonth(customerId, monthId); if (!CollectionUtils.isEmpty(gridDailyList)) { List gridMonthlyList = ConvertUtils.sourceToTarget(gridDailyList, FactTagUsedGridMonthlyEntity.class); - factTagUsedGridMonthlyService.deleteAndInsertByMonthId(customerId,monthId,gridMonthlyList); + 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); + 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)); + factTagUsedAgencyMonthlyService.deleteAndInsertByMonthId(customerId, monthId, (agencyMonthlyList)); + } + } + + /** + * desc:按月统计 标签使用数 + * + * @param monthId + * @param customerId + */ + private void statsTagViewedMonthly(String monthId, String customerId) { + List gridDailyList = factTagViewedGridDailyService.getTagViewedCountByMonth(customerId, monthId); + if (!CollectionUtils.isEmpty(gridDailyList)) { + List gridMonthlyList = ConvertUtils.sourceToTarget(gridDailyList, FactTagViewedGridMonthlyEntity.class); + factTagViewedGridMonthlyService.deleteAndInsertByMonthId(customerId, monthId, gridMonthlyList); + } + + List agencyDailyList = factTagViewedAgencyDailyService.getTagViewedCountByMonth(customerId, monthId); + if (!CollectionUtils.isEmpty(agencyDailyList)) { + List agencyMonthlyList = ConvertUtils.sourceToTarget(agencyDailyList, FactTagViewedAgencyMonthlyEntity.class); + factTagViewedAgencyMonthlyService.deleteAndInsertByMonthId(customerId, monthId, (agencyMonthlyList)); } } @@ -464,18 +653,37 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { List gridMonthlyList = factTagUsedGridMonthlyService.getTagUsedCountByQuarterId(customerId, quarterId); if (!CollectionUtils.isEmpty(gridMonthlyList)) { List gridQuarterlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagUsedGridQuarterlyEntity.class); - factTagUsedGridQuarterlyService.deleteAndInsertByQuarterId(customerId,quarterId,gridQuarterlyList); + 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); + factTagUsedDepartmentQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, deptQuarterlyList); } - //TODO 机关的需要添加 pid - List agencyMonthlyList = factTagUsedAgencyMonthlyService.getTagUsedCountByQuarterId(customerId, quarterId); + List agencyMonthlyList = factTagUsedAgencyMonthlyService.getTagUsedCountByQuarterId(customerId, quarterId); if (!CollectionUtils.isEmpty(agencyMonthlyList)) { List agencyQuarterlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagUsedAgencyQuarterlyEntity.class); - factTagUsedAgencyQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId,agencyQuarterlyList); + factTagUsedAgencyQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, agencyQuarterlyList); + } + } + + /** + * desc:按季统计 标签查看数 + * + * @param quarterId + * @param customerId + */ + private void statsTagViewedQuarterly(String quarterId, String customerId) { + List gridMonthlyList = factTagViewedGridMonthlyService.getTagViewedCountByQuarterId(customerId, quarterId); + if (!CollectionUtils.isEmpty(gridMonthlyList)) { + List gridQuarterlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagViewedGridQuarterlyEntity.class); + factTagViewedGridQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, gridQuarterlyList); + } + + List agencyMonthlyList = factTagViewedAgencyMonthlyService.getTagViewedCountByQuarterId(customerId, quarterId); + if (!CollectionUtils.isEmpty(agencyMonthlyList)) { + List agencyQuarterlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagViewedAgencyQuarterlyEntity.class); + factTagViewedAgencyQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, agencyQuarterlyList); } } @@ -489,21 +697,36 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { 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); + factTagUsedGridYearlyService.deleteAndInsertByYearId(customerId, yearId, 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); + factTagUsedDepartmentYearlyService.deleteAndInsertByYearId(customerId, yearId, gridYearlyList); } - List agencyMonthlyList = factTagUsedAgencyMonthlyService.getTagUsedCountByYearId(customerId, yearId); + List agencyMonthlyList = factTagUsedAgencyMonthlyService.getTagUsedCountByYearId(customerId, yearId); if (!CollectionUtils.isEmpty(agencyMonthlyList)) { List agencyYearlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagUsedAgencyYearlyEntity.class); - factTagUsedAgencyYearlyService.deleteByYearId(customerId, yearId); - factTagUsedAgencyYearlyService.insertBatch(agencyYearlyList); + factTagUsedAgencyYearlyService.deleteAndInsertByYearId(customerId, yearId, agencyYearlyList); + } + } + + /** + * desc:按年统计 标签阅读数 + * + * @param yearId + * @param customerId + */ + private void statsTagViewedYearly(String yearId, String customerId) { + List gridMonthlyList = factTagViewedGridMonthlyService.getTagViewedCountByYearId(customerId, yearId); + if (!CollectionUtils.isEmpty(gridMonthlyList)) { + List gridYearlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagViewedGridYearlyEntity.class); + factTagViewedGridYearlyService.deleteAndInsertByYearId(customerId, yearId, gridYearlyList); + } + List agencyMonthlyList = factTagViewedAgencyMonthlyService.getTagViewedCountByYearId(customerId, yearId); + if (!CollectionUtils.isEmpty(agencyMonthlyList)) { + List agencyYearlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagViewedAgencyYearlyEntity.class); + factTagViewedAgencyYearlyService.deleteAndInsertByYearId(customerId, yearId, agencyYearlyList); } } @@ -534,6 +757,33 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } } + private void setTagViewedData2ParentAgency(Map dimAgencyEntityMap, Map agencyDailyEntityMap, FactTagViewedAgencyDailyEntity currentEntity, DimIdGenerator.DimIdBean dimIdBean) { + String pid = currentEntity.getPid(); + String tagId = currentEntity.getTagId(); + String key = pid.concat(StrConstant.UNDER_LINE).concat(tagId); + FactTagViewedAgencyDailyEntity parentAgencyDailyEntity = agencyDailyEntityMap.get(key); + DimAgencyEntity currentDimAgency = dimAgencyEntityMap.get(pid); + if (currentDimAgency == null) { + return; + } + if (parentAgencyDailyEntity == null) { + parentAgencyDailyEntity = ConvertUtils.sourceToTarget(dimIdBean, FactTagViewedAgencyDailyEntity.class); + parentAgencyDailyEntity.setCustomerId(currentEntity.getCustomerId()); + parentAgencyDailyEntity.setPid(currentDimAgency.getPid()); + parentAgencyDailyEntity.setAgencyId(currentDimAgency.getId()); + parentAgencyDailyEntity.setTagId(currentEntity.getTagId()); + parentAgencyDailyEntity.setTagName(currentEntity.getTagName()); + parentAgencyDailyEntity.setTagReadCount(currentEntity.getTagReadCount()); + agencyDailyEntityMap.put(key, parentAgencyDailyEntity); + } else { + parentAgencyDailyEntity.setTagReadCount(parentAgencyDailyEntity.getTagReadCount() + currentEntity.getTagReadCount()); + } + pid = currentDimAgency.getPid(); + if (!NumConstant.ZERO_STR.equals(pid)) { + setTagViewedData2ParentAgency(dimAgencyEntityMap, agencyDailyEntityMap, parentAgencyDailyEntity, dimIdBean); + } + } + private void setPublishedData2ParentAgency(Map agencyDailyEntityMap, FactArticlePublishedAgencyDailyEntity agencySummary, FactArticlePublishedAgencyDailyEntity summary) { String pid = summary.getPid(); FactArticlePublishedAgencyDailyEntity parentAgency = agencyDailyEntityMap.get(pid); @@ -690,4 +940,46 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setUsedCount(entity.getUsedCount() + 1); } } + + private void convertTagViewedGridDailyEntity(DimAgencyEntity dimAgencyEntity, Map result, + ArticleTagsEntity tagEntity, ArticleViewedSummaryDTO viewedSummaryDTO, DimIdGenerator.DimIdBean dimIdBean) { + String gridId = viewedSummaryDTO.getGridId(); + String tagId = tagEntity.getTagId(); + String key = gridId.concat(StrConstant.UNDER_LINE).concat(tagId); + Integer viewedCount = viewedSummaryDTO.getViewedCount() == null ? 0 : viewedSummaryDTO.getViewedCount(); + FactTagViewedGridDailyEntity entity = result.get(key); + if (entity == null) { + entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagViewedGridDailyEntity.class); + entity.setGridId(gridId); + entity.setCustomerId(tagEntity.getCustomerId()); + entity.setAgencyId(dimAgencyEntity.getId()); + entity.setTagId(tagId); + entity.setTagName(tagEntity.getTagName()); + entity.setTagReadCount(viewedCount); + result.put(key, entity); + } else { + entity.setTagReadCount(entity.getTagReadCount() + viewedCount); + } + } + + private void convertTagViewedAgencyDailyEntity(DimAgencyEntity dimAgencyEntity, Map result, + ArticleTagsEntity tagEntity, ArticleViewedSummaryDTO viewedSummaryDTO, DimIdGenerator.DimIdBean dimIdBean) { + String agencyId = dimAgencyEntity.getId(); + String tagId = tagEntity.getTagId(); + String key = agencyId.concat(StrConstant.UNDER_LINE).concat(tagId); + Integer viewedCount = viewedSummaryDTO.getViewedCount() == null ? 0 : viewedSummaryDTO.getViewedCount(); + FactTagViewedAgencyDailyEntity entity = result.get(key); + if (entity == null) { + entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagViewedAgencyDailyEntity.class); + entity.setPid(dimAgencyEntity.getPid()); + entity.setCustomerId(tagEntity.getCustomerId()); + entity.setAgencyId(agencyId); + entity.setTagId(tagId); + entity.setTagName(tagEntity.getTagName()); + entity.setTagReadCount(viewedCount); + result.put(key, entity); + } else { + entity.setTagReadCount(entity.getTagReadCount() + viewedCount); + } + } } 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 index 98568ee385..3c90d2003a 100644 --- 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 @@ -19,7 +19,6 @@ 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; @@ -31,9 +30,9 @@ import java.util.List; */ public interface FactTagUsedAgencyMonthlyService extends BaseService { - List getTagUsedCountByYearId(String customerId, String monthId); + List getTagUsedCountByYearId(String customerId, String monthId); - List getTagUsedCountByQuarterId(String customerId, String quarterId); + 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/FactTagUsedAgencyYearlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyYearlyService.java index c3102ab786..83f4049722 100644 --- 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 @@ -20,6 +20,8 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.stats.FactTagUsedAgencyYearlyEntity; +import java.util.List; + /** * 标签【机关】年度统计表 * @@ -28,6 +30,7 @@ import com.epmet.entity.stats.FactTagUsedAgencyYearlyEntity; */ public interface FactTagUsedAgencyYearlyService extends BaseService { - int deleteByYearId(String customerId,String yearId); + int deleteByYearId(String customerId, String yearId); + Boolean deleteAndInsertByYearId(String customerId, String yearId, List agencyYearlyList); } \ 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 index 0e5e152fa6..672940a9fb 100644 --- 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 @@ -20,6 +20,8 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.stats.FactTagUsedDepartmentYearlyEntity; +import java.util.List; + /** * 标签【部门】年度统计表 * @@ -29,5 +31,5 @@ import com.epmet.entity.stats.FactTagUsedDepartmentYearlyEntity; public interface FactTagUsedDepartmentYearlyService extends BaseService { - Integer deleteByYearId(String customerId, String yearId); + Boolean deleteAndInsertByYearId(String customerId, String yearId, List gridYearlyList); } \ 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 index f9f5b35510..027b00a376 100644 --- 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 @@ -20,6 +20,8 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.stats.FactTagUsedGridYearlyEntity; +import java.util.List; + /** * 标签【网格】年度统计表 * @@ -27,6 +29,5 @@ import com.epmet.entity.stats.FactTagUsedGridYearlyEntity; * @since v1.0.0 2020-06-18 */ public interface FactTagUsedGridYearlyService extends BaseService { - - Integer deleteByYearId(String customerId, String yearId); + Boolean deleteAndInsertByYearId(String customerId, String yearId, List gridYearlyList); } \ 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 index a2b2ca57e7..bd24b1afd7 100644 --- 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 @@ -20,6 +20,9 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.stats.FactTagViewedAgencyDailyEntity; +import java.util.Collection; +import java.util.List; + /** * 文章引用标签阅读数量【机关】日统计表 * @@ -29,4 +32,7 @@ import com.epmet.entity.stats.FactTagViewedAgencyDailyEntity; public interface FactTagViewedAgencyDailyService extends BaseService { + Boolean deleteAndInsertBatch(String customerId, String dateId, Collection values); + + List getTagViewedCountByMonth(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/FactTagViewedAgencyMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyMonthlyService.java index 1838e6dc72..02c2604600 100644 --- 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 @@ -20,6 +20,8 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.stats.FactTagViewedAgencyMonthlyEntity; +import java.util.List; + /** * 文章引用标签阅读数量【机关】月统计表 * @@ -28,4 +30,9 @@ import com.epmet.entity.stats.FactTagViewedAgencyMonthlyEntity; */ public interface FactTagViewedAgencyMonthlyService extends BaseService { + Boolean deleteAndInsertByMonthId(String customerId, String monthId, List agencyMonthlyList); + + List getTagViewedCountByQuarterId(String customerId, String quarterId); + + List getTagViewedCountByYearId(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/FactTagViewedAgencyQuarterlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyQuarterlyService.java index ef86491926..e32ca8ad7e 100644 --- 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 @@ -20,6 +20,8 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.stats.FactTagViewedAgencyQuarterlyEntity; +import java.util.List; + /** * 文章引用标签阅读数量【机关】季度统计表 * @@ -28,4 +30,5 @@ import com.epmet.entity.stats.FactTagViewedAgencyQuarterlyEntity; */ public interface FactTagViewedAgencyQuarterlyService 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/FactTagViewedAgencyYearlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyYearlyService.java index 2bf9bc345e..abd0e42e08 100644 --- 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 @@ -20,6 +20,8 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.stats.FactTagViewedAgencyYearlyEntity; +import java.util.List; + /** * 文章引用标签阅读数量【机关】年度统计表 * @@ -29,4 +31,5 @@ import com.epmet.entity.stats.FactTagViewedAgencyYearlyEntity; public interface FactTagViewedAgencyYearlyService extends BaseService { + Boolean deleteAndInsertByYearId(String customerId, String yearId, List agencyYearlyList); } \ 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 index 4b07728ae9..dbd488ade2 100644 --- 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 @@ -20,6 +20,9 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.stats.FactTagViewedGridDailyEntity; +import java.util.Collection; +import java.util.List; + /** * 文章引用标签阅读数量【网格】日统计表 * @@ -28,4 +31,7 @@ import com.epmet.entity.stats.FactTagViewedGridDailyEntity; */ public interface FactTagViewedGridDailyService extends BaseService { + Boolean deleteAndInsertBatch(String customerId, String dateId, Collection values); + + List getTagViewedCountByMonth(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/FactTagViewedGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridMonthlyService.java index 149364fc8d..6c5ccc8840 100644 --- 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 @@ -20,6 +20,8 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.stats.FactTagViewedGridMonthlyEntity; +import java.util.List; + /** * 文章引用标签阅读数量【网格】月统计表 * @@ -28,4 +30,9 @@ import com.epmet.entity.stats.FactTagViewedGridMonthlyEntity; */ public interface FactTagViewedGridMonthlyService extends BaseService { + Boolean deleteAndInsertByMonthId(String customerId, String monthId, List gridMonthlyList); + + List getTagViewedCountByQuarterId(String customerId, String quarterId); + + List getTagViewedCountByYearId(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/FactTagViewedGridQuarterlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridQuarterlyService.java index 481bed7ee6..9e224c8802 100644 --- 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 @@ -20,6 +20,8 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.stats.FactTagViewedGridQuarterlyEntity; +import java.util.List; + /** * 文章引用标签阅读数量【网格】季度统计表 * @@ -28,4 +30,5 @@ import com.epmet.entity.stats.FactTagViewedGridQuarterlyEntity; */ public interface FactTagViewedGridQuarterlyService 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/FactTagViewedGridYearlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridYearlyService.java index a62c431a0e..c18d0a7385 100644 --- 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 @@ -20,6 +20,8 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.stats.FactTagViewedGridYearlyEntity; +import java.util.List; + /** * 文章引用标签阅读数量【网格】年度统计表 * @@ -28,4 +30,5 @@ import com.epmet.entity.stats.FactTagViewedGridYearlyEntity; */ public interface FactTagViewedGridYearlyService extends BaseService { + Boolean deleteAndInsertByYearId(String customerId, String yearId, List gridYearlyList); } \ 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 index eb54c6b93b..85c51f9fdb 100644 --- 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 @@ -22,7 +22,6 @@ 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; @@ -43,19 +42,19 @@ import java.util.List; 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()); + 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,monthId); + 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()); + 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); + return baseDao.getTagUsedCountByQuarterId(customerId, quarterId); } @Override 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 index ebe9603a35..32f24e5836 100644 --- 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 @@ -26,6 +26,10 @@ import com.epmet.service.stats.FactTagUsedAgencyYearlyService; 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; /** * 标签【机关】年度统计表 @@ -39,9 +43,19 @@ public class FactTagUsedAgencyYearlyServiceImpl extends BaseServiceImpl agencyYearlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId) || CollectionUtils.isEmpty(agencyYearlyList)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); } - return baseDao.deleteByYearId(customerId,yearId); + baseDao.deleteByYearId(customerId, yearId); + return this.insertBatch(agencyYearlyList, 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 index d80eb5102c..6614095001 100644 --- 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 @@ -26,6 +26,9 @@ import com.epmet.service.stats.FactTagUsedDepartmentYearlyService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; /** * 标签【部门】年度统计表 @@ -38,10 +41,11 @@ import org.springframework.stereotype.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()); + public Boolean deleteAndInsertByYearId(String customerId, String yearId, List gridYearlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId) || CollectionUtils.isEmpty(gridYearlyList)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); } - return baseDao.deleteByYearId(customerId,yearId); + baseDao.deleteByYearId(customerId, yearId); + return this.insertBatch(gridYearlyList, 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 index e25d32852f..02c7902ec2 100644 --- 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 @@ -25,6 +25,10 @@ import com.epmet.entity.stats.FactTagUsedGridYearlyEntity; import com.epmet.service.stats.FactTagUsedGridYearlyService; 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; /** * 标签【网格】年度统计表 @@ -36,11 +40,12 @@ import org.springframework.stereotype.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()); + @Transactional(rollbackFor = Exception.class) + public Boolean deleteAndInsertByYearId(String customerId, String yearId, List gridYearlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId) || CollectionUtils.isEmpty(gridYearlyList)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); } - return baseDao.deleteByYearId(customerId,yearId); + baseDao.deleteByYearId(customerId, yearId); + return this.insertBatch(gridYearlyList, 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/FactTagViewedAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..9e9500e96e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyDailyServiceImpl.java @@ -0,0 +1,62 @@ +/** + * 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.FactTagViewedAgencyDailyDao; +import com.epmet.entity.stats.FactTagViewedAgencyDailyEntity; +import com.epmet.service.stats.FactTagViewedAgencyDailyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +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 FactTagViewedAgencyDailyServiceImpl extends BaseServiceImpl implements FactTagViewedAgencyDailyService { + + @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); + return true; + } + + @Override + public List getTagViewedCountByMonth(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.getTagViewedCountByMonthId(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/FactTagViewedAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyMonthlyServiceImpl.java new file mode 100644 index 0000000000..0b7f08a6ed --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyMonthlyServiceImpl.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.FactTagViewedAgencyMonthlyDao; +import com.epmet.entity.stats.FactTagViewedAgencyMonthlyEntity; +import com.epmet.service.stats.FactTagViewedAgencyMonthlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +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 FactTagViewedAgencyMonthlyServiceImpl extends BaseServiceImpl implements FactTagViewedAgencyMonthlyService { + + @Override + 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); + } + + @Override + public List getTagViewedCountByQuarterId(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.getTagViewedCountByQuarterId(customerId, quarterId); + } + + @Override + public List getTagViewedCountByYearId(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); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyQuarterlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyQuarterlyServiceImpl.java new file mode 100644 index 0000000000..ba226febc9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyQuarterlyServiceImpl.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.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.FactTagViewedAgencyQuarterlyDao; +import com.epmet.entity.stats.FactTagViewedAgencyQuarterlyEntity; +import com.epmet.service.stats.FactTagViewedAgencyQuarterlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +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 FactTagViewedAgencyQuarterlyServiceImpl extends BaseServiceImpl implements FactTagViewedAgencyQuarterlyService { + + @Override + 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/FactTagViewedAgencyYearlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyYearlyServiceImpl.java new file mode 100644 index 0000000000..d5a0f0c123 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyYearlyServiceImpl.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.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.FactTagViewedAgencyYearlyDao; +import com.epmet.entity.stats.FactTagViewedAgencyYearlyEntity; +import com.epmet.service.stats.FactTagViewedAgencyYearlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +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 FactTagViewedAgencyYearlyServiceImpl extends BaseServiceImpl implements FactTagViewedAgencyYearlyService { + + @Override + public Boolean deleteAndInsertByYearId(String customerId, String yearId, List agencyYearlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId) || CollectionUtils.isEmpty(agencyYearlyList)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByYearId(customerId, yearId); + return this.insertBatch(agencyYearlyList, 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/FactTagViewedGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridDailyServiceImpl.java new file mode 100644 index 0000000000..2f3d9c0781 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridDailyServiceImpl.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.FactTagViewedGridDailyDao; +import com.epmet.entity.stats.FactTagViewedGridDailyEntity; +import com.epmet.service.stats.FactTagViewedGridDailyService; +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 FactTagViewedGridDailyServiceImpl extends BaseServiceImpl implements FactTagViewedGridDailyService { + + @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 getTagViewedCountByMonth(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.getTagViewedCountByMonthId(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/FactTagViewedGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridMonthlyServiceImpl.java new file mode 100644 index 0000000000..59e0726914 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridMonthlyServiceImpl.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.FactTagViewedGridMonthlyDao; +import com.epmet.entity.stats.FactTagViewedGridMonthlyEntity; +import com.epmet.service.stats.FactTagViewedGridMonthlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +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 FactTagViewedGridMonthlyServiceImpl extends BaseServiceImpl implements FactTagViewedGridMonthlyService { + + @Override + 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); + } + + @Override + public List getTagViewedCountByQuarterId(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.getTagViewCountByQuarterId(customerId, quarterId); + } + + @Override + public List getTagViewedCountByYearId(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); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridQuarterlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridQuarterlyServiceImpl.java new file mode 100644 index 0000000000..1671a6f4ef --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridQuarterlyServiceImpl.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.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.FactTagViewedGridQuarterlyDao; +import com.epmet.entity.stats.FactTagViewedGridQuarterlyEntity; +import com.epmet.service.stats.FactTagViewedGridQuarterlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +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 FactTagViewedGridQuarterlyServiceImpl extends BaseServiceImpl implements FactTagViewedGridQuarterlyService { + + @Override + 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/FactTagViewedGridYearlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridYearlyServiceImpl.java new file mode 100644 index 0000000000..a7dd6a6242 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridYearlyServiceImpl.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.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.FactTagViewedGridYearlyDao; +import com.epmet.entity.stats.FactTagViewedGridYearlyEntity; +import com.epmet.service.stats.FactTagViewedGridYearlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +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 FactTagViewedGridYearlyServiceImpl extends BaseServiceImpl implements FactTagViewedGridYearlyService { + + @Override + public Boolean deleteAndInsertByYearId(String customerId, String yearId, List gridYearlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId) || CollectionUtils.isEmpty(gridYearlyList)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByYearId(customerId, yearId); + return this.insertBatch(gridYearlyList, 100); + } +} \ 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 index 43c0518792..07067cd1dd 100644 --- 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 @@ -31,12 +31,15 @@ import java.util.List; */ public interface ArticleTagsService extends BaseService { - /** - * desc:根据客户Id 创建时间获取 文章便签数据 - * @param customerId - * @param startTime - * @param endTime - * @return - */ - List getArticleTagsByCreateTime(String customerId, Date startTime, Date endTime); + /** + * desc:根据客户Id 创建时间获取 文章便签数据 + * + * @param customerId + * @param startTime + * @param endTime + * @return + */ + List getArticleTagsByCreateTime(String customerId, Date startTime, Date endTime); + + List getArticleTagsByArticleId(String customerId, String articleId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleVisitRecordService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleVisitRecordService.java new file mode 100644 index 0000000000..69de820d79 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleVisitRecordService.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.voice; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.voice.ArticleViewedSummaryDTO; +import com.epmet.entity.voice.ArticleVisitRecordEntity; + +import java.util.Date; +import java.util.List; + +/** + * 文章访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface ArticleVisitRecordService extends BaseService { + + /** + * desc:根据客户Id + * + * @param customerId + * @param startTime + * @param endTime + * @return + */ + List getArticleVisitByCreateTime(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/ArticleTagsServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleTagsServiceImpl.java index d34e2f9e06..52a8a43295 100644 --- 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 @@ -45,10 +45,19 @@ public class ArticleTagsServiceImpl extends BaseServiceImpl getArticleTagsByCreateTime(String customerId, Date startTime, Date endTime) { - this.checkParam(customerId,endTime,endTime); - return baseDao.getArticleTagsByDay(customerId,startTime, endTime); + this.checkParam(customerId, endTime, endTime); + return baseDao.getArticleTagsByDay(customerId, startTime, endTime); } - private void checkParam(String customerId, Date starTime,Date endTime) { + + @Override + public List getArticleTagsByArticleId(String customerId, String articleId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(articleId)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getArticleTagsByArticleId(customerId, articleId); + } + + 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()); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleVisitRecordServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleVisitRecordServiceImpl.java new file mode 100644 index 0000000000..689a1a32e2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleVisitRecordServiceImpl.java @@ -0,0 +1,54 @@ +/** + * 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.ArticleVisitRecordDao; +import com.epmet.dto.voice.ArticleViewedSummaryDTO; +import com.epmet.entity.voice.ArticleVisitRecordEntity; +import com.epmet.service.voice.ArticleVisitRecordService; +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 ArticleVisitRecordServiceImpl extends BaseServiceImpl implements ArticleVisitRecordService { + + @Override + public List getArticleVisitByCreateTime(String customerId, Date startTime, Date endTime) { + if (StringUtils.isBlank(customerId) || startTime == null || endTime == null) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getArticleVisitByCreateTime(customerId, startTime, endTime); + } +} \ 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 156a284376..ccbe4c211b 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,7 +3,7 @@ - SELECT CUSTOMER_ID, PID, @@ -25,7 +25,7 @@ AGENCY_ID, TAG_ID - SELECT CUSTOMER_ID, AGENCY_ID, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyDailyDao.xml index e01c2c7f77..f8c7a55728 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyDailyDao.xml @@ -3,26 +3,31 @@ - - - - - - - - - - - - - - - - - - - - + + DELETE FROM fact_tag_viewed_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/FactTagViewedAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyMonthlyDao.xml index ed0778ec54..85e33ec0ac 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyMonthlyDao.xml @@ -3,22 +3,52 @@ - - - - - - - - - - - - - - - - + + DELETE FROM fact_tag_viewed_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/FactTagViewedAgencyQuarterlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyQuarterlyDao.xml index 84e1e796e5..83c09a954d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyQuarterlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyQuarterlyDao.xml @@ -2,23 +2,9 @@ - - - - - - - - - - - - - - - - - + + DELETE FROM fact_tag_viewed_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/FactTagViewedAgencyYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyYearlyDao.xml index 0064d6b545..25b2d6a11c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyYearlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyYearlyDao.xml @@ -3,22 +3,9 @@ - - - - - - - - - - - - - - - - + + DELETE FROM fact_tag_viewed_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/FactTagViewedGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridDailyDao.xml index 22a4e138c6..3fa886f434 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 @@ -4,4 +4,29 @@ + + DELETE FROM fact_tag_viewed_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/FactTagViewedGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridMonthlyDao.xml index 363a48027b..8bde85f5a3 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,4 +3,51 @@ + + DELETE FROM fact_tag_viewed_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/FactTagViewedGridQuarterlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridQuarterlyDao.xml index fc6b5d4b11..8d2908737e 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,4 +3,7 @@ + + DELETE FROM fact_tag_viewed_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/FactTagViewedGridYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridYearlyDao.xml index a2dc843964..30276d91ac 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,4 +3,7 @@ + + DELETE FROM fact_tag_viewed_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/voice/ArticleTagsDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleTagsDao.xml index 94202f337a..a6a733f6ac 100644 --- 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 @@ -29,4 +29,17 @@ AND CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND CREATED_TIME BETWEEN #{startTime,jdbcType=TIMESTAMP} AND #{endTime,jdbcType=TIMESTAMP} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleVisitRecordDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleVisitRecordDao.xml new file mode 100644 index 0000000000..c5019d41f4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleVisitRecordDao.xml @@ -0,0 +1,23 @@ + + + + + + + + \ No newline at end of file From 6bc4dca6510e524aaa239943b01dd484ad991ea2 Mon Sep 17 00:00:00 2001 From: jianjun Date: Sat, 20 Jun 2020 12:10:45 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/StatsProjectServiceImpl.java | 2 +- .../epmet/service/impl/StatsPublicityServiceImpl.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java index c09e064258..3525e45f97 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java @@ -72,7 +72,7 @@ public class StatsProjectServiceImpl implements StatsProjectService { customerStats(customerId); } } - } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() >= pageSize); + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); } /** 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 1fd8375faa..98f5b3f2a7 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 @@ -147,7 +147,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { }); } } - } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() >= pageSize); + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); return true; } @@ -176,7 +176,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { }); } } - } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() >= pageSize); + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); return true; } @@ -226,7 +226,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { }); } } - } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() >= pageSize); + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); return true; } @@ -255,7 +255,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //}); } } - } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() >= pageSize); + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); return true; } @@ -309,7 +309,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { }); } } - } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() >= pageSize); + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); return true; }