Browse Source

得分说明 上下级添加具体分数

dev_shibei_match
jianjun 4 years ago
parent
commit
36bd27b601
  1. 4
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainResult.java
  2. 9
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreResult.java
  3. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java
  4. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java
  5. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java
  6. 1
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java
  7. 54
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java
  8. 17
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml
  9. 17
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml
  10. 5
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml

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;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.util.ArrayList;
@ -49,5 +50,8 @@ public class IndexExplainResult {
*/
private String tableDesc;
@JsonIgnore
private String indexCode;
}

9
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 selfScore;
/**
* 下级分数
*/
private BigDecimal subScore;
/**
* 指标对应的权重
*/

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

@ -24,6 +24,8 @@ public class IndexConstant {
public static final String ZB_CN = "指标";
public static final String BEN_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 XIA_JI = "xiaji";

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

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

@ -61,4 +61,5 @@ public interface FactIndexGridScoreDao {
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> selectGridMonthWeightScoreList(MonthScoreListFormDTO formDTO);
List<IndexScoreResult> selectGridScoreList(@Param("customerId") String customerId, @Param("orgId") String orgId, @Param("monthId") String monthId);
}

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

@ -82,7 +82,6 @@ public class IndexExplainServiceImpl implements IndexExplainService {
private FactIndexAgencyScoreDao agencyScoreDao;
@Override
public List<IndexExplainResult> getScoreDetail(IndexExplainFormDTO formDTO) {
List<IndexExplainResult> results = new ArrayList<>();
@ -91,7 +90,7 @@ public class IndexExplainServiceImpl implements IndexExplainService {
first.setMeaning(IndexConstant.INDEX_SCORE_DESC);
results.add(first);
//获取该等级的分数及权重
setCurrentMonthScore(formDTO,first);
List<IndexExplainTreeDTO> explainDTOList = indexExplainDao.getIndexExplainTreeByOrgType(formDTO.getOrgLevel());
if (CollectionUtils.isEmpty(explainDTOList)) {
return null;
@ -109,6 +108,7 @@ public class IndexExplainServiceImpl implements IndexExplainService {
results.add(result);
result.setTitle(explainDTO.getTitle());
result.setMeaning(explainDTO.getMeaning());
result.setIndexCode(explainDTO.getIndexCode());
//全区相关的服务能力的含义中 有权重 所以特殊处理下
if (explainDTO.getOrgLevel().equals(OrgLevelEnum.DISTRICT.getCode()) && IndexConstant.ZLZS_CN.equals(explainDTO.getTitle())) {
@ -123,6 +123,9 @@ public class IndexExplainServiceImpl implements IndexExplainService {
setTableData(formDTO, detailEntityMap, explainDTO, result);
//子节点
setChildren(formDTO, detailEntityMap, result, explainDTO, explainDTO.getChildren());
//设置 新的含义 带分数的
System.out.println(result.getIndexCode()+"=============");
setCurrentMonthScore(formDTO, first,result);
}
return results;
@ -133,38 +136,53 @@ public class IndexExplainServiceImpl implements IndexExplainService {
return indexDictDao.selectIndexDict(formDTO.getIndexCode());
}
private void setCurrentMonthScore(IndexExplainFormDTO formDTO, IndexExplainResult first){
private void setCurrentMonthScore(IndexExplainFormDTO formDTO, IndexExplainResult first, IndexExplainResult second) {
String orgLevel = formDTO.getOrgLevel();
String orgId = formDTO.getOrgId();
OrgLevelEnum anEnum = OrgLevelEnum.getEnum(orgLevel);
List<IndexScoreResult> list = null;
switch (anEnum) {
case GRID:
List<IndexScoreResult> list = gridScoreDao.selectGridScoreList(formDTO.getCustomerId(),formDTO.getOrgId(),formDTO.getMonthId());
String meaning = first.getMeaning();
for (IndexScoreResult score : list) {
String indexCode = score.getIndexCode();
if (score.getIsTotal()){
meaning = meaning.replaceFirst(IndexConstant.PATTERN_TOTAL,score.getScore().toString());
continue;
}
meaning = meaning.replaceFirst(indexCode, score.getScore().toString()).replaceFirst(indexCode.concat(IndexConstant.PATTERN_WEIGHT), score.getWeight() + "%");
}
first.setMeaning(meaning);
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);
}
if (CollectionUtils.isNotEmpty(list)) {
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()).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())){
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);
}
private void setTableData(IndexExplainFormDTO formDTO, Map<String, List<IndexGroupDetailResult>> detailEntityMap, IndexExplainTreeDTO explainDTO, IndexExplainResult result) {

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

@ -74,5 +74,22 @@
ORDER BY
fact.month_id ASC
</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>

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

@ -74,5 +74,22 @@
ORDER BY
fact.month_id ASC
</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>

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

@ -81,9 +81,12 @@
ROUND(fact.score,1) AS "score",
fact.index_code ,
fact.WEIGHT,
fact.IS_TOTAL
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}

Loading…
Cancel
Save