|  |  | @ -261,7 +261,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         List<FactIndexPartyAblityCpcMonthlyEntity> list = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |         List<List<FactIndexPartyAblityCpcMonthlyEntity>> partionList = Lists.partition(indexPartyAblityCpcList, 200); | 
			
		
	
		
			
				
					|  |  |  |         List<List<FactIndexPartyAblityCpcMonthlyEntity>> partionList = Lists.partition(indexPartyAblityCpcList, 500); | 
			
		
	
		
			
				
					|  |  |  |         List<CompletableFuture<List<FactIndexPartyAblityCpcMonthlyEntity>>> entityFutures = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |         //2、计算实际值,更新
 | 
			
		
	
		
			
				
					|  |  |  |         for (List<FactIndexPartyAblityCpcMonthlyEntity> partList : partionList) { | 
			
		
	
	
		
			
				
					|  |  | @ -415,11 +415,13 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { | 
			
		
	
		
			
				
					|  |  |  |      * @Date 2020/9/18 10:59 | 
			
		
	
		
			
				
					|  |  |  |      **/ | 
			
		
	
		
			
				
					|  |  |  |     private Map<String, Integer> calCreateTopicCount(String customerId, String monthId) { | 
			
		
	
		
			
				
					|  |  |  |         long startCpc = System.currentTimeMillis(); | 
			
		
	
		
			
				
					|  |  |  |         List<CpcIndexCommonDTO> list = factOriginTopicMainDailyService.selectPartyCreateTopicCount(customerId, monthId); | 
			
		
	
		
			
				
					|  |  |  |         Map<String, Integer> 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<String, Integer> calJoinTopicCount(String customerId, String monthId) { | 
			
		
	
		
			
				
					|  |  |  |         long startCpc = System.currentTimeMillis(); | 
			
		
	
		
			
				
					|  |  |  |         List<CpcIndexCommonDTO> list = factOriginTopicLogDailyService.selectJoinTopicCount(customerId, monthId); | 
			
		
	
		
			
				
					|  |  |  |         Map<String, Integer> 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<String, Integer> calShiftIssueCount(String customerId, String monthId) { | 
			
		
	
		
			
				
					|  |  |  |         long startCpc = System.currentTimeMillis(); | 
			
		
	
		
			
				
					|  |  |  |         List<CpcIndexCommonDTO> list = issueExtractService.selectShiftIssueCount(customerId, monthId); | 
			
		
	
		
			
				
					|  |  |  |         Map<String, Integer> 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<String, Integer> calShiftProjectCount(String customerId, String monthId) { | 
			
		
	
		
			
				
					|  |  |  |         long startCpc = System.currentTimeMillis(); | 
			
		
	
		
			
				
					|  |  |  |         //查询fact_origin_project_main_daily 表 中议题的议题的状态为 shift_
 | 
			
		
	
		
			
				
					|  |  |  |         List<CpcIndexCommonDTO> list = factOriginProjectMainDailyService.selectShiftProjectCount(customerId, monthId); | 
			
		
	
		
			
				
					|  |  |  |         Map<String, Integer> 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<String, Integer> calJoinThreeMeetsCount(String customerId, String monthId) { | 
			
		
	
		
			
				
					|  |  |  |         long startCpc = System.currentTimeMillis(); | 
			
		
	
		
			
				
					|  |  |  |         //查询小组活动签到表,计算用户在本月内签到的活动次数
 | 
			
		
	
		
			
				
					|  |  |  |         List<CpcIndexCommonDTO> list=groupDataService.selectJoinThreeMeetsCount(customerId,monthId); | 
			
		
	
		
			
				
					|  |  |  |         Map<String, Integer> 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<String, Integer> calgroupUserCount(String customerId, String monthId, | 
			
		
	
		
			
				
					|  |  |  |                                                    List<FactIndexPartyAblityCpcMonthlyEntity> partyMemberList, | 
			
		
	
		
			
				
					|  |  |  |                                                    Map<String, List<String>> 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<String, Integer> calGroupActiveUserCount(String customerId, String monthId, | 
			
		
	
		
			
				
					|  |  |  |                                                          List<FactIndexPartyAblityCpcMonthlyEntity> partyMemberList, | 
			
		
	
		
			
				
					|  |  |  |                                                          Map<String, List<String>> 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<String, Integer> 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<FactIndexPartyAblityCpcMonthlyEntity> partyMemberList, | 
			
		
	
		
			
				
					|  |  |  |                                                          Map<String, List<String>> userCreatedGroups) { | 
			
		
	
		
			
				
					|  |  |  |         long startCpc = System.currentTimeMillis(); | 
			
		
	
		
			
				
					|  |  |  |         Map<String, BigDecimal> 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; | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | 
 |