|
@ -140,12 +140,15 @@ public class DeptScoreServiceImpl extends BaseServiceImpl<DeptScoreDao, DeptScor |
|
|
Map<String, Set<String>> selfSubParentMap = new HashMap<>(); |
|
|
Map<String, Set<String>> selfSubParentMap = new HashMap<>(); |
|
|
selfSubParentMap.put(ProjectConstant.ZI_SHEN, new HashSet<>()); |
|
|
selfSubParentMap.put(ProjectConstant.ZI_SHEN, new HashSet<>()); |
|
|
selfSubParentMap.put(ProjectConstant.XIA_JI, new HashSet<>()); |
|
|
selfSubParentMap.put(ProjectConstant.XIA_JI, new HashSet<>()); |
|
|
|
|
|
Map<String, BigDecimal> weightMap = new HashMap<>(); |
|
|
selfSubIndexList.forEach(o -> { |
|
|
selfSubIndexList.forEach(o -> { |
|
|
//找出自身 和下级的指标
|
|
|
//找出自身 和下级的指标
|
|
|
if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) { |
|
|
if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) { |
|
|
selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode()); |
|
|
selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode()); |
|
|
|
|
|
weightMap.put(ProjectConstant.XIA_JI, weightMap.getOrDefault(ProjectConstant.XIA_JI, new BigDecimal(0)).add(o.getWeight())); |
|
|
} else { |
|
|
} else { |
|
|
selfSubParentMap.get(ProjectConstant.ZI_SHEN).add(o.getIndexCode()); |
|
|
selfSubParentMap.get(ProjectConstant.ZI_SHEN).add(o.getIndexCode()); |
|
|
|
|
|
weightMap.put(ProjectConstant.ZI_SHEN, weightMap.getOrDefault(ProjectConstant.ZI_SHEN, new BigDecimal(0)).add(o.getWeight())); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
Map<String, DeptSelfSubScoreEntity> insertMap = new HashMap<>(); |
|
|
Map<String, DeptSelfSubScoreEntity> insertMap = new HashMap<>(); |
|
@ -158,16 +161,16 @@ public class DeptScoreServiceImpl extends BaseServiceImpl<DeptScoreDao, DeptScor |
|
|
scoreEntity.setSelfScore(new BigDecimal(0)); |
|
|
scoreEntity.setSelfScore(new BigDecimal(0)); |
|
|
scoreEntity.setSubScore(new BigDecimal(0)); |
|
|
scoreEntity.setSubScore(new BigDecimal(0)); |
|
|
scoreEntity.setParentIndexCode(index.getIndexCode()); |
|
|
scoreEntity.setParentIndexCode(index.getIndexCode()); |
|
|
scoreEntity.setSelfWeight(new BigDecimal(0)); |
|
|
scoreEntity.setSelfWeight(weightMap.getOrDefault(score.getIndexCode(), new BigDecimal(0))); |
|
|
scoreEntity.setSubWeight(new BigDecimal(0)); |
|
|
scoreEntity.setSubWeight(weightMap.getOrDefault(score.getIndexCode(), new BigDecimal(0))); |
|
|
} |
|
|
} |
|
|
BigDecimal partScore = score.getScore().multiply(score.getWeight()); |
|
|
BigDecimal partScore = score.getScore().multiply(score.getWeight()); |
|
|
if (selfSubParentMap.get(ProjectConstant.XIA_JI).contains(score.getIndexCode())) { |
|
|
if (selfSubParentMap.get(ProjectConstant.XIA_JI).contains(score.getIndexCode())) { |
|
|
scoreEntity.setSubScore(scoreEntity.getSubScore().add(partScore)); |
|
|
scoreEntity.setSubScore(scoreEntity.getSubScore().add(partScore)); |
|
|
scoreEntity.setSubWeight(scoreEntity.getSubWeight().add(score.getWeight())); |
|
|
scoreEntity.setSelfWeight(weightMap.get(ProjectConstant.XIA_JI)); |
|
|
} else { |
|
|
} else { |
|
|
scoreEntity.setSelfScore(scoreEntity.getSelfScore().add(partScore)); |
|
|
scoreEntity.setSelfScore(scoreEntity.getSelfScore().add(partScore)); |
|
|
scoreEntity.setSelfWeight(scoreEntity.getSelfWeight().add(score.getWeight())); |
|
|
scoreEntity.setSelfWeight(weightMap.get(ProjectConstant.ZI_SHEN)); |
|
|
} |
|
|
} |
|
|
log.debug("=====key" + key + ",grid:{},originScore:{},weight:{},finalScore:{},total", score.getAgencyId(), score.getScore(), score.getWeight(), partScore); |
|
|
log.debug("=====key" + key + ",grid:{},originScore:{},weight:{},finalScore:{},total", score.getAgencyId(), score.getScore(), score.getWeight(), partScore); |
|
|
}); |
|
|
}); |
|
|