|
|
@ -2,7 +2,6 @@ package com.epmet.service.evaluationindex.extract.dataToIndex.impl; |
|
|
|
|
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
|
import com.epmet.constant.IndexCalConstant; |
|
|
|
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; |
|
|
|
import com.epmet.service.evaluationindex.extract.dataToIndex.CalCpcIndexService; |
|
|
|
import com.epmet.service.evaluationindex.extract.todata.*; |
|
|
@ -10,7 +9,6 @@ import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthl |
|
|
|
import com.epmet.service.stats.DimCustomerPartymemberService; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
import org.apache.commons.collections4.ListUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
@ -63,9 +61,6 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { |
|
|
|
} |
|
|
|
String quarterId= DateUtils.getQuarterId(monthId); |
|
|
|
String yearId=DateUtils.getYearId(monthId); |
|
|
|
//2、删除之前统计过的
|
|
|
|
factIndexPartyAblityCpcMonthlyService.deleteFactIndexPartyAblityCpcMonthly(customerId, monthId); |
|
|
|
|
|
|
|
|
|
|
|
//1、党员提出话题数
|
|
|
|
Map<String, Integer> createTopicCountMap = calCreateTopicCount(customerId, monthId); |
|
|
@ -88,7 +83,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { |
|
|
|
//9、自建群活跃度——议题转项目率
|
|
|
|
Map<String, BigDecimal> topicToIssueRatioMap = caltopicToIssueRatio(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups); |
|
|
|
|
|
|
|
//3、计算实际值,更新
|
|
|
|
//2、计算实际值,更新
|
|
|
|
for (FactIndexPartyAblityCpcMonthlyEntity indexPartyAblityCpcEntity : indexPartyAblityCpcList) { |
|
|
|
indexPartyAblityCpcEntity.setMonthId(monthId); |
|
|
|
indexPartyAblityCpcEntity.setQuarterId(quarterId); |
|
|
@ -127,12 +122,8 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { |
|
|
|
indexPartyAblityCpcEntity.setTopicToIssueRatio(topicToIssueRatioMap.get(indexPartyAblityCpcEntity.getUserId())); |
|
|
|
} |
|
|
|
} |
|
|
|
//4、分批插入批量插入
|
|
|
|
List<List<FactIndexPartyAblityCpcMonthlyEntity>> partition = ListUtils.partition(indexPartyAblityCpcList, IndexCalConstant.INSERT_SIZE); |
|
|
|
partition.forEach(list -> { |
|
|
|
factIndexPartyAblityCpcMonthlyService.saveFactIndexPartyAblityCpcMonthlyEntity(list); |
|
|
|
}); |
|
|
|
|
|
|
|
//3、删除之前统计过的、批插入批量插入
|
|
|
|
factIndexPartyAblityCpcMonthlyService.delAndSavePartyAblityCpcMonthly(customerId,monthId,indexPartyAblityCpcList); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|