Browse Source

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

master
jianjun 4 years ago
parent
commit
037b0ef1d8
  1. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexExplainFormDTO.java
  2. 4
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainResult.java
  3. 14
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreResult.java
  4. 10
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java
  5. 5
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java
  6. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java
  7. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java
  8. 5
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java
  9. 109
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java
  10. 17
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml
  11. 17
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml
  12. 17
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml

5
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexExplainFormDTO.java

@ -19,6 +19,7 @@ package com.epmet.evaluationindex.index.form;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable; import java.io.Serializable;
@ -37,20 +38,24 @@ public class IndexExplainFormDTO implements Serializable {
/** /**
* 客户id * 客户id
*/ */
@NotBlank(message = "客户ID不能为空")
private String customerId; private String customerId;
/** /**
* 组织级别网格级grid;社区级community;街道:street;区县级: district;市级: city;省级:province * 组织级别网格级grid;社区级community;街道:street;区县级: district;市级: city;省级:province
*/ */
@NotBlank(message = "组织级别不能为空")
private String orgLevel; private String orgLevel;
/** /**
* 组织id * 组织id
*/ */
@NotBlank(message = "组织ID不能为空")
private String orgId; private String orgId;
/** /**
* 月份Id * 月份Id
*/ */
@NotBlank(message = "月份不能为空")
private String monthId; private String monthId;

4
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainResult.java

@ -1,5 +1,6 @@
package com.epmet.evaluationindex.index.result; package com.epmet.evaluationindex.index.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data; import lombok.Data;
import java.util.ArrayList; import java.util.ArrayList;
@ -49,5 +50,8 @@ public class IndexExplainResult {
*/ */
private String tableDesc; private String tableDesc;
@JsonIgnore
private String indexCode;
} }

14
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreResult.java

@ -23,6 +23,15 @@ public class IndexScoreResult implements Serializable {
*/ */
private BigDecimal score; private BigDecimal score;
/**
* 本级分数
*/
private BigDecimal selfScore;
/**
* 下级分数
*/
private BigDecimal subScore;
/** /**
* 指标对应的权重 * 指标对应的权重
*/ */
@ -43,4 +52,9 @@ public class IndexScoreResult implements Serializable {
*/ */
private String valueType; private String valueType;
/**
* 是否是总分
*/
private Boolean isTotal;
} }

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

@ -24,17 +24,25 @@ public class IndexConstant {
public static final String ZB_CN = "指标"; public static final String ZB_CN = "指标";
public static final String BEN_JI_CN = "本级"; public static final String BEN_JI_CN = "本级";
public static final String XIA_JI_CN = "下级"; public static final String XIA_JI_CN = "下级";
public static final String BEN_JI_EN = "self";
public static final String XIA_JI_EN = "sub";
public static final String ZI_SHEN = "zishen"; public static final String ZI_SHEN = "zishen";
public static final String XIA_JI = "xiaji"; public static final String XIA_JI = "xiaji";
public static final String THRESHOLD_TEXT = "给定阈值%d%%,超过阈值不加分"; public static final String THRESHOLD_TEXT = "给定阈值%d%%,超过阈值不加分";
public static final String TABLE_DESC = "详见下表:"; public static final String TABLE_DESC = "详见下表:";
public static final String INDEX_SCORE_TITLE = "当月指数"; public static final String INDEX_SCORE_TITLE = "当月指数";
public static final String INDEX_SCORE_DESC = "自然月周期内,当月指数得分=党建指数得分*相关权重+治理指数得分*相关权重+服务指数得分*相关权重"; 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_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 ZHI_LI_NENG_LI = "zhilinengli";
public static final String PATTERN_FIX = "#";
public static final String PATTERN_D = "d"; public static final String PATTERN_D = "d";
public static final String PATTERN_WEIGHT = "weight";
public static final String PATTERN_TOTAL = "totalScore";
public static final String QUAN_QU_ZHI_LI_INDEX_CODE = "quanquxiangguan:zhilinengli"; public static final String QUAN_QU_ZHI_LI_INDEX_CODE = "quanquxiangguan:zhilinengli";
public static final String PATTERN_ALL = "[#][^#]+[#]";
/** /**

5
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java

@ -17,12 +17,15 @@
package com.epmet.datareport.controller.index; package com.epmet.datareport.controller.index;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.index.IndexExplainService; import com.epmet.datareport.service.evaluationindex.index.IndexExplainService;
import com.epmet.evaluationindex.index.form.IndexExplainFormDTO; import com.epmet.evaluationindex.index.form.IndexExplainFormDTO;
import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; import com.epmet.evaluationindex.index.form.IndexScoreFormDTO;
import com.epmet.evaluationindex.index.result.IndexExplainResult; import com.epmet.evaluationindex.index.result.IndexExplainResult;
import com.epmet.evaluationindex.screen.dto.result.IndexDictResultDTO; import com.epmet.evaluationindex.screen.dto.result.IndexDictResultDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@ -56,6 +59,8 @@ public class IndexExplainController {
*/ */
@PostMapping("detail") @PostMapping("detail")
public Result<List<IndexExplainResult>> getScoreDetail(@RequestBody IndexExplainFormDTO formDTO){ public Result<List<IndexExplainResult>> getScoreDetail(@RequestBody IndexExplainFormDTO formDTO){
formDTO.setMonthId(StringUtils.isBlank(formDTO.getMonthId()) ? DateUtils.getCurrentTimeBeforeMonthId() : formDTO.getMonthId());
ValidatorUtils.validateEntity(formDTO);
Result<List<IndexExplainResult>> ok = new Result<List<IndexExplainResult>>().ok(indexExplainService.getScoreDetail(formDTO)); Result<List<IndexExplainResult>> ok = new Result<List<IndexExplainResult>>().ok(indexExplainService.getScoreDetail(formDTO));
return ok; return ok;
} }

4
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java

@ -17,6 +17,7 @@
package com.epmet.datareport.dao.fact; package com.epmet.datareport.dao.fact;
import com.epmet.evaluationindex.index.result.IndexScoreResult;
import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO; import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO;
import com.epmet.evaluationindex.screen.dto.form.MonthScoreListFormDTO; import com.epmet.evaluationindex.screen.dto.form.MonthScoreListFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScoreListFormDTO; import com.epmet.evaluationindex.screen.dto.form.ScoreListFormDTO;
@ -24,6 +25,7 @@ import com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO;
import com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO; import com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO; import com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
@ -57,4 +59,6 @@ public interface FactIndexAgencyScoreDao {
* @author sun * @author sun
*/ */
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> selectAgencyMonthWeightScoreList(MonthScoreListFormDTO formDTO); LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> selectAgencyMonthWeightScoreList(MonthScoreListFormDTO formDTO);
List<IndexScoreResult> selectAgencyScoreList(@Param("customerId") String customerId, @Param("orgId") String orgId, @Param("monthId") String monthId);
} }

4
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java

@ -17,6 +17,7 @@
package com.epmet.datareport.dao.fact; package com.epmet.datareport.dao.fact;
import com.epmet.evaluationindex.index.result.IndexScoreResult;
import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO; import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO;
import com.epmet.evaluationindex.screen.dto.form.MonthScoreListFormDTO; import com.epmet.evaluationindex.screen.dto.form.MonthScoreListFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScoreListFormDTO; import com.epmet.evaluationindex.screen.dto.form.ScoreListFormDTO;
@ -24,6 +25,7 @@ import com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO;
import com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO; import com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO; import com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
@ -57,4 +59,6 @@ public interface FactIndexCommunityScoreDao {
* @author sun * @author sun
*/ */
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> selectCommunityMonthWeightScoreList(MonthScoreListFormDTO formDTO); LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> selectCommunityMonthWeightScoreList(MonthScoreListFormDTO formDTO);
List<IndexScoreResult> selectComunityScoreList(@Param("customerId") String customerId, @Param("orgId") String orgId, @Param("monthId") String monthId);
} }

5
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java

@ -17,6 +17,7 @@
package com.epmet.datareport.dao.fact; package com.epmet.datareport.dao.fact;
import com.epmet.evaluationindex.index.result.IndexScoreResult;
import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO; import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO;
import com.epmet.evaluationindex.screen.dto.form.MonthScoreListFormDTO; import com.epmet.evaluationindex.screen.dto.form.MonthScoreListFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScoreListFormDTO; import com.epmet.evaluationindex.screen.dto.form.ScoreListFormDTO;
@ -24,6 +25,7 @@ import com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO;
import com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO; import com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO; import com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
@ -57,4 +59,7 @@ public interface FactIndexGridScoreDao {
* @author sun * @author sun
*/ */
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> selectGridMonthWeightScoreList(MonthScoreListFormDTO formDTO); LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> selectGridMonthWeightScoreList(MonthScoreListFormDTO formDTO);
List<IndexScoreResult> selectGridScoreList(@Param("customerId") String customerId, @Param("orgId") String orgId, @Param("monthId") String monthId);
} }

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

