|
|
@ -19,6 +19,7 @@ package com.epmet.datareport.service.evaluationindex.index.impl; |
|
|
|
|
|
|
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
|
import com.epmet.commons.tools.enums.OrgLevelEnum; |
|
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
|
import com.epmet.constant.DataSourceConstant; |
|
|
@ -89,7 +90,6 @@ public class IndexExplainServiceImpl implements IndexExplainService { |
|
|
|
first.setTitle(IndexConstant.INDEX_SCORE_TITLE); |
|
|
|
first.setMeaning(IndexConstant.INDEX_SCORE_DESC); |
|
|
|
results.add(first); |
|
|
|
//获取该等级的分数及权重
|
|
|
|
|
|
|
|
List<IndexExplainTreeDTO> explainDTOList = indexExplainDao.getIndexExplainTreeByOrgType(formDTO.getOrgLevel()); |
|
|
|
if (CollectionUtils.isEmpty(explainDTOList)) { |
|
|
@ -120,19 +120,21 @@ public class IndexExplainServiceImpl implements IndexExplainService { |
|
|
|
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()) |
|
|
|
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());; |
|
|
|
e.getWeight().multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.ZERO, BigDecimal.ROUND_HALF_UP).toString()); |
|
|
|
result.setMeaning(newMeaning); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//设置表格数据
|
|
|
|
setTableData(formDTO, detailEntityMap, explainDTO, result); |
|
|
|
//子节点
|
|
|
|
setChildren(formDTO, detailEntityMap, result, explainDTO, explainDTO.getChildren()); |
|
|
|
//设置 新的含义 带分数的
|
|
|
|
setCurrentMonthScore(formDTO, first,result); |
|
|
|
//设置 新的含义 带分数的
|
|
|
|
setCurrentMonthScore(formDTO, first, result); |
|
|
|
} |
|
|
|
|
|
|
|
return results; |
|
|
@ -166,9 +168,10 @@ public class IndexExplainServiceImpl implements IndexExplainService { |
|
|
|
default: |
|
|
|
log.error("暂不支持更高级别的查询,level:{}", orgLevel); |
|
|
|
} |
|
|
|
if (CollectionUtils.isNotEmpty(list)) { |
|
|
|
setNewMeaningWithScore(list, first,second); |
|
|
|
} |
|
|
|
|
|
|
|
setNewMeaningWithScore(list, first, second); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
private void setNewMeaningWithScore(List<IndexScoreResult> list, IndexExplainResult first, IndexExplainResult second) { |
|
|
@ -181,15 +184,31 @@ public class IndexExplainServiceImpl implements IndexExplainService { |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
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 (second.getIndexCode().contains(score.getIndexCode())){ |
|
|
|
firstMeaning = firstMeaning.replaceFirst(indexCode, score.getScore().toString()).replace(indexCode.concat(IndexConstant.PATTERN_WEIGHT), score.getWeight().multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.ZERO, BigDecimal.ROUND_HALF_UP).toString() + "%"); |
|
|
|
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()); |
|
|
|
} |
|
|
|
} |
|
|
|
first.setMeaning(firstMeaning); |
|
|
|
second.setMeaning(secondMeaning); |
|
|
|
if (CollectionUtils.isEmpty(list)) { |
|
|
|
firstMeaning = firstMeaning.replaceAll(IndexConstant.PATTERN_ALL, StrConstant.EPMETY_STR); |
|
|
|
secondMeaning = secondMeaning.replaceAll(IndexConstant.PATTERN_ALL, StrConstant.EPMETY_STR); |
|
|
|
} |
|
|
|
|
|
|
|
first.setMeaning(firstMeaning.replaceAll(IndexConstant.PATTERN_FIX, StrConstant.EPMETY_STR)); |
|
|
|
second.setMeaning(secondMeaning.replaceAll(IndexConstant.PATTERN_FIX, StrConstant.EPMETY_STR)); |
|
|
|
} |
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
String patern = "(?<=\\{).*?(?=(\\}|$))"; |
|
|
|
patern = "[#][^#]+[#]"; |
|
|
|
String str = "1234#qwert#134"; |
|
|
|
|
|
|
|
System.out.println(str.replaceAll(patern, "")); |
|
|
|
String str2 = "自然月周期内,当月指数得分P(totalScore)P=党建指数得分#(65.7)#*相关权重#(40%)#+治理指数得分#(68.2)#*相关权重#(40%)#+服务指数得分#(77.5)#*相关权重#(20%)#"; |
|
|
|
String totalP = "P".concat(IndexConstant.PATTERN_TOTAL).concat("P"); |
|
|
|
System.out.println(str2.replaceFirst(totalP, "")); |
|
|
|
} |
|
|
|
|
|
|
|
private void setTableData(IndexExplainFormDTO formDTO, Map<String, List<IndexGroupDetailResult>> detailEntityMap, IndexExplainTreeDTO explainDTO, IndexExplainResult result) { |
|
|
@ -375,10 +394,6 @@ public class IndexExplainServiceImpl implements IndexExplainService { |
|
|
|
result.setChildren(childrenList); |
|
|
|
} |
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
private List<String> getTableHeaders(String type, String allIndexCode, String orgLevel) { |
|
|
|
List<String> headers = new ArrayList<>(); |
|
|
|
OrgLevelEnum anEnum = OrgLevelEnum.getEnum(orgLevel); |
|
|
|