Browse Source

公众参与解决 dimGrid 维度不存在时的情况兼容

dev_shibei_match
jianjun 5 years ago
parent
commit
1f495c3d9f
  1. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java

14
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java

@ -112,14 +112,18 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService {
return;
}
Map<String, GridUserCountResultDTO> userCountMap = userCountList.stream().collect(Collectors.toMap(GridUserCountResultDTO::getOrgId, o -> o));
issueTotal.forEach(issue -> {
for (FactIssueGridMonthlyEntity issue : issueTotal) {
String gridId = issue.getGridId();
ScreenUserJoinEntity entity = insertMap.get(gridId);
if (entity == null) {
log.warn("gridId:{} is not exist in dimGrid,monthId:{},gridId:{}", formDTO.getCustomerId(), formDTO.getMonthId(), gridId);
continue;
}
entity.setJoinTotal(issue.getIssueIncr());
GridUserCountResultDTO user = userCountMap.get(gridId);
if (user == null) {
log.warn("gridId:{} is not exist in issue,customerId:{},monthId:{},gridId:{}", JSON.toJSONString(issue), formDTO.getCustomerId(), formDTO.getMonthId(), gridId);
return;
continue;
}
//百人人均议题:统计周期内总的议题数/(注册用户数/100)
log.debug("issue:{}", JSON.toJSONString(issue));
@ -129,7 +133,7 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService {
.divide(new BigDecimal(NumConstant.ONE_HUNDRED)), 4, BigDecimal.ROUND_HALF_UP);
entity.setAvgIssue(avgIssueCount);
}
});
}
//获取该月 表决的人数
@ -153,6 +157,10 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService {
for (Map.Entry<String, List<IssueVoteUserCountResultDTO>> entry : voteMap.entrySet()) {
String gridId = entry.getKey();
ScreenUserJoinEntity entity = insertMap.get(gridId);
if (entity == null) {
log.warn("gridId:{} is not exist in dimGrid,monthId:{},gridId:{}", formDTO.getCustomerId(), formDTO.getMonthId(), gridId);
continue;
}
List<IssueVoteUserCountResultDTO> issueList = entry.getValue();
BigDecimal bigDecimal = new BigDecimal(0);
BigDecimal votedByIssueCount = new BigDecimal(issueList.get(0).getIssueCount());

Loading…
Cancel
Save