Browse Source

修改错误

dev_shibei_match
jianjun 5 years ago
parent
commit
d1226a2d4b
  1. 4
      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

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

@ -15,11 +15,11 @@ public interface IndexCalConstant {
/** /**
* 批量删除 一次删除50 * 批量删除 一次删除50
*/ */
Integer DELETE_SIZE=1000; Integer DELETE_SIZE = 1000;
/** /**
* 分批计算一次计算 10条 * 分批计算一次计算 10条
*/ */
Integer PAGE_SIZE = 1000; Integer PAGE_SIZE = 800;
String GRID_ID="GRID_ID"; 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; 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));

Loading…
Cancel
Save