diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java index 3758d966f1..ff2c4558c5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -53,4 +53,13 @@ public interface ProjectConstant { */ String STATS_FAILED_PREFIX = "统计数据执行失败:%s 客户ID:%s,统计日期:%s"; + /** + * 自身 + */ + String ZI_SHEN = "zishen"; + + /** + * 下级 + */ + String XIA_JI = "xiaji"; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java index 483194cc01..8f4a1f1ef8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java @@ -26,6 +26,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; +import com.epmet.constant.ProjectConstant; import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao; import com.epmet.dao.evaluationindex.indexcal.DeptSelfSubScoreDao; import com.epmet.dao.evaluationindex.indexcal.DeptSubScoreDao; @@ -137,14 +138,14 @@ public class DeptScoreServiceImpl extends BaseServiceImpl> selfSubParentMap = new HashMap<>(); - selfSubParentMap.put("zishen", new HashSet<>()); - selfSubParentMap.put("xiaji", new HashSet<>()); + selfSubParentMap.put(ProjectConstant.ZI_SHEN, new HashSet<>()); + selfSubParentMap.put(ProjectConstant.XIA_JI, new HashSet<>()); selfSubIndexList.forEach(o -> { //找出自身 和下级的指标 - if (o.getAllIndexCodePath().indexOf("xiaji") > -1) { - selfSubParentMap.get("xiaji").add(o.getIndexCode()); + if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) { + selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode()); } else { - selfSubParentMap.get("zishen").add(o.getIndexCode()); + selfSubParentMap.get(ProjectConstant.ZI_SHEN).add(o.getIndexCode()); } }); Map insertMap = new HashMap<>(); @@ -160,8 +161,8 @@ public class DeptScoreServiceImpl extends BaseServiceImpl> selfSubParentMap = new HashMap<>(); - selfSubParentMap.put("zishen", new HashSet<>()); - selfSubParentMap.put("xiaji", new HashSet<>()); + selfSubParentMap.put(ProjectConstant.ZI_SHEN, new HashSet<>()); + selfSubParentMap.put(ProjectConstant.XIA_JI, new HashSet<>()); selfSubIndexList.forEach(o -> { //找出自身 和下级的指标 - if (o.getAllIndexCodePath().indexOf("xiaji") > -1) { - selfSubParentMap.get("xiaji").add(o.getIndexCode()); + if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) { + selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode()); } else { - selfSubParentMap.get("zishen").add(o.getIndexCode()); + selfSubParentMap.get(ProjectConstant.ZI_SHEN).add(o.getIndexCode()); } }); Map insertMap = new HashMap<>(); @@ -150,9 +151,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { scoreEntity.setSelfWeight(new BigDecimal(0)); scoreEntity.setSubWeight(new BigDecimal(0)); } - BigDecimal partScore = score.getScore().multiply(score.getWeight()); - BigDecimal partWeight = score.getScore().multiply(score.getWeight()); - if (selfSubParentMap.get("xiaji").contains(score.getIndexCode())) { + BigDecimal partScore = score.getScore(); + if (selfSubParentMap.get(ProjectConstant.XIA_JI).contains(score.getIndexCode())) { scoreEntity.setSubScore(scoreEntity.getSubScore().add(partScore)); scoreEntity.setSubWeight(scoreEntity.getSubWeight().add(score.getWeight())); } else { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java index 9fee142586..07db8a8822 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java @@ -10,6 +10,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; +import com.epmet.constant.ProjectConstant; import com.epmet.dao.evaluationindex.indexcal.CommunityScoreDao; import com.epmet.dao.evaluationindex.indexcal.CommunitySelfSubScoreDao; import com.epmet.dao.evaluationindex.indexcal.CommunitySubScoreDao; @@ -135,14 +136,14 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return; } Map> selfSubParentMap = new HashMap<>(); - selfSubParentMap.put("zishen", new HashSet<>()); - selfSubParentMap.put("xiaji", new HashSet<>()); + selfSubParentMap.put(ProjectConstant.ZI_SHEN, new HashSet<>()); + selfSubParentMap.put(ProjectConstant.XIA_JI, new HashSet<>()); selfSubIndexList.forEach(o -> { //找出自身 和下级的指标 - if (o.getAllIndexCodePath().indexOf("xiaji") > -1) { - selfSubParentMap.get("xiaji").add(o.getIndexCode()); + if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) { + selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode()); } else { - selfSubParentMap.get("zishen").add(o.getIndexCode()); + selfSubParentMap.get(ProjectConstant.ZI_SHEN).add(o.getIndexCode()); } }); Map insertMap = new HashMap<>(); @@ -158,8 +159,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni scoreEntity.setSelfWeight(new BigDecimal(0)); scoreEntity.setSubWeight(new BigDecimal(0)); } - BigDecimal partScore = score.getScore().multiply(score.getWeight()); - if (selfSubParentMap.get("xiaji").contains(score.getIndexCode())) { + BigDecimal partScore = score.getScore(); + if (selfSubParentMap.get(ProjectConstant.XIA_JI).contains(score.getIndexCode())) { scoreEntity.setSubScore(scoreEntity.getSubScore().add(partScore)); scoreEntity.setSubWeight(scoreEntity.getSubWeight().add(score.getWeight())); } else { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java index 80b55fe7ad..a7e1fac331 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java @@ -11,6 +11,7 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; import com.epmet.constant.OrgTypeConstant; +import com.epmet.constant.ProjectConstant; import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; import com.epmet.dao.evaluationindex.indexcal.AgencySelfSubScoreDao; import com.epmet.dao.evaluationindex.indexcal.AgencySubScoreDao; @@ -133,14 +134,14 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict return; } Map> selfSubParentMap = new HashMap<>(); - selfSubParentMap.put("zishen", new HashSet<>()); - selfSubParentMap.put("xiaji", new HashSet<>()); + selfSubParentMap.put(ProjectConstant.ZI_SHEN, new HashSet<>()); + selfSubParentMap.put(ProjectConstant.XIA_JI, new HashSet<>()); selfSubIndexList.forEach(o -> { //找出自身 和下级的指标 - if (o.getAllIndexCodePath().indexOf("xiaji") > -1) { - selfSubParentMap.get("xiaji").add(o.getIndexCode()); + if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) { + selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode()); } else { - selfSubParentMap.get("zishen").add(o.getIndexCode()); + selfSubParentMap.get(ProjectConstant.ZI_SHEN).add(o.getIndexCode()); } }); Map insertMap = new HashMap<>(); @@ -156,8 +157,8 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict scoreEntity.setSelfWeight(new BigDecimal(0)); scoreEntity.setSubWeight(new BigDecimal(0)); } - BigDecimal partScore = score.getScore().multiply(score.getWeight()); - if (selfSubParentMap.get("xiaji").contains(score.getIndexCode())) { + BigDecimal partScore = score.getScore(); + if (selfSubParentMap.get(ProjectConstant.XIA_JI).contains(score.getIndexCode())) { scoreEntity.setSubScore(scoreEntity.getSubScore().add(partScore)); scoreEntity.setSubWeight(scoreEntity.getSubWeight().add(score.getWeight())); } else { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java index 3e77e7289b..b4808fabee 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java @@ -11,6 +11,7 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; import com.epmet.constant.OrgTypeConstant; +import com.epmet.constant.ProjectConstant; import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; import com.epmet.dao.evaluationindex.indexcal.AgencySelfSubScoreDao; import com.epmet.dao.evaluationindex.indexcal.AgencySubScoreDao; @@ -136,14 +137,14 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ return; } Map> selfSubParentMap = new HashMap<>(); - selfSubParentMap.put("zishen", new HashSet<>()); - selfSubParentMap.put("xiaji", new HashSet<>()); + selfSubParentMap.put(ProjectConstant.ZI_SHEN, new HashSet<>()); + selfSubParentMap.put(ProjectConstant.XIA_JI, new HashSet<>()); selfSubIndexList.forEach(o -> { //找出自身 和下级的指标 - if (o.getAllIndexCodePath().indexOf("xiaji") > -1) { - selfSubParentMap.get("xiaji").add(o.getIndexCode()); + if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) { + selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode()); } else { - selfSubParentMap.get("zishen").add(o.getIndexCode()); + selfSubParentMap.get(ProjectConstant.ZI_SHEN).add(o.getIndexCode()); } }); Map insertMap = new HashMap<>(); @@ -159,8 +160,8 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ scoreEntity.setSelfWeight(new BigDecimal(0)); scoreEntity.setSubWeight(new BigDecimal(0)); } - BigDecimal partScore = score.getScore().multiply(score.getWeight()); - if (selfSubParentMap.get("xiaji").contains(score.getIndexCode())) { + BigDecimal partScore = score.getScore(); + if (selfSubParentMap.get(ProjectConstant.XIA_JI).contains(score.getIndexCode())) { scoreEntity.setSubScore(scoreEntity.getSubScore().add(partScore)); scoreEntity.setSubWeight(scoreEntity.getSubWeight().add(score.getWeight())); } else {