Browse Source

Merge remote-tracking branch 'remotes/origin/dev_bugfix_ljj' into dev

dev_shibei_match
jianjun 4 years ago
parent
commit
6524ec2be0
  1. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java
  2. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java
  3. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java
  4. 2
      epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/MathUtilTest.java

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java

@ -153,7 +153,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl<DeptScoreDao, DeptScor
});
Map<String, DeptSelfSubScoreEntity> insertMap = new HashMap<>();
subScore.forEach(score -> {
String key = score.getAgencyId().concat(index.getIndexCode());
String key = score.getDeptId().concat(index.getIndexCode());
DeptSelfSubScoreEntity scoreEntity = insertMap.get(key);
if (scoreEntity == null) {
scoreEntity = ConvertUtils.sourceToTarget(score, DeptSelfSubScoreEntity.class);
@ -465,4 +465,4 @@ public class DeptScoreServiceImpl extends BaseServiceImpl<DeptScoreDao, DeptScor
return map;
}
}
}

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java

@ -135,7 +135,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService {
start = System.currentTimeMillis();
try {
flag = gridCorreLationService.calculateGridCorreLation(formDTO);
log.info("客户Id:{}【网格相关】计算完毕,总耗时:{}秒,result:{},result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag);
log.info("客户Id:{}【网格相关】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag);
} catch (Exception e) {
log.error("indexCalculate calculateGridCorreLation exception", e);
}
@ -143,7 +143,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService {
start = System.currentTimeMillis();
try {
flag = indexCalculateCommunityService.calCommunityAll(formDTO);
log.info("客户Id:{}【社区相关】计算完毕,总耗时:{}秒,result:{},result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag);
log.info("客户Id:{}【社区相关】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag);
} catch (Exception e) {
log.error("indexCalculate calCommunityAll exception", e);
}

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

@ -80,13 +80,19 @@ public class BatchScoreCalculator {
.multiply(
(maxScoreValue.subtract(minScoreValue).divide(new BigDecimal(Math.PI / 2), 10, RoundingMode.HALF_UP)))
.add(minScoreValue).setScale(6, RoundingMode.HALF_UP);
//
if (scoreCalculator.getCorrelation().getCode().equals(Correlation.NEGATIVE)) {
normalizeValue = maxScoreValue.subtract(normalizeValue);
}
} else {
normalizeValue = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold));
}
//如果是负相关 则用100-归一后的值为最大值减
if (Correlation.NEGATIVE.getCode().equals(scoreCalculator.getCorrelation().getCode())) {
normalizeValue = maxScoreValue.subtract(normalizeValue);
}
}
//如果归一后的值小于0 则置为0
if (normalizeValue.compareTo(NumConstant.ZERO_DECIMAL)<=-1){
normalizeValue = NumConstant.ZERO_DECIMAL;
}
BigDecimal score = normalizeValue.multiply(weight).setScale(6, RoundingMode.HALF_UP);
CalculateResult result = scoreCountOfSamples.get(sampleId);

2
epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/MathUtilTest.java

@ -5,7 +5,7 @@ import java.math.RoundingMode;
public class MathUtilTest {
public static void main(String[] args) {
//值 域:(-π/2,π/2) ->(60,100)
//值 域:[-π/2,π/2] ->[60,100]
double tan = Math.atan(4);
double tan2 = Math.atan(1);
double tan3 = Math.atan(8);

Loading…
Cancel
Save