Browse Source

Merge remote-tracking branch 'remotes/origin/dev_index_explain_fix' into develop

master
jianjun 4 years ago
parent
commit
7fa783bc3b
  1. 1
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java
  2. 29
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java

1
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java

@ -34,6 +34,7 @@ public class IndexConstant {
public static final String INDEX_SCORE_TITLE = "当月指数";
public static final String INDEX_SCORE_DESC = "自然月周期内,当月指数得分(totalScore)=党建指数得分(dangjiannengli)*相关权重(dangjiannengliweight)+治理指数得分(zhilinengli)*相关权重(zhilinengliweight)+服务指数得分(fuwunengli)*相关权重(fuwunengliweight)";
public static final String INDEX_DISTRINCT_TABLE1_INDEX_CODE = "suoyoujiedaozlnlpjz";
public static final String INDEX_DISTRINCT_TABLE2_INDEX_CODE = "suoyouzhishubmzlnlpjz";
public static final String ZHI_LI_NENG_LI = "zhilinengli";
public static final String PATTERN_D = "d";
public static final String PATTERN_WEIGHT = "weight";

29
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java

@ -112,10 +112,18 @@ public class IndexExplainServiceImpl implements IndexExplainService {
//全区相关的服务能力的含义中 有权重 所以特殊处理下
if (explainDTO.getOrgLevel().equals(OrgLevelEnum.DISTRICT.getCode()) && IndexConstant.ZLZS_CN.equals(explainDTO.getTitle())) {
List<IndexGroupDetailResult> detailResults = detailEntityMap.get(IndexConstant.QUAN_QU_ZHI_LI_INDEX_CODE);
detailResults.forEach(index -> {
String newMeaning = result.getMeaning().replaceFirst(IndexConstant.PATTERN_D,
index.getWeight().multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.ZERO, BigDecimal.ROUND_HALF_UP).toString());
//获取分数 补充下
IndexScoreFormDTO ablityListFormDTO = new IndexScoreFormDTO();
ablityListFormDTO.setCustomerId(formDTO.getCustomerId());
ablityListFormDTO.setOrgId(formDTO.getOrgId());
ablityListFormDTO.setAllParentIndexCode(explainDTO.getIndexCode());
ablityListFormDTO.setMonthId(StringUtils.isBlank(formDTO.getMonthId()) ? DateUtils.getCurrentTimeBeforeMonthId() : formDTO.getMonthId());
List<IndexScoreResult> scoreResults = agencySubScoreDao.selectSubScore(ablityListFormDTO);
scoreResults.forEach(e->{
String newMeaning = result.getMeaning().replaceFirst(e.getIndexCode(),e.getScore().toString())
.replaceFirst(IndexConstant.PATTERN_D,
e.getWeight().multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.ZERO, BigDecimal.ROUND_HALF_UP).toString());;
result.setMeaning(newMeaning);
});
}
@ -124,7 +132,6 @@ public class IndexExplainServiceImpl implements IndexExplainService {
//子节点
setChildren(formDTO, detailEntityMap, result, explainDTO, explainDTO.getChildren());
//设置 新的含义 带分数的
System.out.println(result.getIndexCode()+"=============");
setCurrentMonthScore(formDTO, first,result);
}
@ -175,7 +182,7 @@ public class IndexExplainServiceImpl implements IndexExplainService {
}
firstMeaning = firstMeaning.replaceFirst(indexCode, score.getScore().toString()).replaceFirst(indexCode.concat(IndexConstant.PATTERN_WEIGHT), score.getWeight().multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.ZERO, BigDecimal.ROUND_HALF_UP).toString() + "%");
if (score.getIndexCode().equals(second.getIndexCode())){
if (second.getIndexCode().contains(score.getIndexCode())){
secondMeaning = secondMeaning.replaceFirst(IndexConstant.PATTERN_TOTAL, score.getScore().toString())
.replaceFirst(IndexConstant.BEN_JI_EN, score.getSelfScore().toString())
.replaceFirst(IndexConstant.XIA_JI_EN, score.getSubScore().toString());
@ -235,6 +242,9 @@ public class IndexExplainServiceImpl implements IndexExplainService {
List<IndexGroupDetailResult> indexGroupDetailEntities = new ArrayList<>();
for (IndexGroupDetailResult index : detailResults) {
if (IndexConstant.INDEX_DISTRINCT_TABLE1_INDEX_CODE.equals(index.getIndexCode())) {
String newMeaning = result.getMeaning().replaceFirst(IndexConstant.PATTERN_D,
index.getWeight().multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.ZERO, BigDecimal.ROUND_HALF_UP).toString());
result.setMeaning(newMeaning);
indexGroupDetailEntities.add(index);
setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath, indexGroupDetailEntities);
//不下钻
@ -312,14 +322,14 @@ public class IndexExplainServiceImpl implements IndexExplainService {
}
}
private List<IndexScoreDetailResult> setDefaultTableData(String orgLevel, String type, Map<String, List<IndexGroupDetailResult>> detailEntityMap,
IndexExplainResult result, String allIndexCodePath, List<IndexGroupDetailResult> indexGroupDetailEntities) {
private void setDefaultTableData(String orgLevel, String type, Map<String, List<IndexGroupDetailResult>> detailEntityMap,
IndexExplainResult result, String allIndexCodePath, List<IndexGroupDetailResult> indexGroupDetailEntities) {
if (indexGroupDetailEntities == null) {
indexGroupDetailEntities = detailEntityMap.get(allIndexCodePath);
}
if (CollectionUtils.isEmpty(indexGroupDetailEntities)) {
log.warn("setDefaultTableData allINdexCodePath:{} is config error", allIndexCodePath);
return null;
return;
}
List<IndexScoreDetailResult> tableList = new ArrayList<>();
List<String> threlodList = new ArrayList<>();
@ -348,7 +358,6 @@ public class IndexExplainServiceImpl implements IndexExplainService {
result.setTableDataList(tableList);
result.setThresholdList(threlodList);
result.setTableDesc(IndexConstant.TABLE_DESC);
return tableList;
}
private void setChildren(IndexExplainFormDTO formDTO, Map<String, List<IndexGroupDetailResult>> detailEntityMap, IndexExplainResult result, IndexExplainTreeDTO parentNode, List<IndexExplainTreeDTO> children) {

Loading…
Cancel
Save