|
|
@ -5,16 +5,20 @@ import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.constant.DataSourceConstant; |
|
|
|
import com.epmet.constant.IndexCalConstant; |
|
|
|
import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyDao; |
|
|
|
import com.epmet.entity.evaluationindex.extract.FactOriginTopicLogDailyEntity; |
|
|
|
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; |
|
|
|
import com.epmet.service.evaluationindex.extract.CalCpcIndexService; |
|
|
|
import com.epmet.service.evaluationindex.extract.FactOriginTopicLogDailyService; |
|
|
|
import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService; |
|
|
|
import com.epmet.service.evaluationindex.extract.IssueExtractService; |
|
|
|
import com.epmet.service.stats.DimCustomerPartymemberService; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.collections4.ListUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
/** |
|
|
|
* 党员相关 |
|
|
@ -29,6 +33,12 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { |
|
|
|
private DimCustomerPartymemberService dimCustomerPartymemberService; |
|
|
|
@Autowired |
|
|
|
private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; |
|
|
|
@Autowired |
|
|
|
private FactOriginTopicMainDailyService factOriginTopicMainDailyService; |
|
|
|
@Autowired |
|
|
|
private FactOriginTopicLogDailyService factOriginTopicLogDailyService; |
|
|
|
@Autowired |
|
|
|
private IssueExtractService issueExtractService; |
|
|
|
|
|
|
|
/** |
|
|
|
* @param customerId 客户id |
|
|
@ -44,18 +54,48 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { |
|
|
|
List<FactIndexPartyAblityCpcMonthlyEntity> indexPartyAblityCpcList = dimCustomerPartymemberService.selectPartyMemberList(customerId); |
|
|
|
//2、删除之前统计过的
|
|
|
|
deleteFactIndexPartyAblityCpcMonthly(customerId, monthId); |
|
|
|
//1、党员提出话题数
|
|
|
|
Map<String, Integer> createTopicCountMap = calCreateTopicCount(customerId, monthId); |
|
|
|
//2、党员参与话题数(支持、反对、评论、浏览)---目前只统计 党员评论话题次数之和
|
|
|
|
Map<String,Integer> joinTopicCountMap=calJoinTopicCount(customerId,monthId); |
|
|
|
//3、党员提出的话题转议题数
|
|
|
|
Map<String,Integer> shiftIssueCountMap=calShiftIssueCount(customerId,monthId); |
|
|
|
//4、党员提出的议题转项目数
|
|
|
|
Map<String,Integer> shiftProjectCountMap=calShiftProjectCount(customerId,monthId); |
|
|
|
//6、党员自建群群众人数
|
|
|
|
Map<String,Integer> groupUserCountMap=calgroupUserCount(customerId,monthId); |
|
|
|
//8、党员自建群活跃度——话题数
|
|
|
|
Map<String,Integer> groupTopicCountMap=calGroupTopicCountMap(customerId,monthId); |
|
|
|
//3、计算实际值,更新
|
|
|
|
for (FactIndexPartyAblityCpcMonthlyEntity indexPartyAblityCpcEntity : indexPartyAblityCpcList) { |
|
|
|
//TODO
|
|
|
|
//党员提出话题数
|
|
|
|
//党员参与话题数(支持、反对、评论、浏览)
|
|
|
|
//党员提出的话题转议题数
|
|
|
|
//党员提出的议题转项目数
|
|
|
|
//参加“三会一课”次数
|
|
|
|
//党员自建群群众人数
|
|
|
|
//党员自建群活跃群众人数
|
|
|
|
//党员自建群活跃度——话题数
|
|
|
|
//自建群活跃度——议题转项目率
|
|
|
|
//1、党员提出话题数
|
|
|
|
if (createTopicCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { |
|
|
|
indexPartyAblityCpcEntity.setCreateTopicCount(createTopicCountMap.get(indexPartyAblityCpcEntity.getUserId())); |
|
|
|
} |
|
|
|
//2、党员参与话题数(支持、反对、评论、浏览)---目前只统计 党员评论话题次数之和
|
|
|
|
if(joinTopicCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())){ |
|
|
|
indexPartyAblityCpcEntity.setJoinTopicCount(joinTopicCountMap.get(indexPartyAblityCpcEntity.getUserId())); |
|
|
|
} |
|
|
|
//3、党员提出的话题转议题数
|
|
|
|
if(shiftIssueCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())){ |
|
|
|
indexPartyAblityCpcEntity.setShiftIssueCount(shiftIssueCountMap.get(indexPartyAblityCpcEntity.getUserId())); |
|
|
|
} |
|
|
|
//4、党员提出的议题转项目数
|
|
|
|
if(shiftProjectCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())){ |
|
|
|
indexPartyAblityCpcEntity.setShiftProjectCount(shiftProjectCountMap.get(indexPartyAblityCpcEntity.getUserId())); |
|
|
|
} |
|
|
|
//5、参加“三会一课”次数 目前没有此业务,默认0
|
|
|
|
//6、党员自建群群众人数 TODO
|
|
|
|
if(groupUserCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())){ |
|
|
|
indexPartyAblityCpcEntity.setGroupUserCount(groupUserCountMap.get(indexPartyAblityCpcEntity.getUserId())); |
|
|
|
} |
|
|
|
//7、党员自建群活跃群众人数 TODO
|
|
|
|
//8、党员自建群活跃度——话题数
|
|
|
|
if(groupTopicCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())){ |
|
|
|
indexPartyAblityCpcEntity.setGroupTopicCount(groupTopicCountMap.get(indexPartyAblityCpcEntity.getUserId())); |
|
|
|
} |
|
|
|
//9、自建群活跃度——议题转项目率 TODO
|
|
|
|
|
|
|
|
} |
|
|
|
//4、分批插入
|
|
|
|
//批量插入
|
|
|
@ -63,8 +103,117 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { |
|
|
|
partition.forEach(list -> { |
|
|
|
this.FactIndexPartyAblityCpcMonthlyEntity(list); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param customerId |
|
|
|
* @param monthId |
|
|
|
* @return java.lang.Integer |
|
|
|
* @author yinzuomei |
|
|
|
* @description 1、查询出客户下所有党员对应的-党员提出话题数 |
|
|
|
* @Date 2020/9/18 10:59 |
|
|
|
**/ |
|
|
|
private Map<String, Integer> calCreateTopicCount(String customerId, String monthId) { |
|
|
|
List<Map<String, Integer>> mapList = factOriginTopicMainDailyService.selectPartyCreateTopicCount(customerId, monthId); |
|
|
|
Map<String, Integer> resultMap = new HashMap<>(); |
|
|
|
for (Map<String, Integer> map : mapList) { |
|
|
|
for (Map.Entry<String, Integer> m : map.entrySet()) { |
|
|
|
resultMap.put(m.getKey(), m.getValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
return resultMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return java.util.Map<java.lang.String,java.lang.Integer> |
|
|
|
* @param customerId |
|
|
|
* @param monthId |
|
|
|
* @author yinzuomei |
|
|
|
* @description 2、查询客户下,这个月内,每个党员评论话题的次数 |
|
|
|
* @Date 2020/9/18 13:33 |
|
|
|
**/ |
|
|
|
private Map<String, Integer> calJoinTopicCount(String customerId, String monthId) { |
|
|
|
List<Map<String, Integer>> mapList = factOriginTopicLogDailyService.selectJoinTopicCount(customerId, monthId); |
|
|
|
Map<String, Integer> resultMap = new HashMap<>(); |
|
|
|
for (Map<String, Integer> map : mapList) { |
|
|
|
for (Map.Entry<String, Integer> m : map.entrySet()) { |
|
|
|
resultMap.put(m.getKey(), m.getValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
return resultMap; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* @return java.util.Map<java.lang.String,java.lang.Integer> |
|
|
|
* @param customerId |
|
|
|
* @param monthId |
|
|
|
* @author yinzuomei |
|
|
|
* @description 3、党员提出的话题转议题数 |
|
|
|
* @Date 2020/9/18 13:53 |
|
|
|
**/ |
|
|
|
private Map<String, Integer> calShiftIssueCount(String customerId, String monthId) { |
|
|
|
List<Map<String, Integer>> mapList = issueExtractService.selectShiftIssueCount(customerId, monthId); |
|
|
|
Map<String, Integer> resultMap = new HashMap<>(); |
|
|
|
for (Map<String, Integer> map : mapList) { |
|
|
|
for (Map.Entry<String, Integer> m : map.entrySet()) { |
|
|
|
resultMap.put(m.getKey(), m.getValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
return resultMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return java.util.Map<java.lang.String,java.lang.Integer> |
|
|
|
* @param customerId |
|
|
|
* @param monthId |
|
|
|
* @author yinzuomei |
|
|
|
* @description 4、党员提出的议题转项目数 |
|
|
|
* @Date 2020/9/18 14:10 |
|
|
|
**/ |
|
|
|
private Map<String, Integer> calShiftProjectCount(String customerId, String monthId) { |
|
|
|
List<Map<String, Integer>> mapList = issueExtractService.selectShiftProjectCount(customerId, monthId); |
|
|
|
Map<String, Integer> resultMap = new HashMap<>(); |
|
|
|
for (Map<String, Integer> map : mapList) { |
|
|
|
for (Map.Entry<String, Integer> m : map.entrySet()) { |
|
|
|
resultMap.put(m.getKey(), m.getValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
return resultMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return java.util.Map<java.lang.String,java.lang.Integer> |
|
|
|
* @param customerId |
|
|
|
* @param monthId |
|
|
|
* @author yinzuomei |
|
|
|
* @description 6、党员自建群群众人数 |
|
|
|
* @Date 2020/9/18 15:38 |
|
|
|
**/ |
|
|
|
private Map<String, Integer> calgroupUserCount(String customerId, String monthId) { |
|
|
|
// TODO
|
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param customerId |
|
|
|
* @param monthId |
|
|
|
* @return java.util.Map<java.lang.String, java.lang.Integer> |
|
|
|
* @author yinzuomei |
|
|
|
* @description 8、党员自建群活跃度——话题数 |
|
|
|
* @Date 2020/9/18 14:31 |
|
|
|
**/ |
|
|
|
private Map<String, Integer> calGroupTopicCountMap(String customerId, String monthId) { |
|
|
|
List<Map<String, Integer>> mapList = factOriginTopicLogDailyService.selectGroupTopicCount(customerId, monthId); |
|
|
|
Map<String, Integer> resultMap = new HashMap<>(); |
|
|
|
for (Map<String, Integer> map : mapList) { |
|
|
|
for (Map.Entry<String, Integer> m : map.entrySet()) { |
|
|
|
resultMap.put(m.getKey(), m.getValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
return resultMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param customerId |
|
|
|