|
|
@ -37,7 +37,7 @@ public class BatchScoreCalculator { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 执行计算,以样本的所有指标总得分及明细分数值 |
|
|
|
* 执行计算,以样本的所有指标总得分(原始值)及明细分数(归一后的值 不乘以权重)值 |
|
|
|
* |
|
|
|
* @param indexInputVOS |
|
|
|
* @return |
|
|
@ -56,7 +56,9 @@ public class BatchScoreCalculator { |
|
|
|
//遍历该指标下的每个数据
|
|
|
|
for (SampleValue vo : indexValueVOs) { |
|
|
|
String sampleId = vo.getSampleId(); |
|
|
|
BigDecimal score = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold), weight).setScale(6, RoundingMode.HALF_UP); |
|
|
|
//归一后的值
|
|
|
|
BigDecimal normalizeValue = getFinalSampleValue(vo.getSampleValue(), threshold); |
|
|
|
BigDecimal score = scoreCalculator.normalize(normalizeValue, weight).setScale(6, RoundingMode.HALF_UP); |
|
|
|
CalculateResult result = scoreCountOfSamples.get(sampleId); |
|
|
|
|
|
|
|
if (result == null) { |
|
|
@ -67,7 +69,7 @@ public class BatchScoreCalculator { |
|
|
|
result.setDetails(new ArrayList<>()); |
|
|
|
scoreCountOfSamples.put(sampleId, result); |
|
|
|
} |
|
|
|
IndexScoreVo sampleScore = new IndexScoreVo(idx.getIndexId(), idx.getAllParentIndexCode(), score, idx.getWeight()); |
|
|
|
IndexScoreVo sampleScore = new IndexScoreVo(idx.getIndexId(), idx.getAllParentIndexCode(), normalizeValue, idx.getWeight()); |
|
|
|
result.getDetails().add(sampleScore); |
|
|
|
result.setTotalScore(result.getTotalScore().add(score).setScale(6, RoundingMode.HALF_UP)); |
|
|
|
} |
|
|
|