diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java index 5e9177adf7..aa77da7fc6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java @@ -170,4 +170,12 @@ public interface FactOriginIssueLogDailyDao extends BaseDao */ List getClosedIssueIncr(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 查询出本月内做过议题表决的用户id + * @param customerId + * @param monthId + * @return + */ + List queryVoteUserIds(@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/evaluationindex/extract/FactOriginTopicLogDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicLogDailyDao.java index ef3ab5e833..0e8b939582 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicLogDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicLogDailyDao.java @@ -103,4 +103,12 @@ public interface FactOriginTopicLogDailyDao extends BaseDao selectPartyActiveTopic(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("isParty") Integer isParty); + + /** + * 查询出本月内,评论过话题的用户id + * @param customerId + * @param monthId + * @return + */ + List queryCommentTopicUserIds(@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/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java index cb5620eb0a..90f39088ea 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java @@ -583,19 +583,29 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { map.put(partyMember.getUserId(), NumConstant.ZERO); continue; } - //todo 可以先把本月内评论的用户+本月内表决过的用户 集合查询出来。避免循环查询 + //可以先把本月内评论的用户+本月内表决过的用户 集合查询出来。避免循环查询 + List commentTopicUserIds=factOriginTopicLogDailyService.queryCommentTopicUserIds(customerId,monthId); + List voteUserIds=issueExtractService.queryVoteUserIds(customerId,monthId); //3、判断每个成员是否 “活跃” for (String memberId : memberIdList) { + //注释2022.03.02 //1、判断成员在本月内是否评论过 - Integer topicCommentCount = factOriginTopicLogDailyService.selectUserCommentCount(memberId, customerId, monthId); + /*Integer topicCommentCount = factOriginTopicLogDailyService.selectUserCommentCount(memberId, customerId, monthId); if (topicCommentCount > 0) { groupActiveUserCount++; continue; - } + }*/ //2、判断成员在本月内是否表决过(支持or反对)议题 - Integer voteCount = issueExtractService.selectCountUserVote(memberId, customerId, monthId); + /*Integer voteCount = issueExtractService.selectCountUserVote(memberId, customerId, monthId); if (voteCount > 0) { groupActiveUserCount++; + }*/ + if (CollectionUtils.isNotEmpty(commentTopicUserIds) && commentTopicUserIds.contains(memberId)) { + groupActiveUserCount++; + continue; + } + if (CollectionUtils.isNotEmpty(voteUserIds) && voteUserIds.contains(memberId)) { + groupActiveUserCount++; } } //赋值每个党员的 -- 党员自建群活跃群众人数 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicLogDailyService.java index 7c43394dea..6820edb992 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicLogDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicLogDailyService.java @@ -79,4 +79,12 @@ public interface FactOriginTopicLogDailyService extends BaseService selectPartyActiveTopic(String customerId, String monthId,Integer isParty); + + /** + * 查询出本月内,评论过话题的用户id + * @param customerId + * @param monthId + * @return + */ + List queryCommentTopicUserIds(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/evaluationindex/extract/todata/IssueExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/IssueExtractService.java index 85caea8cc5..010791542e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/IssueExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/IssueExtractService.java @@ -107,4 +107,12 @@ public interface IssueExtractService { * @date 2020/9/21 9:37 上午 */ List selectPartyActiveIssueVote(String customerId, String monthId, Integer isParty); + + /** + * 查询出本月内做过议题表决的用户id + * @param customerId + * @param monthId + * @return + */ + List queryVoteUserIds(String customerId, String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicLogDailyServiceImpl.java index 70ecc1807f..46da054bd8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicLogDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicLogDailyServiceImpl.java @@ -108,4 +108,16 @@ public class FactOriginTopicLogDailyServiceImpl extends BaseServiceImpl selectPartyActiveTopic(String customerId, String monthId, Integer isParty) { return baseDao.selectPartyActiveTopic(customerId, monthId, isParty); } + + /** + * 查询出本月内,评论过话题的用户id + * + * @param customerId + * @param monthId + * @return + */ + @Override + public List queryCommentTopicUserIds(String customerId, String monthId) { + return baseDao.queryCommentTopicUserIds(customerId,monthId); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java index 4cdd1368e6..d55cfdcc71 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java @@ -374,4 +374,17 @@ public class IssueExtractServiceImpl implements IssueExtractService { public List selectPartyActiveIssueVote(String customerId, String monthId, Integer isParty) { return issueLogDailyDao.selectPartyActiveIssueVote(customerId, monthId, isParty); } + + /** + * 查询出本月内做过议题表决的用户id + * + * @param customerId + * @param monthId + * @return + */ + @Override + public List queryVoteUserIds(String customerId, String monthId) { + return issueLogDailyDao.queryVoteUserIds(customerId,monthId); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml index 995c6cebad..6c8aa06b96 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml @@ -237,4 +237,26 @@ GRID_ID, OPERATION_USER_ID + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml index 1d7bc88cab..8e6f652f07 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml @@ -143,4 +143,27 @@ AND CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + + + \ No newline at end of file