From 861d46638ecb76959a21f37e34d977668df56081 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 2 Mar 2022 10:42:04 +0800 Subject: [PATCH] 500 --- .../impl/CalCpcIndexServiceImpl.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) 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 7694f0cb87..cb5620eb0a 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 @@ -261,7 +261,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { } List list = new ArrayList<>(); - List> partionList = Lists.partition(indexPartyAblityCpcList, 200); + List> partionList = Lists.partition(indexPartyAblityCpcList, 500); List>> entityFutures = new ArrayList<>(); //2、计算实际值,更新 for (List partList : partionList) { @@ -415,11 +415,13 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { * @Date 2020/9/18 10:59 **/ private Map calCreateTopicCount(String customerId, String monthId) { + long startCpc = System.currentTimeMillis(); List list = factOriginTopicMainDailyService.selectPartyCreateTopicCount(customerId, monthId); Map resultMap = new HashMap<>(); for (CpcIndexCommonDTO cpcIndexCommonDTO: list) { resultMap.put(cpcIndexCommonDTO.getUserId(), cpcIndexCommonDTO.getIndexValue()); } + log.warn("1、党员相关-党建能力【党员提出话题数】执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId); return resultMap; } @@ -432,11 +434,13 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { * @Date 2020/9/18 13:33 **/ private Map calJoinTopicCount(String customerId, String monthId) { + long startCpc = System.currentTimeMillis(); List list = factOriginTopicLogDailyService.selectJoinTopicCount(customerId, monthId); Map resultMap = new HashMap<>(); for (CpcIndexCommonDTO cpcIndexCommonDTO : list) { resultMap.put(cpcIndexCommonDTO.getUserId(), cpcIndexCommonDTO.getIndexValue()); } + log.warn("2、党员相关-党建能力【党员参与话题数】执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId); return resultMap; } @@ -450,11 +454,13 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { * @Date 2020/9/18 13:53 **/ private Map calShiftIssueCount(String customerId, String monthId) { + long startCpc = System.currentTimeMillis(); List list = issueExtractService.selectShiftIssueCount(customerId, monthId); Map resultMap = new HashMap<>(); for (CpcIndexCommonDTO cpcIndexCommonDTO : list) { resultMap.put(cpcIndexCommonDTO.getUserId(), cpcIndexCommonDTO.getIndexValue()); } + log.warn("3、党员相关-党建能力【党员提出的话题转议题数】执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId); return resultMap; } @@ -467,12 +473,14 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { * @Date 2020/9/18 14:10 **/ private Map calShiftProjectCount(String customerId, String monthId) { + long startCpc = System.currentTimeMillis(); //查询fact_origin_project_main_daily 表 中议题的议题的状态为 shift_ List list = factOriginProjectMainDailyService.selectShiftProjectCount(customerId, monthId); Map resultMap = new HashMap<>(); for (CpcIndexCommonDTO cpcIndexCommonDTO : list) { resultMap.put(cpcIndexCommonDTO.getUserId(), cpcIndexCommonDTO.getIndexValue()); } + log.warn("4、党员相关-党建能力【党员提出的议题转项目数】执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId); return resultMap; } @@ -485,12 +493,14 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { * @Date 2021/5/12 13:38 **/ private Map calJoinThreeMeetsCount(String customerId, String monthId) { + long startCpc = System.currentTimeMillis(); //查询小组活动签到表,计算用户在本月内签到的活动次数 List list=groupDataService.selectJoinThreeMeetsCount(customerId,monthId); Map resultMap = new HashMap<>(); for (CpcIndexCommonDTO cpcIndexCommonDTO : list) { resultMap.put(cpcIndexCommonDTO.getUserId(), cpcIndexCommonDTO.getIndexValue()); } + log.warn("5、党员相关-党建能力【参加“三会一课”次数】执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId); return resultMap; } @@ -505,6 +515,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { private Map calgroupUserCount(String customerId, String monthId, List partyMemberList, Map> userCreatedGroups) { + long startCpc = System.currentTimeMillis(); /*含义:评价周期内,党员自建群中群众成员数。 数据来源:用户社群关系表。 计算方法:对党员i的所有j个自建群,从用户社群关系表中统计属于每个自建群的群众用户总人数,并对j个群众用户总数进行不重复累加。 @@ -528,6 +539,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { map.put(partyMember.getUserId(), memberIdList.size()); } } + log.warn("6、党员相关-党建能力【党员自建群群众人数】执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId); return map; } @@ -543,6 +555,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { private Map calGroupActiveUserCount(String customerId, String monthId, List partyMemberList, Map> userCreatedGroups) { + long startCpc = System.currentTimeMillis(); /*含义:评价周期内,党员自建群中活跃群众成员数。所谓活跃群成员,即评价周期内参与话题、事件评论、点赞、点踩总次数大于给定阈值的群众用户。 数据来源:话题用户阅读表、话题评论用户表态表、话题评论表、事件点赞点踩表、事件评论点赞点踩表、事件评论表、用户信息表。 计算方法: @@ -570,6 +583,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { map.put(partyMember.getUserId(), NumConstant.ZERO); continue; } + //todo 可以先把本月内评论的用户+本月内表决过的用户 集合查询出来。避免循环查询 //3、判断每个成员是否 “活跃” for (String memberId : memberIdList) { //1、判断成员在本月内是否评论过 @@ -587,6 +601,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { //赋值每个党员的 -- 党员自建群活跃群众人数 map.put(partyMember.getUserId(), groupActiveUserCount); } + log.warn("7、党员相关-党建能力【党员自建群活跃群众人数】执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId); return map; } @@ -600,6 +615,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { * @Date 2020/9/18 14:31 **/ private Map calGroupTopicCount(String customerId, String monthId) { + long startCpc = System.currentTimeMillis(); /*含义:评价周期内,党员自建群中话题发布数。 数据来源:话题表。 计算方法:从话题表中统计党员自建群i的话题总数;对所有自建群话题数累加。 @@ -609,6 +625,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { for (CpcIndexCommonDTO dto : list) { resultMap.put(dto.getUserId(), dto.getIndexValue()); } + log.warn("8、党员相关-党建能力【党员自建群活跃度——话题数】执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId); return resultMap; } @@ -623,6 +640,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { String monthId, List partyMemberList, Map> userCreatedGroups) { + long startCpc = System.currentTimeMillis(); Map map = new HashMap<>(); for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) { //如果党员自建群为空,直接赋值0 @@ -657,6 +675,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { BigDecimal topicToIssueRatio = new BigDecimal(topicToIssueRatioStr).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); map.put(partyMember.getUserId(), topicToIssueRatio); } + log.warn("9、党员相关-党建能力【自建群活跃度——议题转项目率】执行完毕======总耗时:{}ms,customerId:{}", System.currentTimeMillis() - startCpc, customerId); return map; }