Browse Source

总分计算错误

dev_shibei_match
jianjun 5 years ago
parent
commit
e8c33cf1fe
  1. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java
  2. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java

@ -148,7 +148,7 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
templateEntity.setAllParentIndexCode(allIndexCodeSb.toString());
templateEntity.setId(UniqueIdGenerator.generate());
templateEntity.setCorrelation(index.getCorrelation());
buildIndexGroupDetail(templateEntity,indexDictEntity, index, group1, 2);
buildIndexGroupDetail(templateEntity, indexDictEntity, index, 2);
indexGroupDetailMap.put(index.getLevel1Index() + level4Index, templateEntity);
}
}
@ -164,7 +164,7 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
templateEntity.setAllParentIndexCode(allIndexCodeSb.toString());
templateEntity.setId(UniqueIdGenerator.generate());
templateEntity.setCorrelation(index.getCorrelation());
buildIndexGroupDetail(templateEntity,indexDictEntity, index, group2, 5);
buildIndexGroupDetail(templateEntity, indexDictEntity, index, 5);
indexGroupDetailMap.put(index.getLevel1Index() + index.getLevel5Index(), templateEntity);
}
} else {
@ -203,8 +203,8 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
templateEntity.setAllParentIndexCode(allIndexCodeSb.toString());
templateEntity.setId(UniqueIdGenerator.generate());
templateEntity.setCorrelation(index.getCorrelation());
buildIndexGroupDetail(templateEntity,indexDictEntity, index, group1, 2);
indexGroupDetailMap.put(level2Index,templateEntity);
buildIndexGroupDetail(templateEntity, indexDictEntity, index, 2);
indexGroupDetailMap.put(groupMapKey, templateEntity);
}
}
indexDictEntity = indexDicMap.get(index.getLevel5Index());
@ -218,7 +218,7 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
templateEntity.setAllParentIndexCode(allIndexCodeSb.toString());
templateEntity.setId(UniqueIdGenerator.generate());
templateEntity.setCorrelation(index.getCorrelation());
buildIndexGroupDetail(templateEntity, indexDictEntity, index, group2, 5);
buildIndexGroupDetail(templateEntity, indexDictEntity, index, 5);
indexGroupDetailMap.put(index.getLevel1Index() + index.getLevel5Index(), templateEntity);
}
}
@ -228,7 +228,7 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
LOGGER.info("所有指标分组明细数据解析完成:{}", JSON.toJSONString(indexGroupDetailMap.values()));
}
private void buildIndexGroupDetail( IndexGroupDetailTemplateEntity templateEntity,IndexDictEntity indexDictEntity, IndexModel index, IndexGroupTemplateEntity parentGroup, Integer level) {
private void buildIndexGroupDetail(IndexGroupDetailTemplateEntity templateEntity, IndexDictEntity indexDictEntity, IndexModel index, Integer level) {
if (level == 5) {
templateEntity.setIndexCode(Pinyin4jUtil.getSpellPinYin(index.getLevel5Index(), false, 4));
String level5WeightStr = index.getLevel5Weight().replace("%", "");

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java

@ -84,11 +84,12 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
totalEntity = ConvertUtils.sourceToTarget(part, CpcScoreEntity.class);
totalEntity.setIsTotal(NumConstant.ONE_STR);
totalEntity.setIndexCode(indexGroupDetailEntity.getIndexCode());
totalEntity.setScore(new BigDecimal(0));
cpcScoreTotalMap.put(userId, totalEntity);
}
//todo 自建群活跃度——议题转项目率 有阈值 >60%按60%算
BigDecimal total = part.getScore().multiply(indexGroupDetailEntity.getWeight());
log.debug("userId:{},分数:{},权重:{},total:{}", userId, part.getScore(), indexGroupDetailEntity.getWeight(), total);
log.info("userId:{},分数:{},权重:{},total:{}", userId, part.getScore(), indexGroupDetailEntity.getWeight(), total);
totalEntity.setScore(totalEntity.getScore().add(total));
}
});
@ -225,6 +226,8 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
indexInputVO.setIndexId(index.getIndexCode());
//权重
indexInputVO.setWeight(index.getWeight());
//阈值
indexInputVO.setThreshold(index.getThreshold());
BigDecimal minValue = null;
BigDecimal maxValue = null;

Loading…
Cancel
Save