Browse Source

添加权重

dev_shibei_match
jianjun 5 years ago
parent
commit
7352f239c1
  1. 9
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java
  2. 13
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java
  3. 2
      epmet-module/data-statistical/data-statistical-server/pom.xml
  4. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java
  5. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java
  6. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java
  7. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java
  8. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java
  9. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java

9
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java

@ -120,12 +120,17 @@ public class AgencyScoreDTO implements Serializable {
/** /**
* 更新人 * 更新人
*/ */
private String updatedBy; private String updatedBy;
/** /**
* 更新时间 * 更新时间
*/ */
private Date updatedTime; private Date updatedTime;
/**
* 权重
*/
private BigDecimal weight;
public AgencyScoreDTO() { public AgencyScoreDTO() {
this.isTotal = NumConstant.ZERO_STR; this.isTotal = NumConstant.ZERO_STR;

13
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java

@ -17,11 +17,11 @@
package com.epmet.dto.screen; package com.epmet.dto.screen;
import java.io.Serializable;
import java.util.Date;
import lombok.Data; import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
/** /**
* 社区相关分数表 * 社区相关分数表
@ -112,12 +112,17 @@ public class FactIndexCommunityScoreDTO implements Serializable {
/** /**
* 更新人 * 更新人
*/ */
private String updatedBy; private String updatedBy;
/** /**
* 更新时间 * 更新时间
*/ */
private Date updatedTime; private Date updatedTime;
/**
* 权重
*/
private BigDecimal weight;
public FactIndexCommunityScoreDTO() { public FactIndexCommunityScoreDTO() {
this.customerId = ""; this.customerId = "";

2
epmet-module/data-statistical/data-statistical-server/pom.xml

@ -226,7 +226,7 @@
<activeByDefault>true</activeByDefault> <activeByDefault>true</activeByDefault>
</activation> </activation>
<properties> <properties>
<server.port>8109</server.port> <server.port>8108</server.port>
<spring.profiles.active>local</spring.profiles.active> <spring.profiles.active>local</spring.profiles.active>
<!-- 数据库配置--> <!-- 数据库配置-->

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

@ -50,7 +50,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
@Autowired @Autowired
private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao;
@Autowired @Autowired
private IndexGroupDetailService getDetailListByParentCode; private IndexGroupDetailService indexGroupDetailService;
@Autowired @Autowired
private IndexCodeFieldReService indexCodeFieldReService; private IndexCodeFieldReService indexCodeFieldReService;
@Autowired @Autowired
@ -72,7 +72,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
*/ */
private void calculateTotalScore(CalculateCommonFormDTO formDTO) { private void calculateTotalScore(CalculateCommonFormDTO formDTO) {
//获取指标权重 //获取指标权重
List<IndexGroupDetailEntity> parentIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); List<IndexGroupDetailEntity> parentIndexDetails = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode());
if (CollectionUtils.isEmpty(parentIndexDetails)) { if (CollectionUtils.isEmpty(parentIndexDetails)) {
log.warn("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); log.warn("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId());
throw new RenException("客户【党员相关】指标权重信息不存在"); throw new RenException("客户【党员相关】指标权重信息不存在");
@ -113,6 +113,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
totalEntity.setIndexCode(IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); totalEntity.setIndexCode(IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode());
totalEntity.setScore(new BigDecimal(NumConstant.ZERO)); totalEntity.setScore(new BigDecimal(NumConstant.ZERO));
totalEntity.setAllParentIndexCode(NumConstant.ZERO_STR); totalEntity.setAllParentIndexCode(NumConstant.ZERO_STR);
totalEntity.setWeight(new BigDecimal(NumConstant.ONE_NEG));
if (preLastCpcScoreTotalMap.containsKey(part.getUserId())) { if (preLastCpcScoreTotalMap.containsKey(part.getUserId())) {
preLastCpcScoreTotalMap.put(part.getUserId(), part); preLastCpcScoreTotalMap.put(part.getUserId(), part);
@ -265,6 +266,9 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
cpcScoreEntity.setScore(new BigDecimal(NumConstant.ZERO)); cpcScoreEntity.setScore(new BigDecimal(NumConstant.ZERO));
cpcScoreEntity.setIndexCode(parentIndexCode); cpcScoreEntity.setIndexCode(parentIndexCode);
cpcScoreEntity.setAllParentIndexCode(value.getAllParentIndexCode()); cpcScoreEntity.setAllParentIndexCode(value.getAllParentIndexCode());
String vallPath = value.getAllParentIndexCode().concat(StrConstant.COLON).concat(parentIndexCode);
BigDecimal weight = indexGroupDetailService.getWeightByAllPathIndexCode(formDTO.getCustomerId(), vallPath);
cpcScoreEntity.setWeight(weight);
scoreEntityMap.put(userId, cpcScoreEntity); scoreEntityMap.put(userId, cpcScoreEntity);
//构造样本值对象 //构造样本值对象
@ -311,6 +315,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
child.setIndexCode(o.getIndexCode()); child.setIndexCode(o.getIndexCode());
child.setAllParentIndexCode(o.getAllParentIndexCode()); child.setAllParentIndexCode(o.getAllParentIndexCode());
child.setScore(o.getScore()); child.setScore(o.getScore());
child.setWeight(o.getWeight());
subList.add(child); subList.add(child);
}); });
@ -403,17 +408,17 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
*/ */
private Map<String, List<IndexGroupDetailEntity>> getIndexDetailMap(CalculateCommonFormDTO formDTO) { private Map<String, List<IndexGroupDetailEntity>> getIndexDetailMap(CalculateCommonFormDTO formDTO) {
//获取指标权重信息 -参与议事 //获取指标权重信息 -参与议事
List<IndexGroupDetailEntity> canyuyishiIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.CAN_YU_YI_SHI.getCode()); List<IndexGroupDetailEntity> canyuyishiIndexDetails = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.CAN_YU_YI_SHI.getCode());
if (CollectionUtils.isEmpty(canyuyishiIndexDetails)) { if (CollectionUtils.isEmpty(canyuyishiIndexDetails)) {
log.error("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); log.error("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId());
return null; return null;
} }
List<IndexGroupDetailEntity> dangwuhongdongIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_WU_HUO_DONG.getCode()); List<IndexGroupDetailEntity> dangwuhongdongIndexDetails = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_WU_HUO_DONG.getCode());
if (CollectionUtils.isEmpty(canyuyishiIndexDetails)) { if (CollectionUtils.isEmpty(canyuyishiIndexDetails)) {
log.error("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); log.error("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId());
return null; return null;
} }
List<IndexGroupDetailEntity> lianxiqunzhongIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.LIAN_XI_QUN_ZHONG.getCode()); List<IndexGroupDetailEntity> lianxiqunzhongIndexDetails = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.LIAN_XI_QUN_ZHONG.getCode());
if (CollectionUtils.isEmpty(canyuyishiIndexDetails)) { if (CollectionUtils.isEmpty(canyuyishiIndexDetails)) {
log.error("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); log.error("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId());
return null; return null;

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java

@ -78,7 +78,7 @@ import java.util.stream.Collectors;
@Service @Service
public class DeptScoreServiceImpl extends BaseServiceImpl<DeptScoreDao, DeptScoreEntity> implements DeptScoreService { public class DeptScoreServiceImpl extends BaseServiceImpl<DeptScoreDao, DeptScoreEntity> implements DeptScoreService {
@Autowired @Autowired
private IndexGroupDetailService getDetailListByParentCode; private IndexGroupDetailService indexGroupDetailService;
@Autowired @Autowired
private FactIndexGovrnAblityDeptMonthlyDao factIndexGovrnAblityDeptMonthlyDao; private FactIndexGovrnAblityDeptMonthlyDao factIndexGovrnAblityDeptMonthlyDao;
@Autowired @Autowired
@ -117,7 +117,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl<DeptScoreDao, DeptScor
**/ **/
private void calculateZhiLiNengLiScore(CalculateCommonFormDTO formDTO) { private void calculateZhiLiNengLiScore(CalculateCommonFormDTO formDTO) {
//获取区直部门的治理能力下,五级指标权重 //获取区直部门的治理能力下,五级指标权重
List<IndexGroupDetailEntity> indexGroupDetailEntityList = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), List<IndexGroupDetailEntity> indexGroupDetailEntityList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(),
IndexCodeEnum.QU_ZHI_BU_MEN.getCode(), IndexCodeEnum.QU_ZHI_BU_MEN.getCode(),
IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
if (CollectionUtils.isEmpty(indexGroupDetailEntityList)) { if (CollectionUtils.isEmpty(indexGroupDetailEntityList)) {
@ -167,7 +167,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl<DeptScoreDao, DeptScor
**/ **/
private void calculateDeptTotalScore(CalculateCommonFormDTO formDTO) { private void calculateDeptTotalScore(CalculateCommonFormDTO formDTO) {
//计算区直部门总分 //计算区直部门总分
List<IndexGroupDetailEntity> indexList = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), List<IndexGroupDetailEntity> indexList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(),
IndexCodeEnum.QU_ZHI_BU_MEN.getCode()); IndexCodeEnum.QU_ZHI_BU_MEN.getCode());
if (CollectionUtils.isEmpty(indexList)) { if (CollectionUtils.isEmpty(indexList)) {
log.error("calculateDeptTotalScore customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); log.error("calculateDeptTotalScore customerId:{} have not any indexGroupDetail", formDTO.getCustomerId());
@ -189,6 +189,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl<DeptScoreDao, DeptScor
deptScoreEntity.setIndexCode(IndexCodeEnum.QU_ZHI_BU_MEN.getCode()); deptScoreEntity.setIndexCode(IndexCodeEnum.QU_ZHI_BU_MEN.getCode());
deptScoreEntity.setScore(BigDecimal.ZERO); deptScoreEntity.setScore(BigDecimal.ZERO);
deptScoreEntity.setAllParentIndexCode(NumConstant.ZERO_STR); deptScoreEntity.setAllParentIndexCode(NumConstant.ZERO_STR);
deptScoreEntity.setWeight(new BigDecimal(NumConstant.ONE_NEG));
for (DeptScoreDetailDTO deptScoreDetailDTO : deptScore.getDetailList()) { for (DeptScoreDetailDTO deptScoreDetailDTO : deptScore.getDetailList()) {
BigDecimal indexScore = deptScoreDetailDTO.getScore().multiply(indexMap.get(deptScoreDetailDTO.getIndexCode()).getWeight()); BigDecimal indexScore = deptScoreDetailDTO.getScore().multiply(indexMap.get(deptScoreDetailDTO.getIndexCode()).getWeight());
deptScoreEntity.setScore(deptScoreEntity.getScore().add(indexScore)); deptScoreEntity.setScore(deptScoreEntity.getScore().add(indexScore));
@ -310,13 +311,17 @@ public class DeptScoreServiceImpl extends BaseServiceImpl<DeptScoreDao, DeptScor
//区直部门治理能力的 上一级是 quzhibumen //区直部门治理能力的 上一级是 quzhibumen
////新增ALL_PARENT_INDEX_CODE 所有指标code拼接的字符串 冒号隔开 ////新增ALL_PARENT_INDEX_CODE 所有指标code拼接的字符串 冒号隔开
deptScoreEntity.setAllParentIndexCode(IndexCodeEnum.QU_ZHI_BU_MEN.getCode()); deptScoreEntity.setAllParentIndexCode(IndexCodeEnum.QU_ZHI_BU_MEN.getCode());
String allPath = deptScoreEntity.getAllParentIndexCode().concat(StrConstant.COLON).concat(IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
BigDecimal weight = indexGroupDetailService.getWeightByAllPathIndexCode(formDTO.getCustomerId(), allPath);
deptScoreEntity.setWeight(weight);
deptScoreEntityList.add(deptScoreEntity); deptScoreEntityList.add(deptScoreEntity);
for(IndexScoreVo detail:calculateResult.getDetails()){ for (IndexScoreVo detail : calculateResult.getDetails()) {
DeptSubScoreEntity deptSubScore= ConvertUtils.sourceToTarget(deptScoreEntity, DeptSubScoreEntity.class); DeptSubScoreEntity deptSubScore = ConvertUtils.sourceToTarget(deptScoreEntity, DeptSubScoreEntity.class);
//重新赋值 //重新赋值
deptSubScore.setIndexCode(detail.getIndexCode()); deptSubScore.setIndexCode(detail.getIndexCode());
deptSubScore.setAllParentIndexCode(detail.getAllParentIndexCode()); deptSubScore.setAllParentIndexCode(detail.getAllParentIndexCode());
deptSubScore.setScore(detail.getScore()); deptSubScore.setScore(detail.getScore());
deptSubScore.setWeight(detail.getWeight());
deptSubScoreEntityList.add(deptSubScore); deptSubScoreEntityList.add(deptSubScore);
} }
}); });

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java

@ -356,7 +356,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
if(StringUtils.isNotBlank(screenCustomerGridDTO.getParentAgencyId())){ if(StringUtils.isNotBlank(screenCustomerGridDTO.getParentAgencyId())){
gridScoreEntity.setAgencyId(screenCustomerGridDTO.getParentAgencyId()); gridScoreEntity.setAgencyId(screenCustomerGridDTO.getParentAgencyId());
} }
if(StringUtils.isNotBlank(screenCustomerGridDTO.getAllParentIds())){ if (StringUtils.isNotBlank(screenCustomerGridDTO.getAllParentIds())) {
gridScoreEntity.setAllParentIds(screenCustomerGridDTO.getAllParentIds()); gridScoreEntity.setAllParentIds(screenCustomerGridDTO.getAllParentIds());
} }
} }
@ -366,9 +366,11 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
gridScoreEntity.setScore(calculateResult.getTotalScore()); gridScoreEntity.setScore(calculateResult.getTotalScore());
//新增ALL_PARENT_INDEX_CODE 所有指标code拼接的字符串 冒号隔开 //新增ALL_PARENT_INDEX_CODE 所有指标code拼接的字符串 冒号隔开
gridScoreEntity.setAllParentIndexCode(IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); gridScoreEntity.setAllParentIndexCode(IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode());
BigDecimal weight = indexGroupDetailService.getWeightByAllPathIndexCode(formDTO.getCustomerId(), IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode());
gridScoreEntity.setWeight(weight);
gridScoreEntityList.add(gridScoreEntity); gridScoreEntityList.add(gridScoreEntity);
for(IndexScoreVo detail:calculateResult.getDetails()){ for (IndexScoreVo detail : calculateResult.getDetails()) {
GridSubScoreEntity gridSubScoreEntity= ConvertUtils.sourceToTarget(gridScoreEntity, GridSubScoreEntity.class); GridSubScoreEntity gridSubScoreEntity = ConvertUtils.sourceToTarget(gridScoreEntity, GridSubScoreEntity.class);
//重新赋值 //重新赋值
gridSubScoreEntity.setIndexCode(detail.getIndexCode()); gridSubScoreEntity.setIndexCode(detail.getIndexCode());
gridSubScoreEntity.setAllParentIndexCode(detail.getAllParentIndexCode()); gridSubScoreEntity.setAllParentIndexCode(detail.getAllParentIndexCode());
@ -667,6 +669,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
gridScoreEntity.setIndexCode(IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); gridScoreEntity.setIndexCode(IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode());
gridScoreEntity.setScore(BigDecimal.ZERO); gridScoreEntity.setScore(BigDecimal.ZERO);
gridScoreEntity.setAllParentIndexCode(NumConstant.ZERO_STR); gridScoreEntity.setAllParentIndexCode(NumConstant.ZERO_STR);
gridScoreEntity.setWeight(new BigDecimal(NumConstant.ONE_NEG));
log.warn("customerId:" + gridScoreDTO.getCustomerId() + ";gridId:" + gridScoreDTO.getGridId() + ";monthId:" + gridScoreDTO.getMonthId() + "能力值缺失"); log.warn("customerId:" + gridScoreDTO.getCustomerId() + ";gridId:" + gridScoreDTO.getGridId() + ";monthId:" + gridScoreDTO.getMonthId() + "能力值缺失");
for (GridScoreDetailDTO gridScoreDetailDTO : gridScoreDTO.getDetailList()) { for (GridScoreDetailDTO gridScoreDetailDTO : gridScoreDTO.getDetailList()) {
BigDecimal indexScore = gridScoreDetailDTO.getScore().multiply(indexMap.get(gridScoreDetailDTO.getIndexCode()).getWeight()); BigDecimal indexScore = gridScoreDetailDTO.getScore().multiply(indexMap.get(gridScoreDetailDTO.getIndexCode()).getWeight());

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java

@ -4,6 +4,7 @@ import com.alibaba.druid.util.StringUtils;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
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.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant; import com.epmet.constant.DataSourceConstant;
@ -322,6 +323,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
score.setQuarterId(DateUtils.getQuarterId(monthId)); score.setQuarterId(DateUtils.getQuarterId(monthId));
score.setIndexCode(IndexCalConstant.COMMUNITY_RELATE); score.setIndexCode(IndexCalConstant.COMMUNITY_RELATE);
score.setAllParentIndexCode(NumConstant.ZERO_STR); score.setAllParentIndexCode(NumConstant.ZERO_STR);
score.setWeight(new BigDecimal(NumConstant.ONE_NEG));
value.forEach(community -> { value.forEach(community -> {
score.setScore(score.getScore().add(community.getScore())); score.setScore(score.getScore().add(community.getScore()));
score.setParentAgencyId(community.getParentAgencyId()); score.setParentAgencyId(community.getParentAgencyId());
@ -441,6 +443,9 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
score.setIndexCode(indexCode); score.setIndexCode(indexCode);
score.setScore(v.getTotalScore()); score.setScore(v.getTotalScore());
score.setAllParentIndexCode(allParentIndexCode); score.setAllParentIndexCode(allParentIndexCode);
String allPath = allParentIndexCode.concat(StrConstant.COLON).concat(indexCode);
BigDecimal weight = indexGroupDetailService.getWeightByAllPathIndexCode(customerId, allPath);
score.setWeight(weight);
pid.forEach((agency, parentAgency) -> { pid.forEach((agency, parentAgency) -> {
if (k.equals(agency)) { if (k.equals(agency)) {
score.setParentAgencyId(parentAgency); score.setParentAgencyId(parentAgency);
@ -458,6 +463,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
s.setIndexCode(fiveDetail.getIndexCode()); s.setIndexCode(fiveDetail.getIndexCode());
s.setScore(fiveDetail.getScore()); s.setScore(fiveDetail.getScore());
s.setAllParentIndexCode(fiveDetail.getAllParentIndexCode()); s.setAllParentIndexCode(fiveDetail.getAllParentIndexCode());
s.setWeight(fiveDetail.getWeight());
pid.forEach((agency, parentAgency) -> { pid.forEach((agency, parentAgency) -> {
if (k.equals(agency)) { if (k.equals(agency)) {
s.setParentAgencyId(parentAgency); s.setParentAgencyId(parentAgency);

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java

@ -4,6 +4,7 @@ import com.alibaba.druid.util.StringUtils;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
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.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant; import com.epmet.constant.DataSourceConstant;
@ -415,13 +416,16 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
score.setScore(v.getTotalScore()); score.setScore(v.getTotalScore());
score.setAllParentIndexCode(allParentIndexCode); score.setAllParentIndexCode(allParentIndexCode);
score.setDataType(IndexCalConstant.DISTRICT_LEVEL); score.setDataType(IndexCalConstant.DISTRICT_LEVEL);
String allPath = allParentIndexCode.concat(StrConstant.COLON).concat(indexCode);
BigDecimal weight = indexGroupDetailService.getWeightByAllPathIndexCode(customerId, allPath);
score.setWeight(weight);
pid.forEach((agency, parentAgency) -> { pid.forEach((agency, parentAgency) -> {
//todo 确认 //todo 确认
if (k != null && k.equals(agency)) { if (k != null && k.equals(agency)) {
score.setParentAgencyId(parentAgency); score.setParentAgencyId(parentAgency);
} }
}); });
if (!CollectionUtils.isEmpty(v.getDetails())){ if (!CollectionUtils.isEmpty(v.getDetails())) {
v.getDetails().forEach(streetScore -> { v.getDetails().forEach(streetScore -> {
AgencyScoreDTO s = new AgencyScoreDTO(); AgencyScoreDTO s = new AgencyScoreDTO();
s.setCustomerId(customerId); s.setCustomerId(customerId);
@ -434,6 +438,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
s.setScore(streetScore.getScore()); s.setScore(streetScore.getScore());
s.setAllParentIndexCode(streetScore.getAllParentIndexCode()); s.setAllParentIndexCode(streetScore.getAllParentIndexCode());
s.setDataType(IndexCalConstant.DISTRICT_LEVEL); s.setDataType(IndexCalConstant.DISTRICT_LEVEL);
s.setWeight(streetScore.getWeight());
pid.forEach((agency, parentAgency) -> { pid.forEach((agency, parentAgency) -> {
//todo 确认 //todo 确认
if (k != null && k.equals(agency)) { if (k != null && k.equals(agency)) {

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java

@ -4,6 +4,7 @@ import com.alibaba.druid.util.StringUtils;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
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.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant; import com.epmet.constant.DataSourceConstant;
@ -351,6 +352,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
score.setIndexCode(IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode()); score.setIndexCode(IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode());
score.setDataType(IndexCalConstant.STREET_LEVEL); score.setDataType(IndexCalConstant.STREET_LEVEL);
score.setAllParentIndexCode(NumConstant.ZERO_STR); score.setAllParentIndexCode(NumConstant.ZERO_STR);
score.setWeight(new BigDecimal(NumConstant.ONE_NEG));
value.forEach(street -> { value.forEach(street -> {
score.setScore(score.getScore().add(street.getScore())); score.setScore(score.getScore().add(street.getScore()));
score.setParentAgencyId(street.getParentAgencyId()); score.setParentAgencyId(street.getParentAgencyId());
@ -445,12 +447,15 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
score.setScore(v.getTotalScore()); score.setScore(v.getTotalScore());
score.setAllParentIndexCode(allParentIndexCode); score.setAllParentIndexCode(allParentIndexCode);
score.setDataType(IndexCalConstant.STREET_LEVEL); score.setDataType(IndexCalConstant.STREET_LEVEL);
String allPath = allParentIndexCode.concat(StrConstant.COLON).concat(indexCode);
BigDecimal weight = indexGroupDetailService.getWeightByAllPathIndexCode(customerId, allPath);
score.setWeight(weight);
pid.forEach((agency, parentAgency) -> { pid.forEach((agency, parentAgency) -> {
if (k.equals(agency)) { if (k.equals(agency)) {
score.setParentAgencyId(parentAgency); score.setParentAgencyId(parentAgency);
} }
}); });
if (!CollectionUtils.isEmpty(v.getDetails())){ if (!CollectionUtils.isEmpty(v.getDetails())) {
v.getDetails().forEach(streetScore -> { v.getDetails().forEach(streetScore -> {
AgencyScoreDTO s = new AgencyScoreDTO(); AgencyScoreDTO s = new AgencyScoreDTO();
s.setCustomerId(customerId); s.setCustomerId(customerId);
@ -463,6 +468,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
s.setScore(streetScore.getScore()); s.setScore(streetScore.getScore());
s.setDataType(IndexCalConstant.STREET_LEVEL); s.setDataType(IndexCalConstant.STREET_LEVEL);
s.setAllParentIndexCode(streetScore.getAllParentIndexCode()); s.setAllParentIndexCode(streetScore.getAllParentIndexCode());
s.setWeight(streetScore.getWeight());
pid.forEach((agency, parentAgency) -> { pid.forEach((agency, parentAgency) -> {
if (k.equals(agency)) { if (k.equals(agency)) {
s.setParentAgencyId(parentAgency); s.setParentAgencyId(parentAgency);

Loading…
Cancel
Save