Browse Source

批量归一算法 返回原始值

dev_shibei_match
jianjun 5 years ago
parent
commit
d5b1c5a225
  1. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java

@ -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));
}

Loading…
Cancel
Save