|
|
@ -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()); |
|
|
|