From c81447993151b97af5ef46e75cec056bbb3eb165 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 8 Sep 2020 22:06:04 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E6=B7=BB=E5=8A=A0allParentIndexCode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/indexcal/AgencyScoreDTO.java | 19 +++++++++------ .../com/epmet/dto/indexcal/DeptScoreDTO.java | 14 +++++++---- .../indexcal/CpcScoreEntity.java | 17 +++++++++----- .../indexcal/DeptScoreEntity.java | 9 ++++++-- .../indexcal/GridScoreEntity.java | 23 +++++++++++-------- .../screen/FactIndexCommunityScoreEntity.java | 9 ++++++-- .../screen/IndexDictEntity.java | 23 +++++++++++-------- .../epmet/model/IndexExcelDataListener.java | 5 ++++ 8 files changed, 80 insertions(+), 39 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java index a9abd3411f..f4f23d2611 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java @@ -17,14 +17,13 @@ package com.epmet.dto.indexcal; -import java.io.Serializable; -import java.util.Date; - import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.IndexCalConstant; import lombok.Data; +import java.io.Serializable; import java.math.BigDecimal; +import java.util.Date; /** * 区/街道相关分数表 @@ -80,20 +79,26 @@ public class AgencyScoreDTO implements Serializable { /** * 分值 */ - private BigDecimal score; + private BigDecimal score; /** * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;街道相关:jiedaoxiangguan;全区相关:quanquxiangguan */ - private String indexCode; + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + /** - * 数据类型 district :全区;street:街道 + * 数据类型 district :全区;street:街道 */ private String dataType; /** - * + * */ private Integer delFlag; diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDTO.java index 5051aa3d82..f61ab58957 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDTO.java @@ -17,11 +17,11 @@ package com.epmet.dto.indexcal; -import java.io.Serializable; -import java.util.Date; import lombok.Data; +import java.io.Serializable; import java.math.BigDecimal; +import java.util.Date; /** * 区直部门分值表 @@ -77,12 +77,18 @@ public class DeptScoreDTO implements Serializable { /** * 分值 */ - private BigDecimal score; + private BigDecimal score; /** * 治理能力:zhilinengli; */ - private String indexCode; + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + /** * diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcScoreEntity.java index 0b21c5de92..30eb9fb66a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcScoreEntity.java @@ -71,15 +71,20 @@ public class CpcScoreEntity extends BaseEpmetEntity { /** * 分值 */ - private BigDecimal score; + private BigDecimal score; /** * 指标code */ - private String indexCode; + private String indexCode; - /** - * 是否是总分 1是0不是 - */ - private String isTotal; + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 是否是总分 1是0不是 + */ + private String isTotal; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptScoreEntity.java index 29857fdc2c..7a5dcce754 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptScoreEntity.java @@ -75,11 +75,16 @@ public class DeptScoreEntity extends BaseEpmetEntity { /** * 分值 */ - private BigDecimal score; + private BigDecimal score; /** * 治理能力:zhilinengli; */ - private String indexCode; + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridScoreEntity.java index 781dca54bf..2fc442c0be 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridScoreEntity.java @@ -77,14 +77,19 @@ public class GridScoreEntity extends BaseEpmetEntity { */ private String isTotal; - /** - * 分值 - */ - private BigDecimal score; - - /** - * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;网格相关:wanggexiangguan - */ - private String indexCode; + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;网格相关:wanggexiangguan + */ + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityScoreEntity.java index d99cd7b506..5fee9d7cb3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityScoreEntity.java @@ -75,11 +75,16 @@ public class FactIndexCommunityScoreEntity extends BaseEpmetEntity { /** * 分值 */ - private BigDecimal score; + private BigDecimal score; /** * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;社区相关:shequxiangguan */ - private String indexCode; + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexDictEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexDictEntity.java index e0932daeef..149c4c128c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexDictEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexDictEntity.java @@ -35,19 +35,24 @@ public class IndexDictEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; - /** - * 指标名 - */ + /** + * 指标名 + */ private String indexName; - /** - * 指标描述 - */ + /** + * 指标编码 + */ + private String indexCode; + + /** + * 指标描述 + */ private String indexDesc; - /** - * 指标级别(1,2,3,4,5) - */ + /** + * 指标级别(1,2,3,4,5) + */ private String level; /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java index 3fec1a9132..971a11074a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java @@ -266,6 +266,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { entity.setIndexName(data.getLevel1Index()); entity.setCorrelation(data.getCorrelation()); entity.setLevel("1"); + entity.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel1Index(), false, 4)); indexDicMap.put(data.getLevel1Index(), entity); } if (!indexDicMap.containsKey(data.getLevel2Index())) { @@ -273,6 +274,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { entity2.setIndexName(data.getLevel2Index()); entity2.setCorrelation(data.getCorrelation()); entity2.setLevel("2"); + entity.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel2Index(), false, 4)); indexDicMap.put(data.getLevel2Index(), entity2); } if (!indexDicMap.containsKey(data.getLevel3Index())) { @@ -280,6 +282,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { entity3.setIndexName(data.getLevel3Index()); entity3.setCorrelation(data.getCorrelation()); entity3.setLevel("3"); + entity.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel3Index(), false, 4)); indexDicMap.put(data.getLevel3Index(), entity3); } if (!indexDicMap.containsKey(data.getLevel4Index())) { @@ -287,6 +290,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { entity4.setIndexName(data.getLevel4Index()); entity4.setCorrelation(data.getCorrelation()); entity4.setLevel("4"); + entity.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel4Index(), false, 4)); indexDicMap.put(data.getLevel4Index(), entity4); } if (!indexDicMap.containsKey(data.getLevel5Index())) { @@ -294,6 +298,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { entity5.setIndexName(data.getLevel5Index()); entity5.setCorrelation(data.getCorrelation()); entity5.setLevel("5"); + entity.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel5Index(), false, 4)); indexDicMap.put(data.getLevel5Index(), entity5); } } From ba605db6d813c6d3bd579a5ce4d8bc0e5e1f5ccd Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 9 Sep 2020 09:54:36 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E6=8C=87=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../normalizing/batch/CalculateResult.java | 2 +- .../normalizing/batch/IndexScoreVo.java | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/CalculateResult.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/CalculateResult.java index 8430149681..4765c023ba 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/CalculateResult.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/CalculateResult.java @@ -21,5 +21,5 @@ public class CalculateResult implements Serializable { /** * 每项具体的分支 */ - private List details; + private List details; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java new file mode 100644 index 0000000000..ee3605fb7d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java @@ -0,0 +1,25 @@ +package com.epmet.support.normalizing.batch; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @author liujianjun + */ +@Data +public class IndexScoreVo implements Serializable { + + private static final long serialVersionUID = 65642416224721650L; + /** + * 指标code + */ + private String indexCode; + /** + * 分值 + */ + private BigDecimal score; + + +} From c2d6eecf385f19d1eba3cf6958b0efa807c1ed8d Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 9 Sep 2020 10:05:30 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E6=8C=87=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/support/normalizing/batch/BatchScoreCalculator.java | 2 +- .../java/com/epmet/support/normalizing/batch/IndexScoreVo.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java index d13eb8337a..5cc30af57a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java @@ -67,7 +67,7 @@ public class BatchScoreCalculator { result.setDetails(new ArrayList<>()); scoreCountOfSamples.put(sampleId, result); } - SampleScore sampleScore = new SampleScore(idx.getIndexId(), score); + IndexScoreVo sampleScore = new IndexScoreVo(idx.getIndexId(), score); result.getDetails().add(sampleScore); result.setTotalScore(result.getTotalScore().add(score).setScale(6, RoundingMode.HALF_UP)); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java index ee3605fb7d..a46ec66c1d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java @@ -9,6 +9,7 @@ import java.math.BigDecimal; * @author liujianjun */ @Data +@AllArgsConstructor public class IndexScoreVo implements Serializable { private static final long serialVersionUID = 65642416224721650L; From 04f6c16f45a16cc2320ceceaad6319c00415037f Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 9 Sep 2020 10:08:28 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E6=8C=87=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/support/normalizing/batch/IndexScoreVo.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java index a46ec66c1d..e6d189045c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java @@ -1,5 +1,6 @@ package com.epmet.support.normalizing.batch; +import lombok.AllArgsConstructor; import lombok.Data; import java.io.Serializable; From e250d40cf5f362b36fdfc5841dba5118db520fc6 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 9 Sep 2020 10:15:23 +0800 Subject: [PATCH 05/10] =?UTF-8?q?communityScore=E6=96=87=E4=BB=B6=E6=8C=AA?= =?UTF-8?q?=E5=8A=A8=EF=BC=8CgridScore=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CommunityScoreDao.java} | 4 +- .../indexcal/GridScoreDao.java | 43 ++++++++ .../screen/FactIndexGridScoreDao.java | 77 ------------- .../IndexCalculateCommunityServiceImpl.java | 8 +- .../impl/IndexCalculateStreetServiceImpl.java | 4 +- .../impl/FactIndexCollectServiceImpl.java | 6 +- .../CommunityScoreDao.xml} | 2 +- .../evaluationindex/indexcal/GridScoreDao.xml | 101 +++++++++++++++++ .../screen/FactIndexGridScoreDao.xml | 103 ------------------ 9 files changed, 157 insertions(+), 191 deletions(-) rename epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/{screen/FactIndexCommunityScoreDao.java => indexcal/CommunityScoreDao.java} (96%) delete mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexGridScoreDao.java rename epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/{screen/FactIndexCommunityScoreDao.xml => indexcal/CommunityScoreDao.xml} (98%) delete mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexGridScoreDao.xml diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexCommunityScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java similarity index 96% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexCommunityScoreDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java index 40fd49e6ab..ba236c1192 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexCommunityScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.dao.evaluationindex.screen; +package com.epmet.dao.evaluationindex.indexcal; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcal.SubCommunityAvgResultDTO; @@ -33,7 +33,7 @@ import java.util.List; * @since v1.0.0 2020-08-31 */ @Mapper -public interface FactIndexCommunityScoreDao extends BaseDao { +public interface CommunityScoreDao extends BaseDao { /** * @Description 【社区】中间表插入 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java index 2e4a10cde2..b4db5f05f9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java @@ -20,6 +20,8 @@ package com.epmet.dao.evaluationindex.indexcal; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.GridScoreDTO; +import com.epmet.dto.screen.FactIndexGridScoreDTO; +import com.epmet.dto.screen.result.SubGridAvgResultDTO; import com.epmet.entity.evaluationindex.indexcal.GridScoreEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -66,4 +68,45 @@ public interface GridScoreDao extends BaseDao { * @Date 2020/8/31 16:42 **/ List selectList(CalculateCommonFormDTO formDTO); + + /** + * @Description 下属所有网格的平均值 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/28 3:20 下午 + */ + List selectSubGridAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + + /** + * 根据入参查询 网格相关分值记录 + * @param customerId + * @param monthId + * @return java.util.List + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListGridScore(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * 根据入参查询 网格id + * @param customerId + * @param monthId + * @return java.util.List + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListGridId(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * 批量插入 网格相关分值表 + * + * @param list + * @param customerId + * @return void + * @Author zhangyong + * @Date 11:11 2020-09-04 + **/ + void batchInsertGridScoreData(@Param("list") List list,@Param("customerId")String customerId); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexGridScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexGridScoreDao.java deleted file mode 100644 index 77c3f85366..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexGridScoreDao.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.dao.evaluationindex.screen; - -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.screen.FactIndexGridScoreDTO; -import com.epmet.dto.screen.result.SubGridAvgResultDTO; -import com.epmet.entity.evaluationindex.screen.FactIndexGridScoreEntity; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 网格相关分值 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-08-28 - */ -@Mapper -public interface FactIndexGridScoreDao extends BaseDao { - - /** - * @Description 下属所有网格的平均值 - * @param customerId - * @param monthId - * @author zxc - * @date 2020/8/28 3:20 下午 - */ - List selectSubGridAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); - - /** - * 根据入参查询 网格相关分值记录 - * @param customerId - * @param monthId - * @return java.util.List - * @Author zhangyong - * @Date 10:43 2020-09-03 - **/ - List selectListGridScore(@Param("customerId")String customerId, @Param("monthId")String monthId); - - /** - * 根据入参查询 网格id - * @param customerId - * @param monthId - * @return java.util.List - * @Author zhangyong - * @Date 10:43 2020-09-03 - **/ - List selectListGridId(@Param("customerId")String customerId, @Param("monthId")String monthId); - - /** - * 批量插入 网格相关分值表 - * - * @param list - * @param customerId - * @return void - * @Author zhangyong - * @Date 11:11 2020-09-04 - **/ - void batchInsertGridScoreData(@Param("list") List list,@Param("customerId")String customerId); -} 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 50960abf52..07a14db8f4 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 @@ -8,11 +8,11 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; +import com.epmet.dao.evaluationindex.indexcal.CommunityScoreDao; +import com.epmet.dao.evaluationindex.indexcal.GridScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityOrgMonthlyDao; -import com.epmet.dao.evaluationindex.screen.FactIndexCommunityScoreDao; -import com.epmet.dao.evaluationindex.screen.FactIndexGridScoreDao; import com.epmet.dto.screen.FactIndexCommunityScoreDTO; import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; import com.epmet.dto.screen.result.SubGridAvgResultDTO; @@ -59,9 +59,9 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni @Autowired private IndexCodeFieldReService indexCodeFieldReService; @Autowired - private FactIndexCommunityScoreDao factIndexCommunityScoreDao; + private CommunityScoreDao factIndexCommunityScoreDao; @Autowired - private FactIndexGridScoreDao factIndexGridScoreDao; + private GridScoreDao factIndexGridScoreDao; /** * @param customerId 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 3c024c3ec4..6a672a88c7 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 @@ -8,10 +8,10 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; +import com.epmet.dao.evaluationindex.indexcal.CommunityScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityOrgMonthlyDao; -import com.epmet.dao.evaluationindex.screen.FactIndexCommunityScoreDao; import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.dto.indexcal.AgencyScoreDTO; import com.epmet.dto.indexcal.SubCommunityAvgResultDTO; @@ -59,7 +59,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ @Autowired private IndexCodeFieldReService indexCodeFieldReService; @Autowired - private FactIndexCommunityScoreDao communityScoreDao; + private CommunityScoreDao communityScoreDao; @Autowired private AgencyScoreDao agencyScoreDao; @Autowired diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java index 02cd42be2a..65e0afbf0d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java @@ -7,7 +7,9 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.OrgTypeConstant; import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; +import com.epmet.dao.evaluationindex.indexcal.CommunityScoreDao; import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao; +import com.epmet.dao.evaluationindex.indexcal.GridScoreDao; import com.epmet.dao.evaluationindex.indexcoll.*; import com.epmet.dao.evaluationindex.screen.*; import com.epmet.dto.ScreenCustomerGridDTO; @@ -63,9 +65,9 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { @Autowired private FactIndexGovrnAblityDeptMonthlyDao factIndexGovrnAblityDeptMonthlyDao; @Autowired - private FactIndexGridScoreDao factIndexGridScoreDao; + private GridScoreDao factIndexGridScoreDao; @Autowired - private FactIndexCommunityScoreDao factIndexCommunityScoreDao; + private CommunityScoreDao factIndexCommunityScoreDao; @Autowired private DeptScoreDao deptScoreDao; @Autowired diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml similarity index 98% rename from epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml rename to epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml index e00f0b2c12..66ea89b140 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml @@ -1,7 +1,7 @@ - + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml index e45dcb04ef..d42d063e35 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml @@ -112,4 +112,105 @@ AND m.CUSTOMER_ID =#{customerId} AND m.MONTH_ID =#{monthId} + + + + + + + + + + insert into fact_index_grid_score + ( + ID, + CUSTOMER_ID, + GRID_ID, + AGENCY_ID, + ALL_PARENT_IDS, + QUARTER_ID, + YEAR_ID, + MONTH_ID, + IS_TOTAL, + SCORE, + INDEX_CODE, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.gridId}, + #{item.agencyId}, + #{item.allParentIds}, + #{item.quarterId}, + + #{item.yearId}, + #{item.monthId}, + #{item.isTotal}, + #{item.score}, + #{item.indexCode}, + #{item.delFlag}, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexGridScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexGridScoreDao.xml deleted file mode 100644 index 05ae94667e..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexGridScoreDao.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - insert into fact_index_grid_score - ( - ID, - CUSTOMER_ID, - GRID_ID, - AGENCY_ID, - ALL_PARENT_IDS, - QUARTER_ID, - YEAR_ID, - MONTH_ID, - IS_TOTAL, - SCORE, - INDEX_CODE, - DEL_FLAG, - REVISION, - CREATED_BY, - CREATED_TIME, - UPDATED_BY, - UPDATED_TIME - ) values - - ( - (SELECT REPLACE(UUID(), '-', '') AS id), - #{customerId}, - #{item.gridId}, - #{item.agencyId}, - #{item.allParentIds}, - #{item.quarterId}, - - #{item.yearId}, - #{item.monthId}, - #{item.isTotal}, - #{item.score}, - #{item.indexCode}, - #{item.delFlag}, - 0, - 'APP_USER', - now(), - 'APP_USER', - now() - ) - - - - - From 76249a1abcfb5a0cce33ecdd53a2702a73bcc2d7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 9 Sep 2020 10:23:15 +0800 Subject: [PATCH 06/10] KcScreenCollController --- .../epmet/controller/KcScreenCollController.java | 15 +++++++++++++++ ...oller.java => ShiBeiScreenCollController.java} | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java rename epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/{ScreenCollController.java => ShiBeiScreenCollController.java} (99%) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java new file mode 100644 index 0000000000..766db2294b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java @@ -0,0 +1,15 @@ +package com.epmet.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 孔村大屏数据采集api + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/9 10:18 + */ +@RestController +@RequestMapping("kcscreencoll") +public class KcScreenCollController { +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java similarity index 99% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java index 55e91e89d4..467bb63b2f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java @@ -14,14 +14,14 @@ import org.springframework.web.bind.annotation.RestController; import java.util.List; /** - * 大屏数据采集api + * 市北大屏数据采集api * * @author yinzuomei@elink-cn.com * @date 2020/8/18 10:25 */ @RestController @RequestMapping("screencoll") -public class ScreenCollController { +public class ShiBeiScreenCollController { @Autowired private ScreenCollService screenCollService; From 286f501da3eb7eafeacbc767c9ee30f3f63a94ce Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 9 Sep 2020 10:29:30 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E9=87=87=E9=9B=86?= =?UTF-8?q?=E9=80=9A=E7=94=A8=E5=85=A5=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/screencoll/ScreenCollFormDTO.java | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java new file mode 100644 index 0000000000..95167c65c3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java @@ -0,0 +1,43 @@ +package com.epmet.dto.screencoll; + +import com.alibaba.fastjson.JSON; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 大屏采集通用入参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/9 10:25 + */ +@Data +public class ScreenCollFormDTO implements Serializable { + + private static final long serialVersionUID = 4605543711669000348L; + /** + * 当为true时后台将先删除当前维度的数据,后新增 + */ + private Boolean isFirst; + + /** + * 日期Id, 数据更新至:yyyyMMdd + */ + private String dateId; + + /** + * yyyyMM + */ + private String monthId; + + /** + * 数据集合 + */ + private List dataList; + + @Override + public String toString() { + return JSON.toJSONString(this); + } +} From 883b33208ac136dac4c9d79a99c26386f2e67f65 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 9 Sep 2020 10:40:15 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E6=8C=87=E6=A0=87code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/model/IndexExcelDataListener.java | 8 +++--- .../indexcal/impl/DeptScoreServiceImpl.java | 1 + .../impl/GridCorreLationServiceImpl.java | 9 +++--- .../IndexCalculateCommunityServiceImpl.java | 12 ++++---- .../IndexCalculateDistrictServiceImpl.java | 10 +++---- .../impl/IndexCalculateStreetServiceImpl.java | 12 ++++---- .../batch/BatchScoreCalculator.java | 2 +- .../normalizing/batch/IndexInputVO.java | 5 ++++ .../normalizing/batch/IndexScoreVo.java | 4 +++ .../stats/test/normalizing/DemoScoreCal.java | 28 +++++++++---------- 10 files changed, 51 insertions(+), 40 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java index 971a11074a..b172852d63 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java @@ -274,7 +274,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { entity2.setIndexName(data.getLevel2Index()); entity2.setCorrelation(data.getCorrelation()); entity2.setLevel("2"); - entity.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel2Index(), false, 4)); + entity2.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel2Index(), false, 4)); indexDicMap.put(data.getLevel2Index(), entity2); } if (!indexDicMap.containsKey(data.getLevel3Index())) { @@ -282,7 +282,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { entity3.setIndexName(data.getLevel3Index()); entity3.setCorrelation(data.getCorrelation()); entity3.setLevel("3"); - entity.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel3Index(), false, 4)); + entity3.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel3Index(), false, 4)); indexDicMap.put(data.getLevel3Index(), entity3); } if (!indexDicMap.containsKey(data.getLevel4Index())) { @@ -290,7 +290,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { entity4.setIndexName(data.getLevel4Index()); entity4.setCorrelation(data.getCorrelation()); entity4.setLevel("4"); - entity.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel4Index(), false, 4)); + entity4.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel4Index(), false, 4)); indexDicMap.put(data.getLevel4Index(), entity4); } if (!indexDicMap.containsKey(data.getLevel5Index())) { @@ -298,7 +298,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { entity5.setIndexName(data.getLevel5Index()); entity5.setCorrelation(data.getCorrelation()); entity5.setLevel("5"); - entity.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel5Index(), false, 4)); + entity5.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel5Index(), false, 4)); indexDicMap.put(data.getLevel5Index(), entity5); } } 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 959f3caa64..dba7178f96 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 @@ -249,6 +249,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl> sampleValueList = new ArrayList<>(); IndexInputVO indexInputVO1 = new IndexInputVO(index.getIndexCode(), + index.getAllParentIndexCode(), sampleValueList, index.getThreshold(), // new BigDecimal("-1"), //FOR TEST diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java index abbe326a81..1db443914c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java @@ -454,11 +454,12 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { ); List> sampleValueList = new ArrayList<>(); IndexInputVO indexInputVO1 = new IndexInputVO(index.getIndexCode(), - sampleValueList, - index.getThreshold(), + index.getAllParentIndexCode(), + sampleValueList, + index.getThreshold(), // new BigDecimal("-1"),//FOR TEST - index.getWeight(), - scoreCalculator); + index.getWeight(), + scoreCalculator); map.put(index.getIndexCode(), indexInputVO1); } return map; 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 07a14db8f4..cd2e036cf4 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 @@ -102,7 +102,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni index1SampleValues.add(s); }); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); indexInputVOS.add(index1VO); }); } @@ -133,7 +133,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); index1SampleValues.add(s); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } @@ -185,7 +185,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni index1SampleValues.add(s); }); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); indexInputVOS.add(index1VO); }); } @@ -216,7 +216,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); index1SampleValues.add(s); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } @@ -265,7 +265,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } @@ -295,7 +295,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); index1SampleValues.add(s); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } 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 3720a6cc4e..e8a50fabfe 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 @@ -121,7 +121,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict index1SampleValues.add(s); }); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); indexInputVOS.add(index1VO); }); } @@ -152,7 +152,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); index1SampleValues.add(s); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } @@ -197,7 +197,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict index1SampleValues.add(s); }); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); indexInputVOS.add(index1VO); }); } @@ -217,7 +217,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict index1SampleValues.add(s); }); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); indexInputVOS.add(index1VO); }); } @@ -265,7 +265,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict SampleValue s = new SampleValue(c.getParentId(), c.getScore()); index1SampleValues.add(s); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } 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 6a672a88c7..9cdd9fe536 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 @@ -128,7 +128,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ index1SampleValues.add(s); }); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); indexInputVOS.add(index1VO); }); } @@ -158,7 +158,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldName)))); index1SampleValues.add(s); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } @@ -203,7 +203,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ index1SampleValues.add(s); }); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); indexInputVOS.add(index1VO); }); } @@ -234,7 +234,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); index1SampleValues.add(s); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } @@ -280,7 +280,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } @@ -310,7 +310,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); index1SampleValues.add(s); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java index 5cc30af57a..1ca86d8faf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java @@ -67,7 +67,7 @@ public class BatchScoreCalculator { result.setDetails(new ArrayList<>()); scoreCountOfSamples.put(sampleId, result); } - IndexScoreVo sampleScore = new IndexScoreVo(idx.getIndexId(), score); + IndexScoreVo sampleScore = new IndexScoreVo(idx.getIndexId(), idx.getAllParentIndexCode(), score); result.getDetails().add(sampleScore); result.setTotalScore(result.getTotalScore().add(score).setScale(6, RoundingMode.HALF_UP)); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexInputVO.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexInputVO.java index 57c6fbc396..0c805af16c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexInputVO.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexInputVO.java @@ -19,6 +19,11 @@ public class IndexInputVO implements Serializable { */ private String indexId; + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + /** * 指标的样本值 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java index e6d189045c..3b108999a1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java @@ -18,6 +18,10 @@ public class IndexScoreVo implements Serializable { * 指标code */ private String indexCode; + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; /** * 分值 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/DemoScoreCal.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/DemoScoreCal.java index 3b41f1ff2f..57969c12e0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/DemoScoreCal.java +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/DemoScoreCal.java @@ -75,8 +75,8 @@ public class DemoScoreCal { List> index2SampleValues = Arrays.asList(new SampleValue<>("id1", 1), new SampleValue<>("id2", 8), new SampleValue<>("id3", 3)); // 每个指标的信息,包括样本列表,权重,指标标记 - IndexInputVO index1VO = new IndexInputVO<>("aaa", index1SampleValues, new BigDecimal(10), new BigDecimal(1), sc1); - IndexInputVO index2VO = new IndexInputVO<>("bbb", index2SampleValues, new BigDecimal(10), new BigDecimal(1), sc2); + IndexInputVO index1VO = new IndexInputVO<>("aaa", "a:bbb2", index1SampleValues, new BigDecimal(10), new BigDecimal(1), sc1); + IndexInputVO index2VO = new IndexInputVO<>("bbb", "a:bbb2", index2SampleValues, new BigDecimal(10), new BigDecimal(1), sc2); List indexInputVOS = Arrays.asList(index1VO, index2VO); @@ -101,8 +101,8 @@ public class DemoScoreCal { List index2SampleValues = Arrays.asList(new SampleValue<>("id1", new BigDecimal(1)), new SampleValue<>("id2", new BigDecimal(8)), new SampleValue<>("id3", new BigDecimal(3))); // 每个指标的信息,包括样本列表,权重,指标标记 - IndexInputVO index1VO = new IndexInputVO("aaa", index1SampleValues, new BigDecimal(6), new BigDecimal(1), sc1); - IndexInputVO index2VO = new IndexInputVO("bbb", index2SampleValues, new BigDecimal(6), new BigDecimal(1), sc2); + IndexInputVO index1VO = new IndexInputVO("aaa", "a:aaa", index1SampleValues, new BigDecimal(6), new BigDecimal(1), sc1); + IndexInputVO index2VO = new IndexInputVO("bbb", "b:bbb", index2SampleValues, new BigDecimal(6), new BigDecimal(1), sc2); List indexInputVOS = Arrays.asList(index1VO, index2VO); @@ -160,13 +160,13 @@ public class DemoScoreCal { // 每个指标的信息,包括样本列表,权重,指标标记 - IndexInputVO index1VO = new IndexInputVO("aaa1", index1SampleValues, new BigDecimal(-1), new BigDecimal(0.2), sc1); - IndexInputVO index2VO = new IndexInputVO("aaa2", index1SampleValues2, new BigDecimal(-1), new BigDecimal(0.15), sc2); - IndexInputVO index3VO = new IndexInputVO("aaa3", index1SampleValues3, new BigDecimal(-1), new BigDecimal(0.15), sc3); - IndexInputVO index4VO = new IndexInputVO("aaa4", index1SampleValues4, new BigDecimal(-1), new BigDecimal(0.5), sc4); + IndexInputVO index1VO = new IndexInputVO("aaa1", "a:bbb2", index1SampleValues, new BigDecimal(-1), new BigDecimal(0.2), sc1); + IndexInputVO index2VO = new IndexInputVO("aaa2", "a:bbb2", index1SampleValues2, new BigDecimal(-1), new BigDecimal(0.15), sc2); + IndexInputVO index3VO = new IndexInputVO("aaa3", "a:bbb2", index1SampleValues3, new BigDecimal(-1), new BigDecimal(0.15), sc3); + IndexInputVO index4VO = new IndexInputVO("aaa4", "a:bbb2", index1SampleValues4, new BigDecimal(-1), new BigDecimal(0.5), sc4); - List indexInputVOS = Arrays.asList(index1VO, index2VO,index3VO,index4VO); + List indexInputVOS = Arrays.asList(index1VO, index2VO, index3VO, index4VO); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); HashMap result = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); @@ -224,13 +224,13 @@ public class DemoScoreCal { // 每个指标的信息,包括样本列表,权重,指标标记 - IndexInputVO index1VO = new IndexInputVO("aaa1", index1SampleValues, new BigDecimal(-1), new BigDecimal(0.3), sc1); - IndexInputVO index2VO = new IndexInputVO("aaa2", index1SampleValues2, new BigDecimal(-1), new BigDecimal(0.2), sc2); - IndexInputVO index3VO = new IndexInputVO("aaa3", index1SampleValues3, new BigDecimal(-1), new BigDecimal(0.2), sc3); - IndexInputVO index4VO = new IndexInputVO("aaa4", index1SampleValues4, new BigDecimal(0.6), new BigDecimal(0.3), sc4); + IndexInputVO index1VO = new IndexInputVO("aaa1", "a:bbb2", index1SampleValues, new BigDecimal(-1), new BigDecimal(0.3), sc1); + IndexInputVO index2VO = new IndexInputVO("aaa2", "a:bbb2", index1SampleValues2, new BigDecimal(-1), new BigDecimal(0.2), sc2); + IndexInputVO index3VO = new IndexInputVO("aaa3", "a:bbb2", index1SampleValues3, new BigDecimal(-1), new BigDecimal(0.2), sc3); + IndexInputVO index4VO = new IndexInputVO("aaa4", "a:bbb2", index1SampleValues4, new BigDecimal(0.6), new BigDecimal(0.3), sc4); - List indexInputVOS = Arrays.asList(index1VO, index2VO,index3VO,index4VO); + List indexInputVOS = Arrays.asList(index1VO, index2VO, index3VO, index4VO); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); HashMap result = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); From 3411d59e6b2597ff70d33e671e4f61185f036028 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 9 Sep 2020 10:55:05 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E6=8C=87=E6=A0=87code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CpcIndexCalculateServiceImpl.java | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java index 120aa0d77d..5be3452230 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -23,6 +23,7 @@ import com.epmet.support.normalizing.Correlation; import com.epmet.support.normalizing.ScoreCalculator; import com.epmet.support.normalizing.ScoreConstants; import com.epmet.support.normalizing.batch.BatchScoreCalculator; +import com.epmet.support.normalizing.batch.CalculateResult; import com.epmet.support.normalizing.batch.IndexInputVO; import com.epmet.support.normalizing.batch.SampleValue; import lombok.extern.slf4j.Slf4j; @@ -224,7 +225,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { } } log.info("计算的参数:{}", JSON.toJSONString(indexMap)); - HashMap result = calculateScore(indexMap); + HashMap result = calculateScore(indexMap); log.info("计算的结果:{}", result); //处理结果 @@ -244,13 +245,20 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { * @param result */ @Transactional(rollbackFor = Exception.class) - public void saveCpcScore(CalculateCommonFormDTO formDTO, Map indexDetails, String parentIndexCode, HashMap result) { + public void saveCpcScore(CalculateCommonFormDTO formDTO, Map indexDetails, String parentIndexCode, HashMap result) { List list = new ArrayList<>(); result.forEach((userId, score) -> { CpcScoreEntity cpcScoreEntity = indexDetails.get(userId); - cpcScoreEntity.setScore(score); + cpcScoreEntity.setScore(score.getTotalScore()); list.add(cpcScoreEntity); + score.getDetails().forEach(o -> { + CpcScoreEntity child = ConvertUtils.sourceToTarget(o, CpcScoreEntity.class); + child.setIndexCode(o.getIndexCode()); + child.setScore(o.getScore()); + list.add(child); + }); + }); this.deleteAndInsertBatch(formDTO, list, parentIndexCode); } @@ -295,7 +303,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { ScoreConstants.MAX_SCORE, Correlation.getCorrelation(index.getCorrelation()) ); - IndexInputVO indexInputVO = new IndexInputVO(index.getIndexCode(), new ArrayList<>(), index.getThreshold(), index.getWeight(), scoreCalculator); + IndexInputVO indexInputVO = new IndexInputVO(index.getIndexCode(), index.getAllParentIndexCode(), new ArrayList<>(), index.getThreshold(), index.getWeight(), scoreCalculator); map.put(index.getIndexCode(), indexInputVO); } return map; @@ -307,11 +315,11 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { * @param indexMap * @return */ - private HashMap calculateScore(Map> indexMap) { + private HashMap calculateScore(Map> indexMap) { //构造入参 List indexInputVOS = indexMap.values().stream().collect(Collectors.toList()); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - return batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + return batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); } From 2d01a8faaf7357005982899c747f11f49a6f9981 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Wed, 9 Sep 2020 12:18:44 +0800 Subject: [PATCH 10/10] =?UTF-8?q?04=E3=80=81=E4=BA=8B=E4=BB=B6=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=20-=20=E5=9B=BE=E7=89=87=EF=BC=8C=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E6=89=B9=E9=87=8F=E5=88=A0=E9=99=A4=E3=80=81=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E3=80=82=2002=E3=80=81=E5=85=9A=E5=BB=BA=E8=83=BD?= =?UTF-8?q?=E5=8A=9B-=E7=BD=91=E6=A0=BC=E7=9B=B8=E5=85=B3=E6=8C=87?= =?UTF-8?q?=E6=A0=87=E4=B8=8A=E6=8A=A5=EF=BC=8C=E6=8E=A5=E5=8F=A3=E5=85=A5?= =?UTF-8?q?=E5=8F=82=E6=A0=BC=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/GridPartyAbilityFormDTO.java | 4 +- .../screen/ScreenEventImgDataDao.java | 8 +++- .../screen/impl/ScreenCollServiceImpl.java | 35 +++++++++++------- .../screen/ScreenEventImgDataDao.xml | 37 ++++++++++++++++++- 4 files changed, 65 insertions(+), 19 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java index 8738c5c3f2..3aa816cafd 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java @@ -48,7 +48,7 @@ public class GridPartyAbilityFormDTO implements Serializable { /** * 网格党员人均提出的议题转项目数 */ - private Integer partyAvgShiftProjectCount; + private BigDecimal partyAvgShiftProjectCount; /** * 网格活跃群众用户数 @@ -78,7 +78,7 @@ public class GridPartyAbilityFormDTO implements Serializable { /** * 网格群众人均提出的议题转项目数 */ - private Integer userAvgShiftProjectCount; + private BigDecimal userAvgShiftProjectCount; /** * 建群党员数(累计值) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventImgDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventImgDataDao.java index 835b1f112d..fed3048bba 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventImgDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventImgDataDao.java @@ -22,6 +22,8 @@ import com.epmet.entity.evaluationindex.screen.ScreenEventImgDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 中央区-事件数据图片数据 * @@ -34,10 +36,12 @@ public interface ScreenEventImgDataDao extends BaseDao /** * 根据原始事件Id,进行物理删除 * - * @param eventId + * @param eventIds * @return void * @Author zhangyong * @Date 16:47 2020-08-18 **/ - void delEventImgDataByEventId(@Param("eventId") String eventId); + void delEventImgDataByEvent(@Param("eventIds") String[] eventIds); + + void batchInsertEventImgData(@Param("list") List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCollServiceImpl.java index 7afe8df0b0..bc064d7cd8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCollServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCollServiceImpl.java @@ -171,22 +171,31 @@ public class ScreenCollServiceImpl implements ScreenCollService { } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { screenEventDataDao.batchInsertEventData(formDTO.getDataList(), customerId); - } - // 处理图片 - for (int i = NumConstant.ZERO; i < formDTO.getDataList().size(); i++) { - if (null != formDTO.getDataList().get(i).getImgDataList() && formDTO.getDataList().get(i).getImgDataList().size() > NumConstant.ZERO) { - // 根据原始事件ID,物理删除 - 事件数据图片数据 - screenEventImgDataDao.delEventImgDataByEventId(formDTO.getDataList().get(i).getEventId()); - for (int j = NumConstant.ZERO; j < formDTO.getDataList().get(i).getImgDataList().size(); j++){ - // 新增 中央区-事件数据图片数据 表 - ScreenEventImgDataEntity imgDataEntity = new ScreenEventImgDataEntity(); - imgDataEntity.setEventId(formDTO.getDataList().get(i).getImgDataList().get(j).getEventId()); - imgDataEntity.setEventImgUrl(formDTO.getDataList().get(i).getImgDataList().get(j).getImgUrl()); - imgDataEntity.setSort(formDTO.getDataList().get(i).getImgDataList().get(j).getSort()); - screenEventImgDataDao.insert(imgDataEntity); + // 处理图片 + String[] events = new String[formDTO.getDataList().size()]; + List eventImgDataList = new ArrayList<>(); + Boolean isImgUrl = false; + for (int i = NumConstant.ZERO; i < formDTO.getDataList().size(); i++) { + if (null != formDTO.getDataList().get(i).getImgDataList() && formDTO.getDataList().get(i).getImgDataList().size() > NumConstant.ZERO) { + // 根据原始事件ID,物理删除 - 事件数据图片数据 + events[i] = formDTO.getDataList().get(i).getEventId(); + for (int j = NumConstant.ZERO; j < formDTO.getDataList().get(i).getImgDataList().size(); j++){ + // 新增 中央区-事件数据图片数据 表 + ScreenEventImgDataEntity imgDataEntity = new ScreenEventImgDataEntity(); + imgDataEntity.setEventId(formDTO.getDataList().get(i).getImgDataList().get(j).getEventId()); + imgDataEntity.setEventImgUrl(formDTO.getDataList().get(i).getImgDataList().get(j).getImgUrl()); + imgDataEntity.setSort(formDTO.getDataList().get(i).getImgDataList().get(j).getSort()); + eventImgDataList.add(imgDataEntity); + isImgUrl = true; + } } } + if (isImgUrl){ + screenEventImgDataDao.delEventImgDataByEvent(events); + screenEventImgDataDao.batchInsertEventImgData(eventImgDataList); + } + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventImgDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventImgDataDao.xml index 9623ede0b9..bc5228b426 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventImgDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventImgDataDao.xml @@ -3,9 +3,42 @@ - + delete from screen_event_img_data - where DEL_FLAG = '0' AND EVENT_ID = #{eventId} + where DEL_FLAG = '0' + AND EVENT_ID IN + + #{item} + + + insert into screen_event_img_data + ( + ID, + EVENT_ID, + EVENT_IMG_URL, + SORT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.eventId}, + #{item.eventImgUrl}, + #{item.sort}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + +