Browse Source

修改错误

dev_shibei_match
jianjun 5 years ago
parent
commit
d1226a2d4b
  1. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java
  2. 8
      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 = 1000;
Integer PAGE_SIZE = 800;
String GRID_ID="GRID_ID";

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

@ -84,7 +84,10 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
List<CpcScoreEntity> list = null;
Map<String, CpcScoreEntity> preLastCpcScoreTotalMap = new HashMap<>();
//当前最后一条记录
CpcScoreEntity currentLastCpcScore = null;
//当前第一条记录
CpcScoreEntity currentFirstCpcScore = null;
do {
//获取数据
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 {
//获取最后一条
currentLastCpcScore = list.get(list.size() - 1);
if (preLastCpcScoreTotalMap.containsKey(currentLastCpcScore.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));

Loading…
Cancel
Save