yinzuomei 4 years ago
parent
commit
861d46638e
  1. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java

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

Loading…
Cancel
Save