|
|
@ -84,7 +84,10 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { |
|
|
List<CpcScoreEntity> list = null; |
|
|
List<CpcScoreEntity> list = null; |
|
|
|
|
|
|
|
|
Map<String, CpcScoreEntity> preLastCpcScoreTotalMap = new HashMap<>(); |
|
|
Map<String, CpcScoreEntity> preLastCpcScoreTotalMap = new HashMap<>(); |
|
|
|
|
|
//当前最后一条记录
|
|
|
CpcScoreEntity currentLastCpcScore = null; |
|
|
CpcScoreEntity currentLastCpcScore = null; |
|
|
|
|
|
//当前第一条记录
|
|
|
|
|
|
CpcScoreEntity currentFirstCpcScore = null; |
|
|
do { |
|
|
do { |
|
|
//获取数据
|
|
|
//获取数据
|
|
|
list = cpcScoreDao.getPartScore(formDTO.getCustomerId(), formDTO.getMonthId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), (pageNo - NumConstant.ONE) * pageSize, pageSize); |
|
|
list = cpcScoreDao.getPartScore(formDTO.getCustomerId(), formDTO.getMonthId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), (pageNo - NumConstant.ONE) * pageSize, pageSize); |
|
|
@ -94,8 +97,11 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { |
|
|
} else { |
|
|
} else { |
|
|
//获取最后一条
|
|
|
//获取最后一条
|
|
|
currentLastCpcScore = list.get(list.size() - 1); |
|
|
currentLastCpcScore = list.get(list.size() - 1); |
|
|
if (preLastCpcScoreTotalMap.containsKey(currentLastCpcScore.getUserId())) { |
|
|
//获取第一条
|
|
|
|
|
|
currentFirstCpcScore = list.get(0); |
|
|
|
|
|
if (preLastCpcScoreTotalMap.containsKey(currentFirstCpcScore.getUserId())) { |
|
|
cpcScoreTotalMap.putAll(preLastCpcScoreTotalMap); |
|
|
cpcScoreTotalMap.putAll(preLastCpcScoreTotalMap); |
|
|
|
|
|
preLastCpcScoreTotalMap.clear(); |
|
|
preLastCpcScoreTotalMap.put(currentLastCpcScore.getUserId(), null); |
|
|
preLastCpcScoreTotalMap.put(currentLastCpcScore.getUserId(), null); |
|
|
} |
|
|
} |
|
|
Map<String, List<CpcScoreEntity>> userGroupMap = list.stream().collect(Collectors.groupingBy(CpcScoreEntity::getUserId)); |
|
|
Map<String, List<CpcScoreEntity>> userGroupMap = list.stream().collect(Collectors.groupingBy(CpcScoreEntity::getUserId)); |
|
|
|