Browse Source

Merge remote-tracking branch 'remotes/origin/dev_screen_data' into dev

dev_shibei_match
jianjun 5 years ago
parent
commit
92f957c01b
  1. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java
  2. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java

@ -19,7 +19,7 @@ public interface IndexCalConstant {
/**
* 分批计算一次计算 10条
*/
Integer PAGE_SIZE = 800;
Integer PAGE_SIZE = 900;
String GRID_ID="GRID_ID";

18
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java

@ -85,9 +85,9 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
Map<String, CpcScoreEntity> preLastCpcScoreTotalMap = new HashMap<>();
//当前最后一条记录
CpcScoreEntity currentLastCpcScore = null;
//CpcScoreEntity currentLastCpcScore = null;
//当前第一条记录
CpcScoreEntity currentFirstCpcScore = null;
//CpcScoreEntity currentFirstCpcScore = null;
do {
//获取数据
list = cpcScoreDao.getPartScore(formDTO.getCustomerId(), formDTO.getMonthId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), (pageNo - NumConstant.ONE) * pageSize, pageSize);
@ -96,14 +96,14 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
log.warn("calculateTotalScore cpcScoreDao.getPartScore return empty,customerId:{},monthId:{}", formDTO.getCustomerId(), formDTO.getMonthId());
} else {
//获取最后一条
currentLastCpcScore = list.get(list.size() - 1);
//currentLastCpcScore = list.get(list.size() - 1);
//获取第一条
currentFirstCpcScore = list.get(0);
if (preLastCpcScoreTotalMap.containsKey(currentFirstCpcScore.getUserId())) {
//currentFirstCpcScore = list.get(0);
/*if (preLastCpcScoreTotalMap.containsKey(currentFirstCpcScore.getUserId())) {
cpcScoreTotalMap.putAll(preLastCpcScoreTotalMap);
preLastCpcScoreTotalMap.clear();
preLastCpcScoreTotalMap.put(currentLastCpcScore.getUserId(), null);
}
}*/
Map<String, List<CpcScoreEntity>> userGroupMap = list.stream().collect(Collectors.groupingBy(CpcScoreEntity::getUserId));
userGroupMap.forEach((userId, partScoreList) -> {
CpcScoreEntity totalEntity = null;
@ -120,12 +120,12 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
totalEntity.setScore(new BigDecimal(NumConstant.ZERO));
totalEntity.setAllParentIndexCode(NumConstant.ZERO_STR);
totalEntity.setWeight(new BigDecimal(NumConstant.ONE_NEG));
cpcScoreTotalMap.put(userId, totalEntity);
if (preLastCpcScoreTotalMap.containsKey(part.getUserId())) {
/* if (preLastCpcScoreTotalMap.containsKey(part.getUserId())) {
preLastCpcScoreTotalMap.put(part.getUserId(), part);
} else {
cpcScoreTotalMap.put(userId, totalEntity);
}
}*/
}
//自建群活跃度——议题转项目率 有阈值 >60%按60%算
BigDecimal total = part.getScore().multiply(indexGroupDetailEntity.getWeight());

Loading…
Cancel
Save