public static Map<String, CalculationResultDTO> statisticsLevelSubtotal(final List computeResultExports,
final int scoreItemLength) {
// 转换为BigDecimal用于后面计算处理
final BigDecimal weightGroupDataCount = new BigDecimal(CollectionUtils.size(computeResultExports) / scoreItemLength);
return CollectionUtils.emptyIfNull(computeResultExports)
.stream()
.map(item -> levelSubtotalCompute(item, weightGroupDataCount))
// 保证评分项名称和评分项对应值的顺序,需要使用LinkedHashMap保存顺序
.collect(Collectors.toMap(CalculationResultDTO::getScoreItemId,
Function.identity(),
(dto1, dto2) -> new CalculationResultDTO(dto1.getScoreItemId(), dto1.getCalculationResultValue().add(dto2.getCalculationResultValue()))));