@ -19,6 +19,7 @@ package com.epmet.datareport.service.evaluationindex.index.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant; 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.enums.OrgLevelEnum;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant; import com.epmet.constant.DataSourceConstant;
@ -67,13 +68,19 @@ public class IndexExplainServiceImpl implements IndexExplainService {
@Autowired @Autowired
private FactIndexGridSubScoreDao gridSubScoreDao; private FactIndexGridSubScoreDao gridSubScoreDao;
@Autowired @Autowired
private FactIndexGridScoreDao gridScoreDao;
@Autowired
private FactIndexCpcSubScoreDao factIndexCpcSubScoreDao; private FactIndexCpcSubScoreDao factIndexCpcSubScoreDao;
@Autowired @Autowired
private FactIndexCommunitySubScoreDao communitySubScoreDao; private FactIndexCommunitySubScoreDao communitySubScoreDao;
@Autowired @Autowired
private FactIndexCommunityScoreDao communityScoreDao;
@Autowired
private FactIndexAgencySubScoreDao agencySubScoreDao; private FactIndexAgencySubScoreDao agencySubScoreDao;
@Autowired @Autowired
private FactIndexDeptSubScoreDao deptSubScoreDao; private FactIndexDeptSubScoreDao deptSubScoreDao;
@Autowired
private FactIndexAgencyScoreDao agencyScoreDao;
@Override @Override
@ -83,6 +90,7 @@ public class IndexExplainServiceImpl implements IndexExplainService {
first.setTitle(IndexConstant.INDEX_SCORE_TITLE); first.setTitle(IndexConstant.INDEX_SCORE_TITLE);
first.setMeaning(IndexConstant.INDEX_SCORE_DESC); first.setMeaning(IndexConstant.INDEX_SCORE_DESC);
results.add(first); results.add(first);
List<IndexExplainTreeDTO> explainDTOList = indexExplainDao.getIndexExplainTreeByOrgType(formDTO.getOrgLevel()); List<IndexExplainTreeDTO> explainDTOList = indexExplainDao.getIndexExplainTreeByOrgType(formDTO.getOrgLevel());
if (CollectionUtils.isEmpty(explainDTOList)) { if (CollectionUtils.isEmpty(explainDTOList)) {
return null; return null;
@ -100,20 +108,33 @@ public class IndexExplainServiceImpl implements IndexExplainService {
results.add(result); results.add(result);
result.setTitle(explainDTO.getTitle()); result.setTitle(explainDTO.getTitle());
result.setMeaning(explainDTO.getMeaning()); result.setMeaning(explainDTO.getMeaning());
result.setIndexCode(explainDTO.getIndexCode());
//全区相关的服务能力的含义中 有权重 所以特殊处理下 //全区相关的服务能力的含义中 有权重 所以特殊处理下
if (explainDTO.getOrgLevel().equals(OrgLevelEnum.DISTRICT.getCode()) && IndexConstant.ZLZS_CN.equals(explainDTO.getTitle())) { 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, IndexScoreFormDTO ablityListFormDTO = new IndexScoreFormDTO();
index.getWeight().multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.ZERO, BigDecimal.ROUND_HALF_UP).toString()); 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); result.setMeaning(newMeaning);
}); });
} }
//设置表格数据 //设置表格数据
setTableData(formDTO, detailEntityMap, explainDTO, result); setTableData(formDTO, detailEntityMap, explainDTO, result);
//子节点 //子节点
setChildren(formDTO, detailEntityMap, result, explainDTO, explainDTO.getChildren()); setChildren(formDTO, detailEntityMap, result, explainDTO, explainDTO.getChildren());
//设置 新的含义 带分数的
setCurrentMonthScore(formDTO, first, result);
} }
return results; return results;
@ -124,6 +145,72 @@ public class IndexExplainServiceImpl implements IndexExplainService {
return indexDictDao.selectIndexDict(formDTO.getIndexCode()); return indexDictDao.selectIndexDict(formDTO.getIndexCode());
} }
private void setCurrentMonthScore(IndexExplainFormDTO formDTO, IndexExplainResult first, IndexExplainResult second) {
String orgLevel = formDTO.getOrgLevel();
OrgLevelEnum anEnum = OrgLevelEnum.getEnum(orgLevel);
List<IndexScoreResult> list = null;
switch (anEnum) {
case GRID:
list = gridScoreDao.selectGridScoreList(formDTO.getCustomerId(), formDTO.getOrgId(), formDTO.getMonthId());
break;
case COMMUNITY:
list = communityScoreDao.selectComunityScoreList(formDTO.getCustomerId(), formDTO.getOrgId(), formDTO.getMonthId());
break;
case STREET:
list = agencyScoreDao.selectAgencyScoreList(formDTO.getCustomerId(), formDTO.getOrgId(), formDTO.getMonthId());
break;
case DISTRICT:
list = agencyScoreDao.selectAgencyScoreList(formDTO.getCustomerId(), formDTO.getOrgId(), formDTO.getMonthId());
break;
default:
log.error("暂不支持更高级别的查询,level:{}", orgLevel);
}
setNewMeaningWithScore(list, first, second);
}
private void setNewMeaningWithScore(List<IndexScoreResult> list, IndexExplainResult first, IndexExplainResult second) {
String firstMeaning = first.getMeaning();
String secondMeaning = second.getMeaning();
for (IndexScoreResult score : list) {
String indexCode = score.getIndexCode();
if (score.getIsTotal()) {
firstMeaning = firstMeaning.replaceFirst(IndexConstant.PATTERN_TOTAL, score.getScore().toString());
continue;
}
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());
}
}
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) { private void setTableData(IndexExplainFormDTO formDTO, Map<String, List<IndexGroupDetailResult>> detailEntityMap, IndexExplainTreeDTO explainDTO, IndexExplainResult result) {
if (NumConstant.ONE == explainDTO.getIsSearch()) { if (NumConstant.ONE == explainDTO.getIsSearch()) {
List<IndexScoreResult> realScoreList = null; List<IndexScoreResult> realScoreList = null;
@ -174,6 +261,9 @@ public class IndexExplainServiceImpl implements IndexExplainService {
List<IndexGroupDetailResult> indexGroupDetailEntities = new ArrayList<>(); List<IndexGroupDetailResult> indexGroupDetailEntities = new ArrayList<>();
for (IndexGroupDetailResult index : detailResults) { for (IndexGroupDetailResult index : detailResults) {
if (IndexConstant.INDEX_DISTRINCT_TABLE1_INDEX_CODE.equals(index.getIndexCode())) { 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); indexGroupDetailEntities.add(index);
setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath, indexGroupDetailEntities); setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath, indexGroupDetailEntities);
//不下钻 //不下钻
@ -251,14 +341,14 @@ public class IndexExplainServiceImpl implements IndexExplainService {
} }
} }
private List<IndexScoreDetailResult> setDefaultTableData(String orgLevel, String type, Map<String, List<IndexGroupDetailResult>> detailEntityMap, private void setDefaultTableData(String orgLevel, String type, Map<String, List<IndexGroupDetailResult>> detailEntityMap,
IndexExplainResult result, String allIndexCodePath, List<IndexGroupDetailResult> indexGroupDetailEntities) { IndexExplainResult result, String allIndexCodePath, List<IndexGroupDetailResult> indexGroupDetailEntities) {
if (indexGroupDetailEntities == null) { if (indexGroupDetailEntities == null) {
indexGroupDetailEntities = detailEntityMap.get(allIndexCodePath); indexGroupDetailEntities = detailEntityMap.get(allIndexCodePath);
} }
if (CollectionUtils.isEmpty(indexGroupDetailEntities)) { if (CollectionUtils.isEmpty(indexGroupDetailEntities)) {
log.warn("setDefaultTableData allINdexCodePath:{} is config error", allIndexCodePath); log.warn("setDefaultTableData allINdexCodePath:{} is config error", allIndexCodePath);
return null; return;
} }
List<IndexScoreDetailResult> tableList = new ArrayList<>(); List<IndexScoreDetailResult> tableList = new ArrayList<>();
List<String> threlodList = new ArrayList<>(); List<String> threlodList = new ArrayList<>();
@ -287,7 +377,6 @@ public class IndexExplainServiceImpl implements IndexExplainService {
result.setTableDataList(tableList); result.setTableDataList(tableList);
result.setThresholdList(threlodList); result.setThresholdList(threlodList);
result.setTableDesc(IndexConstant.TABLE_DESC); result.setTableDesc(IndexConstant.TABLE_DESC);
return tableList;
} }
private void setChildren(IndexExplainFormDTO formDTO, Map<String, List<IndexGroupDetailResult>> detailEntityMap, IndexExplainResult result, IndexExplainTreeDTO parentNode, List<IndexExplainTreeDTO> children) { private void setChildren(IndexExplainFormDTO formDTO, Map<String, List<IndexGroupDetailResult>> detailEntityMap, IndexExplainResult result, IndexExplainTreeDTO parentNode, List<IndexExplainTreeDTO> children) {
@ -305,10 +394,6 @@ public class IndexExplainServiceImpl implements IndexExplainService {
result.setChildren(childrenList); result.setChildren(childrenList);
} }
public static void main(String[] args) {
}
private List<String> getTableHeaders(String type, String allIndexCode, String orgLevel) { private List<String> getTableHeaders(String type, String allIndexCode, String orgLevel) {
List<String> headers = new ArrayList<>(); List<String> headers = new ArrayList<>();
OrgLevelEnum anEnum = OrgLevelEnum.getEnum(orgLevel); OrgLevelEnum anEnum = OrgLevelEnum.getEnum(orgLevel);

17
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml

@ -74,5 +74,22 @@
ORDER BY ORDER BY
fact.month_id ASC fact.month_id ASC
</select> </select>
<select id="selectAgencyScoreList" resultType="com.epmet.evaluationindex.index.result.IndexScoreResult">
SELECT
ROUND(fact.score,1) AS "score",
fact.index_code ,
fact.WEIGHT,
fact.IS_TOTAL,
ROUND(fiasss.SELF_SCORE,1) AS "selfScore",
ROUND(fiasss.SUB_SCORE,1) AS "subScore"
FROM
fact_index_agency_score fact
LEFT JOIN fact_index_agency_self_sub_score fiasss ON fact.AGENCY_ID = fiasss.AGENCY_ID AND fact.INDEX_CODE = fiasss.PARENT_INDEX_CODE AND fact.MONTH_ID = fiasss.MONTH_ID
WHERE
fact.del_flag = '0'
AND fact.customer_id = #{customerId}
AND fact.AGENCY_ID = #{orgId}
AND fact.month_id = #{monthId}
</select>
</mapper> </mapper>

17
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml

@ -74,5 +74,22 @@
ORDER BY ORDER BY
fact.month_id ASC fact.month_id ASC
</select> </select>
<select id="selectComunityScoreList" resultType="com.epmet.evaluationindex.index.result.IndexScoreResult">
SELECT
ROUND(fact.score,1) AS "score",
fact.index_code ,
fact.WEIGHT,
fact.IS_TOTAL,
ROUND(fiasss.SELF_SCORE,1) AS "selfScore",
ROUND(fiasss.SUB_SCORE,1) AS "subScore"
FROM
fact_index_community_score fact
LEFT JOIN fact_index_community_self_sub_score fiasss ON fact.AGENCY_ID = fiasss.AGENCY_ID AND fact.INDEX_CODE = fiasss.PARENT_INDEX_CODE AND fact.MONTH_ID = fiasss.MONTH_ID
WHERE
fact.del_flag = '0'
AND fact.customer_id = #{customerId}
AND fact.AGENCY_ID = #{orgId}
AND fact.month_id = #{monthId}
</select>
</mapper> </mapper>

17
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml

@ -76,5 +76,22 @@
ORDER BY ORDER BY
fact.month_id ASC fact.month_id ASC
</select> </select>
<select id="selectGridScoreList" resultType="com.epmet.evaluationindex.index.result.IndexScoreResult">
SELECT
ROUND(fact.score,1) AS "score",
fact.index_code ,
fact.WEIGHT,
fact.IS_TOTAL,
ROUND(fiasss.SELF_SCORE,1) AS "selfScore",
ROUND(fiasss.SUB_SCORE,1) AS "subScore"
FROM
fact_index_grid_score fact
LEFT JOIN fact_index_grid_self_sub_score fiasss ON fact.GRID_ID = fiasss.GRID_ID AND fact.INDEX_CODE = fiasss.PARENT_INDEX_CODE AND fact.MONTH_ID = fiasss.MONTH_ID
WHERE
fact.del_flag = '0'
AND fact.customer_id = #{customerId}
AND fact.grid_id = #{orgId}
AND fact.month_id = #{monthId}
</select>
</mapper> </mapper>

Loading…
Cancel
Save