From 798c4e95c96ef991dd7ed26e46a9a7fc1fcbe28c Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 14 Aug 2020 10:21:48 +0800 Subject: [PATCH 001/226] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-third-server/deploy/docker-compose-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml index c1416cc71c..11e57ebe24 100644 --- a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml +++ b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-third-server: container_name: epmet-third-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-third-server:0.0.128 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-third-server:0.0.129 ports: - "8110:8110" network_mode: host # 使用现有网络 From b84d4f68116bfdf38b7f25d6207a09abe77cd72c Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 20 Aug 2020 17:50:31 +0800 Subject: [PATCH 002/226] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-third-server/deploy/docker-compose-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml index e368b27eda..9b72f3c260 100644 --- a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml +++ b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-third-server: container_name: epmet-third-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-third-server:0.0.131 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-third-server:0.0.132 ports: - "8110:8110" network_mode: host # 使用现有网络 From 5c06fa9a41a18666b0cf79927e5282f42204abcc Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 20 Aug 2020 17:51:32 +0800 Subject: [PATCH 003/226] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-third-server/deploy/docker-compose-prod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml index d10eea3729..ed16793dcc 100644 --- a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-third-server: container_name: epmet-third-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-third-server:0.0.131 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-third-server:0.0.132 ports: - "8110:8110" network_mode: host # 使用现有网络 From 4ea75104d860d0277c73827f7306532129370dfb Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 24 Aug 2020 15:55:11 +0800 Subject: [PATCH 004/226] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=88=86=E5=80=BC?= =?UTF-8?q?=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../normalizing/DoubleScoreCalculator.java | 2 +- .../normalizing/IntegerScoreCalculator.java | 2 +- .../support/normalizing/ScoreCalculator.java | 46 ++++++++++++++++++- 3 files changed, 47 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/DoubleScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/DoubleScoreCalculator.java index 87f34db1f9..c626602393 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/DoubleScoreCalculator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/DoubleScoreCalculator.java @@ -17,7 +17,7 @@ public class DoubleScoreCalculator extends ScoreCalculator { * @param correlation 相关性 */ public DoubleScoreCalculator(Double[] sourceArray, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { - this.sourceArrary = sourceArray; + this.sourceArrary = sourceArray.clone(); this.minScore = minScore; this.maxScore = maxScore; this.correlation = correlation; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/IntegerScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/IntegerScoreCalculator.java index 333cd0a4a2..7708b83fc0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/IntegerScoreCalculator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/IntegerScoreCalculator.java @@ -17,7 +17,7 @@ public class IntegerScoreCalculator extends ScoreCalculator { * @param correlation 相关性 */ public IntegerScoreCalculator(Integer[] sourceArray, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { - this.sourceArrary = sourceArray; + this.sourceArrary = sourceArray.clone(); this.minScore = minScore; this.maxScore = maxScore; this.correlation = correlation; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java index 2fb3fab926..e3c98d5117 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java @@ -6,6 +6,7 @@ import java.util.Arrays; /** * 所有数据类型计算器的父类,实现算法骨架,数据类型转换方法则由子类实现 + * ☆☆☆ 如果需要保持传入的数组元素顺序不变,请在实现类的构造方法中将传入数组进行克隆 ☆☆☆ * @param 数据类型泛型 */ public abstract class ScoreCalculator { @@ -38,7 +39,7 @@ public abstract class ScoreCalculator { } /** - * 归一算法 + * 单值归一算法 * @return */ public BigDecimal normalize(T sourceValue) { @@ -66,6 +67,49 @@ public abstract class ScoreCalculator { } } + /** + * 单值归一算法,带权重 + * @param sourceValue + * @param weight + * @return + */ + public BigDecimal normalize(T sourceValue, BigDecimal weight) { + return normalize(sourceValue).multiply(weight); + } + + /** + * 批量归一算法 + * @param sourceValues + * @return + */ + public BigDecimal[] normalize(T[] sourceValues) { + + BigDecimal[] scores = new BigDecimal[sourceValues.length]; + + for (int i=0;i Date: Mon, 24 Aug 2020 16:16:10 +0800 Subject: [PATCH 005/226] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gov-project-server/deploy/docker-compose-prod.yml | 2 +- epmet-user/epmet-user-server/deploy/docker-compose-prod.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-prod.yml b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-prod.yml index 0c08e7e115..e7aae13868 100644 --- a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-prod.yml +++ b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-project-server: container_name: gov-project-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-project-server:0.3.40 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-project-server:0.3.43 ports: - "8102:8102" network_mode: host # 使用现有网络 diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml b/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml index a9847b773c..36ea6d03ac 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-user-server:0.3.118 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-user-server:0.3.120 ports: - "8087:8087" network_mode: host # 不会创建新的网络 From 24fce0d80817a3b201540df9e151a3a59575ae2d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 24 Aug 2020 16:37:06 +0800 Subject: [PATCH 006/226] =?UTF-8?q?fact=5Findex=5Fparty=5Fablity=5Fcpc=5Fm?= =?UTF-8?q?onthly=E8=A1=A8=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FactIndexPartyAblityCpcMonthlyEntity.java | 110 +++++++++--------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java index e6ec77f0fa..689c396b2a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java @@ -27,10 +27,10 @@ import java.math.BigDecimal; import java.util.Date; /** - * 党建能力-党员相关的事实表 + * 党建能力-党员相关的事实表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-08-20 + * @since v1.0.0 2020-08-24 */ @Data @EqualsAndHashCode(callSuper=false) @@ -39,89 +39,89 @@ public class FactIndexPartyAblityCpcMonthlyEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; - /** - * 客户Id - */ + /** + * 客户Id + */ private String customerId; - /** - * 机关Id - */ + /** + * 机关Id + */ private String agencyId; - /** - * 上级组织Id - */ + /** + * 上级组织Id + */ private String parentId; - /** - * 网格Id - */ + /** + * 网格Id + */ private String gridId; - /** - * 用户Id: - */ + /** + * 用户Id: + */ private String userId; - /** - * 月维度Id: yyyMM - */ + /** + * 月维度Id: yyyMM + */ private String monthId; - /** - * 季度Id: yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 - */ + /** + * 季度Id: yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ private String quarterId; - /** - * 年Id : yyyy - */ + /** + * 年Id : yyyy + */ private String yearId; - /** - * 党员提出的话题数 - */ + /** + * 党员提出的话题数 + */ private Integer createTopicCount; - /** - * 党员参与话题数(支持,反对,评论,浏览) - */ + /** + * 党员参与话题数(支持,反对,评论,浏览) + */ private Integer joinTopicCount; - /** - * 话题转议题数 - */ + /** + * 党员提出的话题转议题数 + */ private Integer shiftIssueCount; - /** - * 议题转项目数 - */ + /** + * 党员提出的议题转项目数 + */ private Integer shiftProjectCount; - /** - * 参加三会一课次数 - */ + /** + * 参加三会一课次数 + */ private Integer joinThreeMeetsCount; - /** - * 自建群群众人数 - */ + /** + * 党员自建群群众人数 + */ private Integer groupUserCount; - /** - * 自建群活跃度-话题数 - */ + /** + * 党员自建群活跃群众人数(08-24) + */ + private Integer groupActiveUserCount; + + /** + * 党员自建群活跃度——话题数 + */ private Integer groupTopicCount; - /** - * 议题转项目率 - */ + /** + * 自建群活跃度——议题转项目率 + */ private BigDecimal topicToIssueRatio; - /** - * 提出的议题转项目数 - */ - private Integer issueToProjectCount; - } From b17b7c6c64e478de5130bde54b2c0b9deb013d6c Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Mon, 24 Aug 2020 16:49:59 +0800 Subject: [PATCH 007/226] =?UTF-8?q?1=E3=80=81=E5=85=9A=E5=BB=BA=E8=83=BD?= =?UTF-8?q?=E5=8A=9B-=E5=85=9A=E5=91=98=E7=9B=B8=E5=85=B3=E6=8C=87?= =?UTF-8?q?=E6=A0=87=E4=B8=8A=E6=8A=A5=20-=20=E6=8E=A5=E5=8F=A3=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcollect/form/GridPartyMemberDataFormDTO.java | 10 +++++----- .../indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java index 7993cb2355..ffdc7554cd 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java @@ -81,11 +81,6 @@ public class GridPartyMemberDataFormDTO implements Serializable { */ private BigDecimal topicToIssueRatio; - /** - * 提出的议题转项目数 - */ - private Integer issueToProjectCount; - /** * 用户id */ @@ -95,4 +90,9 @@ public class GridPartyMemberDataFormDTO implements Serializable { * 上级组织Id */ private String parentId; + + /** + * 党员自建群活跃群众人数(08-24) + */ + private Integer groupActiveUserCount; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml index 836adcdb03..c967efd5fe 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml @@ -21,7 +21,7 @@ - + @@ -56,7 +56,7 @@ GROUP_USER_COUNT, GROUP_TOPIC_COUNT, TOPIC_TO_ISSUE_RATIO, - ISSUE_TO_PROJECT_COUNT, + GROUP_ACTIVE_USER_COUNT, DEL_FLAG, REVISION, CREATED_BY, @@ -83,7 +83,7 @@ #{item.groupUserCount}, #{item.groupTopicCount}, #{item.topicToIssueRatio}, - #{item.issueToProjectCount}, + #{item.groupActiveUserCount}, 0, 0, 'APP_USER', From 971d900b5ba7165a8f69a48ff1438e135ddf672d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 24 Aug 2020 16:53:21 +0800 Subject: [PATCH 008/226] =?UTF-8?q?fact=5Findex=5Fparty=5Fablity=5Fcpc=5Fm?= =?UTF-8?q?onthly=E8=A1=A8=E8=B0=83=E6=95=B4,=E5=88=A0=E9=99=A4user=5Fid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java index 689c396b2a..af89b6d401 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java @@ -59,11 +59,6 @@ public class FactIndexPartyAblityCpcMonthlyEntity extends BaseEpmetEntity { */ private String gridId; - /** - * 用户Id: - */ - private String userId; - /** * 月维度Id: yyyMM */ From 49eb10c7d1eb8deb021274806980f373af9d5ec6 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Mon, 24 Aug 2020 17:00:41 +0800 Subject: [PATCH 009/226] =?UTF-8?q?1=E3=80=81=E5=85=9A=E5=BB=BA=E8=83=BD?= =?UTF-8?q?=E5=8A=9B-=E5=85=9A=E5=91=98=E7=9B=B8=E5=85=B3=E6=8C=87?= =?UTF-8?q?=E6=A0=87=E4=B8=8A=E6=8A=A5=20-=20=E6=8E=A5=E5=8F=A3=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=8F=98=E6=9B=B4=20-=20=E5=88=A0=E9=99=A4userId?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/indexcollect/form/GridPartyMemberDataFormDTO.java | 5 ----- .../dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java | 4 +--- .../epmet/service/indexcollect/FactIndexCollectService.java | 2 +- .../indexcollect/impl/FactIndexCollectServiceImpl.java | 2 +- .../mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml | 5 +---- 5 files changed, 4 insertions(+), 14 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java index ffdc7554cd..ed1fde8844 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java @@ -81,11 +81,6 @@ public class GridPartyMemberDataFormDTO implements Serializable { */ private BigDecimal topicToIssueRatio; - /** - * 用户id - */ - private String userId; - /** * 上级组织Id */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java index 387a369af1..92c6c7a9e9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java @@ -36,12 +36,11 @@ public interface FactIndexPartyAblityCpcMonthlyDao extends BaseDao NumConstant.ZERO){ for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ factIndexPartyAblityCpcMonthlyDao.deleteFactIndexPartyAblityCpcMonthly(customerId, - formDTO.get(i).getAgencyId(), formDTO.get(i).getGridId(), formDTO.get(i).getUserId(), + formDTO.get(i).getAgencyId(), formDTO.get(i).getGridId(), formDTO.get(i).getYearId(), formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); } factIndexPartyAblityCpcMonthlyDao.batchInsertFactIndexPartyAblityCpcMonthly(formDTO, customerId); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml index c967efd5fe..e8f599bfd2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml @@ -9,7 +9,6 @@ - @@ -32,7 +31,7 @@ delete from fact_index_party_ablity_cpc_monthly - where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} AND USER_ID = #{userId} + where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} @@ -44,7 +43,6 @@ AGENCY_ID, PARENT_ID, GRID_ID, - USER_ID, MONTH_ID, QUARTER_ID, YEAR_ID, @@ -71,7 +69,6 @@ #{item.agencyId}, #{item.parentId}, #{item.gridId}, - #{item.userId}, #{item.monthId}, #{item.quarterId}, #{item.yearId}, From a1b6a7a78d8a701b7db6de9f59116b172788620d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 24 Aug 2020 17:22:46 +0800 Subject: [PATCH 010/226] =?UTF-8?q?fact=5Findex=5Fparty=5Fablity=5Fcpc=5Fm?= =?UTF-8?q?onthly=E6=81=A2=E5=A4=8DuserId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java index af89b6d401..689c396b2a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java @@ -59,6 +59,11 @@ public class FactIndexPartyAblityCpcMonthlyEntity extends BaseEpmetEntity { */ private String gridId; + /** + * 用户Id: + */ + private String userId; + /** * 月维度Id: yyyMM */ From d4391e875fa508b64bd6426e532c658f7c0928ee Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 24 Aug 2020 17:24:47 +0800 Subject: [PATCH 011/226] =?UTF-8?q?ExtToken=E5=A4=A7=E5=B1=8Ftoken?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java index 80d21ccde0..563d422650 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java @@ -75,11 +75,11 @@ public class ExtAppJwtTokenUtils { public static void genToken() { HashMap claim = new HashMap<>(); - claim.put("appId", "227fb75ae4baa820755aaf43bf7f0a69"); - claim.put("customerId", "b09527201c4409e19d1dbc5e3c3429a1 "); + claim.put("appId", "acc4ad66c82a7b46e741364b4c62dce2"); + claim.put("customerId", "b09527201c4409e19d1dbc5e3c3429a1"); claim.put("ts", System.currentTimeMillis() - 1000 * 60 * 4); - String abc = new ExtAppJwtTokenUtils().createToken(claim, "4a762660254c57996343f8ee42fbc0a6"); + String abc = new ExtAppJwtTokenUtils().createToken(claim, "612d304095c50369c3ef06e490f05779eeb8f19ff16566c73aeafafc5fa01970"); System.out.println(abc); } From 94f9e58e1561fc66ee7ac94caf1395ad234446a0 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 24 Aug 2020 17:32:29 +0800 Subject: [PATCH 012/226] =?UTF-8?q?screen=5Fuser=5Ftotal=5Fdata=E5=88=A0?= =?UTF-8?q?=E9=99=A4REG=5FUSER=5FTOTAL=E3=80=81JOIN=5FUSER=5FTOTAL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/screen/ScreenUserTotalDataEntity.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenUserTotalDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenUserTotalDataEntity.java index a58f257cc6..bc50eaea04 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenUserTotalDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenUserTotalDataEntity.java @@ -26,7 +26,7 @@ import lombok.EqualsAndHashCode; import java.util.Date; /** - * 中央区-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数 + * 中央区-各类(用户|党员|党群|话题|议题|项目)总数 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-08-21 @@ -98,14 +98,4 @@ public class ScreenUserTotalDataEntity extends BaseEpmetEntity { */ private Integer projectTotal; - /** - * 注册人数(08-21新增) - */ - private Integer regUserTotal; - - /** - * 参与人数(08-21新增) - */ - private Integer joinUserTotal; - } From 6081ff05c51a9337ae400e6b17c7b7adf5984efc Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Mon, 24 Aug 2020 17:58:07 +0800 Subject: [PATCH 013/226] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4=20-=208.24?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/GridPartyMemberDataFormDTO.java | 5 ++ .../form/PublicPartiTotalDataFormDTO.java | 67 +++++++++++++++++++ .../screencoll/form/UserTotalDataFormDTO.java | 10 --- .../FactIndexPartyAblityCpcMonthlyDao.java | 4 +- .../indexcollect/FactIndexCollectService.java | 2 +- .../impl/FactIndexCollectServiceImpl.java | 2 +- .../FactIndexPartyAblityCpcMonthlyDao.xml | 7 +- .../mapper/screen/ScreenUserTotalDataDao.xml | 4 -- 8 files changed, 82 insertions(+), 19 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PublicPartiTotalDataFormDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java index ed1fde8844..3c7c7a5141 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java @@ -90,4 +90,9 @@ public class GridPartyMemberDataFormDTO implements Serializable { * 党员自建群活跃群众人数(08-24) */ private Integer groupActiveUserCount; + + /** + * 用户id + */ + private String userId; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PublicPartiTotalDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PublicPartiTotalDataFormDTO.java new file mode 100644 index 0000000000..df902a06a2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PublicPartiTotalDataFormDTO.java @@ -0,0 +1,67 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 18、公众参与各类总数 入参 + * 公众参与-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class PublicPartiTotalDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 组织类别 agency:组织;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id,如果是网格,传入网格所属的组织id + */ + private String parentId; + + /** + * 组织名称(可以是网格名称,也可以是组织名称) + */ + private String orgName; + + /** + * 话题总数 + */ + private Integer topicTotal; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 注册人数 + */ + private Integer regUserTotal; + + /** + * 项目总数 + */ + private Integer projectTotal; + + /** + * 参与人数 + */ + private Integer joinUserTotal; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataFormDTO.java index 14f4df673d..3111d5136d 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataFormDTO.java @@ -68,14 +68,4 @@ public class UserTotalDataFormDTO implements Serializable { * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) */ private String dataEndTime; - - /** - * 注册人数(08-21新增) - */ - private Integer regUserTotal; - - /** - * 参与人数(08-21新增) - */ - private Integer joinUserTotal; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java index 92c6c7a9e9..387a369af1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java @@ -36,11 +36,12 @@ public interface FactIndexPartyAblityCpcMonthlyDao extends BaseDao NumConstant.ZERO){ for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ factIndexPartyAblityCpcMonthlyDao.deleteFactIndexPartyAblityCpcMonthly(customerId, - formDTO.get(i).getAgencyId(), formDTO.get(i).getGridId(), + formDTO.get(i).getAgencyId(), formDTO.get(i).getGridId(), formDTO.get(i).getUserId(), formDTO.get(i).getYearId(), formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); } factIndexPartyAblityCpcMonthlyDao.batchInsertFactIndexPartyAblityCpcMonthly(formDTO, customerId); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml index e8f599bfd2..e97ca8190e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml @@ -27,6 +27,7 @@ + @@ -60,7 +61,8 @@ CREATED_BY, CREATED_TIME, UPDATED_BY, - UPDATED_TIME + UPDATED_TIME, + USER_ID ) values ( @@ -86,7 +88,8 @@ 'APP_USER', now(), 'APP_USER', - now() + now(), + #{item.userId} ) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml index a3f29dd5a6..29cca7fc82 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml @@ -28,8 +28,6 @@ TOPIC_TOTAL, ISSUE_TOTAL, PROJECT_TOTAL, - REG_USER_TOTAL, - JOIN_USER_TOTAL, DEL_FLAG, REVISION, CREATED_BY, @@ -52,8 +50,6 @@ #{item.topicTotal}, #{item.issueTotal}, #{item.projectTotal}, - #{item.regUserTotal}, - #{item.joinUserTotal}, 0, 0, 'APP_USER', From 130ab7420ab8e38a937354a4aab1e69b034bc329 Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 24 Aug 2020 17:59:20 +0800 Subject: [PATCH 014/226] ext govorg +1 --- .../epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/epmet-ext/epmet-ext-server/pom.xml | 2 +- .../gov-org/gov-org-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/gov-org/gov-org-server/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml index 3dbed877f2..812a39470d 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-ext-server: container_name: epmet-ext-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-ext-server:0.0.5 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-ext-server:0.0.6 ports: - "8113:8113" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-ext/epmet-ext-server/pom.xml b/epmet-module/epmet-ext/epmet-ext-server/pom.xml index 9baa7fbb51..805fa21d3a 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/pom.xml +++ b/epmet-module/epmet-ext/epmet-ext-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.0.5 + 0.0.6 com.epmet diff --git a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml index 952b5c665f..4d59daef61 100644 --- a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-org-server:0.3.87 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-org-server:0.3.88 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index 52560b39e2..937125d59c 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.87 + 0.3.88 com.epmet gov-org From 2101ade6dc076e75090f5d7a2e484043f8c2041b Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 24 Aug 2020 18:24:03 +0800 Subject: [PATCH 015/226] =?UTF-8?q?=E4=BF=AE=E6=94=B9/data/report/screen/g?= =?UTF-8?q?rassrootsgovern/publicpartirank=E6=96=B9=E6=B3=95=EF=BC=8C?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E6=9F=A5=E8=AF=A2screen=5Fpublic=5Fparti=5Ft?= =?UTF-8?q?otal=5Fdata?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/ScreenPublicPartiTotalDataDao.java | 43 +++++++++ .../dao/screen/ScreenUserTotalDataDao.java | 9 -- .../impl/GrassRootsGovernServiceImpl.java | 17 +++- .../screen/ScreenPublicPartiTotalDataDao.xml | 29 ++++++ .../mapper/screen/ScreenUserTotalDataDao.xml | 23 ----- .../screen/ScreenPublicPartiTotalDataDao.java | 34 +++++++ .../ScreenPublicPartiTotalDataEntity.java | 96 +++++++++++++++++++ .../screen/ScreenPublicPartiTotalDataDao.xml | 28 ++++++ 8 files changed, 243 insertions(+), 36 deletions(-) create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPublicPartiTotalDataDao.java create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPublicPartiTotalDataDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPublicPartiTotalDataEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPublicPartiTotalDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPublicPartiTotalDataDao.java new file mode 100644 index 0000000000..02d7e0c722 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPublicPartiTotalDataDao.java @@ -0,0 +1,43 @@ +/** + * 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.datareport.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.screen.dto.result.PublicPartiRankResultDTO; +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-24 + */ +@Mapper +public interface ScreenPublicPartiTotalDataDao{ + /** + * @Description 查询公众参与各类总数 + * @param agencyId + * @return + * @author wangc + * @date 2020.08.20 16:00 + **/ + List selectPublicPartiTotal(@Param("agencyId") String agencyId); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserTotalDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserTotalDataDao.java index a03353e825..2230e636b9 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserTotalDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserTotalDataDao.java @@ -18,7 +18,6 @@ package com.epmet.datareport.dao.screen; import com.epmet.screen.dto.result.PartymemberPercentResultDTO; -import com.epmet.screen.dto.result.PublicPartiRankResultDTO; import com.epmet.screen.dto.result.TopProfileResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -60,12 +59,4 @@ public interface ScreenUserTotalDataDao { **/ int selectAvgIssue(@Param("agencyId")String agencyId); - /** - * @Description 查询用户数据 - * @param agencyId - * @return - * @author wangc - * @date 2020.08.20 16:00 - **/ - List selectUserTotalData(@Param("agencyId") String agencyId); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassRootsGovernServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassRootsGovernServiceImpl.java index 8b0db2c65a..2dd8233800 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassRootsGovernServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassRootsGovernServiceImpl.java @@ -44,6 +44,9 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { private ScreenUserTotalDataDao screenUserTotalDataDao; @Autowired private ScreenGovernRankDataDao screenGovernRankDataDao; + @Autowired + private ScreenPublicPartiTotalDataDao screenPublicPartiTotalDataDao; + /** * @Description 1、热心市民积分排行 * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321544 @@ -122,11 +125,17 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) @Override public List publicPartiRank(AgencyAndNumFormDTO param) { - if(null == param.getTopNum()) param.setTopNum(NumConstant.TWO); - if(NumConstant.ZERO == param.getTopNum()) param.setTopNum(NumConstant.MAX); + if(null == param.getTopNum()){ + param.setTopNum(NumConstant.TWO); + } + if(NumConstant.ZERO == param.getTopNum()){ + param.setTopNum(NumConstant.MAX); + } PageHelper.startPage(NumConstant.ONE,param.getTopNum()); - List result = screenUserTotalDataDao.selectUserTotalData(param.getAgencyId()); - if(null == result) return new ArrayList<>(); + List result = screenPublicPartiTotalDataDao.selectPublicPartiTotal(param.getAgencyId()); + if(null == result) { + return new ArrayList<>(); + } return result; } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml new file mode 100644 index 0000000000..ff931885f6 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml @@ -0,0 +1,29 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml index a1700b05a4..5f3cbc0ef2 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml @@ -46,27 +46,4 @@ - - \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPublicPartiTotalDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPublicPartiTotalDataDao.java new file mode 100644 index 0000000000..f703978057 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPublicPartiTotalDataDao.java @@ -0,0 +1,34 @@ +/** + * 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.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.screen.ScreenPublicPartiTotalDataEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 公众参与-各类(话题|议题|项目|注册人数|参与人数)总数 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-24 + */ +@Mapper +public interface ScreenPublicPartiTotalDataDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPublicPartiTotalDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPublicPartiTotalDataEntity.java new file mode 100644 index 0000000000..56905509ad --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPublicPartiTotalDataEntity.java @@ -0,0 +1,96 @@ +/** + * 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.entity.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 公众参与-各类(话题|议题|项目|注册人数|参与人数)总数 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-24 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_public_parti_total_data") +public class ScreenPublicPartiTotalDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织类别 agency:组织;网格:grid;部门:department; + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id,如果是网格,传入网格所属组织id + */ + private String parentId; + + /** + * 组织名称,也可能是网格名称 + */ + private String orgName; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + + /** + * 话题总数 + */ + private Integer topicTotal; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 项目总数 + */ + private Integer projectTotal; + + /** + * 注册人数 + */ + private Integer regUserTotal; + + /** + * 参与人数 + */ + private Integer joinUserTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml new file mode 100644 index 0000000000..5fefac34e9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From c9f7aa958ffabef0a825825b5e089fecbfaeea82 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 24 Aug 2020 22:43:37 +0800 Subject: [PATCH 016/226] oper-customize +1 --- .../oper-customize-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/oper-customize/oper-customize-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml index fc836e6a15..b392052125 100644 --- a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml +++ b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-customize-server: container_name: oper-customize-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/oper-customize-server:0.3.42 + image: 192.168.1.130:10080/epmet-cloud-dev/oper-customize-server:0.3.43 ports: - "8089:8089" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-customize/oper-customize-server/pom.xml b/epmet-module/oper-customize/oper-customize-server/pom.xml index c1170d6d89..4aa3e88d8f 100644 --- a/epmet-module/oper-customize/oper-customize-server/pom.xml +++ b/epmet-module/oper-customize/oper-customize-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.42 + 0.3.43 com.epmet oper-customize From 782043c328be0ebd86e076f8735f1a6f914ff0ef Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Tue, 25 Aug 2020 09:49:50 +0800 Subject: [PATCH 017/226] =?UTF-8?q?18=E3=80=81=E5=85=AC=E4=BC=97=E5=8F=82?= =?UTF-8?q?=E4=B8=8E=E5=90=84=E7=B1=BB=E6=80=BB=E6=95=B0=20=20=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/ScreenCollController.java | 17 +++++++++++++++++ .../epmet/service/screen/ScreenCollService.java | 13 +++++++++++++ .../screen/impl/ScreenCollServiceImpl.java | 15 +++++++++++++++ .../FactIndexPartyAblityCpcMonthlyDao.xml | 2 +- 4 files changed, 46 insertions(+), 1 deletion(-) 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/ScreenCollController.java index 080ba5384b..daeae95dba 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/ScreenCollController.java @@ -283,4 +283,21 @@ public class ScreenCollController { screenCollService.insertPioneerData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } + + /** + * 18、公众参与各类总数 + * 公众参与-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数 + * + * @param formDTO + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 09:44 2020-08-25 + **/ +// @ExternalAppRequestAuth +// @PostMapping("publicpartitotaldata") +// public Result publicPartiTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { +// screenCollService.insertPublicPartiTotalData(formDTO, externalAppRequestParam.getCustomerId()); +// return new Result(); +// } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/ScreenCollService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/ScreenCollService.java index e81e4497c3..33f4970deb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/ScreenCollService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/ScreenCollService.java @@ -218,4 +218,17 @@ public interface ScreenCollService { * @Date 10:52 2020-08-18 **/ void insertPioneerData(List formDTO, String customerId); + + /** + * 18、公众参与各类总数 + * 公众参与-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数 + * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * @param formDTO + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 09:44 2020-08-25 + **/ +// void insertPublicPartiTotalData(List formDTO, String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java index b5e65fd193..bbac660e05 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java @@ -445,4 +445,19 @@ public class ScreenCollServiceImpl implements ScreenCollService { screenPioneerDataDao.batchInsertPioneerData(formDTO, customerId); } } + +// @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) +// @Override +// @Transactional(rollbackFor = Exception.class) +// public void insertPublicPartiTotalData(List formDTO, String customerId) { +// if (null != formDTO && formDTO.size() > NumConstant.ZERO){ +// String[] orgIds = new String[formDTO.size()]; +// for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ +// orgIds[i] = formDTO.get(i).getOrgId(); +// } +//// screenPioneerDataDao.deletePioneerData(customerId, orgIds); +// +//// screenPioneerDataDao.batchInsertPioneerData(formDTO, customerId); +// } +// } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml index e97ca8190e..c64ce8f35e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml @@ -32,7 +32,7 @@ delete from fact_index_party_ablity_cpc_monthly - where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} + where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} AND USER_ID = #{userId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} From 0af8681f831c891981c53b4bd8d7f719a58ff713 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 25 Aug 2020 10:06:48 +0800 Subject: [PATCH 018/226] =?UTF-8?q?=E6=94=BE=E8=A1=8C-=20/data/report/scre?= =?UTF-8?q?en/**?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-gateway/src/main/resources/bootstrap.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index 0e8c054d2e..0d75f40b35 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -432,7 +432,7 @@ epmet: # url认证白名单,先判断白名单,在白名单中的url直接放行,不再判断上述需要认证的名单 urlWhiteList: - /data/report/test/test - + - /data/report/screen/** swaggerUrls: jwt: From 0ea4254c7831b16bbe1c4229afed1cefb4d5e0a3 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 25 Aug 2020 10:09:08 +0800 Subject: [PATCH 019/226] =?UTF-8?q?=E6=94=BE=E8=A1=8C-=20/data/report/scre?= =?UTF-8?q?en/**=20gateway+1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-gateway/deploy/docker-compose-dev.yml | 2 +- epmet-gateway/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-gateway/deploy/docker-compose-dev.yml b/epmet-gateway/deploy/docker-compose-dev.yml index 82a1bb2c15..a07a2549c0 100644 --- a/epmet-gateway/deploy/docker-compose-dev.yml +++ b/epmet-gateway/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-gateway-server: container_name: epmet-gateway-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:0.3.32 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:0.3.33 ports: - "8080:8080" network_mode: host # 使用现有网络 diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index d595ba019c..6bb2a0889f 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.32 + 0.3.33 com.epmet epmet-cloud From b37f9e6c7fa8870d5dbc873b9b9368a78326b45f Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 25 Aug 2020 10:12:36 +0800 Subject: [PATCH 020/226] report+1,stat+1 --- .../data-report-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-report/data-report-server/pom.xml | 2 +- .../data-statistical-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-statistical/data-statistical-server/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml index 92658e8199..25f7ef5741 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-report-server: container_name: data-report-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.28 + image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.29 ports: - "8109:8109" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 9b2253722d..24a09c3c5e 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - 0.3.28 + 0.3.29 data-report-server diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml index a34bca869d..c2022a855b 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-statistical-server: container_name: data-statistical-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.45 + image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.46 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index de8ffeaea8..84e4b1810d 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.45 + 0.3.46 data-statistical com.epmet From d81a76400bf9eebb5cb8d25548319b2d1669bb62 Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 25 Aug 2020 10:33:19 +0800 Subject: [PATCH 021/226] =?UTF-8?q?=E5=BD=92=E4=B8=80=E7=AE=97=E6=B3=95?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0list=E7=9A=84=E9=87=8D=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../normalizing/DoubleScoreCalculator.java | 9 +++++++++ .../normalizing/IntegerScoreCalculator.java | 10 ++++++++++ .../support/normalizing/ScoreCalculator.java | 20 +++++++++++++++++++ 3 files changed, 39 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/DoubleScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/DoubleScoreCalculator.java index c626602393..01258d0f45 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/DoubleScoreCalculator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/DoubleScoreCalculator.java @@ -1,6 +1,7 @@ package com.epmet.support.normalizing; import java.math.BigDecimal; +import java.util.List; /** * Double的分值计算 @@ -24,6 +25,14 @@ public class DoubleScoreCalculator extends ScoreCalculator { this.prepare(); } + public DoubleScoreCalculator(List sourceArray, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { + this.sourceArrary = sourceArray.toArray(); + this.minScore = minScore; + this.maxScore = maxScore; + this.correlation = correlation; + this.prepare(); + } + @Override public BigDecimal getMaxFromSourceArray() { Double[] doubleSourceArrary = (Double[]) this.sourceArrary; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/IntegerScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/IntegerScoreCalculator.java index 7708b83fc0..98f837ab7e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/IntegerScoreCalculator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/IntegerScoreCalculator.java @@ -1,6 +1,7 @@ package com.epmet.support.normalizing; import java.math.BigDecimal; +import java.util.List; /** * Integer的分值计算 @@ -26,6 +27,15 @@ public class IntegerScoreCalculator extends ScoreCalculator { } + public IntegerScoreCalculator(List sourceList, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { + this.sourceArrary = sourceList.toArray(); + this.minScore = minScore; + this.maxScore = maxScore; + this.correlation = correlation; + this.prepare(); + System.out.println("最小值:"+minScore+";最大值:"+maxScore); + } + @Override public BigDecimal getMaxFromSourceArray() { Integer[] intSourceArrary = (Integer[]) this.sourceArrary; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java index e3c98d5117..48692e92ce 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java @@ -3,6 +3,8 @@ package com.epmet.support.normalizing; import java.math.BigDecimal; import java.math.MathContext; import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; /** * 所有数据类型计算器的父类,实现算法骨架,数据类型转换方法则由子类实现 @@ -93,6 +95,15 @@ public abstract class ScoreCalculator { return scores; } + /** + * 批量归一算法,返回List + * @param sourceValues + * @return + */ + public List normalize(List sourceValues) { + return sourceValues.stream().map(s -> normalize(s)).collect(Collectors.toList()); + } + /** * 批量归一算法,带权重 * @param sourceValues @@ -110,6 +121,15 @@ public abstract class ScoreCalculator { return scores; } + /** + * 批量归一算法,返回List + * @param sourceValues + * @return + */ + public List normalize(List sourceValues, BigDecimal weight) { + return sourceValues.stream().map(s -> normalize(s).multiply(weight)).collect(Collectors.toList()); + } + /** * 校验数组 * @param sourceArray From f967d2377abef8424e8c913073aacbeb83fec9e7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 25 Aug 2020 10:59:35 +0800 Subject: [PATCH 022/226] =?UTF-8?q?130+1=20=E8=8E=B7=E5=8F=96=E5=B0=8F?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E9=A6=96=E9=A1=B5=E9=85=8D=E7=BD=AE=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../oper-customize-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/oper-customize/oper-customize-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml index b392052125..dc9635f91c 100644 --- a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml +++ b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-customize-server: container_name: oper-customize-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/oper-customize-server:0.3.43 + image: 192.168.1.130:10080/epmet-cloud-dev/oper-customize-server:0.3.44 ports: - "8089:8089" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-customize/oper-customize-server/pom.xml b/epmet-module/oper-customize/oper-customize-server/pom.xml index 4aa3e88d8f..c670b1e2a0 100644 --- a/epmet-module/oper-customize/oper-customize-server/pom.xml +++ b/epmet-module/oper-customize/oper-customize-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.43 + 0.3.44 com.epmet oper-customize From b69555351602d821ecdc3fe21f6b94fdc9e2157d Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 25 Aug 2020 13:47:35 +0800 Subject: [PATCH 023/226] =?UTF-8?q?gov-access=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gov-access/gov-access-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/gov-access/gov-access-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-access/gov-access-server/deploy/docker-compose-dev.yml b/epmet-module/gov-access/gov-access-server/deploy/docker-compose-dev.yml index 0f0fd6fe31..b3786689c6 100644 --- a/epmet-module/gov-access/gov-access-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-access/gov-access-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-access-server: container_name: gov-access-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-access-server:0.3.38 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-access-server:0.3.39 ports: - "8099:8099" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-access/gov-access-server/pom.xml b/epmet-module/gov-access/gov-access-server/pom.xml index f8d9426042..cd6eeba1c8 100644 --- a/epmet-module/gov-access/gov-access-server/pom.xml +++ b/epmet-module/gov-access/gov-access-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.38 + 0.3.39 gov-access com.epmet From a9d2bde5b9af40fc3da2084b30515f1965403b75 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 25 Aug 2020 14:03:32 +0800 Subject: [PATCH 024/226] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-auth/deploy/docker-compose-dev.yml | 2 +- epmet-auth/pom.xml | 2 +- .../oper-customize-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/oper-customize/oper-customize-server/pom.xml | 2 +- epmet-user/epmet-user-server/deploy/docker-compose-dev.yml | 2 +- epmet-user/epmet-user-server/pom.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/epmet-auth/deploy/docker-compose-dev.yml b/epmet-auth/deploy/docker-compose-dev.yml index c26333a04a..f533348156 100644 --- a/epmet-auth/deploy/docker-compose-dev.yml +++ b/epmet-auth/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-auth-server: container_name: epmet-auth-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.68 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.69 ports: - "8081:8081" network_mode: host # 使用现有网络 diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index dc628f27e9..5d6058dbf7 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.68 + 0.3.69 com.epmet epmet-cloud diff --git a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml index dc9635f91c..382b5a38b7 100644 --- a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml +++ b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-customize-server: container_name: oper-customize-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/oper-customize-server:0.3.44 + image: 192.168.1.130:10080/epmet-cloud-dev/oper-customize-server:0.3.45 ports: - "8089:8089" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-customize/oper-customize-server/pom.xml b/epmet-module/oper-customize/oper-customize-server/pom.xml index c670b1e2a0..0ff2561754 100644 --- a/epmet-module/oper-customize/oper-customize-server/pom.xml +++ b/epmet-module/oper-customize/oper-customize-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.44 + 0.3.45 com.epmet oper-customize diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml index 7f1bcc84c1..4f9f999ce0 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.121 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.122 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index 8c0cb5aac6..9ec0765626 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.121 + 0.3.122 com.epmet epmet-user From 9b4c9231a9d169f48ed5bf9779bb6c972a0fc545 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 25 Aug 2020 14:14:57 +0800 Subject: [PATCH 025/226] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=A0=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datareport/service/screen/impl/AgencyServiceImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java index 9ca543828c..cb7fd872a5 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java @@ -46,7 +46,11 @@ public class AgencyServiceImpl implements AgencyService { if (null == rootAgency){ return new TreeResultDTO(); } - List departmentList = this.getDepartmentList(("".equals(rootAgency.getPids()) ? "" : rootAgency.getPids() + ",") + rootAgency.getValue()); + String sub = null; + if ("".equals(rootAgency.getPids()) || rootAgency.getPids().equals("0")){ + sub = rootAgency.getValue(); + } + List departmentList = this.getDepartmentList(sub); rootAgency.setChildren(departmentList); return rootAgency; } From 0c818a99e0ece15edb1bf00453567744f0f76005 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 25 Aug 2020 14:17:14 +0800 Subject: [PATCH 026/226] =?UTF-8?q?data-report=E6=9C=8D=E5=8A=A1=E5=8D=87?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-report-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-report/data-report-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml index 25f7ef5741..5cee82ae1e 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-report-server: container_name: data-report-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.29 + image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.30 ports: - "8109:8109" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 24a09c3c5e..95ae747b2e 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - 0.3.29 + 0.3.30 data-report-server From 3cb5fde051752811537f332c3a4751217f548f2b Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 25 Aug 2020 14:27:02 +0800 Subject: [PATCH 027/226] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../oper-customize-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/oper-customize/oper-customize-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml index 382b5a38b7..615e3ac046 100644 --- a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml +++ b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-customize-server: container_name: oper-customize-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/oper-customize-server:0.3.45 + image: 192.168.1.130:10080/epmet-cloud-dev/oper-customize-server:0.3.46 ports: - "8089:8089" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-customize/oper-customize-server/pom.xml b/epmet-module/oper-customize/oper-customize-server/pom.xml index 0ff2561754..47db6b2ee9 100644 --- a/epmet-module/oper-customize/oper-customize-server/pom.xml +++ b/epmet-module/oper-customize/oper-customize-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.45 + 0.3.46 com.epmet oper-customize From 128dc3af007fd813aade723a0c64e6bd9797ce6b Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 25 Aug 2020 15:12:37 +0800 Subject: [PATCH 028/226] =?UTF-8?q?=E6=9A=82=E6=97=B6=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=8E=A5=E5=8F=A3=E9=89=B4=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/screen/AgencyController.java | 11 +++-------- .../controller/screen/DistributionController.java | 6 +++--- .../controller/screen/GrassRootsGovernController.java | 11 +++++------ .../screen/GrassrootsPartyDevController.java | 9 ++++----- .../datareport/controller/screen/IndexController.java | 9 ++++----- .../controller/screen/PartyMemberLeadController.java | 11 +++++------ .../controller/screen/ScreenProjectController.java | 3 +-- 7 files changed, 25 insertions(+), 35 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java index d671c4cd05..7d4fcfe070 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java @@ -1,23 +1,18 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; -import com.epmet.commons.tools.annotation.LoginUser; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.screen.AgencyService; import com.epmet.screen.dto.form.CompartmentFormDTO; import com.epmet.screen.dto.result.CompartmentResultDTO; import com.epmet.screen.dto.result.TreeResultDTO; -import com.epmet.datareport.service.screen.AgencyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import java.util.List; - /** * 组织相关api * @@ -37,7 +32,7 @@ public class AgencyController { * @author zxc * @date 2020/8/18 2:04 下午 */ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("tree") public Result tree(ExternalAppRequestParam externalAppRequestParam){ return new Result().ok(agencyService.tree(externalAppRequestParam)); @@ -49,7 +44,7 @@ public class AgencyController { * @author zxc * @date 2020/8/18 2:33 下午 */ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("compartment") public Result compartment(@RequestBody CompartmentFormDTO compartmentFormDTO){ ValidatorUtils.validateEntity(compartmentFormDTO, CompartmentFormDTO.Compartment.class); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java index b0b7c1f7a8..2f57f282f6 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java @@ -3,9 +3,9 @@ package com.epmet.datareport.controller.screen; import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.screen.DistributionService; import com.epmet.screen.dto.form.*; import com.epmet.screen.dto.result.*; -import com.epmet.datareport.service.screen.DistributionService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -33,7 +33,7 @@ public class DistributionController { * @author zxc * @date 2020/8/18 10:59 上午 */ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("branch") public Result> branch(@RequestBody BranchFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, BranchFormDTO.Branch.class); @@ -46,7 +46,7 @@ public class DistributionController { * @author zxc * @date 2020/8/18 11:10 上午 */ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("user") public Result user(@RequestBody UserFormDTO userFormDTO){ ValidatorUtils.validateEntity(userFormDTO, UserFormDTO.User.class); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java index 325c4606c8..3cad80832d 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java @@ -1,6 +1,5 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.screen.GrassRootsGovernService; @@ -39,7 +38,7 @@ public class GrassRootsGovernController { * @author wangc * @date 2020.08.20 11:16 **/ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("userpointrank") public Result userPointRank(@RequestBody AgencyAndNumFormDTO param){ ValidatorUtils.validateEntity(param,AgencyFormDTO.CommonAgencyIdGroup.class); @@ -54,7 +53,7 @@ public class GrassRootsGovernController { * @author wangc * @date 2020.08.20 13:55 **/ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("difficultprojects") public Result> difficultProject(@RequestBody AgencyNumTypeParamFormDTO param){ ValidatorUtils.validateEntity(param, AgencyNumTypeParamFormDTO.AgencyNumTypeParamGroup.class); @@ -69,7 +68,7 @@ public class GrassRootsGovernController { * @author wangc * @date 2020.08.20 14:37 **/ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("publicpartiprofile") public Result publicPartiProfile(@RequestBody AgencyFormDTO param){ ValidatorUtils.validateEntity(param, AgencyFormDTO.CommonAgencyIdGroup.class); @@ -84,7 +83,7 @@ public class GrassRootsGovernController { * @author wangc * @date 2020.08.20 15:32 **/ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("publicpartirank") public Result> publicPartiRank(@RequestBody AgencyAndNumFormDTO param){ ValidatorUtils.validateEntity(param,AgencyFormDTO.CommonAgencyIdGroup.class); @@ -99,7 +98,7 @@ public class GrassRootsGovernController { * @author wangc * @date 2020.08.20 17:46 **/ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("governcapacityrank") public Result> governCapacityRank(@RequestBody AgencyAndNumFormDTO param){ ValidatorUtils.validateEntity(param,AgencyFormDTO.CommonAgencyIdGroup.class); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java index 7c536869e9..34823bd3fd 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java @@ -1,6 +1,5 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.screen.GrassrootsPartyDevService; @@ -38,7 +37,7 @@ public class GrassrootsPartyDevController { * @author wangc * @date 2020.08.18 16:59 **/ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("basicinfo") public Result baseInfo(@RequestBody ParymemberFormDTO param){ ValidatorUtils.validateEntity(param, ParymemberFormDTO.Parymember.class); @@ -53,7 +52,7 @@ public class GrassrootsPartyDevController { * @author wangc * @date 2020.08.18 17:54 **/ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("ageinfo") public Result ageInfo(@RequestBody ParymemberFormDTO param){ ValidatorUtils.validateEntity(param, ParymemberFormDTO.Parymember.class); @@ -68,7 +67,7 @@ public class GrassrootsPartyDevController { * @author wangc * @date 2020.08.19 11:02 **/ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("branchbuildtrend") public Result branchBuildTrend(@RequestBody BranchBuildTrendFormDTO param){ ValidatorUtils.validateEntity(param, BranchBuildTrendFormDTO.branchBuildTrendGroup.class); @@ -83,7 +82,7 @@ public class GrassrootsPartyDevController { * @author wangc * @date 2020.08.19 15:25 **/ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("branchbuildrank") public Result branchBuildRank(@RequestBody BranchBuildRankFormDTO param){ ValidatorUtils.validateEntity(param, BranchBuildRankFormDTO.BranchBuildRankGroup.class); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java index 53b69591b4..401ee272a9 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java @@ -1,6 +1,5 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -40,7 +39,7 @@ public class IndexController { * @author zxc * @date 2020/8/19 2:53 下午 */ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("yearaverageindex") public Result yearAverageIndex(@RequestBody YearAverageIndexFormDTO yearAverageIndexFormDTO){ ValidatorUtils.validateEntity(yearAverageIndexFormDTO, YearAverageIndexFormDTO.YearAverageIndex.class); @@ -53,7 +52,7 @@ public class IndexController { * @author zxc * @date 2020/8/19 3:17 下午 */ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("monthindexanalysis/piechart") public Result monthPieChart(@RequestBody MonthPieChartFormDTO monthPieChartFormDTO){ ValidatorUtils.validateEntity(monthPieChartFormDTO, MonthPieChartFormDTO.MonthPieChart.class); @@ -66,7 +65,7 @@ public class IndexController { * @author zxc * @date 2020/8/19 5:27 下午 */ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("monthindexanalysis/barchart") public Result monthBarchart(@RequestBody MonthBarchartFormDTO monthBarchartFormDTO, ExternalAppRequestParam externalAppRequestParam){ ValidatorUtils.validateEntity(monthBarchartFormDTO, MonthBarchartFormDTO.MonthBarchart.class); @@ -79,7 +78,7 @@ public class IndexController { * @author zxc * @date 2020/8/20 10:02 上午 */ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("subagencyindexrank") public Result> subAgencyIndexRank(@RequestBody SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO){ ValidatorUtils.validateEntity(subAgencyIndexRankFormDTO, SubAgencyIndexRankFormDTO.SubAgencyIndexRank.class); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java index 5478956a32..0f3fe32130 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java @@ -1,6 +1,5 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.screen.PartyMemberLeadService; @@ -33,7 +32,7 @@ public class PartyMemberLeadController { * @author zxc * @date 2020/8/20 1:56 下午 */ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("fineexample") public Result fineExample(@RequestBody FineExampleFormDTO fineExampleFormDTO){ ValidatorUtils.validateEntity(fineExampleFormDTO, FineExampleFormDTO.FineExample.class); @@ -46,7 +45,7 @@ public class PartyMemberLeadController { * @author zxc * @date 2020/8/20 2:35 下午 */ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("contactmasslinechart") public Result contactMassLineChart(@RequestBody ContactMassLineChartFormDTO contactMassLineChartFormDTO){ ValidatorUtils.validateEntity(contactMassLineChartFormDTO, ContactMassLineChartFormDTO.ContactMassLineChart.class); @@ -59,7 +58,7 @@ public class PartyMemberLeadController { * @author zxc * @date 2020/8/20 3:19 下午 */ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("volunteerservice") public Result volunteerService(@RequestBody VolunteerServiceFormDTO volunteerServiceFormDTO){ ValidatorUtils.validateEntity(volunteerServiceFormDTO, VolunteerServiceFormDTO.VolunteerService.class); @@ -74,7 +73,7 @@ public class PartyMemberLeadController { * @author wangc * @date 2020.08.21 11:05 **/ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("advancedbranchrank") Result> advancedBranchRank(@RequestBody AgencyAndNumFormDTO param){ ValidatorUtils.validateEntity(param, AgencyFormDTO.CommonAgencyIdGroup.class); @@ -89,7 +88,7 @@ public class PartyMemberLeadController { * @author wangc * @date 2020.08.21 14:22 **/ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("advancedpartymemberrank") Result> advancedPartymemberRank(@RequestBody AgencyAndNumFormDTO param){ ValidatorUtils.validateEntity(param, AgencyFormDTO.CommonAgencyIdGroup.class); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java index 8c508e5eda..79d61f5f75 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java @@ -1,6 +1,5 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.screen.ScreenProjectService; @@ -31,7 +30,7 @@ public class ScreenProjectController { * @author zxc * @date 2020/8/19 4:36 下午 */ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("detail") public Result projectDetail(@RequestBody ProjectDetailFormDTO projectDetailFormDTO){ ValidatorUtils.validateEntity(projectDetailFormDTO, ProjectDetailFormDTO.ProjectDetail.class); From d4fbd410a8576dd73994aa6f49dfb448c9b3ff89 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 25 Aug 2020 15:13:46 +0800 Subject: [PATCH 029/226] =?UTF-8?q?=E5=8D=87=E7=BA=A7datareport?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-report-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-report/data-report-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml index 5cee82ae1e..afdebc0727 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-report-server: container_name: data-report-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.30 + image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.31 ports: - "8109:8109" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 95ae747b2e..fdfa7d573b 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - 0.3.30 + 0.3.31 data-report-server From b9b7968abfe6b15e79f857f15fa1f37164eecf13 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 25 Aug 2020 15:15:16 +0800 Subject: [PATCH 030/226] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-user/epmet-user-server/deploy/docker-compose-dev.yml | 2 +- epmet-user/epmet-user-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml index 4f9f999ce0..de583485e1 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.122 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.123 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index 9ec0765626..8c094c8805 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.122 + 0.3.123 com.epmet epmet-user From e6d3cd4d44df2edd72adc438fb0a64a88fd02083 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 25 Aug 2020 15:35:43 +0800 Subject: [PATCH 031/226] =?UTF-8?q?=E6=9A=82=E6=97=B6=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=8E=A5=E5=8F=A3=E9=89=B4=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/screen/DistributionController.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java index 2f57f282f6..935dd13830 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java @@ -1,6 +1,5 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.screen.DistributionService; @@ -59,7 +58,7 @@ public class DistributionController { * @author zxc * @date 2020/8/18 11:20 上午 */ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("parymember") public Result parymember(@RequestBody ParymemberFormDTO parymemberFormDTO){ ValidatorUtils.validateEntity(parymemberFormDTO, ParymemberFormDTO.Parymember.class); @@ -72,7 +71,7 @@ public class DistributionController { * @author zxc * @date 2020/8/19 1:29 下午 */ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("project") public Result> project(@RequestBody ProjectFormDTO projectFormDTO){ ValidatorUtils.validateEntity(projectFormDTO, ProjectFormDTO.Project.class); @@ -85,7 +84,7 @@ public class DistributionController { * @author zxc * @date 2020/8/19 1:52 下午 */ - @ExternalAppRequestAuth + //@ExternalAppRequestAuth @PostMapping("topprofile") public Result topProfile(@RequestBody TopProfileFormDTO topProfileFormDTO){ ValidatorUtils.validateEntity(topProfileFormDTO, TopProfileFormDTO.TopProfile.class); From 6cebb738938f8c5bf72ed2b1b823733dadb9d1e5 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 25 Aug 2020 15:36:27 +0800 Subject: [PATCH 032/226] =?UTF-8?q?=E5=8D=87=E7=BA=A7datareport?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-report-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-report/data-report-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml index afdebc0727..27b870a4e3 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-report-server: container_name: data-report-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.31 + image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.32 ports: - "8109:8109" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index fdfa7d573b..46bd5c480b 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - 0.3.31 + 0.3.32 data-report-server From c59b013f73b808c7cd123d84114ff8e48f9f3497 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Tue, 25 Aug 2020 15:49:15 +0800 Subject: [PATCH 033/226] =?UTF-8?q?18=E3=80=81=E5=85=AC=E4=BC=97=E5=8F=82?= =?UTF-8?q?=E4=B8=8E=E5=90=84=E7=B1=BB=E6=80=BB=E6=95=B0=20=20=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ScreenCollController.java | 12 ++-- .../screen/ScreenPublicPartiTotalDataDao.java | 28 ++++++++- .../service/screen/ScreenCollService.java | 2 +- .../screen/impl/ScreenCollServiceImpl.java | 30 +++++----- .../screen/ScreenPublicPartiTotalDataDao.xml | 60 ++++++++++++++++++- 5 files changed, 108 insertions(+), 24 deletions(-) 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/ScreenCollController.java index daeae95dba..60042f986b 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/ScreenCollController.java @@ -294,10 +294,10 @@ public class ScreenCollController { * @Author zhangyong * @Date 09:44 2020-08-25 **/ -// @ExternalAppRequestAuth -// @PostMapping("publicpartitotaldata") -// public Result publicPartiTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { -// screenCollService.insertPublicPartiTotalData(formDTO, externalAppRequestParam.getCustomerId()); -// return new Result(); -// } + @ExternalAppRequestAuth + @PostMapping("publicpartitotaldata") + public Result publicPartiTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertPublicPartiTotalData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPublicPartiTotalDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPublicPartiTotalDataDao.java index f703978057..a4fdc9f221 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPublicPartiTotalDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPublicPartiTotalDataDao.java @@ -18,10 +18,13 @@ package com.epmet.dao.screen; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.PublicPartiTotalDataFormDTO; import com.epmet.entity.screen.ScreenPublicPartiTotalDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 公众参与-各类(话题|议题|项目|注册人数|参与人数)总数 * @@ -31,4 +34,27 @@ import org.apache.ibatis.annotations.Param; @Mapper public interface ScreenPublicPartiTotalDataDao extends BaseDao { -} \ No newline at end of file + /** + * 18、公众参与各类总数 + * 公众参与-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数 + * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param orgIds 组织Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-25 + **/ + void deletePublicPartiTotalData(@Param("customerId") String customerId, + @Param("orgIds") String[] orgIds); + + /** + * 18、公众参与各类总数 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-25 + **/ + void batchInsertPublicPartiTotalData(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/ScreenCollService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/ScreenCollService.java index 33f4970deb..5ebb7d910b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/ScreenCollService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/ScreenCollService.java @@ -230,5 +230,5 @@ public interface ScreenCollService { * @Author zhangyong * @Date 09:44 2020-08-25 **/ -// void insertPublicPartiTotalData(List formDTO, String customerId); + void insertPublicPartiTotalData(List formDTO, String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java index bbac660e05..83162e601a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java @@ -80,6 +80,8 @@ public class ScreenCollServiceImpl implements ScreenCollService { private ScreenPioneerDataDao screenPioneerDataDao; @Autowired private ScreenIndexDataYearlyDao screenIndexDataYearlyDao; + @Autowired + private ScreenPublicPartiTotalDataDao screenPublicPartiTotalDataDao; @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) @Override @@ -446,18 +448,18 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } -// @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) -// @Override -// @Transactional(rollbackFor = Exception.class) -// public void insertPublicPartiTotalData(List formDTO, String customerId) { -// if (null != formDTO && formDTO.size() > NumConstant.ZERO){ -// String[] orgIds = new String[formDTO.size()]; -// for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ -// orgIds[i] = formDTO.get(i).getOrgId(); -// } -//// screenPioneerDataDao.deletePioneerData(customerId, orgIds); -// -//// screenPioneerDataDao.batchInsertPioneerData(formDTO, customerId); -// } -// } + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertPublicPartiTotalData(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] orgIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + orgIds[i] = formDTO.get(i).getOrgId(); + } + screenPublicPartiTotalDataDao.deletePublicPartiTotalData(customerId, orgIds); + + screenPublicPartiTotalDataDao.batchInsertPublicPartiTotalData(formDTO, customerId); + } + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml index 5fefac34e9..c3a9200142 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml @@ -1,7 +1,7 @@ - + @@ -24,5 +24,61 @@ + + delete from screen_public_parti_total_data + where CUSTOMER_ID = #{customerId} + AND ORG_ID IN + + #{item} + + - \ No newline at end of file + + insert into screen_public_parti_total_data + ( + ID, + CUSTOMER_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + DATA_END_TIME, + TOPIC_TOTAL, + ISSUE_TOTAL, + PROJECT_TOTAL, + REG_USER_TOTAL, + JOIN_USER_TOTAL, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.dataEndTime}, + #{item.topicTotal}, + #{item.issueTotal}, + #{item.projectTotal}, + #{item.regUserTotal}, + + #{item.joinUserTotal}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + + From 987928b8ef877cded2d611c55e3a3bb42b9f5262 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 25 Aug 2020 15:55:49 +0800 Subject: [PATCH 034/226] =?UTF-8?q?=E6=94=BE=E8=A1=8C=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-gateway/deploy/docker-compose-dev.yml | 2 +- epmet-gateway/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-gateway/deploy/docker-compose-dev.yml b/epmet-gateway/deploy/docker-compose-dev.yml index a07a2549c0..c091f72548 100644 --- a/epmet-gateway/deploy/docker-compose-dev.yml +++ b/epmet-gateway/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-gateway-server: container_name: epmet-gateway-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:0.3.33 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:0.3.34 ports: - "8080:8080" network_mode: host # 使用现有网络 diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index 6bb2a0889f..4f94446d0c 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.33 + 0.3.34 com.epmet epmet-cloud From 82533f8048e12f0b326059bfaadf116084123246 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 25 Aug 2020 16:13:47 +0800 Subject: [PATCH 035/226] =?UTF-8?q?data=20report=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=92=89=E9=92=89=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/commons/tools/enums/EnvEnum.java | 13 +++++++++++++ epmet-module/data-report/data-report-server/pom.xml | 12 ++++++++++++ .../main/java/com/epmet/DataReportApplication.java | 3 +++ .../screen/impl/GrassrootsPartyDevServiceImpl.java | 3 ++- .../src/main/resources/bootstrap.yml | 7 ++++++- .../src/main/resources/logback-spring.xml | 9 +++++++-- .../main/java/com/epmet/DataStatsApplication.java | 4 +++- 7 files changed, 46 insertions(+), 5 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java index ed265248e6..663731dc1b 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java @@ -1,5 +1,8 @@ package com.epmet.commons.tools.enums; +import com.epmet.commons.tools.utils.SpringContextUtils; +import org.springframework.core.env.Environment; + /** * 系统环境变量枚举类 * dev|test|prod @@ -34,6 +37,16 @@ public enum EnvEnum { return EnvEnum.UN_KNOWN; } + public static EnvEnum getCurrentEnv(){ + Environment environment = SpringContextUtils.getBean(Environment.class); + String[] activeProfiles = environment.getActiveProfiles(); + if (activeProfiles != null && activeProfiles.length > 0) { + return getEnum(activeProfiles[0]); + } + return EnvEnum.UN_KNOWN; + } + + public String getCode() { return code; } diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 46bd5c480b..ca8bdb7b84 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -140,6 +140,10 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 @@ -175,6 +179,10 @@ true + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 @@ -210,6 +218,10 @@ true + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java index cee0ed9096..989bf71965 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java @@ -1,5 +1,7 @@ package com.epmet; +import com.epmet.commons.tools.enums.EnvEnum; +import com.epmet.commons.tools.utils.HttpClientManager; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; @@ -13,5 +15,6 @@ import org.springframework.scheduling.annotation.EnableAsync; public class DataReportApplication { public static void main(String[] args) { SpringApplication.run(DataReportApplication.class, args); + HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() +" DataStatsApplication started!"); } } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java index 51a7a49ff6..b2d5b0deaf 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java @@ -6,12 +6,12 @@ import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.dao.screen.ScreenCpcBaseDataDao; import com.epmet.datareport.dao.screen.ScreenPartyBranchDataDao; import com.epmet.datareport.dao.screen.ScreenUserTotalDataDao; +import com.epmet.datareport.service.screen.GrassrootsPartyDevService; import com.epmet.datareport.utils.ModuleConstant; import com.epmet.screen.dto.form.BranchBuildRankFormDTO; import com.epmet.screen.dto.form.BranchBuildTrendFormDTO; import com.epmet.screen.dto.form.ParymemberFormDTO; import com.epmet.screen.dto.result.*; -import com.epmet.datareport.service.screen.GrassrootsPartyDevService; import com.github.pagehelper.PageHelper; import com.google.common.collect.Maps; import org.apache.commons.lang3.StringUtils; @@ -58,6 +58,7 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService PartymemberPercentResultDTO result = screenUserTotalDataDao.selectAgencyPartymemberPercent(param.getAgencyId()); if(null == result){ + result = new PartymemberPercentResultDTO(); logger.warn("com.epmet.datareport.service.screen.impl.GrassrootsPartyDevServiceImpl.partymemberBaseInfo:未查询出指定agencyId下的党员基础信息数据,agencyId :: {}",param.getAgencyId()); result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO)); return result; diff --git a/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml b/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml index d4db395aa8..44b522b30b 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml @@ -130,4 +130,9 @@ ribbon: #pageHelper分页插件 pagehelper: helper-dialect: mysql - reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml b/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml index 08a6a198d1..ea81aca726 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,14 @@ 15 - - + + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java index 21b5ea51b7..eee1f3bca7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java @@ -1,5 +1,7 @@ package com.epmet; +import com.epmet.commons.tools.enums.EnvEnum; +import com.epmet.commons.tools.utils.HttpClientManager; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; @@ -15,6 +17,6 @@ public class DataStatsApplication { public static void main(String[] args) { SpringApplication.run(DataStatsApplication.class ,args); - //HttpClientManager.getInstance().sendAlarmMsg("DataStatsApplication started!"); + HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() +" DataStatsApplication started!"); } } From 11c3732ea1e684f665250b8c2432b894b4cd5087 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 25 Aug 2020 16:23:14 +0800 Subject: [PATCH 036/226] =?UTF-8?q?data=20report=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=92=89=E9=92=89=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/commons/tools/enums/EnvEnum.java | 13 +++++++++++++ epmet-module/data-report/data-report-server/pom.xml | 12 ++++++++++++ .../main/java/com/epmet/DataReportApplication.java | 3 +++ .../screen/impl/GrassrootsPartyDevServiceImpl.java | 3 ++- .../src/main/resources/bootstrap.yml | 7 ++++++- .../src/main/resources/logback-spring.xml | 9 +++++++-- .../main/java/com/epmet/DataStatsApplication.java | 4 +++- 7 files changed, 46 insertions(+), 5 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java index ed265248e6..663731dc1b 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java @@ -1,5 +1,8 @@ package com.epmet.commons.tools.enums; +import com.epmet.commons.tools.utils.SpringContextUtils; +import org.springframework.core.env.Environment; + /** * 系统环境变量枚举类 * dev|test|prod @@ -34,6 +37,16 @@ public enum EnvEnum { return EnvEnum.UN_KNOWN; } + public static EnvEnum getCurrentEnv(){ + Environment environment = SpringContextUtils.getBean(Environment.class); + String[] activeProfiles = environment.getActiveProfiles(); + if (activeProfiles != null && activeProfiles.length > 0) { + return getEnum(activeProfiles[0]); + } + return EnvEnum.UN_KNOWN; + } + + public String getCode() { return code; } diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index e2239a5081..d2a269c202 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -140,6 +140,10 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 @@ -175,6 +179,10 @@ true + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 @@ -210,6 +218,10 @@ true + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java index cee0ed9096..989bf71965 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java @@ -1,5 +1,7 @@ package com.epmet; +import com.epmet.commons.tools.enums.EnvEnum; +import com.epmet.commons.tools.utils.HttpClientManager; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; @@ -13,5 +15,6 @@ import org.springframework.scheduling.annotation.EnableAsync; public class DataReportApplication { public static void main(String[] args) { SpringApplication.run(DataReportApplication.class, args); + HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() +" DataStatsApplication started!"); } } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java index 51a7a49ff6..b2d5b0deaf 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java @@ -6,12 +6,12 @@ import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.dao.screen.ScreenCpcBaseDataDao; import com.epmet.datareport.dao.screen.ScreenPartyBranchDataDao; import com.epmet.datareport.dao.screen.ScreenUserTotalDataDao; +import com.epmet.datareport.service.screen.GrassrootsPartyDevService; import com.epmet.datareport.utils.ModuleConstant; import com.epmet.screen.dto.form.BranchBuildRankFormDTO; import com.epmet.screen.dto.form.BranchBuildTrendFormDTO; import com.epmet.screen.dto.form.ParymemberFormDTO; import com.epmet.screen.dto.result.*; -import com.epmet.datareport.service.screen.GrassrootsPartyDevService; import com.github.pagehelper.PageHelper; import com.google.common.collect.Maps; import org.apache.commons.lang3.StringUtils; @@ -58,6 +58,7 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService PartymemberPercentResultDTO result = screenUserTotalDataDao.selectAgencyPartymemberPercent(param.getAgencyId()); if(null == result){ + result = new PartymemberPercentResultDTO(); logger.warn("com.epmet.datareport.service.screen.impl.GrassrootsPartyDevServiceImpl.partymemberBaseInfo:未查询出指定agencyId下的党员基础信息数据,agencyId :: {}",param.getAgencyId()); result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO)); return result; diff --git a/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml b/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml index d4db395aa8..44b522b30b 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml @@ -130,4 +130,9 @@ ribbon: #pageHelper分页插件 pagehelper: helper-dialect: mysql - reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml b/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml index 08a6a198d1..ea81aca726 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,14 @@ 15 - - + + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java index 21b5ea51b7..eee1f3bca7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java @@ -1,5 +1,7 @@ package com.epmet; +import com.epmet.commons.tools.enums.EnvEnum; +import com.epmet.commons.tools.utils.HttpClientManager; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; @@ -15,6 +17,6 @@ public class DataStatsApplication { public static void main(String[] args) { SpringApplication.run(DataStatsApplication.class ,args); - //HttpClientManager.getInstance().sendAlarmMsg("DataStatsApplication started!"); + HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() +" DataStatsApplication started!"); } } From 8e8c02954bc29edf77b92758a45263c8a7dd9470 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 25 Aug 2020 16:24:25 +0800 Subject: [PATCH 037/226] =?UTF-8?q?=E5=8D=87=E7=BA=A7datareport?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-report-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-report/data-report-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml index 27b870a4e3..629eae181a 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-report-server: container_name: data-report-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.32 + image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.33 ports: - "8109:8109" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index ca8bdb7b84..95bdfd4161 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - 0.3.32 + 0.3.33 data-report-server From 4fb3f981cf815ab67dcd4d7f0cc286edaf8239f1 Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 25 Aug 2020 18:13:33 +0800 Subject: [PATCH 038/226] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/screen/impl/GrassrootsPartyDevServiceImpl.java | 2 +- .../src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml | 3 +-- .../main/resources/mapper/screen/ScreenDifficultyDataDao.xml | 3 +-- .../main/resources/mapper/screen/ScreenGovernRankDataDao.xml | 1 - .../src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml | 1 - .../main/resources/mapper/screen/ScreenPartyBranchDataDao.xml | 2 +- .../src/main/resources/mapper/screen/ScreenUserJoinDao.xml | 4 ++-- .../main/resources/mapper/screen/ScreenUserTotalDataDao.xml | 4 +--- 8 files changed, 7 insertions(+), 13 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java index 51a7a49ff6..4b31a1e02a 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java @@ -42,7 +42,6 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService private ScreenCpcBaseDataDao screenCpcBaseDataDao; @Autowired private ScreenPartyBranchDataDao screenPartyBranchDataDao; - private List issueGroup; /** * @Description 1、党员基本情况-饼状图概况 @@ -59,6 +58,7 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService PartymemberPercentResultDTO result = screenUserTotalDataDao.selectAgencyPartymemberPercent(param.getAgencyId()); if(null == result){ logger.warn("com.epmet.datareport.service.screen.impl.GrassrootsPartyDevServiceImpl.partymemberBaseInfo:未查询出指定agencyId下的党员基础信息数据,agencyId :: {}",param.getAgencyId()); + result = new PartymemberPercentResultDTO(); result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO)); return result; } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml index 3fc9c990b3..ef851d6a08 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml @@ -15,8 +15,7 @@ screen_cpc_base_data WHERE DEL_FLAG = '0' - AND ORG_TYPE = 'agency' - AND ORG_ID = #{agencyId} + AND PARENT_ID = #{agencyId} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml index ab381cebba..e77b00012b 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml @@ -22,8 +22,7 @@ AND eve.DEL_FLAG = '0' WHERE diff.DEL_FLAG = '0' - AND diff.ORG_TYPE = 'agency' - AND diff.ORG_ID = #{agencyId} + AND diff.PARENT_ID = #{agencyId} ORDER BY CASE #{type} WHEN 'timelongest' THEN diff.EVENT_COST_TIME WHEN 'mosthandled' THEN diff.EVENT_HANDLED_COUNT diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml index 3fb4174055..af49e77592 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml @@ -15,7 +15,6 @@ screen_govern_rank_data WHERE DEL_FLAG = '0' - AND ORG_TYPE = 'agency' AND ORG_ID = #{agencyId} AND MONTH_ID = #{monthId} ORDER BY diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml index f83ec244d7..26007e2997 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml @@ -17,7 +17,6 @@ screen_org_rank_data WHERE DEL_FLAG = '0' - AND ORG_TYPE = 'grid' AND PARENT_ID = #{agencyId} AND MONTH_ID = #{monthId} ORDER BY diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml index 8fbf102170..165b383a81 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml @@ -49,7 +49,7 @@ screen_party_branch_data DEL_FLAG = '0' - AND ORG_TYPE = 'agency' + AND PARENT_ID = #{agencyId} AND TYPE = #{category} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml index 8f17dc796a..74a6e4e661 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml @@ -19,8 +19,8 @@ screen_user_join WHERE DEL_FLAG = '0' - AND ORG_TYPE = 'agency' - AND ORG_ID = #{agencyId} + + AND PARENT_ID = #{agencyId} AND MONTH_ID = #{monthId} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml index a1700b05a4..84e00a0f5d 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml @@ -12,8 +12,7 @@ screen_user_total_data WHERE DEL_FLAG = '0' - AND ORG_TYPE = 'agency' - AND ORG_ID = #{agencyId} + AND PARENT_ID = #{agencyId} @@ -59,7 +58,6 @@ screen_user_total_data WHERE DEL_FLAG = '0' - AND ORG_TYPE = 'agency' AND PARENT_ID = #{agencyId} ORDER BY (REG_USER_TOTAL + JOIN_USER_TOTAL + TOPIC_TOTAL + ISSUE_TOTAL + PROJECT_TOTAL) DESC, From f7045011b1c58a5a4d077d7cd3ab493fec771522 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 25 Aug 2020 18:20:55 +0800 Subject: [PATCH 039/226] =?UTF-8?q?130=E6=9C=8D=E5=8A=A1=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-gateway/deploy/docker-compose-dev.yml | 2 +- epmet-gateway/pom.xml | 2 +- .../data-report-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-report/data-report-server/pom.xml | 2 +- .../data-statistical-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-statistical/data-statistical-server/pom.xml | 2 +- .../oper-access-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/oper-access/oper-access-server/pom.xml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/epmet-gateway/deploy/docker-compose-dev.yml b/epmet-gateway/deploy/docker-compose-dev.yml index c091f72548..3329f89b6d 100644 --- a/epmet-gateway/deploy/docker-compose-dev.yml +++ b/epmet-gateway/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-gateway-server: container_name: epmet-gateway-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:0.3.34 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:0.3.35 ports: - "8080:8080" network_mode: host # 使用现有网络 diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index 4f94446d0c..621e7c38f1 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.34 + 0.3.35 com.epmet epmet-cloud diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml index 629eae181a..9dbdee6dca 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-report-server: container_name: data-report-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.33 + image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.34 ports: - "8109:8109" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 95bdfd4161..3ffa8051a8 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - 0.3.33 + 0.3.34 data-report-server diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml index c2022a855b..dd615ce5f1 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-statistical-server: container_name: data-statistical-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.46 + image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.47 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 84e4b1810d..aca19d6a19 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.46 + 0.3.47 data-statistical com.epmet diff --git a/epmet-module/oper-access/oper-access-server/deploy/docker-compose-dev.yml b/epmet-module/oper-access/oper-access-server/deploy/docker-compose-dev.yml index ea567d95a0..1c81fdec99 100644 --- a/epmet-module/oper-access/oper-access-server/deploy/docker-compose-dev.yml +++ b/epmet-module/oper-access/oper-access-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-access-server: container_name: oper-access-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/oper-access-server:0.3.17 + image: 192.168.1.130:10080/epmet-cloud-dev/oper-access-server:0.3.18 ports: - "8093:8093" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-access/oper-access-server/pom.xml b/epmet-module/oper-access/oper-access-server/pom.xml index 655da4f109..a1c28b8df8 100644 --- a/epmet-module/oper-access/oper-access-server/pom.xml +++ b/epmet-module/oper-access/oper-access-server/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - 0.3.17 + 0.3.18 oper-access com.epmet From 8754dc9352734daf7d0386fdbb585c7e18072734 Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 25 Aug 2020 21:43:26 +0800 Subject: [PATCH 040/226] =?UTF-8?q?=E5=BD=92=E4=B8=80=E5=8C=96=E7=AE=97?= =?UTF-8?q?=E6=B3=95=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=9F=BA=E4=BA=8E=E8=BE=B9?= =?UTF-8?q?=E7=95=8C=E5=80=BC=E7=9A=84=E9=83=A8=E5=88=86=E5=80=BC=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../normalizing/DoubleScoreCalculator.java | 25 ++++++- .../normalizing/IntegerScoreCalculator.java | 37 +++++++++-- .../support/normalizing/ScoreCalculator.java | 44 ++++++++++--- .../stats/test/normalizing/DemoScoreCal.java | 66 +++++++++++++++++++ 4 files changed, 155 insertions(+), 17 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/DemoScoreCal.java diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/DoubleScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/DoubleScoreCalculator.java index 01258d0f45..d919b2470f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/DoubleScoreCalculator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/DoubleScoreCalculator.java @@ -22,7 +22,7 @@ public class DoubleScoreCalculator extends ScoreCalculator { this.minScore = minScore; this.maxScore = maxScore; this.correlation = correlation; - this.prepare(); + this.prepare4SourceArray(); } public DoubleScoreCalculator(List sourceArray, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { @@ -30,7 +30,28 @@ public class DoubleScoreCalculator extends ScoreCalculator { this.minScore = minScore; this.maxScore = maxScore; this.correlation = correlation; - this.prepare(); + this.prepare4SourceArray(); + } + + /** + * 初始化基于边界值的整数分值计算 + * @param minSourceValue 左边界值 + * @param maxSourceValue 右边界值 + * @param minScore 分值区间的左边界 + * @param maxScore 分值区间的右边界 + * @param correlation 相关性 + */ + public DoubleScoreCalculator(Double minSourceValue, Double maxSourceValue, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { + BigDecimal minSourceValueBD = new BigDecimal(minSourceValue); + BigDecimal maxSourceValueBD = new BigDecimal(maxSourceValue); + + this.minScore = minScore; + this.maxScore = maxScore; + this.minValue = minSourceValueBD; + this.maxValue = maxSourceValueBD; + this.correlation = correlation; + prepare4BoundaryValue(); + System.out.println("最小值:"+minScore+";最大值:"+maxScore); } @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/IntegerScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/IntegerScoreCalculator.java index 98f837ab7e..2114eee59e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/IntegerScoreCalculator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/IntegerScoreCalculator.java @@ -10,9 +10,9 @@ import java.util.List; public class IntegerScoreCalculator extends ScoreCalculator { /** - * 初始化整数分值计算 + * 初始化基于原数组的整数分值计算 * ☆☆☆ 务必在该构造方法最后调用父类的prepare()方法 ☆☆☆ - * @param sourceArray 数据所在的数组 + * @param sourceArray 源数据完整数组 * @param minScore 分值区间的左边界 * @param maxScore 分值区间的右边界 * @param correlation 相关性 @@ -22,17 +22,44 @@ public class IntegerScoreCalculator extends ScoreCalculator { this.minScore = minScore; this.maxScore = maxScore; this.correlation = correlation; - this.prepare(); + prepare4SourceArray(); System.out.println("最小值:"+minScore+";最大值:"+maxScore); - } + /** + * 初始化基于原数组的整数分值计算 + * @param sourceList 源数据完整列表 + * @param minScore 分值区间的左边界 + * @param maxScore 分值区间的右边界 + * @param correlation 相关性 + */ public IntegerScoreCalculator(List sourceList, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { this.sourceArrary = sourceList.toArray(); this.minScore = minScore; this.maxScore = maxScore; this.correlation = correlation; - this.prepare(); + prepare4SourceArray(); + System.out.println("最小值:"+minScore+";最大值:"+maxScore); + } + + /** + * 初始化基于边界值的整数分值计算 + * @param minSourceValue 左边界值 + * @param maxSourceValue 右边界值 + * @param minScore 分值区间的左边界 + * @param maxScore 分值区间的右边界 + * @param correlation 相关性 + */ + public IntegerScoreCalculator(Integer minSourceValue, Integer maxSourceValue, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { + BigDecimal minSourceValueBD = new BigDecimal(minSourceValue); + BigDecimal maxSourceValueBD = new BigDecimal(maxSourceValue); + + this.minScore = minScore; + this.maxScore = maxScore; + this.minValue = minSourceValueBD; + this.maxValue = maxSourceValueBD; + this.correlation = correlation; + prepare4BoundaryValue(); System.out.println("最小值:"+minScore+";最大值:"+maxScore); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java index 48692e92ce..0acb52daae 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java @@ -1,5 +1,7 @@ package com.epmet.support.normalizing; +import lombok.Data; + import java.math.BigDecimal; import java.math.MathContext; import java.util.Arrays; @@ -11,23 +13,40 @@ import java.util.stream.Collectors; * ☆☆☆ 如果需要保持传入的数组元素顺序不变,请在实现类的构造方法中将传入数组进行克隆 ☆☆☆ * @param 数据类型泛型 */ +@Data public abstract class ScoreCalculator { + /** + * 源数据的数组 + */ protected T[] sourceArrary; + /** + * 最大最小分 + */ protected BigDecimal minScore; protected BigDecimal maxScore; + /** + * 相关性 + */ protected Correlation correlation; - private BigDecimal maxValue; - private BigDecimal minValue; + /** + * 系数 + */ private BigDecimal coefficient; /** - * 计算准备 + * 最大最小值 */ - protected void prepare() { + protected BigDecimal maxValue; + protected BigDecimal minValue; + + /** + * 计算准备(基于sourceArray方式的) + */ + public void prepare4SourceArray() { // 校验数组 if (!validSourceArray(sourceArrary)) { throw new RuntimeException("入参数组错误:请设置非空数组"); @@ -37,7 +56,14 @@ public abstract class ScoreCalculator { minValue = getMinFromSourceArray(); //计算系数 System.out.println("最小值:"+minScore+";最大值:"+maxScore); - coefficient = getCoefficient(minValue, maxValue); + coefficient = calcuteCoefficient(minValue, maxValue); + } + + /** + * 计算准备(基于边界值的) + */ + public void prepare4BoundaryValue() { + coefficient = calcuteCoefficient(minValue, maxValue); } /** @@ -50,10 +76,6 @@ public abstract class ScoreCalculator { throw new RuntimeException("入参数组错误:请设置sourceValue"); } - if (!Arrays.asList(sourceArrary).contains(sourceValue)) { - throw new RuntimeException("请确认要计算的数组在数组中存在"); - } - if (correlation == Correlation.POSITIVE) { // 正相关 BigDecimal x = coefficient.multiply(convertValue2BigDecimal(sourceValue).subtract(minValue)); @@ -95,6 +117,8 @@ public abstract class ScoreCalculator { return scores; } + //---------------------批量------------------------- + /** * 批量归一算法,返回List * @param sourceValues @@ -147,7 +171,7 @@ public abstract class ScoreCalculator { * 计算系数 * @return */ - protected BigDecimal getCoefficient(BigDecimal min, BigDecimal max) { + protected BigDecimal calcuteCoefficient(BigDecimal min, BigDecimal max) { BigDecimal fenmu = max.subtract(min); if (fenmu.toString().equals("0"))return new BigDecimal(0); BigDecimal fenzi = maxScore.subtract(minScore); 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 new file mode 100644 index 0000000000..14ebc4685c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/DemoScoreCal.java @@ -0,0 +1,66 @@ +package com.epmet.stats.test.normalizing; + +import com.epmet.support.normalizing.Correlation; +import com.epmet.support.normalizing.DoubleScoreCalculator; +import com.epmet.support.normalizing.IntegerScoreCalculator; +import com.epmet.support.normalizing.ScoreCalculator; + +import java.math.BigDecimal; +import java.util.Arrays; + +public class DemoScoreCal { + + public static void main(String[] args) { + //demoInteger(); + demoIntegerPartical(); + //demoDouble(); + } + + /** + * 整数类型,完整源数据列表的归一算法 + */ + public static void demoInteger() { + Integer[] iArray = {4,8,1,3,2}; + BigDecimal minScore = new BigDecimal(5); + BigDecimal maxScore = new BigDecimal(10); + + ScoreCalculator sc = new IntegerScoreCalculator(iArray, minScore, maxScore, Correlation.NEGATIVE); + BigDecimal[] scores = sc.normalize(iArray); + Arrays.stream(scores).forEach(s -> System.out.println(s)); + } + + /** + * 整数类型,基于边界值的部分列表的的归一算法 + */ + public static void demoIntegerPartical() { + Integer[] iArray = {4,1,2}; + BigDecimal minScore = new BigDecimal(5); + BigDecimal maxScore = new BigDecimal(10); + + ScoreCalculator sc = new IntegerScoreCalculator(1, 8 ,minScore, maxScore, Correlation.NEGATIVE); + BigDecimal[] scores = sc.normalize(iArray);// 此处也可以直接使用list参数的重载方法,计算阶段没有任何区别,区别在于new IntegerScoreCalculator()阶段 + Arrays.stream(scores).forEach(s -> System.out.println(s)); + } + + /** + * double类型归一算法 + */ + public static void demoDouble() { + Double[] iArray = {1.9,8.9,1.0,3.0,2.0}; + BigDecimal minScore = new BigDecimal(5); + BigDecimal maxScore = new BigDecimal(10); + + ScoreCalculator sc = new DoubleScoreCalculator(iArray, minScore, maxScore, Correlation.POSITIVE); + BigDecimal normalize = sc.normalize(3.0); + System.out.println(normalize); + + /** + * 同一组数据内,只有被计算值变了的话,不需要重新new对象,直接重复调用即可 + */ + BigDecimal normalize2 = sc.normalize(2.0); + System.out.println(normalize2); + } + + + +} From 5b9a9721b49251a7d8dc73148746d5f39a8c2561 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 26 Aug 2020 09:39:40 +0800 Subject: [PATCH 041/226] =?UTF-8?q?=E5=85=88=E9=94=8B=E6=A8=A1=E8=8C=83?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=99=BE=E5=88=86=E6=AF=94=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/screen/impl/PartyMemberLeadServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java index b1cecb92bb..79868496d1 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java @@ -77,7 +77,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { * @date 2020/8/20 6:06 下午 */ public String getRatio(Double d){ - BigDecimal bigDecimal = new BigDecimal(d * NumConstant.ONE_HUNDRED); + BigDecimal bigDecimal = new BigDecimal(d); return bigDecimal.setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).toPlainString().concat(ScreenConstant.RATIO); } From 9d50fecc328c8292641604934ca1d12dbb4a2907 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 26 Aug 2020 09:56:01 +0800 Subject: [PATCH 042/226] =?UTF-8?q?gov-access=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gov-access/gov-access-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/gov-access/gov-access-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-access/gov-access-server/deploy/docker-compose-dev.yml b/epmet-module/gov-access/gov-access-server/deploy/docker-compose-dev.yml index b3786689c6..6f7c7fe6d8 100644 --- a/epmet-module/gov-access/gov-access-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-access/gov-access-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-access-server: container_name: gov-access-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-access-server:0.3.39 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-access-server:0.3.40 ports: - "8099:8099" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-access/gov-access-server/pom.xml b/epmet-module/gov-access/gov-access-server/pom.xml index cd6eeba1c8..2475569eb2 100644 --- a/epmet-module/gov-access/gov-access-server/pom.xml +++ b/epmet-module/gov-access/gov-access-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.39 + 0.3.40 gov-access com.epmet From 2db816a362dbb6e7617f36b08964833f19232010 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 26 Aug 2020 09:57:11 +0800 Subject: [PATCH 043/226] =?UTF-8?q?data-report=E6=9C=8D=E5=8A=A1=E5=8D=87?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-report-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-report/data-report-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml index 9dbdee6dca..7aad4da80b 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-report-server: container_name: data-report-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.34 + image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.35 ports: - "8109:8109" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 3ffa8051a8..790f5e77b4 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - 0.3.34 + 0.3.35 data-report-server From 8241261ff6362a1295223b8bd567b8b81155a71b Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 26 Aug 2020 10:02:53 +0800 Subject: [PATCH 044/226] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=8F=82=E4=B8=8E=E5=BA=A6=E6=97=B6=EF=BC=8C=E5=8F=AA=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=9C=AC=E6=9C=BA=E5=85=B3=E7=9A=84=20agencyId=20=20?= =?UTF-8?q?=20=E4=B8=8D=E6=9F=A5parentId=EF=BC=8C=E5=9B=A0=E4=B8=BA?= =?UTF-8?q?=E6=AF=8F=E4=B8=80=E6=9D=A1=E6=95=B0=E6=8D=AE=E9=83=BD=E6=9C=89?= =?UTF-8?q?=E7=99=BE=E5=88=86=E6=AF=94=EF=BC=8C=E5=A6=82=E6=9E=9C=E7=94=A8?= =?UTF-8?q?parentId=E6=9F=A5=E8=AF=A2=E4=BC=9A=E6=9F=A5=E5=87=BA=E5=A4=9A?= =?UTF-8?q?=E6=9D=A1=EF=BC=8C=E6=B1=82=E5=92=8C=E5=90=8E=E7=99=BE=E5=88=86?= =?UTF-8?q?=E6=AF=94=E4=BC=9A=E5=A4=A7=E4=BA=8E1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/screen/ScreenUserJoinDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml index 74a6e4e661..856330ecf2 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml @@ -20,7 +20,7 @@ WHERE DEL_FLAG = '0' - AND PARENT_ID = #{agencyId} + AND AGENCY_ID = #{agencyId} AND MONTH_ID = #{monthId} From 0b18608e6dac5da4f5109f7b2b9c9cdbbe47954b Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 26 Aug 2020 10:13:25 +0800 Subject: [PATCH 045/226] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=A0=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datareport/service/screen/impl/AgencyServiceImpl.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java index cb7fd872a5..612239fc8d 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java @@ -46,11 +46,7 @@ public class AgencyServiceImpl implements AgencyService { if (null == rootAgency){ return new TreeResultDTO(); } - String sub = null; - if ("".equals(rootAgency.getPids()) || rootAgency.getPids().equals("0")){ - sub = rootAgency.getValue(); - } - List departmentList = this.getDepartmentList(sub); + List departmentList = this.getDepartmentList(("".equals(rootAgency.getPids()) || rootAgency.getPids().equals(NumConstant.ZERO_STR)) ? rootAgency.getValue():rootAgency.getPids().concat(",").concat(rootAgency.getValue())); rootAgency.setChildren(departmentList); return rootAgency; } From 3b8df373ecd789111df4057b0730cf8d660fb4c9 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 26 Aug 2020 10:15:29 +0800 Subject: [PATCH 046/226] =?UTF-8?q?=E5=85=AC=E5=BC=8F=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/enums/EnvEnum.java | 12 +++-- .../dto/screen/form/IndexCalculateForm.java | 5 +- .../controller/IndexCalculateController.java | 6 +-- .../FactIndexPartyAblityCpcMonthlyDao.java | 8 +-- .../service/screen/IndexCalculateService.java | 3 +- .../impl/IndexCalculateServiceImpl.java | 49 ++++++++++++++++++- .../src/main/resources/bootstrap.yml | 4 -- .../FactIndexPartyAblityCpcMonthlyDao.xml | 18 +++++++ .../EpmetCommonServiceOpenFeignClient.java | 7 +++ ...tCommonServiceOpenFeignClientFallback.java | 5 ++ .../controller/ExternalAppController.java | 12 +++++ .../java/com/epmet/dao/ExternalAppDao.java | 2 + .../com/epmet/service/ExternalAppService.java | 4 ++ .../service/impl/ExternalAppServiceImpl.java | 6 +++ .../main/resources/mapper/ExternalAppDao.xml | 4 ++ 15 files changed, 126 insertions(+), 19 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java index 663731dc1b..0c3f798318 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java @@ -38,10 +38,14 @@ public enum EnvEnum { } public static EnvEnum getCurrentEnv(){ - Environment environment = SpringContextUtils.getBean(Environment.class); - String[] activeProfiles = environment.getActiveProfiles(); - if (activeProfiles != null && activeProfiles.length > 0) { - return getEnum(activeProfiles[0]); + try { + Environment environment = SpringContextUtils.getBean(Environment.class); + String[] activeProfiles = environment.getActiveProfiles(); + if (activeProfiles != null && activeProfiles.length > 0) { + return getEnum(activeProfiles[0]); + } + } catch (Exception e) { + e.printStackTrace(); } return EnvEnum.UN_KNOWN; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/IndexCalculateForm.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/IndexCalculateForm.java index 49e30cdb21..af11109fa3 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/IndexCalculateForm.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/IndexCalculateForm.java @@ -3,6 +3,7 @@ package com.epmet.dto.screen.form; import lombok.Data; import java.io.Serializable; +import java.util.List; /** * desc:初始化客户指标权重参数实体类 @@ -12,9 +13,9 @@ import java.io.Serializable; public class IndexCalculateForm implements Serializable { private static final long serialVersionUID = 3280392511156378209L; /** - * desc:客户id + * desc:客户ids */ - private String customerId; + private List customerIds; /** * desc:月份id diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java index cba12740c5..6b9d8d45e1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java @@ -1,6 +1,5 @@ package com.epmet.controller; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.screen.form.IndexCalculateForm; @@ -25,7 +24,7 @@ public class IndexCalculateController { private IndexCalculateService indexCalculateService; /** - * 1、党建能力-党员相关指标计算(按照月份) + * 1、按照客户计算指标(按照月份) * * @param externalAppRequestParam * @param formDTO @@ -33,10 +32,9 @@ public class IndexCalculateController { * @Author zhangyong * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth @PostMapping("cpc") public Result cpcIndexCalculate(ExternalAppRequestParam externalAppRequestParam, @RequestBody IndexCalculateForm formDTO) { - indexCalculateService.cpcIndexCalculate(formDTO); + indexCalculateService.indexCalculate(formDTO); return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java index 387a369af1..5d786e5113 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java @@ -36,7 +36,7 @@ public interface FactIndexPartyAblityCpcMonthlyDao extends BaseDao list, - @Param("customerId")String customerId); + @Param("customerId") String customerId); + + List getCountByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateService.java index a43dcc2907..70c49c77fe 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateService.java @@ -12,6 +12,7 @@ public interface IndexCalculateService { /** * desc:计算党员相关指标 * @param formDTO + * @return */ - void cpcIndexCalculate(IndexCalculateForm formDTO); + Boolean indexCalculate(IndexCalculateForm formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java index 7aff662edf..4558c87927 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java @@ -1,16 +1,63 @@ package com.epmet.service.screen.impl; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.indexcoll.FactIndexPartyAblityCpcMonthlyDao; import com.epmet.dto.screen.form.IndexCalculateForm; +import com.epmet.entity.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.service.screen.IndexCalculateService; +import com.epmet.util.DimIdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.Date; +import java.util.List; /** * @author liujianjun */ +@Slf4j @Service public class IndexCalculateServiceImpl implements IndexCalculateService { + @Autowired + private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient; + @Autowired + private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; + @Override - public void cpcIndexCalculate(IndexCalculateForm formDTO) { + public Boolean indexCalculate(IndexCalculateForm formDTO) { + if (StringUtils.isBlank(formDTO.getMonthId())) { + //默认 当前月份-1 + formDTO.setMonthId(DimIdGenerator.getMonthDimId(DateUtils.addDateMonths(new Date(), -1))); + } + //按照客户分组 + if (CollectionUtils.isEmpty(formDTO.getCustomerIds())) { + Result> externalCustomerIdsResult = epmetCommonServiceOpenFeignClient.getExternalCustomerIds(); + if (!externalCustomerIdsResult.success()) { + log.error("cpcIndexCalculate epmetCommonServiceOpenFeignClient.getExternalCustomerIds return fail"); + return false; + } + formDTO.setCustomerIds(externalCustomerIdsResult.getData()); + } + formDTO.getCustomerIds().forEach(customerId -> { + //计算党员 + try { + List list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(customerId, formDTO.getMonthId()); + } catch (Exception e) { + + } + + //计算网格 + //TODO + + //计算社区 + //TODO + }); + return true; } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml index 7ece13bb19..709e17ab36 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml @@ -174,7 +174,3 @@ thread: queueCapacity: @thread.pool.queue-capacity@ keepAlive: @thread.pool.keep-alive@ -dingTalk: - robot: - webHook: @dingTalk.robot.webHook@ - secret: @dingTalk.robot.secret@ \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml index c64ce8f35e..92b5a882fa 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml @@ -94,4 +94,22 @@ + + diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java index d23de0c0e2..caa9bd6301 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java @@ -39,4 +39,11 @@ public interface EpmetCommonServiceOpenFeignClient { */ @PostMapping("/commonservice/externalapp/auth") Result externalAppAuth(@RequestBody ExternalAppAuthFormDTO formDTO); + + /** + * 获取外部应用客户Id + * @return + */ + @PostMapping("/commonservice/externalapp/getcustomerids") + Result> getExternalCustomerIds(); } diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java index 555e502062..f21808fc8c 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java @@ -29,4 +29,9 @@ public class EpmetCommonServiceOpenFeignClientFallback implements EpmetCommonSer public Result externalAppAuth(ExternalAppAuthFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "externalAppAuth", formDTO); } + + @Override + public Result> getExternalCustomerIds() { + return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "getExternalCustomerIds", null); + } } diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java index 976c4e4ef0..dfd846c5d0 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java @@ -19,6 +19,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + @RestController @RequestMapping("/externalapp") public class ExternalAppController { @@ -95,4 +97,14 @@ public class ExternalAppController { return new Result>().ok(page); } + /** + * 获取客户ids + * @return + */ + @PostMapping("/getcustomerids") + public Result> list() { + List customerIds = externalAppService.getCustomerIds(); + return new Result>().ok(customerIds); + } + } diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppDao.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppDao.java index 73f6bd3407..45dda5390a 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppDao.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppDao.java @@ -39,4 +39,6 @@ public interface ExternalAppDao extends BaseDao { ExternalAppResultDTO getByNameAndCustomerId(@Param("appName") String appName, @Param("customerId") String customerId); List list(@Param("customerId") String customerId); + + List getCustomerIds(); } \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppService.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppService.java index dff718695f..7b714d18db 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppService.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppService.java @@ -20,6 +20,8 @@ package com.epmet.service; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.result.ExternalAppResultDTO; +import java.util.List; + /** * 外部应用列表 * @@ -32,4 +34,6 @@ public interface ExternalAppService { ExternalAppResultDTO updateById(String appId, String appName, String customerId); PageData listPage(Integer pageNo, Integer pageSize, String customerId); + + List getCustomerIds(); } \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java index 5f92de268e..1968cd4f29 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java @@ -130,4 +130,10 @@ public class ExternalAppServiceImpl implements ExternalAppService { return new PageData<>(list, pageInfo.getTotal()); } + @Override + public List getCustomerIds() { + + return externalAppDao.getCustomerIds(); + } + } \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppDao.xml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppDao.xml index 588f735da7..62d5823a96 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppDao.xml +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppDao.xml @@ -60,5 +60,9 @@ AND DEL_FLAG = 0 + + \ No newline at end of file From f2e107010bbf22bf7a95df62646ddd3d50198092 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 26 Aug 2020 10:24:21 +0800 Subject: [PATCH 047/226] =?UTF-8?q?data-report=E6=9C=8D=E5=8A=A1=E5=8D=87?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-report-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-report/data-report-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml index 7aad4da80b..2d85c451a1 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-report-server: container_name: data-report-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.35 + image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.36 ports: - "8109:8109" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 790f5e77b4..06716fe378 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - 0.3.35 + 0.3.36 data-report-server From af61c7dccab4f6bf5c32b50012d45f7fc0f1a34f Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 26 Aug 2020 10:31:57 +0800 Subject: [PATCH 048/226] =?UTF-8?q?selectUserJoin=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/screen/ScreenUserJoinDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml index 856330ecf2..2fe2eb4337 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml @@ -20,7 +20,7 @@ WHERE DEL_FLAG = '0' - AND AGENCY_ID = #{agencyId} + AND ORG_ID = #{agencyId} AND MONTH_ID = #{monthId} From fa6aa48b937368bdcb2b5d6b02620ff05133689b Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 26 Aug 2020 10:32:25 +0800 Subject: [PATCH 049/226] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../oper-customize-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/oper-customize/oper-customize-server/pom.xml | 2 +- epmet-user/epmet-user-server/deploy/docker-compose-dev.yml | 2 +- epmet-user/epmet-user-server/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml index 615e3ac046..91e39f33c5 100644 --- a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml +++ b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-customize-server: container_name: oper-customize-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/oper-customize-server:0.3.46 + image: 192.168.1.130:10080/epmet-cloud-dev/oper-customize-server:0.3.47 ports: - "8089:8089" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-customize/oper-customize-server/pom.xml b/epmet-module/oper-customize/oper-customize-server/pom.xml index 47db6b2ee9..3cdbbd5b98 100644 --- a/epmet-module/oper-customize/oper-customize-server/pom.xml +++ b/epmet-module/oper-customize/oper-customize-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.46 + 0.3.47 com.epmet oper-customize diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml index de583485e1..e1af81c0ce 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.123 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.124 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index 8c094c8805..55992afad3 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.123 + 0.3.124 com.epmet epmet-user From f6f9bded04d8e563b4531100f792b22a54bee3f4 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 26 Aug 2020 12:51:11 +0800 Subject: [PATCH 050/226] =?UTF-8?q?=E6=9C=80=E5=A4=A7=E5=80=BC=E6=9C=80?= =?UTF-8?q?=E5=B0=8F=E5=80=BC=E9=80=9A=E7=94=A8dto,=E5=AE=A2=E6=88=B7id+mo?= =?UTF-8?q?nthId=E9=80=9A=E7=94=A8dto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/indexcal/CalculateCommonFormDTO.java | 29 +++++++++++++++++++ .../dto/indexcal/ExtremeValueCommonDTO.java | 26 +++++++++++++++++ .../indexcal/GridCorreLationService.java | 21 ++++++++++++++ .../impl/GridCorreLationServiceImpl.java | 27 +++++++++++++++++ .../impl/IndexCalculateServiceImpl.java | 7 ++++- 5 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueCommonDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/GridCorreLationService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java new file mode 100644 index 0000000000..1d56dd17b1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 指标计算通用入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/26 10:49 + */ +@Data +public class CalculateCommonFormDTO implements Serializable { + /** + * 月份id: yyyyMM + */ + private String monthId; + + /** + * 客户id + */ + private String customerId; + + public CalculateCommonFormDTO(String customerId, String monthId) { + this.monthId=monthId; + this.customerId=customerId; + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueCommonDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueCommonDTO.java new file mode 100644 index 0000000000..63dbb58262 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueCommonDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 最值通用DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/26 10:39 + */ +@Data +public class ExtremeValueCommonDTO implements Serializable { + + /** + * 最小值 + */ + private BigDecimal minValue; + + /** + * 最小值 + */ + private BigDecimal maxValue; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/GridCorreLationService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/GridCorreLationService.java new file mode 100644 index 0000000000..89001f5d4f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/GridCorreLationService.java @@ -0,0 +1,21 @@ +package com.epmet.service.indexcal; + +import com.epmet.dto.indexcal.CalculateCommonFormDTO; + +/** + * 网格相关指标计算 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/26 10:34 + */ +public interface GridCorreLationService { + + /** + * @return java.lang.Boolean + * @param formDTO + * @author yinzuomei + * @description 网格相关,分值计算 + * @Date 2020/8/26 10:51 + **/ + Boolean calculateGridCorreLation(CalculateCommonFormDTO formDTO); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java new file mode 100644 index 0000000000..70a6a9222b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java @@ -0,0 +1,27 @@ +package com.epmet.service.indexcal.impl; + +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.service.indexcal.GridCorreLationService; +import org.springframework.stereotype.Service; + +/** + * 网格相关service + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/26 10:35 + */ +@Service +public class GridCorreLationServiceImpl implements GridCorreLationService { + + /** + * @param formDTO + * @return java.lang.Boolean + * @author yinzuomei + * @description 网格相关,分值计算 + * @Date 2020/8/26 10:51 + **/ + @Override + public Boolean calculateGridCorreLation(CalculateCommonFormDTO formDTO) { + return null; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java index 4558c87927..54a368044b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java @@ -3,9 +3,11 @@ package com.epmet.service.screen.impl; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.indexcoll.FactIndexPartyAblityCpcMonthlyDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.screen.form.IndexCalculateForm; import com.epmet.entity.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import com.epmet.service.indexcal.GridCorreLationService; import com.epmet.service.screen.IndexCalculateService; import com.epmet.util.DimIdGenerator; import lombok.extern.slf4j.Slf4j; @@ -27,6 +29,8 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient; @Autowired private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; + @Autowired + private GridCorreLationService gridCorreLationService; @Override public Boolean indexCalculate(IndexCalculateForm formDTO) { @@ -44,6 +48,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { formDTO.setCustomerIds(externalCustomerIdsResult.getData()); } formDTO.getCustomerIds().forEach(customerId -> { + CalculateCommonFormDTO calculateCommonFormDTO=new CalculateCommonFormDTO(customerId, formDTO.getMonthId()); //计算党员 try { List list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(customerId, formDTO.getMonthId()); @@ -53,7 +58,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { //计算网格 //TODO - + gridCorreLationService.calculateGridCorreLation(calculateCommonFormDTO); //计算社区 //TODO From 8a8876eb7daa8fd7b6135572879d9e324d779bed Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 26 Aug 2020 12:55:00 +0800 Subject: [PATCH 051/226] =?UTF-8?q?=E6=8C=87=E6=A0=87=E5=88=86=E7=BB=84?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-statistical-server/pom.xml | 5 + .../epmet/entity/screen/IndexGroupEntity.java | 5 + .../screen/IndexGroupTemplateEntity.java | 5 + .../epmet/model/IndexExcelDataListener.java | 5 + .../java/com/epmet/util/Pinyin4jUtil.java | 170 ++++++++++++++++++ .../src/main/resources/bootstrap.yml | 4 + .../mapper/screen/IndexGroupTemplateDao.xml | 2 +- 7 files changed, 195 insertions(+), 1 deletion(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index aca19d6a19..61af3816fc 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -93,6 +93,11 @@ easyexcel 2.2.6 + + io.github.wnjustdoit + pinyin4j + 2.6.0 + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupEntity.java index 24df1ef18a..dcd8c63648 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupEntity.java @@ -45,6 +45,11 @@ public class IndexGroupEntity extends BaseEpmetEntity { */ private String indexId; + /** + * 指标code + */ + private String indexCode; + /** * 是否启用:启用:enable 禁用:disabled */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupTemplateEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupTemplateEntity.java index 3348ebdeda..6a6408f7a1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupTemplateEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupTemplateEntity.java @@ -40,6 +40,11 @@ public class IndexGroupTemplateEntity extends BaseEpmetEntity { */ private String indexId; + /** + * 指标code + */ + private String indexCode; + /** * 是否启用:启用:enable 禁用:disabled */ 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 76f0897890..931b9afd55 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 @@ -10,6 +10,7 @@ import com.epmet.entity.screen.IndexGroupTemplateEntity; import com.epmet.service.screen.IndexDictService; import com.epmet.service.screen.IndexGroupDetailTemplateService; import com.epmet.service.screen.IndexGroupTemplateService; +import com.epmet.util.Pinyin4jUtil; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -118,6 +119,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { group1.setIndexId(indexDictEntity.getId()); group1.setParentIndexGroupId("0"); group1.setId(level1GroupId); + group1.setIndexCode(Pinyin4jUtil.getFirstSpellPinYin(indexDictEntity.getIndexName(),true)); indexGroupMap.put(index.getLevel1Index(), group1); } @@ -132,6 +134,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { group2.setIndexId(indexDictEntity.getId()); group2.setParentIndexGroupId(level1GroupId); group2.setId(level2GroupId); + group2.setIndexCode(Pinyin4jUtil.getFirstSpellPinYin(indexDictEntity.getIndexName(),true)); indexGroupMap.put(level4Index, group2); //构建 分组明细 templateEntity = indexGroupDetailMap.get(level4Index); @@ -156,6 +159,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { group1.setIndexId(indexDictEntity.getId()); group1.setParentIndexGroupId("0"); group1.setId(level1GroupId); + group1.setIndexCode(Pinyin4jUtil.getFirstSpellPinYin(indexDictEntity.getIndexName(),true)); indexGroupMap.put(index.getLevel1Index(), group1); } @@ -170,6 +174,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { group2.setIndexId(indexDictEntity.getId()); group2.setParentIndexGroupId(level1GroupId); group2.setId(level2GroupId); + group2.setIndexCode(Pinyin4jUtil.getFirstSpellPinYin(indexDictEntity.getIndexName(),true)); indexGroupMap.put(level2Index, group2); //构建 分组明细 templateEntity = indexGroupDetailMap.get(level2Index); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java new file mode 100644 index 0000000000..5ea9d4b828 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java @@ -0,0 +1,170 @@ +package com.epmet.util; + +import net.sourceforge.pinyin4j.PinyinHelper; +import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; +import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; +import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; +import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType; +import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + + +/** + * @author liujianjun + */ +public class Pinyin4jUtil { + private static Map duoyinMap; + static { + duoyinMap = new HashMap<>(); + duoyinMap.put('区',new String[]{"qu"}); + duoyinMap.put('系',new String[]{"xi"}); + } + + /** + * getFirstSpellPinYin:(多音字的时候获取第一个).
+ * + * @param src 传入的拼音字符串,以逗号隔开 + * @param isFullSpell 是否全拼,true:全拼,false:第一个汉字全拼(其它汉字取首字母) + * @return 第一个拼音 + */ + public static String getFirstSpellPinYin(String src, boolean isFullSpell) { + String targetStr = Pinyin4jUtil.makeStringByStringSet(Pinyin4jUtil.getPinyin(src, isFullSpell)); + System.out.println(targetStr); + String[] split = targetStr.split(","); + if (split.length > 1) { + targetStr = split[0]; + } + return targetStr; + } + + /** + * makeStringByStringSet:(拼音字符串集合转换字符串(逗号分隔)).
+ * + * @param stringSet 拼音集合 + * @return 带逗号字符串 + */ + public static String makeStringByStringSet(Set stringSet) { + StringBuilder str = new StringBuilder(); + int i = 0; + if (stringSet.size() > 0) { + for (String s : stringSet) { + if (i == stringSet.size() - 1) { + str.append(s); + } else { + str.append(s + ","); + } + i++; + } + } + return str.toString().toLowerCase(); + } + + /** + * getPinyin:(获取汉字拼音).
+ * + * @param src 汉字 + * @param isFullSpell 是否全拼,如果为true:全拼,false:首字全拼 + * @return + */ + public static Set getPinyin(String src, boolean isFullSpell) { + if (src != null && !src.trim().equalsIgnoreCase("")) { + char[] srcChar; + srcChar = src.toCharArray(); + // 汉语拼音格式输出类 + HanyuPinyinOutputFormat hanYuPinOutputFormat = new HanyuPinyinOutputFormat(); + + // 输出设置,大小写,音标方式等 + hanYuPinOutputFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE); + hanYuPinOutputFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE); + hanYuPinOutputFormat.setVCharType(HanyuPinyinVCharType.WITH_V); + + String[][] temp = new String[src.length()][]; + for (int i = 0; i < srcChar.length; i++) { + char c = srcChar[i]; + if (String.valueOf(c).matches("[\\u4E00-\\u9FA5]+")) {//中文 + try { + String[] py = duoyinMap.get(c); + if (py != null){ + temp[i] = py; + }else{ + temp[i] = PinyinHelper.toHanyuPinyinStringArray(srcChar[i], hanYuPinOutputFormat); + } + + if (!isFullSpell) { + if (i == 0) { + temp[i] = temp[i]; + } else { + String[] tTemps = new String[temp[i].length]; + for (int j = 0; j < temp[i].length; j++) { + char t = temp[i][j].charAt(0); + tTemps[j] = Character.toString(t); + } + temp[i] = tTemps; + } + } + } catch (BadHanyuPinyinOutputFormatCombination e) { + e.printStackTrace(); + } + } else if (((int) c >= 65 && (int) c <= 90) + || ((int) c >= 97 && (int) c <= 122)) {//英文 + temp[i] = new String[]{String.valueOf(srcChar[i])}; + } else { + temp[i] = new String[]{""}; + } + } + String[] pingyinArray = exchange(temp); + Set pinyinSet = new HashSet(); + for (int i = 0; i < pingyinArray.length; i++) { + pinyinSet.add(pingyinArray[i]); + } + return pinyinSet; + } + return null; + } + + /** + * 递归 + * + * @param strJaggedArray + * @return + */ + public static String[] exchange(String[][] strJaggedArray) { + String[][] temp = doExchange(strJaggedArray); + return temp[0]; + } + + /** + * 递归 + * + * @param strJaggedArray + * @return + */ + private static String[][] doExchange(String[][] strJaggedArray) { + int len = strJaggedArray.length; + if (len >= 2) { + int len1 = strJaggedArray[0].length; + int len2 = strJaggedArray[1].length; + int newlen = len1 * len2; + String[] temp = new String[newlen]; + int Index = 0; + for (int i = 0; i < len1; i++) { + for (int j = 0; j < len2; j++) { + temp[Index] = strJaggedArray[0][i] + strJaggedArray[1][j]; + Index++; + } + } + String[][] newArray = new String[len - 1][]; + for (int i = 2; i < len; i++) { + newArray[i - 1] = strJaggedArray[i]; + } + newArray[0] = temp; + return doExchange(newArray); + } else { + return strJaggedArray; + } + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml index 709e17ab36..ce995b962e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml @@ -174,3 +174,7 @@ thread: queueCapacity: @thread.pool.queue-capacity@ keepAlive: @thread.pool.keep-alive@ +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupTemplateDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupTemplateDao.xml index 6adfa4474b..29ff0c7e17 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupTemplateDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupTemplateDao.xml @@ -7,7 +7,7 @@ \ No newline at end of file From 8a680c0cf6704a3fa44fc15e484c5a52798eb591 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 26 Aug 2020 13:36:10 +0800 Subject: [PATCH 052/226] =?UTF-8?q?=E6=9E=9A=E4=B8=BE=E7=B1=BBcode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/eum/IndexCodeEnum.java | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java new file mode 100644 index 0000000000..29766018d8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java @@ -0,0 +1,56 @@ +package com.epmet.eum; + +/** + * 需要计算指标code枚举类 + * + * @author jianjun liu + * @date 2020-08-26 11:14 + **/ +public enum IndexCodeEnum { + DANG_YUAN_XIANG_GUAN("dangyuanxiangguan", "党员相关", 1), + WANG_GE_XIANG_GUAN("wangggexiangguan", "网格相关", 1), + SHE_QU_XIANG_GUAN("shequxiangguan", "社区相关", 1), + JIE_DAO_XIANG_GUAN("jiedaoxiangguan", "街道相关", 1), + QU_ZHI_BU_MEN("quzhibumen", "区直部门", 1), + QUAN_QU_XIANG_GUAN("quanquxiangguan", "全区相关", 1), + + DANG_JIAN_NENG_LI("dangjiannengli", "党建能力", 2), + ZHI_LI_NENG_LI("zhilinengli", "治理能力", 2), + FU_WU_NENG_LI("fuwunengli", "服务能力", 2), + + CAN_YU_YI_SHI("canyuyishi", "参与议事", 4), + DANG_WU_HUO_DONG("dangwuhuodong", "党务活动", 4), + LIAN_XI_QUN_ZHONG("lianxiqunzhong", "联系群众", 4), + + ; + + private String code; + private String name; + private Integer level; + + + IndexCodeEnum(String code, String name, Integer level) { + this.code = code; + this.name = name; + this.level = level; + } + + public static IndexCodeEnum getEnum(String code) { + IndexCodeEnum[] values = IndexCodeEnum.values(); + for (IndexCodeEnum value : values) { + if (code != null && value.getCode().equals(code)) { + return value; + } + } + return null; + } + + + public String getCode() { + return code; + } + + public String getName() { + return name; + } +} From 60b2c2ed7ddc3cf10cd1d29e317b372e45fb4d41 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 26 Aug 2020 14:45:22 +0800 Subject: [PATCH 053/226] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=A0=91=20=E5=86=99?= =?UTF-8?q?=E6=AD=BBcustomerId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datareport/service/screen/impl/AgencyServiceImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java index 612239fc8d..0e1d557215 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java @@ -41,7 +41,13 @@ public class AgencyServiceImpl implements AgencyService { @Override public TreeResultDTO tree(ExternalAppRequestParam externalAppRequestParam) { // 1. 查询客户根组织ID - String customerId = externalAppRequestParam.getCustomerId(); +// String customerId = externalAppRequestParam.getCustomerId(); + + + // 验签关闭,customerId无法获取,暂时写死 + String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + + TreeResultDTO rootAgency = screenCustomerAgencyDao.selectRootAgencyId(customerId); if (null == rootAgency){ return new TreeResultDTO(); From 9cf5ada85baae40c26bcf5dbd62b7305c4548474 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 26 Aug 2020 15:15:50 +0800 Subject: [PATCH 054/226] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E5=BD=92?= =?UTF-8?q?=E4=B8=80=E5=8C=96=E7=AE=97=E6=B3=95=E6=89=B9=E9=87=8F=E8=AE=A1?= =?UTF-8?q?=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../support/normalizing/ScoreCalculator.java | 2 +- .../support/normalizing/ScoreConstants.java | 13 +++++ .../batch/BatchScoreCalculator.java | 35 +++++++++++++ .../normalizing/batch/IndexInputVO.java | 39 ++++++++++++++ .../normalizing/batch/IndexOutputVO.java | 23 +++++++++ .../stats/test/normalizing/DemoScoreCal.java | 51 +++++++++++++++---- 6 files changed, 151 insertions(+), 12 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexInputVO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexOutputVO.java diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java index 0acb52daae..df84c2196c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java @@ -79,7 +79,7 @@ public abstract class ScoreCalculator { if (correlation == Correlation.POSITIVE) { // 正相关 BigDecimal x = coefficient.multiply(convertValue2BigDecimal(sourceValue).subtract(minValue)); - BigDecimal score = minScore.add(x, MathContext.DECIMAL32); + BigDecimal score = minScore.add(x); return score; } else if (correlation == Correlation.NEGATIVE) { // 负相关 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java new file mode 100644 index 0000000000..1eecc8cf36 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java @@ -0,0 +1,13 @@ +package com.epmet.support.normalizing; + +import java.math.BigDecimal; + +/** + * 分值常量 + */ +public class ScoreConstants { + + public static final BigDecimal MIN_SCORE = new BigDecimal(0); + public static final BigDecimal MAX_SCORE = new BigDecimal(100); + +} 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 new file mode 100644 index 0000000000..85b8cf501d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java @@ -0,0 +1,35 @@ +package com.epmet.support.normalizing.batch; + +import com.epmet.support.normalizing.ScoreCalculator; + +import java.math.BigDecimal; +import java.util.List; +import java.util.stream.Collectors; + +public class BatchScoreCalculator { + + /** + * 每个指标都是一条数据,每一条数据中包含该指标的一组样本 + */ + private List indexVOS; + + /** + * 执行计算 + * @return 每一条都是一个指标的,所有样本对应的,得分值 + */ + public List exec(List indexVOS) { + this.indexVOS = indexVOS; + + return indexVOS.stream().map(i -> { + String indexId = i.getIndexId(); + List indexValues = i.getIndexValues(); + BigDecimal weight = i.getWeight(); + ScoreCalculator scoreCalculator = i.getScoreCalculator(); + + List scores4OneIndex = scoreCalculator.normalize(indexValues, weight); + + return new IndexOutputVO(indexId, scores4OneIndex); + }).collect(Collectors.toList()); + } + +} 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 new file mode 100644 index 0000000000..984388d07d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexInputVO.java @@ -0,0 +1,39 @@ +package com.epmet.support.normalizing.batch; + +import com.epmet.support.normalizing.ScoreCalculator; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; +import java.util.List; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class IndexInputVO { + + /** + * 指标标记,由使用者传入,用以标记该条指标的独有特性,一般用id或者code + * 非必填 + */ + private String indexId; + + /** + * 指标的样本值 + */ + private List indexValues; + + /** + * 权重 + */ + private BigDecimal weight; + + private ScoreCalculator scoreCalculator; + + public IndexInputVO(List indexValues, BigDecimal weight, ScoreCalculator scoreCalculator) { + this.indexValues = indexValues; + this.weight = weight; + this.scoreCalculator = scoreCalculator; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexOutputVO.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexOutputVO.java new file mode 100644 index 0000000000..ab85a8cabf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexOutputVO.java @@ -0,0 +1,23 @@ +package com.epmet.support.normalizing.batch; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +@Data +@AllArgsConstructor +public class IndexOutputVO { + + /** + * 指标标记,由使用者传入,用以标记该条指标的独有特性,一般用id或者code + * 非必填 + */ + private String indexId; + + /** + * 指标的样本值 + */ + private List indexScores; +} 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 14ebc4685c..178468b0a0 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 @@ -1,26 +1,29 @@ package com.epmet.stats.test.normalizing; -import com.epmet.support.normalizing.Correlation; -import com.epmet.support.normalizing.DoubleScoreCalculator; -import com.epmet.support.normalizing.IntegerScoreCalculator; -import com.epmet.support.normalizing.ScoreCalculator; +import com.epmet.support.normalizing.*; +import com.epmet.support.normalizing.batch.BatchScoreCalculator; +import com.epmet.support.normalizing.batch.IndexInputVO; +import com.epmet.support.normalizing.batch.IndexOutputVO; +import org.junit.Test; import java.math.BigDecimal; import java.util.Arrays; +import java.util.List; public class DemoScoreCal { public static void main(String[] args) { //demoInteger(); - demoIntegerPartical(); + //demoIntegerPartical(); //demoDouble(); } /** * 整数类型,完整源数据列表的归一算法 */ - public static void demoInteger() { - Integer[] iArray = {4,8,1,3,2}; + @Test + public void demoInteger() { + Integer[] iArray = {4, 8, 1, 3, 2}; BigDecimal minScore = new BigDecimal(5); BigDecimal maxScore = new BigDecimal(10); @@ -32,12 +35,13 @@ public class DemoScoreCal { /** * 整数类型,基于边界值的部分列表的的归一算法 */ - public static void demoIntegerPartical() { - Integer[] iArray = {4,1,2}; + @Test + public void demoIntegerPartical() { + Integer[] iArray = {4, 1, 8}; BigDecimal minScore = new BigDecimal(5); BigDecimal maxScore = new BigDecimal(10); - ScoreCalculator sc = new IntegerScoreCalculator(1, 8 ,minScore, maxScore, Correlation.NEGATIVE); + ScoreCalculator sc = new IntegerScoreCalculator(1, 8, minScore, maxScore, Correlation.NEGATIVE); BigDecimal[] scores = sc.normalize(iArray);// 此处也可以直接使用list参数的重载方法,计算阶段没有任何区别,区别在于new IntegerScoreCalculator()阶段 Arrays.stream(scores).forEach(s -> System.out.println(s)); } @@ -46,7 +50,7 @@ public class DemoScoreCal { * double类型归一算法 */ public static void demoDouble() { - Double[] iArray = {1.9,8.9,1.0,3.0,2.0}; + Double[] iArray = {1.9, 8.9, 1.0, 3.0, 2.0}; BigDecimal minScore = new BigDecimal(5); BigDecimal maxScore = new BigDecimal(10); @@ -61,6 +65,31 @@ public class DemoScoreCal { System.out.println(normalize2); } + /** + * 批量计算demo + */ + @Test + public void testBatchCalculate() throws InterruptedException { + //{4,8,1,3,2} + + // 每个指标需要单独的分支计算器,因为每个指标的最大最小值是不同的 + ScoreCalculator sc1 = new IntegerScoreCalculator(1, 8, ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.NEGATIVE); + ScoreCalculator sc2 = new IntegerScoreCalculator(1, 8, ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.NEGATIVE); + + // 每个指标的信息,包括样本列表,权重,指标标记 + IndexInputVO index1VO = new IndexInputVO<>("aaa", Arrays.asList(4, 1, 8), new BigDecimal(1), sc1); + IndexInputVO index2VO = new IndexInputVO<>("bbb", Arrays.asList(1, 8, 3), new BigDecimal(1), sc2); + + List indexInputVOS = Arrays.asList(index1VO, index2VO); + + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + List result = batchScoreCalculator.exec(indexInputVOS); + + System.err.println("--------------------------------"); + result.stream().forEach(r -> System.out.println(r)); + Thread.sleep(10); + System.err.println("--------------------------------"); + } } From 7acab40223d73184e6c9c9358d29ff48ac4c3382 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 26 Aug 2020 15:19:37 +0800 Subject: [PATCH 055/226] =?UTF-8?q?=E5=85=9A=E6=94=AF=E9=83=A8=E3=80=81?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6sql=E4=BF=AE=E6=94=B9=EF=BC=8C=E5=85=9A?= =?UTF-8?q?=E5=91=98=E5=88=86=E5=B8=83=E3=80=81=E7=94=A8=E6=88=B7=E5=88=86?= =?UTF-8?q?=E5=B8=83=E9=9A=90=E8=97=8F=E5=AD=97=E6=AE=B5areaMarks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/screen/dto/result/ParymemberResultDTO.java | 1 + .../src/main/java/com/epmet/screen/dto/result/UserResultDTO.java | 1 + .../src/main/resources/mapper/screen/ScreenCustomerGridDao.xml | 1 + .../src/main/resources/mapper/screen/ScreenEventDataDao.xml | 1 + 4 files changed, 4 insertions(+) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ParymemberResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ParymemberResultDTO.java index 18bc33df48..710ce303aa 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ParymemberResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ParymemberResultDTO.java @@ -29,6 +29,7 @@ public class ParymemberResultDTO implements Serializable { /** * 当前所选组织的坐标区域 */ + @JsonIgnore private String areaMarks = ""; /** diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserResultDTO.java index 179aa5bec2..cea3d4b7ad 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserResultDTO.java @@ -29,6 +29,7 @@ public class UserResultDTO implements Serializable { /** * 当前所选组织的坐标区域 */ + @JsonIgnore private String areaMarks = ""; /** diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml index 988e0b17cd..1e45902a79 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml @@ -29,6 +29,7 @@ WHERE del_flag = 0 AND parent_agency_id = #{agencyId} + AND all_parent_ids LIKE concat('%', #{agencyId}, '%') diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml index 63cadbbd5e..0b2e8698e2 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml @@ -32,5 +32,6 @@ WHERE del_flag = '0' AND event_id = #{projectId} + AND all_parent_ids LIKE concat('%', #{agencyId}, '%') \ No newline at end of file From afe39de165c889437c328b47ceaef511921efa1f Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Wed, 26 Aug 2020 15:29:25 +0800 Subject: [PATCH 056/226] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=87=87=E9=9B=86=20=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=85=A5?= =?UTF-8?q?=E5=8F=82=E5=A2=9E=E5=8A=A0=EF=BC=9AallParentIds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/screencoll/form/CustomerGridFormDTO.java | 5 +++++ .../epmet/dto/screencoll/form/DifficultyDataFormDTO.java | 6 +++++- .../com/epmet/dto/screencoll/form/EventDataFormDTO.java | 5 +++++ .../com/epmet/dto/screencoll/form/OrgRankDataFormDTO.java | 5 +++++ .../epmet/dto/screencoll/form/PartyUserRankDataFormDTO.java | 5 +++++ .../com/epmet/entity/screen/ScreenCustomerGridEntity.java | 4 ++++ .../com/epmet/entity/screen/ScreenDifficultyDataEntity.java | 4 ++++ .../java/com/epmet/entity/screen/ScreenEventDataEntity.java | 4 ++++ .../com/epmet/entity/screen/ScreenOrgRankDataEntity.java | 4 ++++ .../epmet/entity/screen/ScreenPartyUserRankDataEntity.java | 4 ++++ .../main/resources/mapper/screen/ScreenCustomerGridDao.xml | 6 ++++-- .../resources/mapper/screen/ScreenDifficultyDataDao.xml | 6 ++++-- .../src/main/resources/mapper/screen/ScreenEventDataDao.xml | 6 ++++-- .../main/resources/mapper/screen/ScreenOrgRankDataDao.xml | 6 ++++-- .../resources/mapper/screen/ScreenPartyUserRankDataDao.xml | 6 ++++-- 15 files changed, 65 insertions(+), 11 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridFormDTO.java index 38094a105a..75eb13a0fa 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridFormDTO.java @@ -48,4 +48,9 @@ public class CustomerGridFormDTO implements Serializable { * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) */ private String dataEndTime; + + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java index 7d136c4b27..e446e073a3 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java @@ -94,9 +94,13 @@ public class DifficultyDataFormDTO implements Serializable { */ private Integer eventHandledCount; - /** * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) */ private String dataEndTime; + + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataFormDTO.java index 21e8ee718e..6c2cbe43a5 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataFormDTO.java @@ -121,4 +121,9 @@ public class EventDataFormDTO implements Serializable { * 数据更新至: yyyy|yyyMM|yyyyMMdd 8.21增加字段 */ private String dataEndTime; + + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataFormDTO.java index 8b0a753839..5e962e47bb 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataFormDTO.java @@ -79,4 +79,9 @@ public class OrgRankDataFormDTO implements Serializable { * 满意率,最大值100,保留小数点后四位 */ private BigDecimal satisfactionRatio; + + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataFormDTO.java index 29b35aa147..5d9f5da32b 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataFormDTO.java @@ -73,4 +73,9 @@ public class PartyUserRankDataFormDTO implements Serializable { * 名 */ private String name; + + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerGridEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerGridEntity.java index 99b6c99553..62dddc6960 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerGridEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerGridEntity.java @@ -78,4 +78,8 @@ public class ScreenCustomerGridEntity extends BaseEpmetEntity { */ private String dataEndTime; + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenDifficultyDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenDifficultyDataEntity.java index 845bbb7db0..9a4d3af36b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenDifficultyDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenDifficultyDataEntity.java @@ -127,4 +127,8 @@ public class ScreenDifficultyDataEntity extends BaseEpmetEntity { */ private String dataEndTime; + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenEventDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenEventDataEntity.java index e666f852b0..0242ab8ce2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenEventDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenEventDataEntity.java @@ -144,4 +144,8 @@ public class ScreenEventDataEntity extends BaseEpmetEntity { */ private String dataEndTime; + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenOrgRankDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenOrgRankDataEntity.java index a732eda4b9..abbdbb7d20 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenOrgRankDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenOrgRankDataEntity.java @@ -109,4 +109,8 @@ public class ScreenOrgRankDataEntity extends BaseEpmetEntity { */ private BigDecimal satisfactionRatio; + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyUserRankDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyUserRankDataEntity.java index 702e184439..c542da7085 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyUserRankDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyUserRankDataEntity.java @@ -98,4 +98,8 @@ public class ScreenPartyUserRankDataEntity extends BaseEpmetEntity { */ private String dataEndTime; + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml index 5381e9ddd2..9a37bd23c0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml @@ -29,7 +29,8 @@ CREATED_TIME, UPDATED_BY, UPDATED_TIME, - DATA_END_TIME + DATA_END_TIME, + ALL_PARENT_IDS ) values ( @@ -47,7 +48,8 @@ now(), 'APP_USER', now(), - #{item.dataEndTime} + #{item.dataEndTime}, + #{item.allParentIds} ) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml index e26c43115c..fb9a087e42 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml @@ -35,7 +35,8 @@ UPDATED_BY, UPDATED_TIME, LATEST_OPERATE_DESC, - DATA_END_TIME + DATA_END_TIME, + ALL_PARENT_IDS ) values ( @@ -63,7 +64,8 @@ 'APP_USER', now(), #{item.latestOperateDesc}, - #{item.dataEndTime} + #{item.dataEndTime}, + #{item.allParentIds} ) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml index be95b118df..9c950e18e1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml @@ -38,7 +38,8 @@ EVENT_STATUS_CODE, EVENT_STATUS_DESC, LATEST_OPERATE_DESC, - DATA_END_TIME + DATA_END_TIME, + ALL_PARENT_IDS ) values ( @@ -69,7 +70,8 @@ #{item.eventStatusCode}, #{item.eventStatusDesc}, #{item.latestOperateDesc}, - #{item.dataEndTime} + #{item.dataEndTime}, + #{item.allParentIds} ) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml index 4ebe5e2c28..345deacd5d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml @@ -35,7 +35,8 @@ CREATED_BY, CREATED_TIME, UPDATED_BY, - UPDATED_TIME + UPDATED_TIME, + ALL_PARENT_IDS ) values ( @@ -59,7 +60,8 @@ 'APP_USER', now(), 'APP_USER', - now() + now(), + #{item.allParentIds} ) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml index 070e952878..cf93e38a5f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml @@ -29,7 +29,8 @@ CREATED_TIME, UPDATED_BY, UPDATED_TIME, - DATA_END_TIME + DATA_END_TIME, + ALL_PARENT_IDS ) values ( @@ -51,7 +52,8 @@ now(), 'APP_USER', now(), - #{item.dataEndTime} + #{item.dataEndTime}, + #{item.allParentIds} ) From 389f2401dab5315c0dc4c84dba9ad07f96662da1 Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 26 Aug 2020 15:29:30 +0800 Subject: [PATCH 057/226] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9->?= =?UTF-8?q?=20=E5=85=9A=E5=BB=BA=E5=BC=95=E9=A2=86=EF=BC=9A=204=E3=80=81?= =?UTF-8?q?=E5=85=88=E8=BF=9B=E6=8E=92=E8=A1=8C=E6=A6=9C=E5=8D=95-?= =?UTF-8?q?=E5=85=88=E8=BF=9B=E6=94=AF=E9=83=A8=E6=8E=92=E8=A1=8C=205?= =?UTF-8?q?=E3=80=81=E5=85=88=E8=BF=9B=E6=8E=92=E8=A1=8C=E6=A6=9C=E5=8D=95?= =?UTF-8?q?-=E5=85=88=E8=BF=9B=E5=85=9A=E5=91=98=E6=8E=92=E8=A1=8C=20?= =?UTF-8?q?=E5=9F=BA=E5=B1=82=E6=B2=BB=E7=90=86=EF=BC=9A=201=E3=80=81?= =?UTF-8?q?=E7=83=AD=E5=BF=83=E5=B8=82=E6=B0=91=E7=A7=AF=E5=88=86=E6=8E=92?= =?UTF-8?q?=E8=A1=8C=202=E3=80=81=E9=9A=BE=E7=82=B9=E8=B5=8C=E7=82=B9-?= =?UTF-8?q?=E8=80=97=E6=97=B6=E6=9C=80=E9=95=BF|=E6=B6=89=E5=8F=8A?= =?UTF-8?q?=E9=83=A8=E9=97=A8=E6=9C=80=E5=A4=9A|=E5=A4=84=E7=90=86?= =?UTF-8?q?=E6=AC=A1=E6=95=B0=20=E4=BD=BF=E7=94=A8ALL=5FPARENT=5FIDS?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E6=A8=A1=E7=B3=8A=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/screen/ScreenDifficultyDataDao.xml | 2 +- .../src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml | 2 +- .../resources/mapper/screen/ScreenPartyUserRankDataDao.xml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml index e77b00012b..77f6fb0108 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml @@ -22,7 +22,7 @@ AND eve.DEL_FLAG = '0' WHERE diff.DEL_FLAG = '0' - AND diff.PARENT_ID = #{agencyId} + AND diff.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%') ORDER BY CASE #{type} WHEN 'timelongest' THEN diff.EVENT_COST_TIME WHEN 'mosthandled' THEN diff.EVENT_HANDLED_COUNT diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml index 26007e2997..b15df8d588 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml @@ -17,7 +17,7 @@ screen_org_rank_data WHERE DEL_FLAG = '0' - AND PARENT_ID = #{agencyId} + AND all_parent_ids LIKE CONCAT('%',#{agencyId},'%') AND MONTH_ID = #{monthId} ORDER BY (PARTY_TOTAL + GROUP_TOTAL + ISSUE_TOTAL + PROJECT_TOTAL + CLOSE_PROJECT_RATIO + SATISFACTION_RATIO) DESC, diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml index 66fb4d6a80..a61e832fab 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml @@ -12,7 +12,7 @@ screen_party_user_rank_data WHERE del_flag = '0' - AND org_id = #{agencyId} + AND all_parent_ids LIKE CONCAT('%',#{agencyId},'%') ORDER BY point_total DESC, user_name @@ -30,7 +30,7 @@ screen_party_user_rank_data WHERE DEL_FLAG = '0' - AND ORG_ID = #{agencyId} + AND all_parent_ids LIKE CONCAT('%',#{agencyId},'%') AND PARTY_FLAG = '1' ORDER BY POINT_TOTAL DESC From e7866cd5f13ced39566c6d127baeadd6b97ffae7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 26 Aug 2020 15:39:57 +0800 Subject: [PATCH 058/226] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/indexcal/CalculateCommonFormDTO.java | 1 + .../dto/indexcal/CustomerGridInfoDTO.java | 28 +++++ .../dto/indexcal/ExtremeValueCommonDTO.java | 1 + .../dto/screen/ScreenCustomerGridDTO.java | 116 ++++++++++++++++++ .../dao/screen/ScreenCustomerGridDao.java | 19 +++ .../indexcal/GridCorreLationService.java | 1 + .../impl/GridCorreLationServiceImpl.java | 39 +++++- .../mapper/screen/ScreenCustomerGridDao.xml | 23 ++++ 8 files changed, 227 insertions(+), 1 deletion(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CustomerGridInfoDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java index 1d56dd17b1..4c43a57890 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java @@ -12,6 +12,7 @@ import java.io.Serializable; */ @Data public class CalculateCommonFormDTO implements Serializable { + private static final long serialVersionUID = -5689788391963427717L; /** * 月份id: yyyyMM */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CustomerGridInfoDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CustomerGridInfoDTO.java new file mode 100644 index 0000000000..16ede875bb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CustomerGridInfoDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.indexcal; + +import com.epmet.dto.ScreenCustomerGridDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 客户下所有网格 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/26 13:45 + */ +@Data +public class CustomerGridInfoDTO implements Serializable { + private static final long serialVersionUID = -3211409107659568304L; + + /** + * 网格总数 + */ + private Integer total; + + /** + * 网格列表 + */ + private List gridList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueCommonDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueCommonDTO.java index 63dbb58262..fd383a61dd 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueCommonDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueCommonDTO.java @@ -14,6 +14,7 @@ import java.math.BigDecimal; @Data public class ExtremeValueCommonDTO implements Serializable { + private static final long serialVersionUID = -6295067080250068024L; /** * 最小值 */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java new file mode 100644 index 0000000000..ee7863d40b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java @@ -0,0 +1,116 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 网格(党支部)信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-26 + */ +@Data +public class ScreenCustomerGridDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID 主键ID + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 网格id + */ + private String gridId; + + /** + * 组织名称 + */ + private String gridName; + + /** + * 网格所属组织id + */ + private String parentAgencyId; + + /** + * 坐标区域 + */ + private String areaMarks; + + /** + * 中心点位 + */ + private String centerMark; + + /** + * 党支部(=网格)的位置 + */ + private String partyMark; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java index c9fa856582..60f5a64ef4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.screen; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.ScreenCustomerGridDTO; import com.epmet.dto.screencoll.form.CustomerGridFormDTO; import com.epmet.entity.screen.ScreenCustomerGridEntity; import org.apache.ibatis.annotations.Mapper; @@ -55,4 +56,22 @@ public interface ScreenCustomerGridDao extends BaseDao * @Date 10:52 2020-08-18 **/ void batchInsertCustomerGrid(@Param("list") List list, @Param("customerId")String customerId); + + /** + * @return java.lang.Integer + * @param customerId + * @author yinzuomei + * @description 查询客户下网格总数 + * @Date 2020/8/26 15:33 + **/ + Integer selectCountByCustomerId(@Param("customerId") String customerId); + + /** + * @return java.util.List + * @param customerId + * @author yinzuomei + * @description 查询客户下网格信息 + * @Date 2020/8/26 15:33 + **/ + List selectListByCustomerId(@Param("customerId")String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/GridCorreLationService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/GridCorreLationService.java index 89001f5d4f..7b7905a535 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/GridCorreLationService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/GridCorreLationService.java @@ -1,5 +1,6 @@ package com.epmet.service.indexcal; +import com.epmet.commons.tools.utils.Result; import com.epmet.dto.indexcal.CalculateCommonFormDTO; /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java index 70a6a9222b..a192fafc6a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java @@ -1,7 +1,18 @@ package com.epmet.service.indexcal.impl; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.indexcoll.FactIndexGovrnAblityGridMonthlyDao; +import com.epmet.dao.indexcoll.FactIndexPartyAblityGridMonthlyDao; +import com.epmet.dao.indexcoll.FactIndexServiceAblityGridMonthlyDao; +import com.epmet.dao.screen.ScreenCustomerGridDao; +import com.epmet.dto.ScreenCustomerGridDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.indexcal.CustomerGridInfoDTO; import com.epmet.service.indexcal.GridCorreLationService; +import io.swagger.annotations.Authorization; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** @@ -12,6 +23,16 @@ import org.springframework.stereotype.Service; */ @Service public class GridCorreLationServiceImpl implements GridCorreLationService { + private Logger logger = LogManager.getLogger(GridCorreLationServiceImpl.class); + @Autowired + private FactIndexGovrnAblityGridMonthlyDao factIndexGovrnAblityGridMonthlyDao; + @Autowired + private FactIndexPartyAblityGridMonthlyDao factIndexPartyAblityGridMonthlyDao; + @Autowired + private FactIndexServiceAblityGridMonthlyDao factIndexServiceAblityGridMonthlyDao; + @Autowired + private ScreenCustomerGridDao screenCustomerGridDao; + /** * @param formDTO @@ -22,6 +43,22 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { **/ @Override public Boolean calculateGridCorreLation(CalculateCommonFormDTO formDTO) { - return null; + return true; + } + + + + /** + * @return com.epmet.dto.indexcal.CustomerGridInfoDTO + * @param customerId + * @author yinzuomei + * @description 查询客户下网格信息 + * @Date 2020/8/26 15:37 + **/ + public CustomerGridInfoDTO queryCustomerGridInfo(String customerId){ + CustomerGridInfoDTO customerGridInfoDTO=new CustomerGridInfoDTO(); + customerGridInfoDTO.setTotal(screenCustomerGridDao.selectCountByCustomerId(customerId)); + customerGridInfoDTO.setGridList(screenCustomerGridDao.selectListByCustomerId(customerId)); + return customerGridInfoDTO; } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml index 5381e9ddd2..80450ccb6f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml @@ -52,4 +52,27 @@ + + + + + From cd41458c40f882c5196fa37b624655a64f91c46f Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 26 Aug 2020 15:43:42 +0800 Subject: [PATCH 059/226] =?UTF-8?q?compose=E7=89=88=E6=9C=AC=E5=8D=87?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../oper-crm/oper-crm-server/deploy/docker-compose-prod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-prod.yml b/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-prod.yml index 9a7eb3e9b9..aeefe23068 100644 --- a/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-prod.yml +++ b/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-crm-server: container_name: oper-crm-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/oper-crm-server:0.3.66 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/oper-crm-server:0.3.70 ports: - "8090:8090" network_mode: host # 使用现有网络 From 3538826d9d63ee27cd540d785588976d7bce8d42 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 26 Aug 2020 16:13:01 +0800 Subject: [PATCH 060/226] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=A6=81=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E7=9A=84=E6=8C=87=E6=A0=87=E6=98=8E=E7=BB=86=E6=9D=83?= =?UTF-8?q?=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/screen/IndexGroupDetailDTO.java | 60 +++++++++++++++++++ .../screen/result/IndexGroupDetailResult.java | 28 +++++++++ .../com/epmet/dao/screen/IndexGroupDao.java | 4 ++ .../epmet/dao/screen/IndexGroupDetailDao.java | 6 +- .../entity/screen/IndexGroupDetailEntity.java | 10 ++++ .../IndexGroupDetailTemplateEntity.java | 5 ++ .../epmet/model/IndexExcelDataListener.java | 23 ++++--- .../screen/IndexGroupDetailService.java | 9 ++- .../impl/IndexCalculateServiceImpl.java | 6 ++ .../impl/IndexGroupDetailServiceImpl.java | 16 +++++ .../mapper/screen/IndexGroupDetailDao.xml | 5 ++ .../screen/IndexGroupDetailTemplateDao.xml | 2 +- 12 files changed, 162 insertions(+), 12 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/IndexGroupDetailDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/IndexGroupDetailResult.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/IndexGroupDetailDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/IndexGroupDetailDTO.java new file mode 100644 index 0000000000..efe372f027 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/IndexGroupDetailDTO.java @@ -0,0 +1,60 @@ +/** + * 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.dto.screen; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 客户指标详情 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +public class IndexGroupDetailDTO { + + private static final long serialVersionUID = 1L; + + /** + * index_group.id + */ + private String indexGroupId; + + /** + * 指标id + */ + private String indexId; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; + + /** + * 是否启用:启用:enable 禁用:disabled + */ + private String status; + + /** + * 阈值 如果是百分比 则为除以100以后的值 + */ + private BigDecimal threshold; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/IndexGroupDetailResult.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/IndexGroupDetailResult.java new file mode 100644 index 0000000000..0d6cea89c8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/IndexGroupDetailResult.java @@ -0,0 +1,28 @@ +package com.epmet.dto.screen.result; + +import com.epmet.dto.screen.IndexGroupDetailDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * desc:计算指标时 获取要计算的组的指标 + * + * @author liujianjun + */ +@Data +public class IndexGroupDetailResult implements Serializable { + private static final long serialVersionUID = 3937041236261115759L; + + /** + * 是否有下一组 + */ + private Boolean hasNextGroup; + + /** + * desc:指标详情列表 如果hasNextGroup是true则返回的是明细,否则返回的是上级的分组的指标明细 + * 例如:网格的三大能力上次已经返回完毕,下一次调用时返回的是网格相关的三大能力的 指标明细 + */ + private List indexGroupDetailList; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDao.java index 5458720940..c873ffdb0b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDao.java @@ -21,6 +21,8 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.screen.IndexGroupEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 客户指标分组 * @@ -31,4 +33,6 @@ import org.apache.ibatis.annotations.Mapper; public interface IndexGroupDao extends BaseDao { int inertGroupFromTable(String customerId); + + List getDetailByCode(String indexCode, Integer offset); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailDao.java index 1a7dd4a0a8..8c7a4e82fb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailDao.java @@ -20,6 +20,9 @@ package com.epmet.dao.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.screen.IndexGroupDetailEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 客户指标详情 @@ -29,5 +32,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IndexGroupDetailDao extends BaseDao { - + + List getDetailListByParentCode(@Param("customerId") String customerId, @Param("indexCode") String indexCode); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailEntity.java index c0088d5383..1336dd050f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailEntity.java @@ -62,4 +62,14 @@ public class IndexGroupDetailEntity extends BaseEpmetEntity { */ private String status; + /** + * 阈值 如果是百分比 则为除以100以后的值 + */ + private BigDecimal threshold; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailTemplateEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailTemplateEntity.java index 569cda48d9..20162b1198 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailTemplateEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailTemplateEntity.java @@ -62,4 +62,9 @@ public class IndexGroupDetailTemplateEntity extends BaseEpmetEntity { */ private BigDecimal threshold; + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + } 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 931b9afd55..d19fb1d628 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 @@ -3,6 +3,7 @@ package com.epmet.model; import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.event.AnalysisEventListener; import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.utils.UniqueIdGenerator; import com.epmet.entity.screen.IndexDictEntity; import com.epmet.entity.screen.IndexGroupDetailTemplateEntity; @@ -122,7 +123,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { group1.setIndexCode(Pinyin4jUtil.getFirstSpellPinYin(indexDictEntity.getIndexName(),true)); indexGroupMap.put(index.getLevel1Index(), group1); } - + StringBuilder allIndexCodeSb = new StringBuilder(group1.getIndexCode()); String level4Index = index.getLevel4Index(); indexDictEntity = indexDicMap.get(level4Index); String level2GroupId = UniqueIdGenerator.generate(); @@ -139,14 +140,16 @@ public class IndexExcelDataListener extends AnalysisEventListener { //构建 分组明细 templateEntity = indexGroupDetailMap.get(level4Index); if (templateEntity == null) { - buildIndexGroupDetail(indexDictEntity, index, group1.getId(), 2); + buildIndexGroupDetail(indexDictEntity, index, group1, allIndexCodeSb.toString(), 2); } } indexDictEntity = indexDicMap.get(index.getLevel5Index()); + allIndexCodeSb.append(StrConstant.COLON); + allIndexCodeSb.append(group2.getIndexCode()); templateEntity = indexGroupDetailMap.get(index.getLevel5Index()); if (templateEntity == null) { - buildIndexGroupDetail(indexDictEntity, index, group2.getId(), 5); + buildIndexGroupDetail(indexDictEntity, index, group2, allIndexCodeSb.toString(), 5); } } else { //todo 测试完去掉 @@ -162,7 +165,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { group1.setIndexCode(Pinyin4jUtil.getFirstSpellPinYin(indexDictEntity.getIndexName(),true)); indexGroupMap.put(index.getLevel1Index(), group1); } - + StringBuilder allIndexCodeSb = new StringBuilder(group1.getIndexCode()); String level2Index = index.getLevel2Index(); indexDictEntity = indexDicMap.get(level2Index); String level2GroupId = UniqueIdGenerator.generate(); @@ -179,14 +182,15 @@ public class IndexExcelDataListener extends AnalysisEventListener { //构建 分组明细 templateEntity = indexGroupDetailMap.get(level2Index); if (templateEntity == null) { - buildIndexGroupDetail(indexDictEntity, index, group1.getId(), 2); + buildIndexGroupDetail(indexDictEntity, index, group1, allIndexCodeSb.toString(), 2); } } indexDictEntity = indexDicMap.get(index.getLevel5Index()); - + allIndexCodeSb.append(StrConstant.COLON); + allIndexCodeSb.append(group2.getIndexCode()); templateEntity = indexGroupDetailMap.get(index.getLevel5Index()); if (templateEntity == null) { - buildIndexGroupDetail(indexDictEntity, index, group2.getId(), 5); + buildIndexGroupDetail(indexDictEntity, index, group2, allIndexCodeSb.toString(), 5); } } //} @@ -195,10 +199,11 @@ public class IndexExcelDataListener extends AnalysisEventListener { LOGGER.info("所有指标分组明细数据解析完成:{}", JSON.toJSONString(indexGroupDetailMap.values())); } - private void buildIndexGroupDetail(IndexDictEntity indexDictEntity, IndexModel index, String groupId, Integer level) { + private void buildIndexGroupDetail(IndexDictEntity indexDictEntity, IndexModel index, IndexGroupTemplateEntity parentGroup, String allIndexCode, Integer level) { IndexGroupDetailTemplateEntity templateEntity; templateEntity = new IndexGroupDetailTemplateEntity(); - templateEntity.setIndexGroupId(groupId); + templateEntity.setIndexGroupId(parentGroup.getId()); + templateEntity.setAllParentIndexCode(allIndexCode); templateEntity.setIndexId(indexDictEntity.getId()); if (level == 5) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailService.java index ea03e298a1..aa69cba8e7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailService.java @@ -20,6 +20,8 @@ package com.epmet.service.screen; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.screen.IndexGroupDetailEntity; +import java.util.List; + /** * 客户指标详情 * @@ -27,5 +29,10 @@ import com.epmet.entity.screen.IndexGroupDetailEntity; * @since v1.0.0 2020-08-19 */ public interface IndexGroupDetailService extends BaseService { - + /** + * desc:根据all_parent_index_code 获取指标明细 + * @param customerId + * @param indexCode + */ + List getDetailListByParentCode(String customerId,String... indexCode); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java index 54a368044b..d51cf3ea88 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java @@ -3,6 +3,8 @@ package com.epmet.service.screen.impl; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.indexcoll.FactIndexPartyAblityCpcMonthlyDao; +import com.epmet.dao.screen.IndexGroupDao; +import com.epmet.dao.screen.IndexGroupDetailDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.screen.form.IndexCalculateForm; import com.epmet.entity.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; @@ -31,6 +33,10 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; @Autowired private GridCorreLationService gridCorreLationService; + @Autowired + private IndexGroupDao indexGroupDao; + @Autowired + private IndexGroupDetailDao indexGroupDetailDao; @Override public Boolean indexCalculate(IndexCalculateForm formDTO) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailServiceImpl.java index db9fe1f411..6c22b360d6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailServiceImpl.java @@ -18,11 +18,15 @@ package com.epmet.service.screen.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.exception.RenException; import com.epmet.dao.screen.IndexGroupDetailDao; import com.epmet.entity.screen.IndexGroupDetailEntity; import com.epmet.service.screen.IndexGroupDetailService; import org.springframework.stereotype.Service; +import java.util.List; + /** * 客户指标详情 * @@ -33,4 +37,16 @@ import org.springframework.stereotype.Service; public class IndexGroupDetailServiceImpl extends BaseServiceImpl implements IndexGroupDetailService { + @Override + public List getDetailListByParentCode(String customerId,String... indexCode) { + if (indexCode == null || indexCode.length == 0){ + throw new RenException("参数错误"); + } + StringBuilder sb = new StringBuilder(); + for (String code:indexCode){ + sb.append(code).append(StrConstant.COLON); + } + sb = sb.deleteCharAt(sb.length()); + return baseDao.getDetailListByParentCode(customerId,sb.toString()); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml index b7854f3338..ac4ad73bd5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml @@ -3,4 +3,9 @@ + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailTemplateDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailTemplateDao.xml index c044654dd8..8ec562b386 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailTemplateDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailTemplateDao.xml @@ -7,7 +7,7 @@ delete from index_group_detail_template From 445fb28380aabe0f00416ed93147f06701649b71 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 26 Aug 2020 16:57:19 +0800 Subject: [PATCH 061/226] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=9A=84=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E5=88=86=E6=94=AF=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../batch/BatchScoreCalculator.java | 14 +++++++++----- .../normalizing/batch/IndexInputVO.java | 6 +++--- .../normalizing/batch/IndexOutputVO.java | 4 ++-- .../normalizing/batch/SampleScore.java | 19 +++++++++++++++++++ .../normalizing/batch/SampleValue.java | 17 +++++++++++++++++ .../stats/test/normalizing/DemoScoreCal.java | 16 ++++++++-------- 6 files changed, 58 insertions(+), 18 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/SampleScore.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/SampleValue.java 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 85b8cf501d..fb54b5960e 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 @@ -17,16 +17,20 @@ public class BatchScoreCalculator { * 执行计算 * @return 每一条都是一个指标的,所有样本对应的,得分值 */ - public List exec(List indexVOS) { - this.indexVOS = indexVOS; + public List exec(List indexInputVOS) { + this.indexVOS = indexInputVOS; - return indexVOS.stream().map(i -> { + return indexInputVOS.stream().map(i -> { String indexId = i.getIndexId(); - List indexValues = i.getIndexValues(); + List indexValueVOs = i.getIndexValueVOs(); BigDecimal weight = i.getWeight(); ScoreCalculator scoreCalculator = i.getScoreCalculator(); - List scores4OneIndex = scoreCalculator.normalize(indexValues, weight); + // 循环同一个指标内的多个样本值的SampleValue列表 + List scores4OneIndex = indexValueVOs.stream().map(vo -> { + BigDecimal score = scoreCalculator.normalize(vo.getSampleValue(), weight); + return new SampleScore(vo.getSampleId(), score); + }).collect(Collectors.toList()); return new IndexOutputVO(indexId, scores4OneIndex); }).collect(Collectors.toList()); 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 984388d07d..94ea1ef0ad 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 @@ -22,7 +22,7 @@ public class IndexInputVO { /** * 指标的样本值 */ - private List indexValues; + private List> indexValueVOs; /** * 权重 @@ -31,8 +31,8 @@ public class IndexInputVO { private ScoreCalculator scoreCalculator; - public IndexInputVO(List indexValues, BigDecimal weight, ScoreCalculator scoreCalculator) { - this.indexValues = indexValues; + public IndexInputVO(List> indexValueVOs, BigDecimal weight, ScoreCalculator scoreCalculator) { + this.indexValueVOs = indexValueVOs; this.weight = weight; this.scoreCalculator = scoreCalculator; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexOutputVO.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexOutputVO.java index ab85a8cabf..fdf0a3dea9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexOutputVO.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexOutputVO.java @@ -8,7 +8,7 @@ import java.util.List; @Data @AllArgsConstructor -public class IndexOutputVO { +public class IndexOutputVO { /** * 指标标记,由使用者传入,用以标记该条指标的独有特性,一般用id或者code @@ -19,5 +19,5 @@ public class IndexOutputVO { /** * 指标的样本值 */ - private List indexScores; + private List indexScoreVOs; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/SampleScore.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/SampleScore.java new file mode 100644 index 0000000000..bd677fc861 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/SampleScore.java @@ -0,0 +1,19 @@ +package com.epmet.support.normalizing.batch; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 样本得分对象 + */ +@Data +@AllArgsConstructor +public class SampleScore { + + private String sampleId; + + private BigDecimal sampleScore; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/SampleValue.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/SampleValue.java new file mode 100644 index 0000000000..0818cc8d97 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/SampleValue.java @@ -0,0 +1,17 @@ +package com.epmet.support.normalizing.batch; + +import lombok.AllArgsConstructor; +import lombok.Data; + +/** + * 样本值对象 + */ +@Data +@AllArgsConstructor +public class SampleValue { + + private String sampleId; + + private T sampleValue; + +} 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 178468b0a0..1bb7514d5a 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 @@ -4,6 +4,7 @@ import com.epmet.support.normalizing.*; import com.epmet.support.normalizing.batch.BatchScoreCalculator; import com.epmet.support.normalizing.batch.IndexInputVO; import com.epmet.support.normalizing.batch.IndexOutputVO; +import com.epmet.support.normalizing.batch.SampleValue; import org.junit.Test; import java.math.BigDecimal; @@ -24,10 +25,8 @@ public class DemoScoreCal { @Test public void demoInteger() { Integer[] iArray = {4, 8, 1, 3, 2}; - BigDecimal minScore = new BigDecimal(5); - BigDecimal maxScore = new BigDecimal(10); - ScoreCalculator sc = new IntegerScoreCalculator(iArray, minScore, maxScore, Correlation.NEGATIVE); + ScoreCalculator sc = new IntegerScoreCalculator(iArray, ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.NEGATIVE); BigDecimal[] scores = sc.normalize(iArray); Arrays.stream(scores).forEach(s -> System.out.println(s)); } @@ -38,10 +37,8 @@ public class DemoScoreCal { @Test public void demoIntegerPartical() { Integer[] iArray = {4, 1, 8}; - BigDecimal minScore = new BigDecimal(5); - BigDecimal maxScore = new BigDecimal(10); - ScoreCalculator sc = new IntegerScoreCalculator(1, 8, minScore, maxScore, Correlation.NEGATIVE); + ScoreCalculator sc = new IntegerScoreCalculator(1, 8, ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.NEGATIVE); BigDecimal[] scores = sc.normalize(iArray);// 此处也可以直接使用list参数的重载方法,计算阶段没有任何区别,区别在于new IntegerScoreCalculator()阶段 Arrays.stream(scores).forEach(s -> System.out.println(s)); } @@ -76,9 +73,12 @@ public class DemoScoreCal { ScoreCalculator sc1 = new IntegerScoreCalculator(1, 8, ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.NEGATIVE); ScoreCalculator sc2 = new IntegerScoreCalculator(1, 8, ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.NEGATIVE); + List> index1SampleValues = Arrays.asList(new SampleValue<>("id1", 4), new SampleValue<>("id2", 1), new SampleValue<>("id3", 8)); + List> index2SampleValues = Arrays.asList(new SampleValue<>("id1", 1), new SampleValue<>("id2", 8), new SampleValue<>("id3", 3)); + // 每个指标的信息,包括样本列表,权重,指标标记 - IndexInputVO index1VO = new IndexInputVO<>("aaa", Arrays.asList(4, 1, 8), new BigDecimal(1), sc1); - IndexInputVO index2VO = new IndexInputVO<>("bbb", Arrays.asList(1, 8, 3), new BigDecimal(1), sc2); + IndexInputVO index1VO = new IndexInputVO<>("aaa", index1SampleValues, new BigDecimal(1), sc1); + IndexInputVO index2VO = new IndexInputVO<>("bbb", index2SampleValues, new BigDecimal(1), sc2); List indexInputVOS = Arrays.asList(index1VO, index2VO); From c2fdea89767f1ae53093f697f852e19e4200ab07 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 26 Aug 2020 17:13:32 +0800 Subject: [PATCH 062/226] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../support/normalizing/batch/BatchScoreCalculator.java | 6 ------ 1 file changed, 6 deletions(-) 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 fb54b5960e..9ce5ec4913 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 @@ -8,17 +8,11 @@ import java.util.stream.Collectors; public class BatchScoreCalculator { - /** - * 每个指标都是一条数据,每一条数据中包含该指标的一组样本 - */ - private List indexVOS; - /** * 执行计算 * @return 每一条都是一个指标的,所有样本对应的,得分值 */ public List exec(List indexInputVOS) { - this.indexVOS = indexInputVOS; return indexInputVOS.stream().map(i -> { String indexId = i.getIndexId(); From 362a930c476588e09b09395d8172840f3bc87dc9 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 26 Aug 2020 18:09:37 +0800 Subject: [PATCH 063/226] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=A0=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/dto/result/TreeResultDTO.java | 14 ++++++ .../dao/screen/ScreenCustomerGridDao.java | 13 +++-- .../screen/impl/AgencyServiceImpl.java | 50 ++++++++++++++++--- .../mapper/screen/ScreenCustomerAgencyDao.xml | 8 ++- .../mapper/screen/ScreenCustomerGridDao.xml | 15 ++++++ 5 files changed, 88 insertions(+), 12 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/TreeResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/TreeResultDTO.java index b12a8f46f5..0f28cda5b2 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/TreeResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/TreeResultDTO.java @@ -29,6 +29,20 @@ public class TreeResultDTO implements Serializable { @JsonIgnore private String pids; + /** + * 中心点位 + */ + private List centerMark; + + /** + * 机关级别 + */ + @JsonIgnore + private String level; + + @JsonIgnore + private String centerMarkA; + /** * 子目录 */ diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerGridDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerGridDao.java index 4e57c2f71d..ec6a2e7ee1 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerGridDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerGridDao.java @@ -17,10 +17,7 @@ package com.epmet.datareport.dao.screen; -import com.epmet.screen.dto.result.AgencyDistributionResultDTO; -import com.epmet.screen.dto.result.BranchResultDTO; -import com.epmet.screen.dto.result.ParymemberDistributionResultDTO; -import com.epmet.screen.dto.result.UserDistributionResultDTO; +import com.epmet.screen.dto.result.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -66,5 +63,13 @@ public interface ScreenCustomerGridDao { * @date 2020/8/19 10:30 上午 */ List selectParymemberDistribution(@Param("parentId")String parentId); + + /** + * @Description 查询机关下的网格 + * @param agencyId + * @author zxc + * @date 2020/8/26 5:29 下午 + */ + List selectGridInfo(@Param("agencyId")String agencyId); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java index 0e1d557215..8ee16c42f6 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java @@ -15,6 +15,7 @@ import com.epmet.datareport.service.screen.AgencyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; /** @@ -52,11 +53,37 @@ public class AgencyServiceImpl implements AgencyService { if (null == rootAgency){ return new TreeResultDTO(); } - List departmentList = this.getDepartmentList(("".equals(rootAgency.getPids()) || rootAgency.getPids().equals(NumConstant.ZERO_STR)) ? rootAgency.getValue():rootAgency.getPids().concat(",").concat(rootAgency.getValue())); - rootAgency.setChildren(departmentList); + List centerMark = this.getCenterMark(rootAgency.getCenterMarkA()); + rootAgency.setCenterMark(centerMark.size() == NumConstant.ZERO ? new ArrayList<>() : centerMark); + if (rootAgency.getLevel().equals(ScreenConstant.COMMUNITY)){ + List treeResultDTOS = screenCustomerGridDao.selectGridInfo(rootAgency.getValue()); + rootAgency.setChildren(treeResultDTOS); + }else { + List departmentList = this.getDepartmentList(("".equals(rootAgency.getPids()) || rootAgency.getPids().equals(NumConstant.ZERO_STR)) ? rootAgency.getValue() : rootAgency.getPids().concat(",").concat(rootAgency.getValue())); + rootAgency.setChildren(departmentList); + } return rootAgency; } + /** + * @Description 处理centerMark + * @param centerMark + * @author zxc + * @date 2020/8/26 5:18 下午 + */ + public List getCenterMark(String centerMark){ + if (centerMark.length() == NumConstant.ZERO) { + return new ArrayList<>(); + } + List result = new ArrayList<>(); + String substring = centerMark.substring(2, centerMark.length() - 2); + String[] split = substring.split(","); + for (String s : split) { + result.add(Double.valueOf(s)); + } + return result; + } + /** * @Description 递归查询填充下级 * @param subAgencyPids @@ -66,10 +93,21 @@ public class AgencyServiceImpl implements AgencyService { private List getDepartmentList(String subAgencyPids) { List subAgencyList = screenCustomerAgencyDao.selectSubAgencyList(subAgencyPids); if (subAgencyList.size() > NumConstant.ZERO) { - for (TreeResultDTO sub : subAgencyList) { - List subAgency = getDepartmentList(sub.getPids() + "," + sub.getValue()); - sub.setChildren(subAgency); - } + subAgencyList.forEach(sub -> { + List centerMark = this.getCenterMark(sub.getCenterMarkA()); + sub.setCenterMark(centerMark.size() == NumConstant.ZERO ? new ArrayList<>() : centerMark); + if (sub.getLevel().equals(ScreenConstant.COMMUNITY)){ + List treeResultDTOS = screenCustomerGridDao.selectGridInfo(sub.getValue()); + treeResultDTOS.forEach(tree -> { + List centerMarkTree = this.getCenterMark(tree.getCenterMarkA()); + tree.setCenterMark(centerMarkTree.size() == NumConstant.ZERO ? new ArrayList<>() : centerMarkTree); + }); + sub.setChildren(treeResultDTOS); + }else { + List subAgency = getDepartmentList(sub.getPids() + "," + sub.getValue()); + sub.setChildren(subAgency); + } + }); } return subAgencyList; } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml index cfdb8da6de..f66aef3609 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml @@ -8,7 +8,9 @@ SELECT agency_name AS label, agency_id AS value, - pids AS pids + pids AS pids, + IFNULL(center_mark,'') AS centerMarkA, + level AS level FROM screen_customer_agency WHERE @@ -22,7 +24,9 @@ SELECT agency_id AS value, agency_name AS label, - pids AS pids + pids AS pids, + IFNULL(center_mark,'') AS centerMarkA, + level AS level FROM screen_customer_agency WHERE diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml index 1e45902a79..123fbbbc75 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml @@ -67,4 +67,19 @@ AND scg.del_flag = 0 AND sutd.parent_id = #{parentId} + + + \ No newline at end of file From 50c45048fc3a901bddbe41b8e8ed1f6fa9caa038 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 26 Aug 2020 18:11:53 +0800 Subject: [PATCH 064/226] =?UTF-8?q?detail=E6=B7=BB=E5=8A=A0code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/indexcal/ExtremeValueDTO.java | 43 +++++++++++++++++++ .../controller/IndexCalculateController.java | 13 +++++- .../FactIndexPartyAblityCpcMonthlyDao.java | 4 ++ .../epmet/dao/screen/IndexCodeFieldReDao.java | 9 ++++ .../entity/screen/IndexCodeFieldReEntity.java | 12 ++++++ .../entity/screen/IndexGroupDetailEntity.java | 5 +++ .../IndexGroupDetailTemplateEntity.java | 5 +++ .../epmet/model/IndexExcelDataListener.java | 2 + .../screen/CpcIndexCalculateService.java | 18 ++++++++ .../impl/CpcIndexCalculateServiceImpl.java | 34 +++++++++++++++ .../FactIndexPartyAblityCpcMonthlyDao.xml | 32 ++++++++++++-- .../mapper/screen/IndexCodeFieIdReDao.xml | 6 +++ 12 files changed, 179 insertions(+), 4 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexCodeFieldReDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexCodeFieldReEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/CpcIndexCalculateService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/CpcIndexCalculateServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexCodeFieIdReDao.xml diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueDTO.java new file mode 100644 index 0000000000..4dbabbf958 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueDTO.java @@ -0,0 +1,43 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 最值通用DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/26 10:39 + */ +@Data +public class ExtremeValueDTO implements Serializable { + + private static final long serialVersionUID = -2227402439857459667L; + + /** + * 最小值 + */ + private BigDecimal minValue1; + private BigDecimal minValue2; + private BigDecimal minValue3; + private BigDecimal minValue4; + private BigDecimal minValue5; + private BigDecimal minValue6; + private BigDecimal minValue7; + private BigDecimal minValue8; + private BigDecimal minValue9; + private BigDecimal minValue10; + + private BigDecimal maxValue1; + private BigDecimal maxValue2; + private BigDecimal maxValue3; + private BigDecimal maxValue4; + private BigDecimal maxValue5; + private BigDecimal maxValue6; + private BigDecimal maxValue7; + private BigDecimal maxValue8; + private BigDecimal maxValue9; + private BigDecimal maxValue10; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java index 6b9d8d45e1..4117f6dc75 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java @@ -2,7 +2,9 @@ package com.epmet.controller; import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.screen.form.IndexCalculateForm; +import com.epmet.service.screen.CpcIndexCalculateService; import com.epmet.service.screen.IndexCalculateService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -21,7 +23,10 @@ import org.springframework.web.bind.annotation.RestController; public class IndexCalculateController { @Autowired - private IndexCalculateService indexCalculateService; + private IndexCalculateService indexCalculateService; + + @Autowired + private CpcIndexCalculateService cpcIndexCalculateService; /** * 1、按照客户计算指标(按照月份) @@ -37,6 +42,12 @@ public class IndexCalculateController { indexCalculateService.indexCalculate(formDTO); return new Result(); } + @PostMapping("getMax") + public Result getMax(){ + CalculateCommonFormDTO calculateCommonFormDTO = new CalculateCommonFormDTO("c1","202008"); + cpcIndexCalculateService.cpcIndexCalculate(calculateCommonFormDTO); + return new Result(); + } /* *//** * 2、党建能力-网格相关指标上报(按照月份) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java index 5d786e5113..7208c093aa 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java @@ -23,7 +23,9 @@ import com.epmet.entity.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.math.BigDecimal; import java.util.List; +import java.util.Map; /** * 党建能力-党员相关的事实表 @@ -69,4 +71,6 @@ public interface FactIndexPartyAblityCpcMonthlyDao extends BaseDao getCountByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); + + Map getExtremeValue(@Param("customerId") String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexCodeFieldReDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexCodeFieldReDao.java new file mode 100644 index 0000000000..edd402249f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexCodeFieldReDao.java @@ -0,0 +1,9 @@ +package com.epmet.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.screen.IndexCodeFieldReEntity; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface IndexCodeFieldReDao extends BaseDao { +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexCodeFieldReEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexCodeFieldReEntity.java new file mode 100644 index 0000000000..1e563a118b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexCodeFieldReEntity.java @@ -0,0 +1,12 @@ +package com.epmet.entity.screen; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("index_code_field_re") +public class IndexCodeFieldReEntity extends BaseEpmetEntity { +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailEntity.java index 1336dd050f..a789ae51e7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailEntity.java @@ -52,6 +52,11 @@ public class IndexGroupDetailEntity extends BaseEpmetEntity { */ private String indexId; + /** + * 指标code + */ + private String indexCode; + /** * 权重(同一组权重总和=1) */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailTemplateEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailTemplateEntity.java index 20162b1198..d847f654c6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailTemplateEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailTemplateEntity.java @@ -47,6 +47,11 @@ public class IndexGroupDetailTemplateEntity extends BaseEpmetEntity { */ private String indexId; + /** + * 指标code + */ + private String indexCode; + /** * 权重(同一组权重总和=1) */ 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 d19fb1d628..6e747b0766 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 @@ -207,10 +207,12 @@ public class IndexExcelDataListener extends AnalysisEventListener { templateEntity.setIndexId(indexDictEntity.getId()); if (level == 5) { + templateEntity.setIndexCode(Pinyin4jUtil.getFirstSpellPinYin(index.getLevel5Index(),true)); String level5WeightStr = index.getLevel5Weight().replace("%", ""); templateEntity.setWeight(new BigDecimal(level5WeightStr).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP)); indexGroupDetailMap.put(index.getLevel5Index(), templateEntity); } else { + templateEntity.setIndexCode(Pinyin4jUtil.getFirstSpellPinYin(indexDictEntity.getIndexName(),true)); indexGroupDetailMap.put(indexDictEntity.getIndexName(), templateEntity); templateEntity.setWeight(new BigDecimal(index.getWeight()).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP)); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/CpcIndexCalculateService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/CpcIndexCalculateService.java new file mode 100644 index 0000000000..bb4bc6e397 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/CpcIndexCalculateService.java @@ -0,0 +1,18 @@ +package com.epmet.service.screen; + +import com.epmet.dto.indexcal.CalculateCommonFormDTO; + +/** + * 党员指标计算service + * + * @author liujianjun@elink-cn.com + * @date 2020/8/18 10:25 + */ +public interface CpcIndexCalculateService { + /** + * desc:计算党员相关指标 + * @param formDTO + * @return + */ + Boolean cpcIndexCalculate(CalculateCommonFormDTO formDTO); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/CpcIndexCalculateServiceImpl.java new file mode 100644 index 0000000000..63a0105f28 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/CpcIndexCalculateServiceImpl.java @@ -0,0 +1,34 @@ +package com.epmet.service.screen.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.dao.indexcoll.FactIndexPartyAblityCpcMonthlyDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.entity.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; +import com.epmet.service.screen.CpcIndexCalculateService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; + +@Slf4j +@Service +public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { + @Autowired + private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; + @Override + public Boolean cpcIndexCalculate(CalculateCommonFormDTO formDTO) { + //计算最大最小值 + Map minAndMaxList = factIndexPartyAblityCpcMonthlyDao.getExtremeValue(formDTO.getCustomerId()); + if (CollectionUtils.isEmpty(minAndMaxList)){ + log.warn("customerId:{} have not any record",formDTO.getCustomerId()); + return false; + } + log.info(JSON.toJSONString(minAndMaxList)); + List list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId()); + return null; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml index 92b5a882fa..115e0ae4e3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml @@ -13,7 +13,7 @@ - + @@ -48,7 +48,7 @@ QUARTER_ID, YEAR_ID, CREATE_TOPIC_COUNT, - JOIN__TOPIC_COUNT, + JOIN_TOPIC_COUNT, SHIFT_ISSUE_COUNT, SHIFT_PROJECT_COUNT, JOIN_THREE_MEETS_COUNT, @@ -97,7 +97,7 @@ + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexCodeFieIdReDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexCodeFieIdReDao.xml new file mode 100644 index 0000000000..4186e0e155 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexCodeFieIdReDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file From c9fa62cc8b0597a71d615e72b544700aa3aa44b2 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 26 Aug 2020 18:16:44 +0800 Subject: [PATCH 065/226] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=A6=81=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E7=9A=84=E6=8C=87=E6=A0=87=E6=98=8E=E7=BB=86=E6=9D=83?= =?UTF-8?q?=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/entity/screen/IndexCodeFieldReEntity.java | 9 +++++++++ .../main/resources/mapper/screen/IndexGroupDetailDao.xml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexCodeFieldReEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexCodeFieldReEntity.java index 1e563a118b..7821fbe41b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexCodeFieldReEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexCodeFieldReEntity.java @@ -9,4 +9,13 @@ import lombok.EqualsAndHashCode; @EqualsAndHashCode(callSuper=false) @TableName("index_code_field_re") public class IndexCodeFieldReEntity extends BaseEpmetEntity { + /** + * 指标code + */ + private String indexCode; + + /** + * 字段名 + */ + private String fieldId; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml index ac4ad73bd5..12eacafdd2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml @@ -5,7 +5,7 @@ \ No newline at end of file From 94f0f7716e37330a89d15830e94d0bd7e3ead9a9 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 27 Aug 2020 08:58:54 +0800 Subject: [PATCH 066/226] =?UTF-8?q?getDetailListByParentCode=20sql?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/screen/IndexGroupDetailDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml index 12eacafdd2..0eeb130617 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml @@ -5,7 +5,7 @@ \ No newline at end of file From 6927d0c73b2123cc6f5a87de61108e0e31f17ee1 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 27 Aug 2020 10:54:47 +0800 Subject: [PATCH 067/226] =?UTF-8?q?=E6=9C=88=E5=BA=A6=E6=8C=87=E6=95=B0?= =?UTF-8?q?=E5=88=86=E6=9E=90-=E6=9F=B1=E7=8A=B6=E5=9B=BE=20customerId?= =?UTF-8?q?=E5=86=99=E6=AD=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datareport/service/screen/impl/IndexServiceImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java index e106a07d45..cd7063f05e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java @@ -78,7 +78,11 @@ public class IndexServiceImpl implements IndexService { @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) @Override public MonthBarchartResultDTO monthBarchart(MonthBarchartFormDTO monthBarchartFormDTO, ExternalAppRequestParam externalAppRequestParam) { - String customerId = externalAppRequestParam.getCustomerId(); + +// String customerId = externalAppRequestParam.getCustomerId(); + + // 验签关闭,customerId无法获取,暂时写死 + String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; MonthBarchartResultDTO result = new MonthBarchartResultDTO(); List serviceAbilityData = new ArrayList<>(); List partyDevAbilityData = new ArrayList<>(); From b835e8a888baef9bb5eaa38cc0aa774827379a14 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 27 Aug 2020 13:24:50 +0800 Subject: [PATCH 068/226] =?UTF-8?q?=E5=85=9A=E5=91=98=E5=88=86=E5=B8=83?= =?UTF-8?q?=E3=80=81=E7=94=A8=E6=88=B7=E5=88=86=E5=B8=83=E3=80=81=E6=9C=88?= =?UTF-8?q?=E5=BA=A6=E6=8C=87=E6=95=B0-=E6=9F=B1=E7=8A=B6=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/ParymemberDistributionResultDTO.java | 2 ++ .../screen/dto/result/UserDistributionResultDTO.java | 2 ++ .../java/com/epmet/screen/dto/result/UserResultDTO.java | 2 +- .../datareport/controller/screen/IndexController.java | 4 ++-- .../datareport/dao/screen/ScreenIndexDataMonthlyDao.java | 3 +-- .../epmet/datareport/service/screen/IndexService.java | 3 +-- .../datareport/service/screen/impl/IndexServiceImpl.java | 9 ++------- .../mapper/screen/ScreenIndexDataMonthlyDao.xml | 1 - 8 files changed, 11 insertions(+), 15 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ParymemberDistributionResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ParymemberDistributionResultDTO.java index 397b53287b..180d6fd3c8 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ParymemberDistributionResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ParymemberDistributionResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.screen.dto.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -31,6 +32,7 @@ public class ParymemberDistributionResultDTO implements Serializable { /** * 坐标区域 */ + @JsonIgnore private String areaMarks = ""; /** diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserDistributionResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserDistributionResultDTO.java index 15787f28ed..de772f423b 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserDistributionResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserDistributionResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.screen.dto.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -31,6 +32,7 @@ public class UserDistributionResultDTO implements Serializable { /** * 坐标区域 */ + @JsonIgnore private String areaMarks; /** diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserResultDTO.java index cea3d4b7ad..592b3fd4af 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserResultDTO.java @@ -30,7 +30,7 @@ public class UserResultDTO implements Serializable { * 当前所选组织的坐标区域 */ @JsonIgnore - private String areaMarks = ""; + private String areaMarks; /** * 机关级别 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java index 401ee272a9..ba4a24ec52 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java @@ -67,9 +67,9 @@ public class IndexController { */ //@ExternalAppRequestAuth @PostMapping("monthindexanalysis/barchart") - public Result monthBarchart(@RequestBody MonthBarchartFormDTO monthBarchartFormDTO, ExternalAppRequestParam externalAppRequestParam){ + public Result monthBarchart(@RequestBody MonthBarchartFormDTO monthBarchartFormDTO){ ValidatorUtils.validateEntity(monthBarchartFormDTO, MonthBarchartFormDTO.MonthBarchart.class); - return new Result().ok(indexService.monthBarchart(monthBarchartFormDTO,externalAppRequestParam)); + return new Result().ok(indexService.monthBarchart(monthBarchartFormDTO)); } /** diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataMonthlyDao.java index 2e18647c39..028fbf6142 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataMonthlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataMonthlyDao.java @@ -46,12 +46,11 @@ public interface ScreenIndexDataMonthlyDao{ /** * @Description 查询近一年的指数值【不包括本月】 - * @param customerId * @param agencyId * @author zxc * @date 2020/8/20 9:02 上午 */ - List selectMonthBarchart(@Param("customerId")String customerId, @Param("agencyId")String agencyId); + List selectMonthBarchart(@Param("agencyId")String agencyId); /** * @Description 4、下级部门指数排行 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/IndexService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/IndexService.java index 5c0b5e4ade..5f840c2369 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/IndexService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/IndexService.java @@ -1,6 +1,5 @@ package com.epmet.datareport.service.screen; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.screen.dto.form.MonthBarchartFormDTO; import com.epmet.screen.dto.form.MonthPieChartFormDTO; import com.epmet.screen.dto.form.SubAgencyIndexRankFormDTO; @@ -42,7 +41,7 @@ public interface IndexService { * @author zxc * @date 2020/8/19 5:27 下午 */ - MonthBarchartResultDTO monthBarchart(MonthBarchartFormDTO monthBarchartFormDTO, ExternalAppRequestParam externalAppRequestParam); + MonthBarchartResultDTO monthBarchart(MonthBarchartFormDTO monthBarchartFormDTO); /** * @Description 4、下级部门指数排行 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java index cd7063f05e..a747d93c31 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java @@ -77,12 +77,7 @@ public class IndexServiceImpl implements IndexService { */ @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) @Override - public MonthBarchartResultDTO monthBarchart(MonthBarchartFormDTO monthBarchartFormDTO, ExternalAppRequestParam externalAppRequestParam) { - -// String customerId = externalAppRequestParam.getCustomerId(); - - // 验签关闭,customerId无法获取,暂时写死 - String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + public MonthBarchartResultDTO monthBarchart(MonthBarchartFormDTO monthBarchartFormDTO) { MonthBarchartResultDTO result = new MonthBarchartResultDTO(); List serviceAbilityData = new ArrayList<>(); List partyDevAbilityData = new ArrayList<>(); @@ -91,7 +86,7 @@ public class IndexServiceImpl implements IndexService { // 1. x轴 result.setXAxis(partyMemberLeadServiceImpl.getXPro()); // 2. 查询近一年的指数值【不包括本月】 - List monthBarchartResults = screenIndexDataMonthlyDao.selectMonthBarchart(customerId, monthBarchartFormDTO.getAgencyId()); + List monthBarchartResults = screenIndexDataMonthlyDao.selectMonthBarchart(monthBarchartFormDTO.getAgencyId()); if (monthBarchartResults.size() == NumConstant.ZERO){ for (int i = NumConstant.ZERO; i <= NumConstant.TWELVE; i++) { serviceAbilityData.add(NumConstant.ZERO_DOT_ZERO); diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index 21293ad4c6..3adcde64e8 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -31,7 +31,6 @@ WHERE del_flag = '0' AND org_id = #{agencyId} - AND customer_id = #{customerId} ORDER BY MONTH_ID DESC LIMIT 12 From 5c9658ddc804dbcf035f66a5d0847b1b418ef8c6 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Thu, 27 Aug 2020 13:41:59 +0800 Subject: [PATCH 069/226] =?UTF-8?q?11=E3=80=81=E5=9F=BA=E5=B1=82=E6=B2=BB?= =?UTF-8?q?=E7=90=86-=E5=85=AC=E4=BC=97=E5=8F=82=E4=B8=8E=20=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=B9=B3=E5=9D=87=E7=8E=87=E8=AE=A1=E7=AE=97=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/screen/impl/ScreenCollServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java index 83162e601a..1411cd9c00 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java @@ -334,9 +334,10 @@ public class ScreenCollServiceImpl implements ScreenCollService { String[] lastMonth = this.lastMonthDate(); // 获取上个月的基本数据 + String moneth = lastMonth[NumConstant.ZERO] + lastMonth[NumConstant.ONE]; List lastMonthJoinList = screenUserJoinDao.selectLastMonthScreenUserJoinList(customerId, lastMonth[NumConstant.ZERO], - lastMonth[NumConstant.ONE], + moneth, orgIds); // 定义本月待添加数据的集合 From 1a0c352156e7ac5074d3318a46fb58c2a9681e2f Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 27 Aug 2020 14:18:53 +0800 Subject: [PATCH 070/226] =?UTF-8?q?=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/screen/impl/PartyMemberLeadServiceImpl.java | 2 +- .../src/main/resources/mapper/screen/ScreenEventDataDao.xml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java index 79868496d1..c00487d080 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java @@ -158,7 +158,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { public List getXPro(){ List xAxis = new ArrayList<>(); LocalDate today = LocalDate.now(); - for(int i = NumConstant.TWELVE;i >= NumConstant.ONE; i--){ + for(int i = NumConstant.ELEVEN;i >= NumConstant.ZERO; i--){ LocalDate localDate = today.minusMonths(i); String s = localDate.getMonth().getValue() + ScreenConstant.MONTH; xAxis.add(s); diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml index 0b2e8698e2..a484d4549a 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml @@ -6,7 +6,7 @@ From e12e6071b453173c99d3a492173dc3c12ea08ec1 Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 27 Aug 2020 14:24:53 +0800 Subject: [PATCH 071/226] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=B0=83=E6=95=B4=EF=BC=9A=20->=E9=BB=98=E8=AE=A4=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E4=B8=8A=E4=B8=AA=E6=9C=88=E4=BB=A5=E5=8F=8A=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E6=9F=A5=E8=AF=A2=E6=88=AA=E8=87=B3=E4=B8=8A=E4=B8=AA?= =?UTF-8?q?=E6=9C=88=E7=9A=84=E6=95=B0=E6=8D=AE=EF=BC=8C=E6=94=B9=E6=88=90?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=9F=A5=E8=AF=A2=E6=9C=AC=E6=9C=88=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E9=BB=98=E8=AE=A4=E6=9F=A5=E8=AF=A2=E6=88=AA=E8=87=B3?= =?UTF-8?q?=E6=9C=AC=E6=9C=88=E7=9A=84=E6=95=B0=E6=8D=AE=EF=BC=9B=20->?= =?UTF-8?q?=E5=85=88=E8=BF=9B=E6=8E=92=E8=A1=8C=E6=A6=9C=E5=8D=95-?= =?UTF-8?q?=E5=85=88=E8=BF=9B=E7=BB=84=E7=BB=87=EF=BC=8C=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?agenyId=E6=9F=A5=E8=AF=A2=E4=B8=8B=E7=BA=A7=E6=9C=BA=E5=85=B3?= =?UTF-8?q?=E6=8E=92=E8=A1=8C=EF=BC=8C=E5=BD=93=E5=89=8D=E6=9C=BA=E5=85=B3?= =?UTF-8?q?=E4=B8=BA=E7=A4=BE=E5=8C=BA=E6=97=B6=EF=BC=8C=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=E6=8E=92=E8=A1=8C=EF=BC=9B=20->=E5=85=88?= =?UTF-8?q?=E8=BF=9B=E6=8E=92=E8=A1=8C=E6=A6=9C=E5=8D=95-=E5=85=88?= =?UTF-8?q?=E8=BF=9B=E5=85=9A=E5=91=98=EF=BC=8C=E6=9F=A5=E8=AF=A2=E6=89=80?= =?UTF-8?q?=E5=B1=9E=E6=9C=BA=E5=85=B3ORG=5FID=E4=B8=BA=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E6=9C=BA=E5=85=B3Id=E7=9A=84=E5=85=9A=E5=91=98=E6=8E=92?= =?UTF-8?q?=E8=A1=8C=E6=83=85=E5=86=B5;=20->=E6=94=BF=E5=BA=9C=E6=B2=BB?= =?UTF-8?q?=E7=90=86=E8=83=BD=E5=8A=9B=E6=A6=9C=E5=8D=95=EF=BC=8C=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=9C=AC=E6=9C=BA=E6=9C=BA=E5=85=B3=E7=9A=84=E4=B8=8B?= =?UTF-8?q?=E7=BA=A7=E6=9C=BA=E5=85=B3=EF=BC=8C=E5=BD=93=E5=89=8D=E6=9C=BA?= =?UTF-8?q?=E5=85=B3=E4=B8=BA=E7=A4=BE=E5=8C=BA=E6=97=B6=EF=BC=8C=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E7=BD=91=E6=A0=BC=E6=8E=92=E8=A1=8C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/GrassRootsGovernServiceImpl.java | 4 ++-- .../impl/GrassrootsPartyDevServiceImpl.java | 7 +++++-- .../screen/impl/PartyMemberLeadServiceImpl.java | 2 +- .../com/epmet/datareport/utils/DateUtils.java | 17 +++++++++++++++-- .../mapper/screen/ScreenDifficultyDataDao.xml | 4 ++-- .../mapper/screen/ScreenGovernRankDataDao.xml | 2 +- .../mapper/screen/ScreenOrgRankDataDao.xml | 2 +- .../screen/ScreenPartyUserRankDataDao.xml | 4 ++-- 8 files changed, 29 insertions(+), 13 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassRootsGovernServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassRootsGovernServiceImpl.java index 2dd8233800..f798d5047e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassRootsGovernServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassRootsGovernServiceImpl.java @@ -104,7 +104,7 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { @Override public PublicPartiProfileResultDTO publicPartiProfile(AgencyFormDTO param) { - String monthId = dateUtils.getPreviousMonthId(); + String monthId = dateUtils.getCurrentMonthId(); UserJoinIndicatorGrowthRateResultDTO latest = screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId); if(null == latest) return new PublicPartiProfileResultDTO(); PublicPartiProfileResultDTO result = ConvertUtils.sourceToTarget(latest,PublicPartiProfileResultDTO.class); @@ -154,7 +154,7 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { if(NumConstant.ZERO == param.getTopNum()) param.setTopNum(NumConstant.MAX); PageHelper.startPage(NumConstant.ONE,param.getTopNum()); List orderList = - screenGovernRankDataDao.selectGovernCapacityRatio(dateUtils.getPreviousMonthId(),param.getAgencyId()); + screenGovernRankDataDao.selectGovernCapacityRatio(dateUtils.getCurrentMonthId(),param.getAgencyId()); if(null == orderList || orderList.isEmpty()) return new ArrayList<>(); List result = new LinkedList<>(); orderList.forEach(o -> { diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java index 3cbb95a0db..aa1b23a448 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java @@ -7,6 +7,7 @@ import com.epmet.datareport.dao.screen.ScreenCpcBaseDataDao; import com.epmet.datareport.dao.screen.ScreenPartyBranchDataDao; import com.epmet.datareport.dao.screen.ScreenUserTotalDataDao; import com.epmet.datareport.service.screen.GrassrootsPartyDevService; +import com.epmet.datareport.utils.DateUtils; import com.epmet.datareport.utils.ModuleConstant; import com.epmet.screen.dto.form.BranchBuildRankFormDTO; import com.epmet.screen.dto.form.BranchBuildTrendFormDTO; @@ -42,6 +43,8 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService private ScreenCpcBaseDataDao screenCpcBaseDataDao; @Autowired private ScreenPartyBranchDataDao screenPartyBranchDataDao; + @Autowired + private DateUtils dateUtils; /** * @Description 1、党员基本情况-饼状图概况 @@ -178,7 +181,7 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService param.setCategory(ModuleConstant.KEY_BRANCH_CATEGORY_PARTY); } if(StringUtils.isBlank(param.getMonthId())){ - param.setMonthId(getPreviousMonthId()); + param.setMonthId(dateUtils.getCurrentMonthId()); } if(NumConstant.ZERO == param.getTopNum()) param.setTopNum(NumConstant.MAX); PageHelper.startPage(NumConstant.ONE,param.getTopNum()); @@ -215,7 +218,7 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService SimpleDateFormat format = new SimpleDateFormat("yyyyMM"); Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); // 设置为当前时间 - calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) - 1); // 设置为上一个月 + //calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) - 1); // 设置为上一个月 String currentMonth = format.format(calendar.getTime()); Integer monthCounter = Integer.parseInt(currentMonth); Map monthMap = new HashMap<>(); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java index 79868496d1..8580503f88 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java @@ -184,7 +184,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { } PageHelper.startPage(NumConstant.ONE,param.getTopNum()); List gridData = - screenOrgRankDataDao.selectGridDataMonthly(param.getAgencyId(),dateUtils.getPreviousMonthId()); + screenOrgRankDataDao.selectGridDataMonthly(param.getAgencyId(),dateUtils.getCurrentMonthId()); List result = new LinkedList<>(); if(null == gridData || gridData.isEmpty()) return result; gridData.forEach( data -> { diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/DateUtils.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/DateUtils.java index 6db1756fdb..b2d99c00f1 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/DateUtils.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/DateUtils.java @@ -31,7 +31,7 @@ public class DateUtils { public Map getX(){ Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); // 设置为当前时间 - calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) - 1); // 设置为上一个月 + //calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) - 1); // 设置为上一个月 String currentMonth = defaultFormat.format(calendar.getTime()); Integer monthCounter = Integer.parseInt(currentMonth); Map monthMap = new HashMap<>(); @@ -64,7 +64,7 @@ public class DateUtils { Map xAxis = new HashMap<>(); LocalDate today = LocalDate.now(); - for(int i = NumConstant.TWELVE;i >= NumConstant.ONE; i--){ + for(int i = NumConstant.ELEVEN;i >= NumConstant.ZERO; i--){ LocalDate localDate = today.minusMonths(i); String s = localDate.getMonth().getValue() + "月"; xAxis.put(localDate.format(fmt),s); @@ -108,6 +108,19 @@ public class DateUtils { return format.format(c.getTime()); } + /** + * @Description 得到当前月份的monthId + * @param + * @return + * @author wangc + * @date 2020.08.27 13:43 + **/ + public String getCurrentMonthId(){ + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); // 设置为当前时间 + return defaultFormat.format(calendar.getTime()); + } + public static void main(String[] args) { DateUtils util = new DateUtils(); Map result = util.getXpro(); diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml index 77f6fb0108..8b98c54ebe 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml @@ -7,9 +7,9 @@ diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml index a484d4549a..750439bb3e 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml @@ -16,8 +16,7 @@ screen_event_data WHERE del_flag = '0' - AND parent_id = #{parentId} - AND all_parent_ids LIKE concat('%', #{agencyId}, '%') + AND all_parent_ids LIKE concat('%', #{parentId}, '%') From b5adf11f74ad60e8446c0db44202ba3918912d04 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 27 Aug 2020 14:57:42 +0800 Subject: [PATCH 073/226] =?UTF-8?q?=E6=9C=80=E5=A4=A7=E5=80=BC=E6=9C=80?= =?UTF-8?q?=E5=B0=8F=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/indexcal/PageQueryGridFormDTO.java | 33 +++ .../FactIndexGovrnAblityGridMonthlyDTO.java | 142 ++++++++++++ .../FactIndexPartyAblityGridMonthlyDTO.java | 167 ++++++++++++++ .../FactIndexServiceAblityGridMonthlyDTO.java | 117 ++++++++++ .../data-statistical-server/pom.xml | 2 +- .../FactIndexGovrnAblityGridMonthlyDao.java | 21 ++ .../FactIndexPartyAblityGridMonthlyDao.java | 22 ++ .../FactIndexServiceAblityGridMonthlyDao.java | 22 ++ .../dao/screen/ScreenCustomerGridDao.java | 10 + .../indexcal/GridCorreLationService.java | 24 ++ .../impl/GridCorreLationServiceImpl.java | 210 +++++++++++++++++- .../FactIndexGovrnAblityGridMonthlyDao.xml | 51 +++++ .../FactIndexPartyAblityGridMonthlyDao.xml | 68 ++++++ .../FactIndexServiceAblityGridMonthlyDao.xml | 37 +++ .../mapper/screen/ScreenCustomerGridDao.xml | 15 ++ 15 files changed, 933 insertions(+), 8 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/PageQueryGridFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexGovrnAblityGridMonthlyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexPartyAblityGridMonthlyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexServiceAblityGridMonthlyDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/PageQueryGridFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/PageQueryGridFormDTO.java new file mode 100644 index 0000000000..51f5244294 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/PageQueryGridFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + +/** + * 分页查询网格列表 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/27 14:37 + */ +@Data +public class PageQueryGridFormDTO implements Serializable { + /** + * 客户id + */ + private String customerId; + + /** + * 页码 + * */ + @Min(1) + private Integer pageNo; + + /** + * 每页多少条 + * */ + private Integer pageSize = 10; + + private Integer pageIndex; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexGovrnAblityGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexGovrnAblityGridMonthlyDTO.java new file mode 100644 index 0000000000..80ec8c7100 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexGovrnAblityGridMonthlyDTO.java @@ -0,0 +1,142 @@ +/** + * 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.dto.indexcollect; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 治理能力-网格相关事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-26 + */ +@Data +public class FactIndexGovrnAblityGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 月维度Id:yyyyMM + */ + private String monthId; + + /** + * 季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Id:yyyy + */ + private String yearId; + + /** + * 网格总议题数 + */ + private Integer issueTotal; + + /** + * 网格人均议题数目 + */ + private Integer avgIssueCount; + + /** + * 网格议题转项目率 + */ + private BigDecimal avgShiftProjectRatio; + + /** + * 网格总项目数 + */ + private Integer projectTotal; + + /** + * 网格自治项目数 统计期网格自身内办结的项目数目 + */ + private Integer selfSolveProjectCount; + + /** + * 网格办结项目数 统计期内办结的项目数目 + */ + private Integer resolveProjectCount; + + /** + * 网格吹哨部门准确率 + */ + private BigDecimal transferRightRatio; + + /** + * 网格内解决的项目的满意度 + */ + private BigDecimal satisfactionRatio; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexPartyAblityGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexPartyAblityGridMonthlyDTO.java new file mode 100644 index 0000000000..901ff46b9e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexPartyAblityGridMonthlyDTO.java @@ -0,0 +1,167 @@ +/** + * 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.dto.indexcollect; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 党建能力-网格相关事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-26 + */ +@Data +public class FactIndexPartyAblityGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 月维度Id:yyyyMM + */ + private String monthId; + + /** + * 季度Id yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Idyyyy + */ + private String yearId; + + /** + * 网格群众用户数 + */ + private Integer userCount; + + /** + * 网格党员用户数 + */ + private Integer partyCount; + + /** + * 网格活跃群众用户数 + */ + private Integer activeUserCount; + + /** + * 网格活跃党员用户数 + */ + private Integer activePartyCount; + + /** + * 网格党员人均提出话题数 + */ + private Integer partyAvgTopicCount; + + /** + * 网格群众人均提出话题数 + */ + private Integer userAvgTopicCount; + + /** + * 网格党员人均提出的议题转项目数 + */ + private Integer partyAvgShiftProjectCount; + + /** + * 网格群众人均提出的议题转项目数 + */ + private Integer userAvgShiftProjectCount; + + /** + * 建群党员数(累计值) 去重 + */ + private Integer createGroupPartyCount; + + /** + * 网格发文数 + */ + private Integer publishArticleCount; + + /** + * 网格议题转项目率 + */ + private BigDecimal issueToProjectRatio; + + /** + * 组织三会一课次数 + */ + private Integer createThreeMeetsCount; + + /** + * 党员参加三会一课人次 + */ + private Integer joinThreeMeetsCount; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexServiceAblityGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexServiceAblityGridMonthlyDTO.java new file mode 100644 index 0000000000..decd896d03 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexServiceAblityGridMonthlyDTO.java @@ -0,0 +1,117 @@ +/** + * 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.dto.indexcollect; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 服务能力-网格相关事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-26 + */ +@Data +public class FactIndexServiceAblityGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属组织Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 月维度Id:yyyyMM + */ + private String monthId; + + /** + * 季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Id: yyyy + */ + private String yearId; + + /** + * 网格活动组织次数 爱心活动 + */ + private Integer activityCount; + + /** + * 网格志愿者占比 + */ + private BigDecimal volunteerRatio; + + /** + * 网格党员志愿者率 + */ + private BigDecimal partyVolunteerRatio; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 8d0e953c05..a805e4a53c 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -195,7 +195,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java index e591ba928d..11cb3fbe03 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java @@ -24,6 +24,7 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 治理能力-网格相关事实表 @@ -64,4 +65,24 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * @param customerId 客户id + * @param monthId yyyyMM + * @return java.util.List + * @author yinzuomei + * @description 当前客户下,所有网格的治理能力相关五级指标 + * @Date 2020/8/26 15:58 + **/ + List> selectListGovrnAblityGrid(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @return java.util.Map + * @param customerId + * @param monthId + * @author yinzuomei + * @description 查询治理能力,网格相关,各五级指标最大值,最小值 + * @Date 2020/8/27 13:10 + **/ + Map selectGovrnAblityGridMinAndMax(@Param("customerId") String customerId, @Param("monthId") String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityGridMonthlyDao.java index b5cb8d2c5e..0aff70aece 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityGridMonthlyDao.java @@ -18,12 +18,14 @@ package com.epmet.dao.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.FactIndexPartyAblityGridMonthlyDTO; import com.epmet.dto.indexcollect.form.GridPartyAbilityFormDTO; import com.epmet.entity.indexcoll.FactIndexPartyAblityGridMonthlyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 党建能力-网格相关事实表 @@ -64,4 +66,24 @@ public interface FactIndexPartyAblityGridMonthlyDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * @param customerId 客户id + * @param monthId yyyyMM + * @return java.util.List + * @author yinzuomei + * @description 当前客户下,所有网格的党建能力相关五级指标 + * @Date 2020/8/26 15:57 + **/ + List> selectListPartyAblityGrid(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @return java.util.Map + * @param customerId + * @param monthId + * @author yinzuomei + * @description 查询党建能力,网格相关,各五级指标最大值,最小值 + * @Date 2020/8/27 12:51 + **/ + Map selectPartyAblityGridMinAndMax(@Param("customerId") String customerId, @Param("monthId") String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.java index 9eb7051762..a2b2eb78f8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.java @@ -18,12 +18,14 @@ package com.epmet.dao.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.FactIndexServiceAblityGridMonthlyDTO; import com.epmet.dto.indexcollect.form.GridServiceAbilityFormDTO; import com.epmet.entity.indexcoll.FactIndexServiceAblityGridMonthlyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 服务能力-网格相关事实表 @@ -63,4 +65,24 @@ public interface FactIndexServiceAblityGridMonthlyDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * @return java.util.List + * @param customerId + * @param monthId + * @author yinzuomei + * @description 当前客户下,所有网格的治理能力相关五级指标 + * @Date 2020/8/26 15:59 + **/ + List> selectListServiceAblityGrid(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @return java.util.Map + * @param customerId + * @param monthId + * @author yinzuomei + * @description 查询 服务能力,网格相关,各五级指标最大值,最小值 + * @Date 2020/8/27 13:15 + **/ + Map selectServiceAblityGridMinAndMax(@Param("customerId") String customerId, @Param("monthId") String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java index 60f5a64ef4..dfb0d95a84 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java @@ -19,6 +19,7 @@ package com.epmet.dao.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.ScreenCustomerGridDTO; +import com.epmet.dto.indexcal.PageQueryGridFormDTO; import com.epmet.dto.screencoll.form.CustomerGridFormDTO; import com.epmet.entity.screen.ScreenCustomerGridEntity; import org.apache.ibatis.annotations.Mapper; @@ -74,4 +75,13 @@ public interface ScreenCustomerGridDao extends BaseDao * @Date 2020/8/26 15:33 **/ List selectListByCustomerId(@Param("customerId")String customerId); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 分页查询网格列表 + * @Date 2020/8/27 14:42 + **/ + List pageListByCustomerId(PageQueryGridFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/GridCorreLationService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/GridCorreLationService.java index 7b7905a535..225ae2bb80 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/GridCorreLationService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/GridCorreLationService.java @@ -1,7 +1,12 @@ package com.epmet.service.indexcal; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.ScreenCustomerGridDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.indexcal.PageQueryGridFormDTO; + +import java.util.List; +import java.util.Map; /** * 网格相关指标计算 @@ -19,4 +24,23 @@ public interface GridCorreLationService { * @Date 2020/8/26 10:51 **/ Boolean calculateGridCorreLation(CalculateCommonFormDTO formDTO); + + /** + * @return java.util.List> + * @param customerId + * @param monthId + * @author yinzuomei + * @description 党建能力-网格相关事实表 当前客户下,所有网格的党建能力相关五级指标 + * @Date 2020/8/27 14:48 + **/ + List> queryListPartyAblityGrid(String customerId, String monthId); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 分页查询网格列表 + * @Date 2020/8/27 14:48 + **/ + List pageGridList(PageQueryGridFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java index a192fafc6a..96b82127c6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java @@ -1,6 +1,6 @@ package com.epmet.service.indexcal.impl; -import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.dao.indexcoll.FactIndexGovrnAblityGridMonthlyDao; import com.epmet.dao.indexcoll.FactIndexPartyAblityGridMonthlyDao; import com.epmet.dao.indexcoll.FactIndexServiceAblityGridMonthlyDao; @@ -8,12 +8,23 @@ import com.epmet.dao.screen.ScreenCustomerGridDao; import com.epmet.dto.ScreenCustomerGridDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.CustomerGridInfoDTO; +import com.epmet.dto.indexcal.PageQueryGridFormDTO; +import com.epmet.dto.indexcollect.FactIndexGovrnAblityGridMonthlyDTO; +import com.epmet.dto.indexcollect.FactIndexPartyAblityGridMonthlyDTO; +import com.epmet.dto.indexcollect.FactIndexServiceAblityGridMonthlyDTO; +import com.epmet.entity.screen.IndexGroupDetailEntity; +import com.epmet.eum.IndexCodeEnum; import com.epmet.service.indexcal.GridCorreLationService; -import io.swagger.annotations.Authorization; +import com.epmet.service.screen.IndexGroupDetailService; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; /** * 网格相关service @@ -32,7 +43,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { private FactIndexServiceAblityGridMonthlyDao factIndexServiceAblityGridMonthlyDao; @Autowired private ScreenCustomerGridDao screenCustomerGridDao; - + @Autowired + private IndexGroupDetailService indexGroupDetailService; /** * @param formDTO @@ -43,22 +55,206 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { **/ @Override public Boolean calculateGridCorreLation(CalculateCommonFormDTO formDTO) { - return true; + boolean resultFlag = false; + List dangJianNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), + IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), + IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + if(!CollectionUtils.isEmpty(dangJianNengLiList)){ + //1、计算网格相关-党建能力 + calculateGridCorreLationDangJian(formDTO,dangJianNengLiList); + } + List zhiLiNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), + IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), + IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + if(!CollectionUtils.isEmpty(zhiLiNengLiList)){ + //2、计算网格相关-治理能力 + calculateGridCorreLationZhiLi(formDTO,zhiLiNengLiList); + } + List fuWuNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), + IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), + IndexCodeEnum.FU_WU_NENG_LI.getCode()); + if(!CollectionUtils.isEmpty(fuWuNengLiList)){ + //3、计算网格相关-服务能力 + calculateGridCorreLationFuWu(formDTO,fuWuNengLiList); + } + //计算网格相关总分 + List wgxgList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), + IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); + if(!CollectionUtils.isEmpty(wgxgList)){ + calculateGridCorreLationTotal(formDTO,wgxgList); + } + resultFlag = true; + return resultFlag; + } + + /** + * @return void + * @param formDTO + * @param indexList + * @author yinzuomei + * @description 计算网格相关-党建能力 + * @Date 2020/8/26 16:47 + **/ + private void calculateGridCorreLationDangJian(CalculateCommonFormDTO formDTO,List indexList){ + //分页查询网格列表 + //查询五级指标 + + } + + /** + * @return void + * @param formDTO + * @param indexList + * @author yinzuomei + * @description 计算网格相关-治理能力 + * @Date 2020/8/26 16:47 + **/ + private void calculateGridCorreLationZhiLi(CalculateCommonFormDTO formDTO,List indexList){ + + } + + /** + * @return void + * @param formDTO + * @param indexList + * @author yinzuomei + * @description 计算网格相关-服务能力 + * @Date 2020/8/26 16:48 + **/ + private void calculateGridCorreLationFuWu(CalculateCommonFormDTO formDTO,List indexList){ + + } + + /** + * @return void + * @param formDTO + * @param indexList + * @author yinzuomei + * @description 计算网格相关总分 + * @Date 2020/8/26 16:50 + **/ + private void calculateGridCorreLationTotal(CalculateCommonFormDTO formDTO,List indexList){ + } /** - * @return com.epmet.dto.indexcal.CustomerGridInfoDTO * @param customerId + * @return com.epmet.dto.indexcal.CustomerGridInfoDTO * @author yinzuomei * @description 查询客户下网格信息 * @Date 2020/8/26 15:37 **/ - public CustomerGridInfoDTO queryCustomerGridInfo(String customerId){ - CustomerGridInfoDTO customerGridInfoDTO=new CustomerGridInfoDTO(); + public CustomerGridInfoDTO queryCustomerGridInfo(String customerId) { + CustomerGridInfoDTO customerGridInfoDTO = new CustomerGridInfoDTO(); customerGridInfoDTO.setTotal(screenCustomerGridDao.selectCountByCustomerId(customerId)); customerGridInfoDTO.setGridList(screenCustomerGridDao.selectListByCustomerId(customerId)); return customerGridInfoDTO; } + + /** + * @return + * @param formDTO + * @author yinzuomei + * @description 分页查询网格列表 + * @Date 2020/8/27 14:42 + **/ + public List pageGridList(PageQueryGridFormDTO formDTO){ + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageIndex(pageIndex); + return screenCustomerGridDao.pageListByCustomerId(formDTO); + } + + + /** + * @param customerId + * @param monthId + * @return java.util.List + * @author yinzuomei + * @description 党建能力-网格相关事实表 当前客户下,所有网格的党建能力相关五级指标 + * @Date 2020/8/26 15:52 + **/ + @Override + public List> queryListPartyAblityGrid(String customerId, String monthId) { + return factIndexPartyAblityGridMonthlyDao.selectListPartyAblityGrid(customerId, monthId); + } + + /*网格群众用户数 + 网格党员用户数 + 网格活跃群众用户数 + 网格活跃党员用户数 + 网格党员人均提出话题数 + 网格群众人均提出话题数 + 网格党员人均提出的议题转项目数 + 网格群众人均提出的议题转项目数 + 建群党员数 + 组织内党员的联系群众能力考评分(平均值) + 网格的发文数量 + 网格议题转项目率 + 组织“三会一课”次数 + 党员参加“三会一课”人次*/ + /** + * @return java.util.Map + * @param customerId + * @param monthId + * @author yinzuomei + * @description 查询党建能力,网格相关,各五级指标最大值,最小值 + * @Date 2020/8/27 12:47 + **/ + public Map queryPartyAblityGridMinAndMax(String customerId, String monthId){ + return factIndexPartyAblityGridMonthlyDao.selectPartyAblityGridMinAndMax(customerId,monthId); + } + + + /** + * @param customerId + * @param monthId + * @return java.util.List + * @author yinzuomei + * @description 当前客户下,所有网格的治理能力相关五级指标 + * @Date 2020/8/26 15:55 + **/ + public List> queryListGovrnAblityGrid(String customerId, String monthId) { + return factIndexGovrnAblityGridMonthlyDao.selectListGovrnAblityGrid(customerId, monthId); + } + + + /** + * @param customerId + * @param monthId + * @return java.util.Map + * @author yinzuomei + * @description 查询治理能力,网格相关,各五级指标最大值,最小值 + * @Date 2020/8/27 12:48 + **/ + public Map queryGovrnAblityGridMinAndMax(String customerId, String monthId) { + return factIndexGovrnAblityGridMonthlyDao.selectGovrnAblityGridMinAndMax(customerId, monthId); + } + + /** + * @param customerId + * @param monthId + * @return java.util.List + * @author yinzuomei + * @description 当前客户下,所有网格的服务能力相关五级指标 + * @Date 2020/8/26 15:55 + **/ + public List> queryListServiceAblityGrid(String customerId, String monthId) { + return factIndexServiceAblityGridMonthlyDao.selectListServiceAblityGrid(customerId, monthId); + } + + /** + * @return java.util.Map + * @param customerId + * @param monthId + * @author yinzuomei + * @description 查询 服务能力,网格相关,各五级指标最大值,最小值 + * @Date 2020/8/27 12:50 + **/ + public Map queryServiceAblityGridMinAndMax(String customerId, String monthId) { + return factIndexServiceAblityGridMonthlyDao.selectServiceAblityGridMinAndMax(customerId, monthId); + } + + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml index ed0f65cc79..504ed412e1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml @@ -85,4 +85,55 @@ + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml index e51a7d4f7f..e0ca717e07 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml @@ -99,4 +99,72 @@ ) + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml index bc4348ea56..fb3c488e9e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml @@ -69,4 +69,41 @@ ) + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml index 1cf2922cd9..a5bee6054f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml @@ -77,4 +77,19 @@ m.DEL_FLAG = '0' AND m.CUSTOMER_ID = #{customerId} + + + From f0807beb94b65a3340ee251147c601ce69a926b4 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 27 Aug 2020 14:58:42 +0800 Subject: [PATCH 074/226] =?UTF-8?q?=E6=89=93=E5=BC=80nacos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/data-statistical/data-statistical-server/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index a805e4a53c..8d0e953c05 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -195,7 +195,7 @@ 6379 123456 - false + true 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 From e04900df19da478d1004b066336f10d4e9d05f91 Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 27 Aug 2020 15:13:48 +0800 Subject: [PATCH 075/226] =?UTF-8?q?=E9=9A=BE=E7=82=B9=E8=B5=8C=E7=82=B9?= =?UTF-8?q?=EF=BC=8C=E6=80=BB=E5=85=B1=E8=80=97=E6=97=B6=E6=8D=A2=E7=AE=97?= =?UTF-8?q?=E6=88=90=E5=B0=8F=E6=97=B6=E8=88=8D=E5=BC=83=E7=B2=BE=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/screen/ScreenDifficultyDataDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml index 8b98c54ebe..7d166fc31f 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml @@ -9,7 +9,7 @@ diff.EVENT_ID AS projectId, diff.EVENT_CONTENT AS title, diff.EVENT_STATUS_CODE AS STATUS, - FORMAT(diff.EVENT_COST_TIME/60,2) AS totalHours, + FORMAT(diff.EVENT_COST_TIME/60,0) AS totalHours, DATE_FORMAT( eve.EVENT_CREATE_TIME, '%Y-%m-%d %H:%i' ) AS createDateTime, diff.EVENT_SOURCE AS gridName, diff.EVENT_IMG_URL AS imgUrl, From 585e640f969b2269288ecaa719f11fa6ed744ed0 Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 27 Aug 2020 15:24:32 +0800 Subject: [PATCH 076/226] =?UTF-8?q?=E5=85=88=E8=BF=9B=E6=94=AF=E9=83=A8?= =?UTF-8?q?=E6=8E=92=E8=A1=8C=20=E5=8F=AA=E5=8F=96=E7=BD=91=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/screen/ScreenDifficultyDataDao.xml | 2 +- .../src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml index 7d166fc31f..630befedcd 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml @@ -9,7 +9,7 @@ diff.EVENT_ID AS projectId, diff.EVENT_CONTENT AS title, diff.EVENT_STATUS_CODE AS STATUS, - FORMAT(diff.EVENT_COST_TIME/60,0) AS totalHours, + ROUND(diff.EVENT_COST_TIME/60,0) AS totalHours, DATE_FORMAT( eve.EVENT_CREATE_TIME, '%Y-%m-%d %H:%i' ) AS createDateTime, diff.EVENT_SOURCE AS gridName, diff.EVENT_IMG_URL AS imgUrl, diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml index 619d47ae48..3d6719522e 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml @@ -17,6 +17,7 @@ screen_org_rank_data WHERE DEL_FLAG = '0' + AND ORG_TYPE = 'grid' AND PARENT_ID = #{agencyId} AND MONTH_ID = #{monthId} ORDER BY From 8f01c746b920ea78f109cfeb2b0fa02d81241162 Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 27 Aug 2020 15:39:03 +0800 Subject: [PATCH 077/226] =?UTF-8?q?=E5=85=88=E8=BF=9B=E6=8E=92=E8=A1=8C=20?= =?UTF-8?q?=E5=85=9A=E5=91=98=E3=80=81=E6=94=AF=E9=83=A8=20=20=20=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E6=9F=A5=E8=AF=A2=E6=89=80=E6=9C=89=E4=B8=8B=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml | 2 +- .../main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml index 3d6719522e..97292b4797 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml @@ -18,7 +18,7 @@ WHERE DEL_FLAG = '0' AND ORG_TYPE = 'grid' - AND PARENT_ID = #{agencyId} + AND ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%') AND MONTH_ID = #{monthId} ORDER BY (PARTY_TOTAL + GROUP_TOTAL + ISSUE_TOTAL + PROJECT_TOTAL + CLOSE_PROJECT_RATIO + SATISFACTION_RATIO) DESC, diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml index 8c6354bd54..80aee4ece5 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml @@ -30,7 +30,7 @@ screen_party_user_rank_data WHERE DEL_FLAG = '0' - AND ORG_ID = #{agencyId} + AND ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%') AND PARTY_FLAG = '1' ORDER BY POINT_TOTAL DESC From 6e4a7dff4149be933ff98f751833422b278461e0 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 27 Aug 2020 17:19:44 +0800 Subject: [PATCH 078/226] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=8C=87=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dao/screen/IndexGroupDao.java | 4 - .../epmet/model/IndexExcelDataListener.java | 92 +++++++++++-------- .../impl/CpcIndexCalculateServiceImpl.java | 17 +++- .../screen/impl/IndexGroupServiceImpl.java | 40 +++++++- .../java/com/epmet/util/Pinyin4jUtil.java | 32 ++++++- .../FactIndexPartyAblityCpcMonthlyDao.xml | 36 ++++---- .../mapper/screen/IndexGroupDetailDao.xml | 8 +- .../screen/IndexGroupDetailTemplateDao.xml | 2 +- 8 files changed, 161 insertions(+), 70 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDao.java index c873ffdb0b..5458720940 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDao.java @@ -21,8 +21,6 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.screen.IndexGroupEntity; import org.apache.ibatis.annotations.Mapper; -import java.util.List; - /** * 客户指标分组 * @@ -33,6 +31,4 @@ import java.util.List; public interface IndexGroupDao extends BaseDao { int inertGroupFromTable(String customerId); - - List getDetailByCode(String indexCode, Integer offset); } \ No newline at end of file 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 6e747b0766..a4993cf00b 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 @@ -112,85 +112,109 @@ public class IndexExcelDataListener extends AnalysisEventListener { List collect = indexModelList.stream().sorted(Comparator.comparing(IndexModel::getLevel1Index)).collect(Collectors.toList()); collect.forEach(index -> { if (index.getLevel1Index().equals("党员相关")) { + IndexDictEntity indexDictEntity = indexDicMap.get(index.getLevel1Index()); - String level1GroupId = UniqueIdGenerator.generate(); IndexGroupTemplateEntity group1 = indexGroupMap.get(index.getLevel1Index()); if (group1 == null) { group1 = new IndexGroupTemplateEntity(); group1.setIndexId(indexDictEntity.getId()); group1.setParentIndexGroupId("0"); - group1.setId(level1GroupId); - group1.setIndexCode(Pinyin4jUtil.getFirstSpellPinYin(indexDictEntity.getIndexName(),true)); + group1.setId(UniqueIdGenerator.generate()); + group1.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(),true,4)); indexGroupMap.put(index.getLevel1Index(), group1); } StringBuilder allIndexCodeSb = new StringBuilder(group1.getIndexCode()); String level4Index = index.getLevel4Index(); indexDictEntity = indexDicMap.get(level4Index); - String level2GroupId = UniqueIdGenerator.generate(); - IndexGroupTemplateEntity group2 = indexGroupMap.get(level4Index); + IndexGroupTemplateEntity group2 = indexGroupMap.get(index.getLevel1Index()+level4Index); IndexGroupDetailTemplateEntity templateEntity = null; if (group2 == null) { group2 = new IndexGroupTemplateEntity(); group2.setIndexId(indexDictEntity.getId()); - group2.setParentIndexGroupId(level1GroupId); - group2.setId(level2GroupId); - group2.setIndexCode(Pinyin4jUtil.getFirstSpellPinYin(indexDictEntity.getIndexName(),true)); - indexGroupMap.put(level4Index, group2); + group2.setParentIndexGroupId(group1.getId()); + group2.setId(UniqueIdGenerator.generate()); + group2.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(),false,4 )); + indexGroupMap.put(index.getLevel1Index()+level4Index, group2); //构建 分组明细 - templateEntity = indexGroupDetailMap.get(level4Index); + templateEntity = indexGroupDetailMap.get(index.getLevel1Index()+level4Index); if (templateEntity == null) { - buildIndexGroupDetail(indexDictEntity, index, group1, allIndexCodeSb.toString(), 2); + templateEntity = new IndexGroupDetailTemplateEntity(); + templateEntity.setIndexGroupId(group1.getId()); + templateEntity.setIndexId(indexDictEntity.getId()); + templateEntity.setAllParentIndexCode(allIndexCodeSb.toString()); + templateEntity.setId(UniqueIdGenerator.generate()); + buildIndexGroupDetail(templateEntity,indexDictEntity, index, group1, 2); + indexGroupDetailMap.put(index.getLevel1Index()+level4Index,templateEntity); } } indexDictEntity = indexDicMap.get(index.getLevel5Index()); allIndexCodeSb.append(StrConstant.COLON); allIndexCodeSb.append(group2.getIndexCode()); - templateEntity = indexGroupDetailMap.get(index.getLevel5Index()); + templateEntity = indexGroupDetailMap.get(index.getLevel1Index()+index.getLevel5Index()); if (templateEntity == null) { - buildIndexGroupDetail(indexDictEntity, index, group2, allIndexCodeSb.toString(), 5); + templateEntity = new IndexGroupDetailTemplateEntity(); + templateEntity.setIndexGroupId(group2.getId()); + System.out.println("=========="+group2.getId()); + templateEntity.setIndexId(indexDictEntity.getId()); + templateEntity.setAllParentIndexCode(allIndexCodeSb.toString()); + templateEntity.setId(UniqueIdGenerator.generate()); + buildIndexGroupDetail(templateEntity,indexDictEntity, index, group2, 5); + indexGroupDetailMap.put(index.getLevel1Index()+index.getLevel5Index(),templateEntity); } } else { //todo 测试完去掉 //if ("街道相关".equals(index.getLevel1Index())) { IndexDictEntity indexDictEntity = indexDicMap.get(index.getLevel1Index()); - String level1GroupId = UniqueIdGenerator.generate(); IndexGroupTemplateEntity group1 = indexGroupMap.get(index.getLevel1Index()); if (group1 == null) { group1 = new IndexGroupTemplateEntity(); group1.setIndexId(indexDictEntity.getId()); group1.setParentIndexGroupId("0"); - group1.setId(level1GroupId); - group1.setIndexCode(Pinyin4jUtil.getFirstSpellPinYin(indexDictEntity.getIndexName(),true)); + group1.setId(UniqueIdGenerator.generate()); + group1.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(),false,4 )); indexGroupMap.put(index.getLevel1Index(), group1); } StringBuilder allIndexCodeSb = new StringBuilder(group1.getIndexCode()); String level2Index = index.getLevel2Index(); indexDictEntity = indexDicMap.get(level2Index); - String level2GroupId = UniqueIdGenerator.generate(); - - IndexGroupTemplateEntity group2 = indexGroupMap.get(level2Index); + String groupMapKey = index.getLevel1Index() + level2Index; + IndexGroupTemplateEntity group2 = indexGroupMap.get(groupMapKey); IndexGroupDetailTemplateEntity templateEntity = null; if (group2 == null) { group2 = new IndexGroupTemplateEntity(); group2.setIndexId(indexDictEntity.getId()); - group2.setParentIndexGroupId(level1GroupId); - group2.setId(level2GroupId); - group2.setIndexCode(Pinyin4jUtil.getFirstSpellPinYin(indexDictEntity.getIndexName(),true)); - indexGroupMap.put(level2Index, group2); + group2.setParentIndexGroupId(group1.getId()); + group2.setId(UniqueIdGenerator.generate()); + group2.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(),false,4 )); + + indexGroupMap.put(groupMapKey, group2); //构建 分组明细 templateEntity = indexGroupDetailMap.get(level2Index); if (templateEntity == null) { - buildIndexGroupDetail(indexDictEntity, index, group1, allIndexCodeSb.toString(), 2); + templateEntity = new IndexGroupDetailTemplateEntity(); + templateEntity.setIndexGroupId(group2.getId()); + templateEntity.setIndexId(indexDictEntity.getId()); + templateEntity.setAllParentIndexCode(allIndexCodeSb.toString()); + templateEntity.setId(UniqueIdGenerator.generate()); + buildIndexGroupDetail(templateEntity,indexDictEntity, index, group1, 2); + indexGroupDetailMap.put(level2Index,templateEntity); } } indexDictEntity = indexDicMap.get(index.getLevel5Index()); allIndexCodeSb.append(StrConstant.COLON); allIndexCodeSb.append(group2.getIndexCode()); - templateEntity = indexGroupDetailMap.get(index.getLevel5Index()); + templateEntity = indexGroupDetailMap.get(index.getLevel1Index()+index.getLevel5Index()); if (templateEntity == null) { - buildIndexGroupDetail(indexDictEntity, index, group2, allIndexCodeSb.toString(), 5); + templateEntity = new IndexGroupDetailTemplateEntity(); + templateEntity.setIndexGroupId(group2.getId()); + templateEntity.setIndexId(indexDictEntity.getId()); + templateEntity.setAllParentIndexCode(allIndexCodeSb.toString()); + templateEntity.setId(UniqueIdGenerator.generate()); + + buildIndexGroupDetail(templateEntity, indexDictEntity, index, group2, 5); + indexGroupDetailMap.put(index.getLevel1Index()+index.getLevel5Index(),templateEntity); } } //} @@ -199,24 +223,16 @@ public class IndexExcelDataListener extends AnalysisEventListener { LOGGER.info("所有指标分组明细数据解析完成:{}", JSON.toJSONString(indexGroupDetailMap.values())); } - private void buildIndexGroupDetail(IndexDictEntity indexDictEntity, IndexModel index, IndexGroupTemplateEntity parentGroup, String allIndexCode, Integer level) { - IndexGroupDetailTemplateEntity templateEntity; - templateEntity = new IndexGroupDetailTemplateEntity(); - templateEntity.setIndexGroupId(parentGroup.getId()); - templateEntity.setAllParentIndexCode(allIndexCode); - templateEntity.setIndexId(indexDictEntity.getId()); - + private void buildIndexGroupDetail( IndexGroupDetailTemplateEntity templateEntity,IndexDictEntity indexDictEntity, IndexModel index, IndexGroupTemplateEntity parentGroup, Integer level) { if (level == 5) { - templateEntity.setIndexCode(Pinyin4jUtil.getFirstSpellPinYin(index.getLevel5Index(),true)); + templateEntity.setIndexCode(Pinyin4jUtil.getSpellPinYin(index.getLevel5Index(),false,4 )); String level5WeightStr = index.getLevel5Weight().replace("%", ""); templateEntity.setWeight(new BigDecimal(level5WeightStr).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP)); - indexGroupDetailMap.put(index.getLevel5Index(), templateEntity); } else { - templateEntity.setIndexCode(Pinyin4jUtil.getFirstSpellPinYin(indexDictEntity.getIndexName(),true)); - indexGroupDetailMap.put(indexDictEntity.getIndexName(), templateEntity); + templateEntity.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(),false,4 )); templateEntity.setWeight(new BigDecimal(index.getWeight()).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP)); } - templateEntity.setId(UniqueIdGenerator.generate()); + if (StringUtils.isNotBlank(index.getThreshold())) { String thresholdStr = index.getThreshold().replace("%", ""); templateEntity.setThreshold(new BigDecimal(thresholdStr).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP)); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/CpcIndexCalculateServiceImpl.java index 63a0105f28..4b26ff128c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/CpcIndexCalculateServiceImpl.java @@ -2,8 +2,12 @@ package com.epmet.service.screen.impl; import com.alibaba.fastjson.JSON; import com.epmet.dao.indexcoll.FactIndexPartyAblityCpcMonthlyDao; +import com.epmet.dao.screen.IndexCodeFieldReDao; +import com.epmet.dao.screen.IndexGroupDetailDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.entity.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; +import com.epmet.entity.screen.IndexGroupDetailEntity; +import com.epmet.eum.IndexCodeEnum; import com.epmet.service.screen.CpcIndexCalculateService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -19,14 +23,25 @@ import java.util.Map; public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { @Autowired private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; + @Autowired + private IndexCodeFieldReDao indexCodeFieldReDao; + @Autowired + private IndexGroupDetailDao indexGroupDetailDao; @Override public Boolean cpcIndexCalculate(CalculateCommonFormDTO formDTO) { //计算最大最小值 Map minAndMaxList = factIndexPartyAblityCpcMonthlyDao.getExtremeValue(formDTO.getCustomerId()); if (CollectionUtils.isEmpty(minAndMaxList)){ - log.warn("customerId:{} have not any record",formDTO.getCustomerId()); + log.warn("customerId:{} have not any fact record",formDTO.getCustomerId()); return false; } + //获取指标权重信息 + List indexDetails = indexGroupDetailDao.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); + if (CollectionUtils.isEmpty(indexDetails)){ + log.warn("customerId:{} have not any indexGroupDetail",formDTO.getCustomerId()); + return false; + } + log.info(JSON.toJSONString(minAndMaxList)); List list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId()); return null; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupServiceImpl.java index 65fc39f131..a575ed7b72 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupServiceImpl.java @@ -17,6 +17,7 @@ package com.epmet.service.screen.impl; +import com.alibaba.fastjson.JSON; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; @@ -35,7 +36,9 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -62,13 +65,44 @@ private IndexGroupTemplateDao indexGroupTemplateDao; if (CollectionUtils.isEmpty(groupTempList) || CollectionUtils.isEmpty(groupDetailTempList)){ throw new RenException("没有需要初始化的数据"); } - List groupEntityList = groupTempList.stream().map(groupTemp -> { + Map groupMap = groupTempList.stream().collect(Collectors.toMap(IndexGroupTemplateEntity::getId, o -> o)); + Map groupEntityMap = new HashMap<>(); + + groupDetailTempList.forEach(groupDetailTemp->{ + String indexGroupId = groupDetailTemp.getIndexGroupId(); + IndexGroupTemplateEntity group = groupMap.get(indexGroupId); + if (group == null){ + System.out.println(JSON.toJSONString(groupDetailTemp)); + } + + IndexGroupEntity groupEntity = groupEntityMap.get(indexGroupId); + if (groupEntity == null){ + groupEntity = ConvertUtils.sourceToTarget(group, IndexGroupEntity.class); + String groupId = UniqueIdGenerator.generate(); + groupEntity.setId(groupId); + groupEntity.setCustomerId(customerId); + groupEntityMap.put(indexGroupId,groupEntity); + } + + IndexGroupDetailEntity entity = ConvertUtils.sourceToTarget(groupDetailTemp, IndexGroupDetailEntity.class); + entity.setId(UniqueIdGenerator.generate()); + entity.setIndexGroupId(groupEntity.getId()); + entity.setCustomerId(customerId); + indexGroupDetailDao.insert(entity); + }); + this.insertBatch(groupEntityMap.values(),10); + + + /* List groupEntityList = groupTempList.stream().map(groupTemp -> { IndexGroupEntity entity = ConvertUtils.sourceToTarget(groupTemp, IndexGroupEntity.class); entity.setId(UniqueIdGenerator.generate()); entity.setCustomerId(customerId); return entity; }).collect(Collectors.toList()); - this.insertBatch(groupEntityList,10); + + groupEntityList.forEach(group->{ + + }); List groupTempEntityList = groupDetailTempList.stream().map(groupTemp -> { IndexGroupDetailEntity entity = ConvertUtils.sourceToTarget(groupTemp, IndexGroupDetailEntity.class); @@ -78,7 +112,7 @@ private IndexGroupTemplateDao indexGroupTemplateDao; }).collect(Collectors.toList()); groupTempEntityList.forEach(o->{ indexGroupDetailDao.insert(o); - }); + });*/ return true; } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java index 5ea9d4b828..c6e61ffb01 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java @@ -22,6 +22,9 @@ public class Pinyin4jUtil { duoyinMap = new HashMap<>(); duoyinMap.put('区',new String[]{"qu"}); duoyinMap.put('系',new String[]{"xi"}); + duoyinMap.put('率',new String[]{"lv"}); + duoyinMap.put('员',new String[]{"yuan"}); + duoyinMap.put('提',new String[]{"ti"}); } /** @@ -32,7 +35,24 @@ public class Pinyin4jUtil { * @return 第一个拼音 */ public static String getFirstSpellPinYin(String src, boolean isFullSpell) { - String targetStr = Pinyin4jUtil.makeStringByStringSet(Pinyin4jUtil.getPinyin(src, isFullSpell)); + String targetStr = Pinyin4jUtil.makeStringByStringSet(Pinyin4jUtil.getPinyin(src, isFullSpell, 1)); + System.out.println(targetStr); + String[] split = targetStr.split(","); + if (split.length > 1) { + targetStr = split[0]; + } + return targetStr; + } + + /** + * getFirstSpellPinYin:(多音字的时候获取第一个).
+ * + * @param src 传入的拼音字符串,以逗号隔开 + * @param isFullSpell 是否全拼,true:全拼,false:第一个汉字全拼(其它汉字取首字母) + * @return 第一个拼音 + */ + public static String getSpellPinYin(String src, boolean isFullSpell,Integer preFont) { + String targetStr = Pinyin4jUtil.makeStringByStringSet(Pinyin4jUtil.getPinyin(src, isFullSpell, preFont)); System.out.println(targetStr); String[] split = targetStr.split(","); if (split.length > 1) { @@ -68,9 +88,10 @@ public class Pinyin4jUtil { * * @param src 汉字 * @param isFullSpell 是否全拼,如果为true:全拼,false:首字全拼 + * @param preFont isFullSpell =true时,前几个字全拼 * @return */ - public static Set getPinyin(String src, boolean isFullSpell) { + public static Set getPinyin(String src, boolean isFullSpell, int preFont) { if (src != null && !src.trim().equalsIgnoreCase("")) { char[] srcChar; srcChar = src.toCharArray(); @@ -95,7 +116,7 @@ public class Pinyin4jUtil { } if (!isFullSpell) { - if (i == 0) { + if (i < preFont) { temp[i] = temp[i]; } else { String[] tTemps = new String[temp[i].length]; @@ -167,4 +188,9 @@ public class Pinyin4jUtil { return strJaggedArray; } } + + public static void main(String[] args) { + System.out.println(getFirstSpellPinYin("区直部门",false)); + System.out.println(getSpellPinYin("党员提出话题数",false,4)); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml index 115e0ae4e3..a1694d1104 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml @@ -114,24 +114,24 @@ - select ID, INDEX_GROUP_ID, INDEX_ID, INDEX_CODE, WEIGHT, THRESHOLD FROM index_group_detail - where STATUS = 'enable' and DEL_FLAG = '0' + select + ID, INDEX_GROUP_ID, INDEX_ID, INDEX_CODE, WEIGHT, THRESHOLD + FROM index_group_detail + WHERE + CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} and STATUS = 'enable' and DEL_FLAG = '0' + and ALL_PARENT_INDEX_CODE = #{indexCode,jdbcType=VARCHAR} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailTemplateDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailTemplateDao.xml index 8ec562b386..5aacdd4b1b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailTemplateDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailTemplateDao.xml @@ -7,7 +7,7 @@ delete from index_group_detail_template From c3ea5ca22b8e8dad84e556756643d2927a6a3c65 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 27 Aug 2020 17:35:16 +0800 Subject: [PATCH 079/226] =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/screen/impl/IndexGroupDetailServiceImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailServiceImpl.java index 6c22b360d6..0225c956c5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailServiceImpl.java @@ -46,7 +46,6 @@ public class IndexGroupDetailServiceImpl extends BaseServiceImpl Date: Thu, 27 Aug 2020 17:39:33 +0800 Subject: [PATCH 080/226] =?UTF-8?q?11=E3=80=81=E5=9F=BA=E5=B1=82=E6=B2=BB?= =?UTF-8?q?=E7=90=86-=E5=85=AC=E4=BC=97=E5=8F=82=E4=B8=8E=20=E9=99=A4?= =?UTF-8?q?=E6=95=B0bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/screen/impl/ScreenCollServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java index 1411cd9c00..c7650aa185 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java @@ -410,6 +410,9 @@ public class ScreenCollServiceImpl implements ScreenCollService { * @Date 15:38 2020-08-21 **/ private BigDecimal calculateGrowthRateNumber(Integer old, Integer now){ + if (NumConstant.ZERO == old){ + return new BigDecimal(now * NumConstant.ONE_HUNDRED); + } BigDecimal bignum1 = new BigDecimal((now - old) * NumConstant.ONE_HUNDRED); BigDecimal bignum2 = bignum1.divide(new BigDecimal(old),2,BigDecimal.ROUND_HALF_UP); return bignum2; From 1b8070b3f33f2b63e5c0cd5a08e1de8cbb95b838 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 27 Aug 2020 21:22:36 +0800 Subject: [PATCH 081/226] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=AD=A3=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=20=E9=BB=98=E8=AE=A4=E6=AD=A3=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E7=AD=89=E6=96=87=E4=BB=B6=E7=94=9F=E6=88=90=E5=90=8E=E5=86=8D?= =?UTF-8?q?=E5=A4=84=E7=90=86=E8=B4=9F=E7=9B=B8=E5=85=B3=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FactIndexPartyAblityCpcMonthlyDao.java | 2 +- .../com/epmet/entity/screen/IndexDictEntity.java | 4 ++++ .../entity/screen/IndexGroupDetailEntity.java | 5 +++++ .../screen/IndexGroupDetailTemplateEntity.java | 5 +++++ .../com/epmet/model/IndexExcelDataListener.java | 15 +++++++++++++-- .../src/main/java/com/epmet/model/IndexModel.java | 5 +++++ .../screen/impl/CpcIndexCalculateServiceImpl.java | 3 +-- .../screen/impl/IndexCalculateServiceImpl.java | 5 +++-- .../FactIndexPartyAblityCpcMonthlyDao.xml | 2 +- 9 files changed, 38 insertions(+), 8 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java index 7208c093aa..f9c0ad1af2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java @@ -70,7 +70,7 @@ public interface FactIndexPartyAblityCpcMonthlyDao extends BaseDao list, @Param("customerId") String customerId); - List getCountByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); + Map getCountByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); Map getExtremeValue(@Param("customerId") String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexDictEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexDictEntity.java index 2ea5745dba..299a1dca5c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexDictEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexDictEntity.java @@ -50,4 +50,8 @@ public class IndexDictEntity extends BaseEpmetEntity { */ private String level; + /** + * 正相关:positive;负相关:negative + */ + private String correlation; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailEntity.java index a789ae51e7..ba9d1a3b09 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailEntity.java @@ -77,4 +77,9 @@ public class IndexGroupDetailEntity extends BaseEpmetEntity { */ private String allParentIndexCode; + /** + * 正相关:positive;负相关:negative + */ + private String correlation; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailTemplateEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailTemplateEntity.java index d847f654c6..bedab6e7f7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailTemplateEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailTemplateEntity.java @@ -72,4 +72,9 @@ public class IndexGroupDetailTemplateEntity extends BaseEpmetEntity { */ private String allParentIndexCode; + /** + * 正相关:positive;负相关:negative + */ + private String correlation; + } 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 a4993cf00b..24770d1bd2 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 @@ -29,6 +29,7 @@ import java.util.stream.Collectors; */ public class IndexExcelDataListener extends AnalysisEventListener { private static final Logger LOGGER = LoggerFactory.getLogger(IndexExcelDataListener.class); + private String POSITIVE = "positive"; /** * 每隔5条存储数据库,实际使用中可以3000条,然后清理list ,方便内存回收 */ @@ -85,6 +86,8 @@ public class IndexExcelDataListener extends AnalysisEventListener { data.setWeight(preWheight); } LOGGER.info("解析到一条数据:{}", JSON.toJSONString(data)); + //TODO 默认正相关 + data.setCorrelation(POSITIVE); IndexDictEntity entity = new IndexDictEntity(); IndexDictEntity entity2 = new IndexDictEntity(); @@ -144,6 +147,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { templateEntity.setIndexId(indexDictEntity.getId()); templateEntity.setAllParentIndexCode(allIndexCodeSb.toString()); templateEntity.setId(UniqueIdGenerator.generate()); + templateEntity.setCorrelation(index.getCorrelation()); buildIndexGroupDetail(templateEntity,indexDictEntity, index, group1, 2); indexGroupDetailMap.put(index.getLevel1Index()+level4Index,templateEntity); } @@ -156,10 +160,10 @@ public class IndexExcelDataListener extends AnalysisEventListener { if (templateEntity == null) { templateEntity = new IndexGroupDetailTemplateEntity(); templateEntity.setIndexGroupId(group2.getId()); - System.out.println("=========="+group2.getId()); templateEntity.setIndexId(indexDictEntity.getId()); templateEntity.setAllParentIndexCode(allIndexCodeSb.toString()); templateEntity.setId(UniqueIdGenerator.generate()); + templateEntity.setCorrelation(index.getCorrelation()); buildIndexGroupDetail(templateEntity,indexDictEntity, index, group2, 5); indexGroupDetailMap.put(index.getLevel1Index()+index.getLevel5Index(),templateEntity); } @@ -198,6 +202,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { templateEntity.setIndexId(indexDictEntity.getId()); templateEntity.setAllParentIndexCode(allIndexCodeSb.toString()); templateEntity.setId(UniqueIdGenerator.generate()); + templateEntity.setCorrelation(index.getCorrelation()); buildIndexGroupDetail(templateEntity,indexDictEntity, index, group1, 2); indexGroupDetailMap.put(level2Index,templateEntity); } @@ -212,7 +217,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { templateEntity.setIndexId(indexDictEntity.getId()); templateEntity.setAllParentIndexCode(allIndexCodeSb.toString()); templateEntity.setId(UniqueIdGenerator.generate()); - + templateEntity.setCorrelation(index.getCorrelation()); buildIndexGroupDetail(templateEntity, indexDictEntity, index, group2, 5); indexGroupDetailMap.put(index.getLevel1Index()+index.getLevel5Index(),templateEntity); } @@ -240,33 +245,39 @@ public class IndexExcelDataListener extends AnalysisEventListener { } private void buildIndexDicEntity(IndexModel data, IndexDictEntity entity, IndexDictEntity entity2, IndexDictEntity entity3, IndexDictEntity entity4, IndexDictEntity entity5) { + if (!indexDicMap.containsKey(data.getLevel1Index())) { entity.setId(UniqueIdGenerator.generate()); entity.setIndexName(data.getLevel1Index()); + entity.setCorrelation(data.getCorrelation()); entity.setLevel("1"); indexDicMap.put(data.getLevel1Index(), entity); } if (!indexDicMap.containsKey(data.getLevel2Index())) { entity2.setId(UniqueIdGenerator.generate()); entity2.setIndexName(data.getLevel2Index()); + entity2.setCorrelation(data.getCorrelation()); entity2.setLevel("2"); indexDicMap.put(data.getLevel2Index(), entity2); } if (!indexDicMap.containsKey(data.getLevel3Index())) { entity3.setId(UniqueIdGenerator.generate()); entity3.setIndexName(data.getLevel3Index()); + entity3.setCorrelation(data.getCorrelation()); entity3.setLevel("3"); indexDicMap.put(data.getLevel3Index(), entity3); } if (!indexDicMap.containsKey(data.getLevel4Index())) { entity4.setId(UniqueIdGenerator.generate()); entity4.setIndexName(data.getLevel4Index()); + entity4.setCorrelation(data.getCorrelation()); entity4.setLevel("4"); indexDicMap.put(data.getLevel4Index(), entity4); } if (!indexDicMap.containsKey(data.getLevel5Index())) { entity5.setId(UniqueIdGenerator.generate()); entity5.setIndexName(data.getLevel5Index()); + entity5.setCorrelation(data.getCorrelation()); entity5.setLevel("5"); indexDicMap.put(data.getLevel5Index(), entity5); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java index f264a2c39e..5ff0b19267 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java @@ -23,4 +23,9 @@ public class IndexModel { private String level5Weight; @ExcelProperty(value = "阈值") private String threshold; + /** + * 正相关:positive;负相关:negative + */ + @ExcelProperty(value = "相关性") + private String correlation; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/CpcIndexCalculateServiceImpl.java index 4b26ff128c..476eacb60c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/CpcIndexCalculateServiceImpl.java @@ -5,7 +5,6 @@ import com.epmet.dao.indexcoll.FactIndexPartyAblityCpcMonthlyDao; import com.epmet.dao.screen.IndexCodeFieldReDao; import com.epmet.dao.screen.IndexGroupDetailDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; -import com.epmet.entity.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; import com.epmet.entity.screen.IndexGroupDetailEntity; import com.epmet.eum.IndexCodeEnum; import com.epmet.service.screen.CpcIndexCalculateService; @@ -43,7 +42,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { } log.info(JSON.toJSONString(minAndMaxList)); - List list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId()); + Map list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId()); return null; } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java index d51cf3ea88..4163ea074c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java @@ -7,7 +7,6 @@ import com.epmet.dao.screen.IndexGroupDao; import com.epmet.dao.screen.IndexGroupDetailDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.screen.form.IndexCalculateForm; -import com.epmet.entity.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.service.indexcal.GridCorreLationService; import com.epmet.service.screen.IndexCalculateService; @@ -18,8 +17,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import java.math.BigDecimal; import java.util.Date; import java.util.List; +import java.util.Map; /** * @author liujianjun @@ -57,7 +58,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { CalculateCommonFormDTO calculateCommonFormDTO=new CalculateCommonFormDTO(customerId, formDTO.getMonthId()); //计算党员 try { - List list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(customerId, formDTO.getMonthId()); + Map list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(customerId, formDTO.getMonthId()); } catch (Exception e) { } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml index a1694d1104..769689fa7f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml @@ -94,7 +94,7 @@ - SELECT CREATE_TOPIC_COUNT, JOIN_TOPIC_COUNT, From 589ad1879ec5890672f5e48069650538c88097bf Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 27 Aug 2020 22:01:45 +0800 Subject: [PATCH 082/226] =?UTF-8?q?=E6=96=B0=E5=A2=9EBigDecimal=E5=88=86?= =?UTF-8?q?=E5=80=BC=E8=AE=A1=E7=AE=97=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BigDecimalScoreCalculator.java | 80 +++++++++++++++++++ .../stats/test/normalizing/DemoScoreCal.java | 26 ++++++ 2 files changed, 106 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/BigDecimalScoreCalculator.java diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/BigDecimalScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/BigDecimalScoreCalculator.java new file mode 100644 index 0000000000..1655c73a6d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/BigDecimalScoreCalculator.java @@ -0,0 +1,80 @@ +package com.epmet.support.normalizing; + +import java.math.BigDecimal; +import java.util.List; + +/** + * BigDecimal的分值计算 + * 每一种数据类型的计算都要继承ScoreCalculator并且实现其抽象方法,实现数据类型的转换 + */ +public class BigDecimalScoreCalculator extends ScoreCalculator { + + /** + * 初始化基于原数组的整数分值计算 + * ☆☆☆ 务必在该构造方法最后调用父类的prepare()方法 ☆☆☆ + * @param sourceArray 源数据完整数组 + * @param minScore 分值区间的左边界 + * @param maxScore 分值区间的右边界 + * @param correlation 相关性 + */ + public BigDecimalScoreCalculator(BigDecimal[] sourceArray, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { + this.sourceArrary = sourceArray.clone(); + this.minScore = minScore; + this.maxScore = maxScore; + this.correlation = correlation; + prepare4SourceArray(); + System.out.println("最小值:"+minScore+";最大值:"+maxScore); + } + + /** + * 初始化基于原数组的整数分值计算 + * @param sourceList 源数据完整列表 + * @param minScore 分值区间的左边界 + * @param maxScore 分值区间的右边界 + * @param correlation 相关性 + */ + public BigDecimalScoreCalculator(List sourceList, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { + this.sourceArrary = sourceList.toArray(); + this.minScore = minScore; + this.maxScore = maxScore; + this.correlation = correlation; + prepare4SourceArray(); + System.out.println("最小值:"+minScore+";最大值:"+maxScore); + } + + /** + * 初始化基于边界值的整数分值计算 + * @param minSourceValue 左边界值 + * @param maxSourceValue 右边界值 + * @param minScore 分值区间的左边界 + * @param maxScore 分值区间的右边界 + * @param correlation 相关性 + */ + public BigDecimalScoreCalculator(BigDecimal minSourceValue, BigDecimal maxSourceValue, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { + + this.minScore = minScore; + this.maxScore = maxScore; + this.minValue = minSourceValue; + this.maxValue = maxSourceValue; + this.correlation = correlation; + prepare4BoundaryValue(); + System.out.println("最小值:"+minScore+";最大值:"+maxScore); + } + + @Override + public BigDecimal getMaxFromSourceArray() { + BigDecimal[] intSourceArrary = (BigDecimal[]) this.sourceArrary; + return intSourceArrary[intSourceArrary.length - 1]; + } + + @Override + public BigDecimal getMinFromSourceArray() { + BigDecimal[] intSourceArrary = (BigDecimal[]) this.sourceArrary; + return intSourceArrary[0]; + } + + @Override + public BigDecimal convertValue2BigDecimal(Object sourceValue) { + return (BigDecimal) sourceValue; + } +} 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 1bb7514d5a..fb3f1246d4 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 @@ -91,5 +91,31 @@ public class DemoScoreCal { System.err.println("--------------------------------"); } + @Test + public void testBigDecimalBatchCalculate() throws InterruptedException { + //{4,8,1,3,2} + + // 每个指标需要单独的分支计算器,因为每个指标的最大最小值是不同的 + ScoreCalculator sc1 = new BigDecimalScoreCalculator(new BigDecimal(1), new BigDecimal(8), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.NEGATIVE); + ScoreCalculator sc2 = new BigDecimalScoreCalculator(new BigDecimal(1), new BigDecimal(8), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.NEGATIVE); + + List index1SampleValues = Arrays.asList(new SampleValue<>("id1", new BigDecimal(4)), new SampleValue<>("id2", new BigDecimal(1)), new SampleValue<>("id3", new BigDecimal(8))); + 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(1), sc1); + IndexInputVO index2VO = new IndexInputVO("bbb", index2SampleValues, new BigDecimal(1), sc2); + + List indexInputVOS = Arrays.asList(index1VO, index2VO); + + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + List result = batchScoreCalculator.exec(indexInputVOS); + + System.err.println("--------------------------------"); + result.stream().forEach(r -> System.out.println(r)); + Thread.sleep(10); + System.err.println("--------------------------------"); + } + } From 68b450936f64ecbd10f3c69e5b3656cb8ec3cfaf Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 28 Aug 2020 09:36:29 +0800 Subject: [PATCH 083/226] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=A0=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/screen/constant/ScreenConstant.java | 4 ++++ .../datareport/service/screen/impl/AgencyServiceImpl.java | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/constant/ScreenConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/constant/ScreenConstant.java index b03dbe6466..b1a25cf947 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/constant/ScreenConstant.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/constant/ScreenConstant.java @@ -12,4 +12,8 @@ public interface ScreenConstant { String RATIO = "%"; + String SQUARE_BRACKETS = "[]"; + + String COMMA = ","; + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java index 8ee16c42f6..0727ebfbde 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java @@ -72,12 +72,12 @@ public class AgencyServiceImpl implements AgencyService { * @date 2020/8/26 5:18 下午 */ public List getCenterMark(String centerMark){ - if (centerMark.length() == NumConstant.ZERO) { + if (centerMark.length() == NumConstant.ZERO || centerMark.equals(ScreenConstant.SQUARE_BRACKETS)) { return new ArrayList<>(); } List result = new ArrayList<>(); - String substring = centerMark.substring(2, centerMark.length() - 2); - String[] split = substring.split(","); + String substring = centerMark.substring(NumConstant.TWO, centerMark.length() - NumConstant.TWO); + String[] split = substring.split(ScreenConstant.COMMA); for (String s : split) { result.add(Double.valueOf(s)); } From bba89ee8ca908d7aabf00aa847b503ded5976589 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 28 Aug 2020 10:40:40 +0800 Subject: [PATCH 084/226] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/screen/dto/form/ProjectDetailFormDTO.java | 6 ++++++ .../com/epmet/datareport/dao/screen/ScreenEventDataDao.java | 2 +- .../service/screen/impl/ScreenProjectServiceImpl.java | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/ProjectDetailFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/ProjectDetailFormDTO.java index 32359cb03e..88744ad004 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/ProjectDetailFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/ProjectDetailFormDTO.java @@ -21,4 +21,10 @@ public class ProjectDetailFormDTO implements Serializable { */ @NotBlank(message = "项目ID不能为空",groups = {ProjectDetail.class}) private String projectId; + + /** + * 机关iD + */ + @NotBlank(message = "机关ID不能为空",groups = {ProjectDetail.class}) + private String agencyId; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventDataDao.java index 92f1641cce..24604bf1de 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventDataDao.java @@ -47,6 +47,6 @@ public interface ScreenEventDataDao{ * @author zxc * @date 2020/8/19 4:36 下午 */ - ProjectDetailResultDTO selectEventDetail(@Param("projectId")String projectId); + ProjectDetailResultDTO selectEventDetail(@Param("projectId")String projectId,@Param("agencyId")String agencyId); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/ScreenProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/ScreenProjectServiceImpl.java index dce609636d..e617449458 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/ScreenProjectServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/ScreenProjectServiceImpl.java @@ -35,7 +35,7 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) @Override public ProjectDetailResultDTO projectDetail(ProjectDetailFormDTO projectDetailFormDTO) { - ProjectDetailResultDTO projectDetailResultDTO = screenEventDataDao.selectEventDetail(projectDetailFormDTO.getProjectId()); + ProjectDetailResultDTO projectDetailResultDTO = screenEventDataDao.selectEventDetail(projectDetailFormDTO.getProjectId(),projectDetailFormDTO.getAgencyId()); if (null == projectDetailResultDTO){ return new ProjectDetailResultDTO(); } From d4306676d4f3be1aa626c32c53c32b6eefa233e1 Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 28 Aug 2020 14:05:05 +0800 Subject: [PATCH 085/226] =?UTF-8?q?=E6=8C=87=E6=A0=87=E8=AE=A1=E7=AE=97red?= =?UTF-8?q?iskey?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/redis/RedisKeys.java | 8 +++ .../controller/IndexCalculateController.java | 2 +- .../epmet/dao/screen/IndexCodeFieldReDao.java | 4 ++ .../epmet/redis/IndexCodeFieldReRedis.java | 54 +++++++++++++++++++ .../CpcIndexCalculateService.java | 2 +- .../indexcal/IndexCodeFieldReService.java | 17 ++++++ .../impl/CpcIndexCalculateServiceImpl.java | 11 ++-- .../impl/GridCorreLationServiceImpl.java | 5 +- .../impl/IndexCodeFieldReServiceImpl.java | 28 ++++++++++ .../mapper/screen/IndexCodeFieIdReDao.xml | 4 ++ 10 files changed, 124 insertions(+), 11 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/redis/IndexCodeFieldReRedis.java rename epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/{screen => indexcal}/CpcIndexCalculateService.java (90%) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/IndexCodeFieldReService.java rename epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/{screen => indexcal}/impl/CpcIndexCalculateServiceImpl.java (79%) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCodeFieldReServiceImpl.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index a5be29eb58..0d623e2010 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -297,4 +297,12 @@ public class RedisKeys { public static String getExternalAppSecretKey(String appId) { return String.format(rootPrefix+"externalapp:secret:%s",appId); } + + /** + * 计算指标时获取指标code和fields关系缓存Key + * @return + */ + public static String getIndexCodeFieldReKey() { + return rootPrefix.concat("data:index:indexcode:field"); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java index 4117f6dc75..c2211c0d80 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java @@ -4,7 +4,7 @@ import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.screen.form.IndexCalculateForm; -import com.epmet.service.screen.CpcIndexCalculateService; +import com.epmet.service.indexcal.CpcIndexCalculateService; import com.epmet.service.screen.IndexCalculateService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexCodeFieldReDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexCodeFieldReDao.java index edd402249f..3088f29531 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexCodeFieldReDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexCodeFieldReDao.java @@ -4,6 +4,10 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.screen.IndexCodeFieldReEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.Map; + @Mapper public interface IndexCodeFieldReDao extends BaseDao { + Map getAllData(); + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/redis/IndexCodeFieldReRedis.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/redis/IndexCodeFieldReRedis.java new file mode 100644 index 0000000000..2863952420 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/redis/IndexCodeFieldReRedis.java @@ -0,0 +1,54 @@ +/** + * 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.redis; + +import com.epmet.commons.tools.redis.RedisKeys; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.HashOperations; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Component; + +import java.util.Map; +import java.util.concurrent.TimeUnit; + +@Slf4j +@Component +public class IndexCodeFieldReRedis { + @Autowired + private RedisTemplate redisTemplate; + + + /** + * @Description 获取指标code和字段Id的关系 + */ + public Map getIndexCodeFiledReMap() { + HashOperations hashOperations = redisTemplate.opsForHash(); + Map values = hashOperations.entries(RedisKeys.getIndexCodeFieldReKey()); + return values; + } + + /** + * @Description 存入指标code和字段Id的关系 + */ + public void setIndexCodeFiledReMap(Map records) { + HashOperations hashOperations = redisTemplate.opsForHash(); + hashOperations.putAll(RedisKeys.getIndexCodeFieldReKey(), records); + redisTemplate.expire(RedisKeys.getIndexCodeFieldReKey(), 1, TimeUnit.DAYS); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/CpcIndexCalculateService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/CpcIndexCalculateService.java similarity index 90% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/CpcIndexCalculateService.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/CpcIndexCalculateService.java index bb4bc6e397..d65f6d43db 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/CpcIndexCalculateService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/CpcIndexCalculateService.java @@ -1,4 +1,4 @@ -package com.epmet.service.screen; +package com.epmet.service.indexcal; import com.epmet.dto.indexcal.CalculateCommonFormDTO; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/IndexCodeFieldReService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/IndexCodeFieldReService.java new file mode 100644 index 0000000000..d8a40a8a52 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/IndexCodeFieldReService.java @@ -0,0 +1,17 @@ +package com.epmet.service.indexcal; + +import java.util.Map; + +/** + * 党员指标计算service + * + * @author liujianjun@elink-cn.com + * @date 2020/8/18 10:25 + */ +public interface IndexCodeFieldReService { + /** + * desc:获取指标code对应的字段值 + * @return + */ + Map getIndexCodeFieldReList(); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java similarity index 79% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/CpcIndexCalculateServiceImpl.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java index 476eacb60c..46a25bb129 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -1,13 +1,13 @@ -package com.epmet.service.screen.impl; +package com.epmet.service.indexcal.impl; import com.alibaba.fastjson.JSON; import com.epmet.dao.indexcoll.FactIndexPartyAblityCpcMonthlyDao; import com.epmet.dao.screen.IndexCodeFieldReDao; -import com.epmet.dao.screen.IndexGroupDetailDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.entity.screen.IndexGroupDetailEntity; import com.epmet.eum.IndexCodeEnum; -import com.epmet.service.screen.CpcIndexCalculateService; +import com.epmet.service.indexcal.CpcIndexCalculateService; +import com.epmet.service.screen.IndexGroupDetailService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -25,7 +25,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { @Autowired private IndexCodeFieldReDao indexCodeFieldReDao; @Autowired - private IndexGroupDetailDao indexGroupDetailDao; + private IndexGroupDetailService getDetailListByParentCode; @Override public Boolean cpcIndexCalculate(CalculateCommonFormDTO formDTO) { //计算最大最小值 @@ -35,12 +35,13 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { return false; } //获取指标权重信息 - List indexDetails = indexGroupDetailDao.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); + List indexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(),IndexCodeEnum.CAN_YU_YI_SHI.getCode()); if (CollectionUtils.isEmpty(indexDetails)){ log.warn("customerId:{} have not any indexGroupDetail",formDTO.getCustomerId()); return false; } + log.info(JSON.toJSONString(minAndMaxList)); Map list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId()); return null; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java index 96b82127c6..8a922020fa 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java @@ -9,9 +9,6 @@ import com.epmet.dto.ScreenCustomerGridDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.CustomerGridInfoDTO; import com.epmet.dto.indexcal.PageQueryGridFormDTO; -import com.epmet.dto.indexcollect.FactIndexGovrnAblityGridMonthlyDTO; -import com.epmet.dto.indexcollect.FactIndexPartyAblityGridMonthlyDTO; -import com.epmet.dto.indexcollect.FactIndexServiceAblityGridMonthlyDTO; import com.epmet.entity.screen.IndexGroupDetailEntity; import com.epmet.eum.IndexCodeEnum; import com.epmet.service.indexcal.GridCorreLationService; @@ -22,7 +19,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import java.math.BigDecimal; import java.util.List; import java.util.Map; @@ -160,6 +156,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { * @description 分页查询网格列表 * @Date 2020/8/27 14:42 **/ + @Override public List pageGridList(PageQueryGridFormDTO formDTO){ int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); formDTO.setPageIndex(pageIndex); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCodeFieldReServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCodeFieldReServiceImpl.java new file mode 100644 index 0000000000..047973e066 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCodeFieldReServiceImpl.java @@ -0,0 +1,28 @@ +package com.epmet.service.indexcal.impl; + +import com.epmet.dao.screen.IndexCodeFieldReDao; +import com.epmet.redis.IndexCodeFieldReRedis; +import com.epmet.service.indexcal.IndexCodeFieldReService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.Map; + +@Service +public class IndexCodeFieldReServiceImpl implements IndexCodeFieldReService { + @Autowired + private IndexCodeFieldReDao indexCodeFieldReDao; + + @Autowired + private IndexCodeFieldReRedis indexCodeFieldReRedis; + @Override + public Map getIndexCodeFieldReList() { + Map indexCodeFiledReMap = indexCodeFieldReRedis.getIndexCodeFiledReMap(); + if (CollectionUtils.isEmpty(indexCodeFiledReMap)){ + indexCodeFiledReMap = indexCodeFieldReDao.getAllData(); + indexCodeFieldReRedis.setIndexCodeFiledReMap(indexCodeFiledReMap); + } + return indexCodeFiledReMap; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexCodeFieIdReDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexCodeFieIdReDao.xml index 4186e0e155..c903e17583 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexCodeFieIdReDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexCodeFieIdReDao.xml @@ -3,4 +3,8 @@ + + \ No newline at end of file From 515652ea8128ce102c7d61f4deaf012f17632b2a Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 28 Aug 2020 14:08:57 +0800 Subject: [PATCH 086/226] =?UTF-8?q?=E6=8C=87=E6=A0=87=E8=AE=A1=E7=AE=97red?= =?UTF-8?q?iskey?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/indexcal/IndexCodeFieldReService.java | 2 +- .../indexcal/impl/CpcIndexCalculateServiceImpl.java | 7 +++++++ .../service/indexcal/impl/IndexCodeFieldReServiceImpl.java | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/IndexCodeFieldReService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/IndexCodeFieldReService.java index d8a40a8a52..ef21e6d023 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/IndexCodeFieldReService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/IndexCodeFieldReService.java @@ -13,5 +13,5 @@ public interface IndexCodeFieldReService { * desc:获取指标code对应的字段值 * @return */ - Map getIndexCodeFieldReList(); + Map getIndexCodeFieldReMap(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java index 46a25bb129..8a6de15483 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -7,6 +7,7 @@ import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.entity.screen.IndexGroupDetailEntity; import com.epmet.eum.IndexCodeEnum; import com.epmet.service.indexcal.CpcIndexCalculateService; +import com.epmet.service.indexcal.IndexCodeFieldReService; import com.epmet.service.screen.IndexGroupDetailService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -26,6 +27,8 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { private IndexCodeFieldReDao indexCodeFieldReDao; @Autowired private IndexGroupDetailService getDetailListByParentCode; + @Autowired + private IndexCodeFieldReService indexCodeFieldReService; @Override public Boolean cpcIndexCalculate(CalculateCommonFormDTO formDTO) { //计算最大最小值 @@ -40,7 +43,11 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { log.warn("customerId:{} have not any indexGroupDetail",formDTO.getCustomerId()); return false; } + Map indexCodeFieldReList = indexCodeFieldReService.getIndexCodeFieldReMap(); + if (CollectionUtils.isEmpty(indexCodeFieldReList)) + indexDetails.forEach(indexDetail->{ + }); log.info(JSON.toJSONString(minAndMaxList)); Map list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCodeFieldReServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCodeFieldReServiceImpl.java index 047973e066..bc89fd6121 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCodeFieldReServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCodeFieldReServiceImpl.java @@ -17,7 +17,7 @@ public class IndexCodeFieldReServiceImpl implements IndexCodeFieldReService { @Autowired private IndexCodeFieldReRedis indexCodeFieldReRedis; @Override - public Map getIndexCodeFieldReList() { + public Map getIndexCodeFieldReMap() { Map indexCodeFiledReMap = indexCodeFieldReRedis.getIndexCodeFiledReMap(); if (CollectionUtils.isEmpty(indexCodeFiledReMap)){ indexCodeFiledReMap = indexCodeFieldReDao.getAllData(); From 756be3e5f0e3147633d8531c55f234d5e0f4327d Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 28 Aug 2020 14:19:14 +0800 Subject: [PATCH 087/226] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E6=8C=87=E6=A0=87cod?= =?UTF-8?q?e=E8=8E=B7=E5=8F=96feild?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/indexcal/IndexCodeFieldReService.java | 7 +++++++ .../indexcal/impl/CpcIndexCalculateServiceImpl.java | 9 ++++++--- .../indexcal/impl/IndexCodeFieldReServiceImpl.java | 12 +++++++++++- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/IndexCodeFieldReService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/IndexCodeFieldReService.java index ef21e6d023..e54f182903 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/IndexCodeFieldReService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/IndexCodeFieldReService.java @@ -14,4 +14,11 @@ public interface IndexCodeFieldReService { * @return */ Map getIndexCodeFieldReMap(); + + /** + * desc:根据指标code获取 对应的字段 + * @param indexCode + * @return + */ + String getFieldNameByIndexCode(String indexCode); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java index 8a6de15483..b03b0f948d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -34,17 +34,20 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { //计算最大最小值 Map minAndMaxList = factIndexPartyAblityCpcMonthlyDao.getExtremeValue(formDTO.getCustomerId()); if (CollectionUtils.isEmpty(minAndMaxList)){ - log.warn("customerId:{} have not any fact record",formDTO.getCustomerId()); + log.warn("cpcIndexCalculate customerId:{} have not any fact record",formDTO.getCustomerId()); return false; } //获取指标权重信息 List indexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(),IndexCodeEnum.CAN_YU_YI_SHI.getCode()); if (CollectionUtils.isEmpty(indexDetails)){ - log.warn("customerId:{} have not any indexGroupDetail",formDTO.getCustomerId()); + log.warn("cpcIndexCalculate customerId:{} have not any indexGroupDetail",formDTO.getCustomerId()); return false; } Map indexCodeFieldReList = indexCodeFieldReService.getIndexCodeFieldReMap(); - if (CollectionUtils.isEmpty(indexCodeFieldReList)) + if (CollectionUtils.isEmpty(indexCodeFieldReList)){ + log.warn("cpcIndexCalculate have any indexcodefieldre"); + return false; + } indexDetails.forEach(indexDetail->{ }); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCodeFieldReServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCodeFieldReServiceImpl.java index bc89fd6121..46ecffbcae 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCodeFieldReServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCodeFieldReServiceImpl.java @@ -16,13 +16,23 @@ public class IndexCodeFieldReServiceImpl implements IndexCodeFieldReService { @Autowired private IndexCodeFieldReRedis indexCodeFieldReRedis; + @Override public Map getIndexCodeFieldReMap() { Map indexCodeFiledReMap = indexCodeFieldReRedis.getIndexCodeFiledReMap(); - if (CollectionUtils.isEmpty(indexCodeFiledReMap)){ + if (CollectionUtils.isEmpty(indexCodeFiledReMap)) { indexCodeFiledReMap = indexCodeFieldReDao.getAllData(); indexCodeFieldReRedis.setIndexCodeFiledReMap(indexCodeFiledReMap); } return indexCodeFiledReMap; } + + @Override + public String getFieldNameByIndexCode(String indexCode) { + Map indexCodeFieldReMap = this.getIndexCodeFieldReMap(); + if (CollectionUtils.isEmpty(indexCodeFieldReMap)) { + return null; + } + return indexCodeFieldReMap.get(indexCode); + } } From 59ddb2ef4e1cbd626b21528e1734f88aff2be662 Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 28 Aug 2020 14:44:06 +0800 Subject: [PATCH 088/226] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E6=8C=87=E6=A0=87cod?= =?UTF-8?q?e=E8=8E=B7=E5=8F=96feild?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dao/screen/IndexCodeFieldReDao.java | 4 ++-- .../indexcal/impl/CpcIndexCalculateServiceImpl.java | 8 ++++++-- .../indexcal/impl/IndexCodeFieldReServiceImpl.java | 10 +++++++++- .../indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml | 4 ++++ .../resources/mapper/screen/IndexCodeFieIdReDao.xml | 5 +++-- 5 files changed, 24 insertions(+), 7 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexCodeFieldReDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexCodeFieldReDao.java index 3088f29531..25e10869ed 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexCodeFieldReDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexCodeFieldReDao.java @@ -4,10 +4,10 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.screen.IndexCodeFieldReEntity; import org.apache.ibatis.annotations.Mapper; -import java.util.Map; +import java.util.List; @Mapper public interface IndexCodeFieldReDao extends BaseDao { - Map getAllData(); + List getAllData(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java index b03b0f948d..0367e90137 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -48,9 +48,13 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { log.warn("cpcIndexCalculate have any indexcodefieldre"); return false; } - indexDetails.forEach(indexDetail->{ + String indexCode = null; + String fieldName = null; + for (IndexGroupDetailEntity indexDetail : indexDetails) { + indexCode = indexDetail.getIndexCode(); + fieldName = indexCodeFieldReService.getFieldNameByIndexCode(indexCode); - }); + } log.info(JSON.toJSONString(minAndMaxList)); Map list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCodeFieldReServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCodeFieldReServiceImpl.java index 46ecffbcae..94189a9c77 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCodeFieldReServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCodeFieldReServiceImpl.java @@ -1,13 +1,17 @@ package com.epmet.service.indexcal.impl; import com.epmet.dao.screen.IndexCodeFieldReDao; +import com.epmet.entity.screen.IndexCodeFieldReEntity; import com.epmet.redis.IndexCodeFieldReRedis; import com.epmet.service.indexcal.IndexCodeFieldReService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import java.util.HashMap; +import java.util.List; import java.util.Map; +import java.util.stream.Collectors; @Service public class IndexCodeFieldReServiceImpl implements IndexCodeFieldReService { @@ -21,7 +25,11 @@ public class IndexCodeFieldReServiceImpl implements IndexCodeFieldReService { public Map getIndexCodeFieldReMap() { Map indexCodeFiledReMap = indexCodeFieldReRedis.getIndexCodeFiledReMap(); if (CollectionUtils.isEmpty(indexCodeFiledReMap)) { - indexCodeFiledReMap = indexCodeFieldReDao.getAllData(); + List allData = indexCodeFieldReDao.getAllData(); + if (CollectionUtils.isEmpty(allData)){ + return new HashMap<>(); + } + indexCodeFiledReMap = allData.stream().collect(Collectors.toMap(IndexCodeFieldReEntity::getIndexCode, o -> o.getFieldId())); indexCodeFieldReRedis.setIndexCodeFiledReMap(indexCodeFiledReMap); } return indexCodeFiledReMap; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml index 769689fa7f..41946192dd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml @@ -96,6 +96,10 @@ - SELECT INDEX_CODE,FIELD_ID FROM index_code_field_re WHERE DEL_FLAG = '0'; + + \ No newline at end of file From 8cc20b87391d1064e30f1e0d95314a15d06c02fe Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 28 Aug 2020 16:40:28 +0800 Subject: [PATCH 089/226] =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FactIndexCommunityGovrnFiveScoreDTO.java | 107 ++++++++++ .../FactIndexCommunityPartyFiveScoreDTO.java | 98 +++++++++ .../screen/FactIndexCommunityScoreDTO.java | 107 ++++++++++ ...FactIndexCommunityServiceFiveScoreDTO.java | 107 ++++++++++ .../dto/screen/FactIndexGridScoreDTO.java | 112 ++++++++++ ...munityGovernAbilityCalculateResultDTO.java | 45 ++++ .../CommunityGovernAbilityResultDTO.java | 68 ++++++ ...PublishArticleCountCalculateResultDTO.java | 45 ++++ ...CommunityPublishArticleCountResultDTO.java | 54 +++++ .../result/MaxAndMinDoubleResultDTO.java | 25 +++ .../result/MaxAndMinIntegerResultDTO.java | 25 +++ .../result/SubGridPartyAvgResultDTO.java | 47 +++++ .../java/com/epmet/DataStatsApplication.java | 2 +- .../com/epmet/controller/DemoController.java | 10 + .../FactIndexGovrnAblityOrgMonthlyDao.java | 10 + .../FactIndexPartyAblityOrgMonthlyDao.java | 10 + .../FactIndexCommunityGovrnFiveScoreDao.java | 33 +++ .../FactIndexCommunityPartyFiveScoreDao.java | 45 ++++ .../screen/FactIndexCommunityScoreDao.java | 33 +++ ...FactIndexCommunityServiceFiveScoreDao.java | 33 +++ .../dao/screen/FactIndexGridScoreDao.java | 46 +++++ ...actIndexCommunityGovrnFiveScoreEntity.java | 77 +++++++ ...actIndexCommunityPartyFiveScoreEntity.java | 77 +++++++ .../screen/FactIndexCommunityScoreEntity.java | 77 +++++++ ...tIndexCommunityServiceFiveScoreEntity.java | 77 +++++++ .../screen/FactIndexGridScoreEntity.java | 82 ++++++++ .../IndexCalculateCommunityService.java | 32 +++ .../IndexCalculateCommunityServiceImpl.java | 194 ++++++++++++++++++ .../FactIndexGovrnAblityOrgMonthlyDao.xml | 23 +++ .../FactIndexPartyAblityOrgMonthlyDao.xml | 18 ++ .../FactIndexCommunityGovrnFiveScoreDao.xml | 6 + .../FactIndexCommunityPartyFiveScoreDao.xml | 27 +++ .../screen/FactIndexCommunityScoreDao.xml | 6 + .../FactIndexCommunityServiceFiveScoreDao.xml | 6 + .../mapper/screen/FactIndexGridScoreDao.xml | 20 ++ 35 files changed, 1783 insertions(+), 1 deletion(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityGovrnFiveScoreDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityPartyFiveScoreDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityServiceFiveScoreDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityGovernAbilityCalculateResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityGovernAbilityResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityPublishArticleCountCalculateResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityPublishArticleCountResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinDoubleResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinIntegerResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridPartyAvgResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityGovrnFiveScoreDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityPartyFiveScoreDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityScoreDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityServiceFiveScoreDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexGridScoreDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityGovrnFiveScoreEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityPartyFiveScoreEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityScoreEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityServiceFiveScoreEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexGridScoreEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateCommunityService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityGovrnFiveScoreDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityPartyFiveScoreDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityScoreDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityServiceFiveScoreDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexGridScoreDao.xml diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityGovrnFiveScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityGovrnFiveScoreDTO.java new file mode 100644 index 0000000000..bfa52ac370 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityGovrnFiveScoreDTO.java @@ -0,0 +1,107 @@ +/** + * 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.dto.screen; + +import java.io.Serializable; +import lombok.Data; + +/** + * 社区相关-治理能力【五级权重】分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-27 + */ +@Data +public class FactIndexCommunityGovrnFiveScoreDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 机关iD + */ + private String agencyId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 指标ID + */ + private String indexId; + + /** + * 分数 + */ + private Double score; + + /** + * 社区被吹哨次数:transfered,社区办结项目数:closed_project,社区项目响应度:resp_project_ratio,社区超期项目率:overdue_project_ratio,社区办结项目率:closed_project_ratio,社区办结项目满意度:satisfaction_ratio + */ + private String type; + + /** + * 删除状态,0正常,1删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 更新人 + */ + private String updatedBy ; + + public FactIndexCommunityGovrnFiveScoreDTO() { + this.agencyId = ""; + this.monthId = ""; + this.quarterId = ""; + this.yearId = ""; + this.indexId = ""; + this.score = 0.00; + this.type = ""; + this.delFlag = 0; + this.revision = 0; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityPartyFiveScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityPartyFiveScoreDTO.java new file mode 100644 index 0000000000..9ab8f8f744 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityPartyFiveScoreDTO.java @@ -0,0 +1,98 @@ +/** + * 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.dto.screen; + +import java.io.Serializable; +import java.math.BigDecimal; + +import lombok.Data; + +/** + * 社区相关-党建能力【五级权重】分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-27 + */ +@Data +public class FactIndexCommunityPartyFiveScoreDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 指标ID + */ + private String indexId; + + /** + * 分数 + */ + private BigDecimal score; + + /** + * 发文数量:publish_article + */ + private String type; + + /** + * 删除状态,0正常,1删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 更新人 + */ + private String updatedBy; + + public FactIndexCommunityPartyFiveScoreDTO() { + this.agencyId = ""; + this.monthId = ""; + this.indexId = ""; + this.score = BigDecimal.valueOf(0); + this.type = ""; + this.delFlag = 0; + this.revision = 0; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java new file mode 100644 index 0000000000..805e28ef7f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java @@ -0,0 +1,107 @@ +/** + * 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.dto.screen; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 社区相关分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-27 + */ +@Data +public class FactIndexCommunityScoreDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 指标ID + */ + private String indexId; + + /** + * 分数 + */ + private BigDecimal score; + + /** + * 党建能力:party,治理能力:govrn,服务能力:service + */ + private String type; + + /** + * 删除状态,0正常,1删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityServiceFiveScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityServiceFiveScoreDTO.java new file mode 100644 index 0000000000..a781ad0e4d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityServiceFiveScoreDTO.java @@ -0,0 +1,107 @@ +/** + * 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.dto.screen; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 社区相关-服务能力【五级权重】分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-27 + */ +@Data +public class FactIndexCommunityServiceFiveScoreDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 指标ID + */ + private String indexId; + + /** + * 分数 + */ + private BigDecimal score; + + /** + * 社区活动组织次数:activity + */ + private String type; + + /** + * 删除状态,0正常,1删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java new file mode 100644 index 0000000000..6590da34cb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java @@ -0,0 +1,112 @@ +/** + * 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.dto.screen; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 网格相关分值 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-28 + */ +@Data +public class FactIndexGridScoreDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属的机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 总指数分值 + */ + private BigDecimal totalScore; + + /** + * 党建能力分值 + */ + private BigDecimal partyAblityScore; + + /** + * 治理能力分值 + */ + private BigDecimal govrnAblityScore; + + /** + * 服务能力分值 + */ + private BigDecimal serviceAblityScore; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityGovernAbilityCalculateResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityGovernAbilityCalculateResultDTO.java new file mode 100644 index 0000000000..84ab47503d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityGovernAbilityCalculateResultDTO.java @@ -0,0 +1,45 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/26 1:21 下午 + */ +@Data +public class CommunityGovernAbilityCalculateResultDTO implements Serializable { + + private static final long serialVersionUID = 3766218681545581100L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 分数 + */ + private Double score; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityGovernAbilityResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityGovernAbilityResultDTO.java new file mode 100644 index 0000000000..92b80e3ecf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityGovernAbilityResultDTO.java @@ -0,0 +1,68 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/26 11:20 上午 + */ +@Data +public class CommunityGovernAbilityResultDTO implements Serializable { + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 社区被吹哨次数 + */ + private Integer transferedCount; + + /** + * 社区办结项目数 + */ + private Integer closedProjectCount; + + /** + * 社区项目响应度 + */ + private Double respProjectRatio; + + /** + * 社区项目超期率 + */ + private Double overDueProjectRatio; + + /** + * 社区办结项目率 + */ + private Double closedProjectRatio; + + /** + * 社区办结项目满意度 + */ + private Double satisfactionRatio; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityPublishArticleCountCalculateResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityPublishArticleCountCalculateResultDTO.java new file mode 100644 index 0000000000..148d6abd80 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityPublishArticleCountCalculateResultDTO.java @@ -0,0 +1,45 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/26 10:43 上午 + */ +@Data +public class CommunityPublishArticleCountCalculateResultDTO implements Serializable { + + private static final long serialVersionUID = 3527690541253204132L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 分数 + */ + private Double score; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityPublishArticleCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityPublishArticleCountResultDTO.java new file mode 100644 index 0000000000..fe50bbf597 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityPublishArticleCountResultDTO.java @@ -0,0 +1,54 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/26 10:37 上午 + */ +@Data +public class CommunityPublishArticleCountResultDTO implements Serializable { + + private static final long serialVersionUID = -8260746179353253237L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 发文数 + */ + public Integer publishArticleCount; + + public CommunityPublishArticleCountResultDTO() { + this.agencyId = ""; + this.parentId = ""; + this.monthId = ""; + this.quarterId = ""; + this.yearId = ""; + this.publishArticleCount = 0; + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinDoubleResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinDoubleResultDTO.java new file mode 100644 index 0000000000..32b429f188 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinDoubleResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/28 9:51 上午 + */ +@Data +public class MaxAndMinDoubleResultDTO implements Serializable { + + private static final long serialVersionUID = -3927045097012156582L; + + /** + * 最小值 + */ + private Double min; + + /** + * 最大值 + */ + private Double max; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinIntegerResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinIntegerResultDTO.java new file mode 100644 index 0000000000..d807e42344 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinIntegerResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/28 9:49 上午 + */ +@Data +public class MaxAndMinIntegerResultDTO implements Serializable { + + private static final long serialVersionUID = 5845694081181431599L; + + /** + * 最小值 + */ + private Integer min; + + /** + * 最大值 + */ + private Integer max; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridPartyAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridPartyAvgResultDTO.java new file mode 100644 index 0000000000..38263c4dc1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridPartyAvgResultDTO.java @@ -0,0 +1,47 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/8/28 3:15 下午 + */ +@Data +public class SubGridPartyAvgResultDTO implements Serializable { + + private static final long serialVersionUID = 1592381327492545907L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 分数 + */ + private BigDecimal score; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java index eee1f3bca7..b11253b6e4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java @@ -17,6 +17,6 @@ public class DataStatsApplication { public static void main(String[] args) { SpringApplication.run(DataStatsApplication.class ,args); - HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() +" DataStatsApplication started!"); +// HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() +" DataStatsApplication started!"); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 6ed40fc377..4932fb509e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -5,6 +5,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.AgencySubTreeDto; import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.service.StatsDemoService; +import com.epmet.service.screen.IndexCalculateCommunityService; import com.epmet.service.stats.DimAgencyService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -32,6 +33,8 @@ public class DemoController { @Autowired private DimAgencyService dimAgencyService; + @Autowired + private IndexCalculateCommunityService indexCalculateCommunityService; @GetMapping("testAlarm") public void testAlarm() { @@ -108,4 +111,11 @@ public class DemoController { List list = dimAgencyService.getAgencyListByCustomerId("ba7c0b5b21e882b263ee8456e2cfb63e"); return new Result().ok(list); } + + @PostMapping("zxc") + public Result getZxc(){ +// indexCalculateCommunityService.communityPublishArticleCountCalculate("b09527201c4409e19d1dbc5e3c3429a1","202008"); + indexCalculateCommunityService.communityPublishArticleCountCalculate("","202008"); + return new Result(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java index 9013d4f9cf..fa9b8569b9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java @@ -19,6 +19,7 @@ package com.epmet.dao.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcollect.form.OrgGovrnAbilityFormDTO; +import com.epmet.dto.screen.result.CommunityGovernAbilityResultDTO; import com.epmet.entity.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -61,4 +62,13 @@ public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * @Description 社区治理能力各个参数查询【被吹哨次数、办结项目数、项目响应度、超期项目率、办结项目率、办结项目满意度】 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/26 1:40 下午 + */ + List selectCommunityGovernAbility(@Param("customerId")String customerId, @Param("monthId")String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java index 73a73a1c50..144ecd1d0a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java @@ -19,6 +19,7 @@ package com.epmet.dao.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcollect.form.OrgPartyAbilityFormDTO; +import com.epmet.dto.screen.result.CommunityPublishArticleCountResultDTO; import com.epmet.entity.indexcoll.FactIndexPartyAblityOrgMonthlyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -62,4 +63,13 @@ public interface FactIndexPartyAblityOrgMonthlyDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * @Description 查询社区下的发文数 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/26 10:49 上午 + */ + List selectPublishArticleCount(@Param("customerId")String customerId, @Param("monthId")String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityGovrnFiveScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityGovrnFiveScoreDao.java new file mode 100644 index 0000000000..52cd149927 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityGovrnFiveScoreDao.java @@ -0,0 +1,33 @@ +/** + * 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.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.screen.FactIndexCommunityGovrnFiveScoreEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 社区相关-治理能力【五级权重】分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-27 + */ +@Mapper +public interface FactIndexCommunityGovrnFiveScoreDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityPartyFiveScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityPartyFiveScoreDao.java new file mode 100644 index 0000000000..4c628a1ec0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityPartyFiveScoreDao.java @@ -0,0 +1,45 @@ +/** + * 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.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screen.FactIndexCommunityPartyFiveScoreDTO; +import com.epmet.entity.screen.FactIndexCommunityPartyFiveScoreEntity; +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-27 + */ +@Mapper +public interface FactIndexCommunityPartyFiveScoreDao extends BaseDao { + + /** + * @Description 党建能力【社区】中间表插入 + * @param lists + * @author zxc + * @date 2020/8/27 5:05 下午 + */ + void insertCommunityPartyRecord(@Param("lists")List lists); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityScoreDao.java new file mode 100644 index 0000000000..9ea796d24a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityScoreDao.java @@ -0,0 +1,33 @@ +/** + * 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.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.screen.FactIndexCommunityScoreEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 社区相关分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-27 + */ +@Mapper +public interface FactIndexCommunityScoreDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityServiceFiveScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityServiceFiveScoreDao.java new file mode 100644 index 0000000000..97a03ad2c9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityServiceFiveScoreDao.java @@ -0,0 +1,33 @@ +/** + * 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.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.screen.FactIndexCommunityServiceFiveScoreEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 社区相关-服务能力【五级权重】分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-27 + */ +@Mapper +public interface FactIndexCommunityServiceFiveScoreDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexGridScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexGridScoreDao.java new file mode 100644 index 0000000000..b95b41ff55 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexGridScoreDao.java @@ -0,0 +1,46 @@ +/** + * 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.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screen.result.SubGridPartyAvgResultDTO; +import com.epmet.entity.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 selectSubGridPartyAvgScore(@Param("customerId")String customerId,@Param("monthId")String monthId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityGovrnFiveScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityGovrnFiveScoreEntity.java new file mode 100644 index 0000000000..bf0bcbeac0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityGovrnFiveScoreEntity.java @@ -0,0 +1,77 @@ +/** + * 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.entity.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 社区相关-治理能力【五级权重】分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_community_govrn_five_score") +public class FactIndexCommunityGovrnFiveScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 机关iD + */ + private String agencyId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 指标ID + */ + private String indexId; + + /** + * 分数 + */ + private BigDecimal score; + + /** + * 社区被吹哨次数:transfered,社区办结项目数:closed_project,社区项目响应度:resp_project_ratio,社区超期项目率:overdue_project_ratio,社区办结项目率:closed_project_ratio,社区办结项目满意度:satisfaction_ratio + */ + private String type; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityPartyFiveScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityPartyFiveScoreEntity.java new file mode 100644 index 0000000000..c42849dd0b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityPartyFiveScoreEntity.java @@ -0,0 +1,77 @@ +/** + * 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.entity.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 社区相关-党建能力【五级权重】分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_community_party_five_score") +public class FactIndexCommunityPartyFiveScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 指标ID + */ + private String indexId; + + /** + * 分数 + */ + private BigDecimal score; + + /** + * 发文数量:publish_article + */ + private String type; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityScoreEntity.java new file mode 100644 index 0000000000..1c3899ef2d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityScoreEntity.java @@ -0,0 +1,77 @@ +/** + * 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.entity.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 社区相关分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_community_score") +public class FactIndexCommunityScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 指标ID + */ + private String indexId; + + /** + * 分数 + */ + private BigDecimal score; + + /** + * 党建能力:party,治理能力:govrn,服务能力:service + */ + private String type; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityServiceFiveScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityServiceFiveScoreEntity.java new file mode 100644 index 0000000000..8d0fb8857f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityServiceFiveScoreEntity.java @@ -0,0 +1,77 @@ +/** + * 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.entity.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 社区相关-服务能力【五级权重】分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_community_service_five_score") +public class FactIndexCommunityServiceFiveScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 指标ID + */ + private String indexId; + + /** + * 分数 + */ + private BigDecimal score; + + /** + * 社区活动组织次数:activity + */ + private String type; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexGridScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexGridScoreEntity.java new file mode 100644 index 0000000000..99bc4d0ed1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexGridScoreEntity.java @@ -0,0 +1,82 @@ +/** + * 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.entity.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 网格相关分值 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-28 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_grid_score") +public class FactIndexGridScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属的机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 总指数分值 + */ + private BigDecimal totalScore; + + /** + * 党建能力分值 + */ + private BigDecimal partyAblityScore; + + /** + * 治理能力分值 + */ + private BigDecimal govrnAblityScore; + + /** + * 服务能力分值 + */ + private BigDecimal serviceAblityScore; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateCommunityService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateCommunityService.java new file mode 100644 index 0000000000..daf11c1519 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateCommunityService.java @@ -0,0 +1,32 @@ +package com.epmet.service.screen; + +import com.epmet.dto.screen.result.CommunityGovernAbilityCalculateResultDTO; +import com.epmet.dto.screen.result.CommunityPublishArticleCountCalculateResultDTO; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/8/26 10:33 上午 + */ +public interface IndexCalculateCommunityService { + + /** + * @Description 社区名义发文数量计算 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/26 10:46 上午 + */ + void communityPublishArticleCountCalculate(String customerId, String monthId); + + /** + * @Description 社区治理能力 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/26 1:40 下午 + */ + void CommunityGovernAbilityCalculate(String customerId, String monthId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java new file mode 100644 index 0000000000..543def9d3b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java @@ -0,0 +1,194 @@ +package com.epmet.service.screen.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dao.indexcoll.FactIndexGovrnAblityOrgMonthlyDao; +import com.epmet.dao.indexcoll.FactIndexPartyAblityCpcMonthlyDao; +import com.epmet.dao.indexcoll.FactIndexPartyAblityOrgMonthlyDao; +import com.epmet.dao.screen.*; +import com.epmet.dto.indexcal.ExtremeValueCommonDTO; +import com.epmet.dto.screen.FactIndexCommunityPartyFiveScoreDTO; +import com.epmet.dto.screen.result.*; +import com.epmet.entity.screen.IndexGroupDetailEntity; +import com.epmet.eum.IndexCodeEnum; +import com.epmet.service.indexcal.IndexCodeFieldReService; +import com.epmet.service.screen.IndexCalculateCommunityService; +import com.epmet.service.screen.IndexGroupDetailService; +import com.epmet.support.normalizing.Correlation; +import com.epmet.support.normalizing.IntegerScoreCalculator; +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.IndexInputVO; +import com.epmet.support.normalizing.batch.IndexOutputVO; +import com.epmet.support.normalizing.batch.SampleValue; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import io.swagger.models.auth.In; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Author zxc + * @DateTime 2020/8/26 10:34 上午 + */ +@Service +@Slf4j +public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommunityService { + + @Autowired + private FactIndexPartyAblityOrgMonthlyDao factIndexPartyAblityOrgMonthlyDao; + @Autowired + private FactIndexGovrnAblityOrgMonthlyDao factIndexGovrnAblityOrgMonthlyDao; + @Autowired + private IndexGroupDetailService indexGroupDetailService; + @Autowired + private IndexCodeFieldReService indexCodeFieldReService; + @Autowired + private FactIndexCommunityPartyFiveScoreDao factIndexCommunityPartyFiveScoreDao; + @Autowired + private FactIndexGridScoreDao factIndexGridScoreDao; + @Autowired + private FactIndexCommunityServiceFiveScoreDao factIndexCommunityServiceFiveScoreDao; + @Autowired + private FactIndexCommunityGovrnFiveScoreDao factIndexCommunityGovrnFiveScoreDao; + @Autowired + private FactIndexCommunityScoreDao factIndexCommunityScoreDao; + + /** + * @Description 社区名义发文数量计算【党建能力】 + * @param customerId + * @author zxc + * @date 2020/8/26 10:46 上午 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void communityPublishArticleCountCalculate(String customerId, String monthId) { + customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + // 根据all_parent_index_code 获取指标明细 + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(),IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + + List subAllGridList = new ArrayList<>(); + List communityPublishArticle = new ArrayList<>(); + + // todo 下属所有网格的党建能力平均值 + String finalCustomerId = customerId; + detailListByParentCode.forEach(indexGroup -> { + if (indexGroup.getIndexCode().equals("xiazhusuoyouwgddjnlpjz")){ + List subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridPartyAvgScore(finalCustomerId, monthId); + subGridPartyAvgScore.forEach(subGridParty -> { + BigDecimal multiply = subGridParty.getScore().multiply(indexGroup.getWeight()); + subGridParty.setScore(multiply); + FactIndexCommunityPartyFiveScoreDTO dto = new FactIndexCommunityPartyFiveScoreDTO(); + BeanUtils.copyProperties(subGridParty,dto); + dto.setType("sub_all_grid_party_avg"); + dto.setIndexId(indexGroup.getIndexId()); + subAllGridList.add(dto); + }); + factIndexCommunityPartyFiveScoreDao.insertCommunityPartyRecord(subAllGridList); + } + }); + + List publishArticleCounts = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCount(customerId, monthId); + detailListByParentCode.forEach(indexGroup -> { + if (indexGroup.getIndexCode().equals("shequmingyifwsl")) { + if (publishArticleCounts.size() == NumConstant.ONE) { + //TODO 计算之后的分数 + FactIndexCommunityPartyFiveScoreDTO dto = new FactIndexCommunityPartyFiveScoreDTO(); + BeanUtils.copyProperties(detailListByParentCode.get(NumConstant.ZERO), dto); + dto.setScore(BigDecimal.valueOf(50.00)); + dto.setType("publish_article_count"); + dto.setIndexId(detailListByParentCode.get(NumConstant.ZERO).getIndexId()); + communityPublishArticle.add(dto); + factIndexCommunityPartyFiveScoreDao.insertCommunityPartyRecord(communityPublishArticle); + } else if (publishArticleCounts.size() != NumConstant.ZERO) { + Integer indexStart = NumConstant.ZERO; + Integer indexEnd = NumConstant.TEN; + List collect; + MaxAndMinIntegerResultDTO maxAndMinInteger = this.getMaxAndMinInteger(publishArticleCounts.stream().map(CommunityPublishArticleCountResultDTO::getPublishArticleCount).collect(Collectors.toList())); + do { + collect = publishArticleCounts.stream().skip(indexEnd * indexStart).limit(indexEnd).collect(Collectors.toList()); + ScoreCalculator sc1 = new IntegerScoreCalculator(maxAndMinInteger.getMin(), maxAndMinInteger.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + List> ll = new ArrayList<>(); + collect.forEach(c -> { + SampleValue s = new SampleValue(c.getAgencyId(), c.getPublishArticleCount()); + ll.add(s); + }); + IndexInputVO index1VO = new IndexInputVO<>(indexGroup.getIndexId(), ll, indexGroup.getWeight(), sc1); + List indexInputVOS = Arrays.asList(index1VO); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + List result = batchScoreCalculator.exec(indexInputVOS); + + indexStart++; + } while (collect.size() == 10); + } + } + }); + + + + } + + /** + * @Description 社区治理能力 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/26 1:40 下午 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void CommunityGovernAbilityCalculate(String customerId, String monthId) { + List communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(customerId, monthId); + if (communityGovernAbility.size() == NumConstant.ONE){ + List result = new ArrayList<>(); + CommunityGovernAbilityCalculateResultDTO governAbility = new CommunityGovernAbilityCalculateResultDTO(); + BeanUtils.copyProperties(communityGovernAbility.get(NumConstant.ZERO),governAbility); + + // TODO 计算之后的分数 + + result.add(governAbility); + + } + + } + + /** + * @Description Integer类型获取最大数和最小数 + * @param list + * @author zxc + * @date 2020/8/27 1:30 下午 + */ + public MaxAndMinIntegerResultDTO getMaxAndMinInteger(List list){ + Integer max = Collections.max(list); + Integer min = Collections.min(list); + MaxAndMinIntegerResultDTO result = new MaxAndMinIntegerResultDTO(); + result.setMax(max); + result.setMin(min); + return result; + } + + /** + * @Description Double类型获取最大数和最小数 + * @param list + * @author zxc + * @date 2020/8/27 1:32 下午 + */ + public MaxAndMinDoubleResultDTO getMaxAndMinDouble(List list){ + Double max = Collections.max(list); + Double min = Collections.min(list); + MaxAndMinDoubleResultDTO result = new MaxAndMinDoubleResultDTO(); + result.setMax(max); + result.setMin(min); + return result; + } + + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml index 36e4d07b3a..11b87f6eb8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml @@ -85,4 +85,27 @@ ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml index 758a686052..ff41b99bd4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml @@ -71,4 +71,22 @@ + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityGovrnFiveScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityGovrnFiveScoreDao.xml new file mode 100644 index 0000000000..721b8181ef --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityGovrnFiveScoreDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityPartyFiveScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityPartyFiveScoreDao.xml new file mode 100644 index 0000000000..f2bab458f6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityPartyFiveScoreDao.xml @@ -0,0 +1,27 @@ + + + + + + + + INSERT INTO fact_index_community_party_five_score ( ID, AGENCY_ID, MONTH_ID, INDEX_ID, SCORE, TYPE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + VALUES + + ( + REPLACE ( UUID(), '-', '' ), + #{item.agencyId}, + #{item.monthId}, + #{item.indexId}, + #{item.score}, + #{item.type}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW() + ) + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityScoreDao.xml new file mode 100644 index 0000000000..54611e0f02 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityScoreDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityServiceFiveScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityServiceFiveScoreDao.xml new file mode 100644 index 0000000000..509f723548 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityServiceFiveScoreDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexGridScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexGridScoreDao.xml new file mode 100644 index 0000000000..7e4ad04732 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexGridScoreDao.xml @@ -0,0 +1,20 @@ + + + + + + + + \ No newline at end of file From 1485154ea3c9a0268859b59a3f2bcf5d3e4e626a Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 28 Aug 2020 17:57:40 +0800 Subject: [PATCH 090/226] =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FactIndexCommunityGovrnFiveScoreDTO.java | 30 +++++++------ .../FactIndexCommunityPartyFiveScoreDTO.java | 24 ++++++++--- ...FactIndexCommunityServiceFiveScoreDTO.java | 20 ++++----- .../IndexCalculateCommunityServiceImpl.java | 43 +++++++++++++------ .../FactIndexCommunityPartyFiveScoreDao.xml | 6 +-- 5 files changed, 76 insertions(+), 47 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityGovrnFiveScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityGovrnFiveScoreDTO.java index bfa52ac370..5f2fbf85b7 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityGovrnFiveScoreDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityGovrnFiveScoreDTO.java @@ -18,6 +18,8 @@ package com.epmet.dto.screen; import java.io.Serializable; +import java.math.BigDecimal; + import lombok.Data; /** @@ -47,29 +49,29 @@ public class FactIndexCommunityGovrnFiveScoreDTO implements Serializable { private String monthId; /** - * 季度ID + * 指标ID */ - private String quarterId; + private String indexId; /** - * 年度ID + * 总指数分值 */ - private String yearId; + private BigDecimal totalScore; /** - * 指标ID + * 党建能力分值 */ - private String indexId; + private BigDecimal partyAbilityScore; /** - * 分数 + * 治理能力分值 */ - private Double score; + private BigDecimal govrnAbilityScore; /** - * 社区被吹哨次数:transfered,社区办结项目数:closed_project,社区项目响应度:resp_project_ratio,社区超期项目率:overdue_project_ratio,社区办结项目率:closed_project_ratio,社区办结项目满意度:satisfaction_ratio + * 服务能力分值 */ - private String type; + private BigDecimal serviceAbilityScore; /** * 删除状态,0正常,1删除 @@ -94,11 +96,11 @@ public class FactIndexCommunityGovrnFiveScoreDTO implements Serializable { public FactIndexCommunityGovrnFiveScoreDTO() { this.agencyId = ""; this.monthId = ""; - this.quarterId = ""; - this.yearId = ""; this.indexId = ""; - this.score = 0.00; - this.type = ""; + this.totalScore = new BigDecimal(0); + this.partyAbilityScore = new BigDecimal(0); + this.govrnAbilityScore = new BigDecimal(0); + this.serviceAbilityScore = new BigDecimal(0); this.delFlag = 0; this.revision = 0; this.createdBy = "APP_USER"; diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityPartyFiveScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityPartyFiveScoreDTO.java index 9ab8f8f744..79024c60ca 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityPartyFiveScoreDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityPartyFiveScoreDTO.java @@ -54,14 +54,24 @@ public class FactIndexCommunityPartyFiveScoreDTO implements Serializable { private String indexId; /** - * 分数 + * 总指数分值 */ - private BigDecimal score; + private BigDecimal totalScore; /** - * 发文数量:publish_article + * 党建能力分值 */ - private String type; + private BigDecimal partyAbilityScore; + + /** + * 治理能力分值 + */ + private BigDecimal govrnAbilityScore; + + /** + * 服务能力分值 + */ + private BigDecimal serviceAbilityScore; /** * 删除状态,0正常,1删除 @@ -87,8 +97,10 @@ public class FactIndexCommunityPartyFiveScoreDTO implements Serializable { this.agencyId = ""; this.monthId = ""; this.indexId = ""; - this.score = BigDecimal.valueOf(0); - this.type = ""; + this.totalScore = new BigDecimal(0); + this.partyAbilityScore = new BigDecimal(0); + this.govrnAbilityScore = new BigDecimal(0); + this.serviceAbilityScore = new BigDecimal(0); this.delFlag = 0; this.revision = 0; this.createdBy = "APP_USER"; diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityServiceFiveScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityServiceFiveScoreDTO.java index a781ad0e4d..1eb6386bcc 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityServiceFiveScoreDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityServiceFiveScoreDTO.java @@ -50,29 +50,29 @@ public class FactIndexCommunityServiceFiveScoreDTO implements Serializable { private String monthId; /** - * 季度ID + * 指标ID */ - private String quarterId; + private String indexId; /** - * 年度ID + * 总指数分值 */ - private String yearId; + private BigDecimal totalScore; /** - * 指标ID + * 党建能力分值 */ - private String indexId; + private BigDecimal partyAbilityScore; /** - * 分数 + * 治理能力分值 */ - private BigDecimal score; + private BigDecimal govrnAbilityScore; /** - * 社区活动组织次数:activity + * 服务能力分值 */ - private String type; + private BigDecimal serviceAbilityScore; /** * 删除状态,0正常,1删除 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java index 543def9d3b..31a1cfe543 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java @@ -72,27 +72,31 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni @Override public void communityPublishArticleCountCalculate(String customerId, String monthId) { customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + + // 党建能力 // 根据all_parent_index_code 获取指标明细 List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(),IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); List subAllGridList = new ArrayList<>(); List communityPublishArticle = new ArrayList<>(); - // todo 下属所有网格的党建能力平均值 + //下属所有网格的党建能力平均值 String finalCustomerId = customerId; detailListByParentCode.forEach(indexGroup -> { if (indexGroup.getIndexCode().equals("xiazhusuoyouwgddjnlpjz")){ List subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridPartyAvgScore(finalCustomerId, monthId); - subGridPartyAvgScore.forEach(subGridParty -> { - BigDecimal multiply = subGridParty.getScore().multiply(indexGroup.getWeight()); - subGridParty.setScore(multiply); - FactIndexCommunityPartyFiveScoreDTO dto = new FactIndexCommunityPartyFiveScoreDTO(); - BeanUtils.copyProperties(subGridParty,dto); - dto.setType("sub_all_grid_party_avg"); - dto.setIndexId(indexGroup.getIndexId()); - subAllGridList.add(dto); - }); - factIndexCommunityPartyFiveScoreDao.insertCommunityPartyRecord(subAllGridList); + if (subGridPartyAvgScore.size() != NumConstant.ZERO){ + subGridPartyAvgScore.forEach(subGridParty -> { + BigDecimal multiply = subGridParty.getScore().multiply(indexGroup.getWeight()); + subGridParty.setScore(multiply); + FactIndexCommunityPartyFiveScoreDTO dto = new FactIndexCommunityPartyFiveScoreDTO(); + BeanUtils.copyProperties(subGridParty,dto); + dto.setIndexId(indexGroup.getIndexId()); + dto.setTotalScore(dto.getPartyAbilityScore()); + subAllGridList.add(dto); + }); + factIndexCommunityPartyFiveScoreDao.insertCommunityPartyRecord(subAllGridList); + } } }); @@ -103,8 +107,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni //TODO 计算之后的分数 FactIndexCommunityPartyFiveScoreDTO dto = new FactIndexCommunityPartyFiveScoreDTO(); BeanUtils.copyProperties(detailListByParentCode.get(NumConstant.ZERO), dto); - dto.setScore(BigDecimal.valueOf(50.00)); - dto.setType("publish_article_count"); + dto.setPartyAbilityScore(BigDecimal.valueOf(50.00)); dto.setIndexId(detailListByParentCode.get(NumConstant.ZERO).getIndexId()); communityPublishArticle.add(dto); factIndexCommunityPartyFiveScoreDao.insertCommunityPartyRecord(communityPublishArticle); @@ -120,14 +123,26 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni collect.forEach(c -> { SampleValue s = new SampleValue(c.getAgencyId(), c.getPublishArticleCount()); ll.add(s); + FactIndexCommunityPartyFiveScoreDTO publishArticle = new FactIndexCommunityPartyFiveScoreDTO(); + BeanUtils.copyProperties(c,publishArticle); + communityPublishArticle.add(publishArticle); }); IndexInputVO index1VO = new IndexInputVO<>(indexGroup.getIndexId(), ll, indexGroup.getWeight(), sc1); List indexInputVOS = Arrays.asList(index1VO); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); List result = batchScoreCalculator.exec(indexInputVOS); - + result.get(NumConstant.ZERO).getIndexScoreVOs().forEach(agency -> { + communityPublishArticle.forEach(publish -> { + if (publish.getAgencyId().equals(agency.getSampleId())){ + publish.setIndexId(indexGroup.getIndexId()); + publish.setPartyAbilityScore(agency.getSampleScore()); + publish.setTotalScore(agency.getSampleScore()); + } + }); + }); indexStart++; } while (collect.size() == 10); + factIndexCommunityPartyFiveScoreDao.insertCommunityPartyRecord(communityPublishArticle); } } }); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityPartyFiveScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityPartyFiveScoreDao.xml index f2bab458f6..7110ba2c04 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityPartyFiveScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityPartyFiveScoreDao.xml @@ -5,7 +5,7 @@ - INSERT INTO fact_index_community_party_five_score ( ID, AGENCY_ID, MONTH_ID, INDEX_ID, SCORE, TYPE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + INSERT INTO fact_index_community_party_five_score ( ID, AGENCY_ID, MONTH_ID, INDEX_ID, TOTAL_SCORE, PARTY_ABILITY_SCORE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) VALUES ( @@ -13,8 +13,8 @@ #{item.agencyId}, #{item.monthId}, #{item.indexId}, - #{item.score}, - #{item.type}, + #{item.totalScore}, + #{item.partyAbilityScore}, #{item.delFlag}, #{item.revision}, #{item.createdBy}, From 5ea4120539007b533147c4fefc7c72e348101b66 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 30 Aug 2020 22:58:26 +0800 Subject: [PATCH 091/226] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=9B=B8=E5=85=B3-?= =?UTF-8?q?=E5=85=9A=E5=BB=BA=E8=83=BD=E5=8A=9B=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/constant/StrConstant.java | 4 + .../com/epmet/constant/IndexCalConstant.java | 18 ++ .../dto/indexcal/PageQueryGridFormDTO.java | 17 +- .../com/epmet/controller/DemoController.java | 13 + .../FactIndexGovrnAblityGridMonthlyDao.java | 6 +- .../FactIndexPartyAblityGridMonthlyDao.java | 9 +- .../FactIndexServiceAblityGridMonthlyDao.java | 6 +- .../java/com/epmet/eum/IndexCodeEnum.java | 6 +- .../indexcal/GridCorreLationService.java | 5 +- .../impl/GridCorreLationServiceImpl.java | 260 ++++++++++++++---- .../support/normalizing/Correlation.java | 29 ++ .../support/normalizing/ScoreCalculator.java | 2 +- .../FactIndexGovrnAblityGridMonthlyDao.xml | 4 +- .../FactIndexPartyAblityGridMonthlyDao.xml | 15 +- .../FactIndexServiceAblityGridMonthlyDao.xml | 4 +- 15 files changed, 331 insertions(+), 67 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java index 655635e6d7..03233b7c47 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java @@ -77,4 +77,8 @@ public interface StrConstant { String NULL_STR="null"; String NOT_FILLED = "无"; + + String MIN="MIN"; + + String MAX="MAX"; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java new file mode 100644 index 0000000000..0cfcdcc2a7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java @@ -0,0 +1,18 @@ +package com.epmet.constant; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/27 15:20 + */ +public interface IndexCalConstant { + + Integer PAGE_SIZE = 10; + + String GRID_ID="GRID_ID"; + + String CUSTOMER_ID="CUSTOMER_ID"; + + String MONTH_ID="MONTH_ID"; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/PageQueryGridFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/PageQueryGridFormDTO.java index 51f5244294..3db0986065 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/PageQueryGridFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/PageQueryGridFormDTO.java @@ -18,6 +18,11 @@ public class PageQueryGridFormDTO implements Serializable { */ private String customerId; + /** + * yyyyMM + */ + private String monthId; + /** * 页码 * */ @@ -27,7 +32,17 @@ public class PageQueryGridFormDTO implements Serializable { /** * 每页多少条 * */ - private Integer pageSize = 10; + private Integer pageSize; private Integer pageIndex; + + + public PageQueryGridFormDTO(String customerId,String monthId,int pageIndex,int pageNo,int pageSize){ + this.customerId=customerId; + this.monthId=monthId; + this.pageIndex=pageIndex; + this.pageNo=pageNo; + this.pageSize=pageSize; + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 4932fb509e..5f18b920f9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -1,10 +1,13 @@ package com.epmet.controller; +import com.baomidou.mybatisplus.extension.api.R; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.service.StatsDemoService; +import com.epmet.service.indexcal.GridCorreLationService; import com.epmet.service.screen.IndexCalculateCommunityService; import com.epmet.service.stats.DimAgencyService; import lombok.extern.slf4j.Slf4j; @@ -35,6 +38,8 @@ public class DemoController { private DimAgencyService dimAgencyService; @Autowired private IndexCalculateCommunityService indexCalculateCommunityService; + @Autowired + private GridCorreLationService gridCorreLationService; @GetMapping("testAlarm") public void testAlarm() { @@ -118,4 +123,12 @@ public class DemoController { indexCalculateCommunityService.communityPublishArticleCountCalculate("","202008"); return new Result(); } + + @PostMapping("testcalculategridcorrelation") + public Result testcalculateGridCorreLation(){ + CalculateCommonFormDTO formDTO=new CalculateCommonFormDTO("b09527201c4409e19d1dbc5e3c3429a1","202008"); + gridCorreLationService.calculateGridCorreLation(formDTO); + return new Result(); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java index 11cb3fbe03..90c9a3ea6e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.PageQueryGridFormDTO; import com.epmet.dto.indexcollect.form.GridGovrnAbilityFormDTO; import com.epmet.entity.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; import org.apache.ibatis.annotations.Mapper; @@ -67,14 +68,13 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao list, @Param("customerId")String customerId); /** - * @param customerId 客户id - * @param monthId yyyyMM + * @param formDTO * @return java.util.List * @author yinzuomei * @description 当前客户下,所有网格的治理能力相关五级指标 * @Date 2020/8/26 15:58 **/ - List> selectListGovrnAblityGrid(@Param("customerId") String customerId, @Param("monthId") String monthId); + List> selectListGovrnAblityGrid(PageQueryGridFormDTO formDTO); /** * @return java.util.Map diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityGridMonthlyDao.java index 0aff70aece..a2fe8dc821 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityGridMonthlyDao.java @@ -18,6 +18,8 @@ package com.epmet.dao.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.indexcal.PageQueryGridFormDTO; import com.epmet.dto.indexcollect.FactIndexPartyAblityGridMonthlyDTO; import com.epmet.dto.indexcollect.form.GridPartyAbilityFormDTO; import com.epmet.entity.indexcoll.FactIndexPartyAblityGridMonthlyEntity; @@ -68,14 +70,13 @@ public interface FactIndexPartyAblityGridMonthlyDao extends BaseDao list, @Param("customerId")String customerId); /** - * @param customerId 客户id - * @param monthId yyyyMM + * @param formDTO * @return java.util.List * @author yinzuomei * @description 当前客户下,所有网格的党建能力相关五级指标 * @Date 2020/8/26 15:57 **/ - List> selectListPartyAblityGrid(@Param("customerId") String customerId, @Param("monthId") String monthId); + List> selectListPartyAblityGrid(PageQueryGridFormDTO formDTO); /** * @return java.util.Map @@ -86,4 +87,6 @@ public interface FactIndexPartyAblityGridMonthlyDao extends BaseDao selectPartyAblityGridMinAndMax(@Param("customerId") String customerId, @Param("monthId") String monthId); + + Integer selectCount(CalculateCommonFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.java index a2b2eb78f8..7357c0cedc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.PageQueryGridFormDTO; import com.epmet.dto.indexcollect.FactIndexServiceAblityGridMonthlyDTO; import com.epmet.dto.indexcollect.form.GridServiceAbilityFormDTO; import com.epmet.entity.indexcoll.FactIndexServiceAblityGridMonthlyEntity; @@ -68,13 +69,12 @@ public interface FactIndexServiceAblityGridMonthlyDao extends BaseDao - * @param customerId - * @param monthId + * @param formDTO * @author yinzuomei * @description 当前客户下,所有网格的治理能力相关五级指标 * @Date 2020/8/26 15:59 **/ - List> selectListServiceAblityGrid(@Param("customerId") String customerId, @Param("monthId") String monthId); + List> selectListServiceAblityGrid(PageQueryGridFormDTO formDTO); /** * @return java.util.Map diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java index 29766018d8..71ef0303d4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java @@ -1,5 +1,7 @@ package com.epmet.eum; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; + /** * 需要计算指标code枚举类 * @@ -8,7 +10,7 @@ package com.epmet.eum; **/ public enum IndexCodeEnum { DANG_YUAN_XIANG_GUAN("dangyuanxiangguan", "党员相关", 1), - WANG_GE_XIANG_GUAN("wangggexiangguan", "网格相关", 1), + WANG_GE_XIANG_GUAN("wanggexiangguan", "网格相关", 1), SHE_QU_XIANG_GUAN("shequxiangguan", "社区相关", 1), JIE_DAO_XIANG_GUAN("jiedaoxiangguan", "街道相关", 1), QU_ZHI_BU_MEN("quzhibumen", "区直部门", 1), @@ -21,7 +23,7 @@ public enum IndexCodeEnum { CAN_YU_YI_SHI("canyuyishi", "参与议事", 4), DANG_WU_HUO_DONG("dangwuhuodong", "党务活动", 4), LIAN_XI_QUN_ZHONG("lianxiqunzhong", "联系群众", 4), - + ZUZHINEIDANGYDLXQZNLKPFPJZ("zuzhineidangydlxqznlkpfpjz","组织内党员的联系群众能力考评分(平均值)",5), ; private String code; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/GridCorreLationService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/GridCorreLationService.java index 225ae2bb80..6648205d5c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/GridCorreLationService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/GridCorreLationService.java @@ -27,13 +27,12 @@ public interface GridCorreLationService { /** * @return java.util.List> - * @param customerId - * @param monthId + * @param formDTO * @author yinzuomei * @description 党建能力-网格相关事实表 当前客户下,所有网格的党建能力相关五级指标 * @Date 2020/8/27 14:48 **/ - List> queryListPartyAblityGrid(String customerId, String monthId); + List> queryListPartyAblityGrid(PageQueryGridFormDTO formDTO); /** * @return java.util.List diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java index 8a922020fa..8b052d2638 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java @@ -1,6 +1,8 @@ package com.epmet.service.indexcal.impl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.constant.IndexCalConstant; import com.epmet.dao.indexcoll.FactIndexGovrnAblityGridMonthlyDao; import com.epmet.dao.indexcoll.FactIndexPartyAblityGridMonthlyDao; import com.epmet.dao.indexcoll.FactIndexServiceAblityGridMonthlyDao; @@ -12,15 +14,21 @@ import com.epmet.dto.indexcal.PageQueryGridFormDTO; import com.epmet.entity.screen.IndexGroupDetailEntity; import com.epmet.eum.IndexCodeEnum; import com.epmet.service.indexcal.GridCorreLationService; +import com.epmet.service.indexcal.IndexCodeFieldReService; import com.epmet.service.screen.IndexGroupDetailService; +import com.epmet.support.normalizing.*; +import com.epmet.support.normalizing.batch.*; +import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import java.util.List; -import java.util.Map; +import java.math.BigDecimal; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; /** * 网格相关service @@ -41,6 +49,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { private ScreenCustomerGridDao screenCustomerGridDao; @Autowired private IndexGroupDetailService indexGroupDetailService; + @Autowired + private IndexCodeFieldReService indexCodeFieldReService; /** * @param formDTO @@ -55,86 +65,242 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { List dangJianNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); - if(!CollectionUtils.isEmpty(dangJianNengLiList)){ + if (!CollectionUtils.isEmpty(dangJianNengLiList)) { //1、计算网格相关-党建能力 - calculateGridCorreLationDangJian(formDTO,dangJianNengLiList); + calculateGridCorreLationDangJian(formDTO, dangJianNengLiList); } - List zhiLiNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), + /* List zhiLiNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); - if(!CollectionUtils.isEmpty(zhiLiNengLiList)){ + if (!CollectionUtils.isEmpty(zhiLiNengLiList)) { //2、计算网格相关-治理能力 - calculateGridCorreLationZhiLi(formDTO,zhiLiNengLiList); + calculateGridCorreLationZhiLi(formDTO, zhiLiNengLiList); } List fuWuNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); - if(!CollectionUtils.isEmpty(fuWuNengLiList)){ + if (!CollectionUtils.isEmpty(fuWuNengLiList)) { //3、计算网格相关-服务能力 - calculateGridCorreLationFuWu(formDTO,fuWuNengLiList); + calculateGridCorreLationFuWu(formDTO, fuWuNengLiList); } //计算网格相关总分 List wgxgList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); - if(!CollectionUtils.isEmpty(wgxgList)){ - calculateGridCorreLationTotal(formDTO,wgxgList); - } + if (!CollectionUtils.isEmpty(wgxgList)) { + calculateGridCorreLationTotal(formDTO, wgxgList); + }*/ resultFlag = true; return resultFlag; } /** - * @return void * @param formDTO * @param indexList + * @return void * @author yinzuomei * @description 计算网格相关-党建能力 - * @Date 2020/8/26 16:47 + * @Date 2020/8/26 16:47 **/ - private void calculateGridCorreLationDangJian(CalculateCommonFormDTO formDTO,List indexList){ - //分页查询网格列表 - //查询五级指标 + private void calculateGridCorreLationDangJian(CalculateCommonFormDTO formDTO, List indexList) { + //查询总记录数 + int total = factIndexPartyAblityGridMonthlyDao.selectCount(formDTO); + if (NumConstant.ZERO == total) { + logger.info(String.format("customerId:%s,monthId:%s,没有上传网格相关-党建能力-五级指标数据"), formDTO.getCustomerId(), formDTO.getMonthId()); + return; + } + //总页数,进行批量查询,批量计算 + int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE); + logger.info(String.format("共%s条数据,分%s次计算", total, totalPage)); + //每一组指标的最大值,key:code_MIN/MAX + Map minAndMaxMap = queryPartyAblityGridMinAndMax(formDTO.getCustomerId(), formDTO.getMonthId()); + //指标集合 + Map> indexMap = getIndexInputVO(formDTO, indexList, minAndMaxMap); + //分页查询采集记录 + for (int pageNo = 1; pageNo <= totalPage; pageNo++) { + int pageIndex = (pageNo - NumConstant.ONE) * IndexCalConstant.PAGE_SIZE; + //前10条 + List> recordList = queryListPartyAblityGrid(new PageQueryGridFormDTO(formDTO.getCustomerId(), + formDTO.getMonthId(), + pageIndex, + pageNo, + IndexCalConstant.PAGE_SIZE)); + //遍历每一个网格的记录 + recordList.forEach(recordMap -> { + //遍历所有的指标 + indexMap.forEach((key, value) -> { + //列名不为空 + if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { + //对应的数值 + String sampleValueStr = String.valueOf(recordMap.get(indexCodeFieldReService.getFieldNameByIndexCode(key))); + //构造样本值对象 + SampleValue currentGridIndexValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), new BigDecimal(sampleValueStr)); + value.getIndexValueVOs().add(currentGridIndexValue); + } else if (IndexCodeEnum.ZUZHINEIDANGYDLXQZNLKPFPJZ.getCode().equals(key)) { + //组织内党员的联系群众能力考评分(平均值) TODO + logger.info("组织内党员的联系群众能力考评分(平均值) TODO"); + //网格内党员的联系群众能力考评分(平均值) + /* BigDecimal contactResiAblity = null; + SampleValue contactResiAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), contactResiAblity); + value.getIndexValueVOs().add(contactResiAblityValue);*/ + } + }); + }); + List result = calculate(indexMap); + // TODO 处理结果 + saveGridCorreLationDangJian(formDTO, indexList, result); + + try { + for (IndexOutputVO m : result) { + logger.info("indexId=" + m.getIndexId()); + for (SampleScore sampleScore : m.getIndexScoreVOs()) { + logger.info(String.format("网格id:%s,得分:%s", sampleScore.getSampleId(), sampleScore.getSampleScore())); + } + } + } catch (Exception e) { + } + } } /** + * @param formDTO 客户id 月份id: yyyyMM + * @param indexList 指标集合 + * @param indexOutputVOList * @return void + * @author yinzuomei + * @description 保存网格相关五级指标分值 + * @Date 2020/8/30 22:50 + **/ + private void saveGridCorreLationDangJian(CalculateCommonFormDTO formDTO, + List indexList, + List indexOutputVOList) { + Map indexMap = indexList.stream().collect(Collectors.toMap(IndexGroupDetailEntity::getIndexCode, Function.identity())); + + + } + + /** + * @param indexMap + * @return java.util.List + * @author yinzuomei + * @description + * @Date 2020/8/30 21:40 + **/ + private List calculate(Map> indexMap) { + //构造入参 + List indexInputVOS = this.getIndexInputVOList(indexMap); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + return batchScoreCalculator.exec(indexInputVOS); + } + + /** + * @param indexMap + * @return java.util.List + * @author yinzuomei + * @description + * @Date 2020/8/30 18:34 + **/ + private List getIndexInputVOList(Map> indexMap) { + List list = new ArrayList<>(); + //遍历所有的指标 + indexMap.forEach((key, indexInputVO) -> { + list.add(indexInputVO); + }); + return list; + } + + + /** + * @param indexList 指标集合 + * @param minAndMaxMap 最大值最小值集合 + * @return java.util.Map + * @author yinzuomei + * @description + * @Date 2020/8/30 15:56 + **/ + private Map> getIndexInputVO(CalculateCommonFormDTO formDTO, List indexList, Map minAndMaxMap) { + Map> map = new HashMap<>(); + for (int indexNum = 0; indexNum < indexList.size(); indexNum++) { + IndexGroupDetailEntity index = indexList.get(indexNum); + IndexInputVO indexInputVO = new IndexInputVO(); + // 指标code + indexInputVO.setIndexId(index.getIndexCode()); + //权重 + indexInputVO.setWeight(index.getWeight()); + BigDecimal minValue = null; + BigDecimal maxValue = null; + if (IndexCodeEnum.ZUZHINEIDANGYDLXQZNLKPFPJZ.getCode().equals(index.getIndexCode())) { + //组织内党员的联系群众能力考评分(平均值) TODO 获取最大值,最小值 + logger.info("组织内党员的联系群众能力考评分(平均值) TODO"); + /*Map contactResiAblityMap=; + minValue=contactResiAblityMap.get(StrConstant.MIN); + maxValue=contactResiAblityMap.get(StrConstant.MAX);*/ + continue; + } else { + //获取指标对应的列名 + String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(index.getIndexCode()); +// logger.info("fieldName=" + fieldName + ";index.getIndexCode()=" + index.getIndexCode()); + //最小值key + String minValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MIN); + //最大值key + String maxValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MAX); + minValue = new BigDecimal(String.valueOf(minAndMaxMap.get(minValueKey))); + maxValue = new BigDecimal(String.valueOf(minAndMaxMap.get(maxValueKey))); + } +// logger.info("minValue="+minValue+";maxValue="+maxValue); + //分值计算器 + ScoreCalculator scoreCalculator = new BigDecimalScoreCalculator(minValue, + maxValue, + ScoreConstants.MIN_SCORE, + ScoreConstants.MAX_SCORE, + Correlation.getCorrelation(index.getCorrelation()) + ); + indexInputVO.setScoreCalculator(scoreCalculator); + List> sampleValueList = new ArrayList<>(); + indexInputVO.setIndexValueVOs(sampleValueList); + + map.put(index.getIndexCode(), indexInputVO); + } + return map; + } + + /** * @param formDTO * @param indexList + * @return void * @author yinzuomei * @description 计算网格相关-治理能力 - * @Date 2020/8/26 16:47 + * @Date 2020/8/26 16:47 **/ - private void calculateGridCorreLationZhiLi(CalculateCommonFormDTO formDTO,List indexList){ + private void calculateGridCorreLationZhiLi(CalculateCommonFormDTO formDTO, List indexList) { } /** - * @return void * @param formDTO * @param indexList + * @return void * @author yinzuomei - * @description 计算网格相关-服务能力 - * @Date 2020/8/26 16:48 + * @description 计算网格相关-服务能力 + * @Date 2020/8/26 16:48 **/ - private void calculateGridCorreLationFuWu(CalculateCommonFormDTO formDTO,List indexList){ + private void calculateGridCorreLationFuWu(CalculateCommonFormDTO formDTO, List indexList) { } /** - * @return void * @param formDTO * @param indexList + * @return void * @author yinzuomei * @description 计算网格相关总分 * @Date 2020/8/26 16:50 **/ - private void calculateGridCorreLationTotal(CalculateCommonFormDTO formDTO,List indexList){ + private void calculateGridCorreLationTotal(CalculateCommonFormDTO formDTO, List indexList) { } - /** * @param customerId * @return com.epmet.dto.indexcal.CustomerGridInfoDTO @@ -150,14 +316,14 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { } /** - * @return * @param formDTO + * @return * @author yinzuomei * @description 分页查询网格列表 * @Date 2020/8/27 14:42 **/ @Override - public List pageGridList(PageQueryGridFormDTO formDTO){ + public List pageGridList(PageQueryGridFormDTO formDTO) { int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); formDTO.setPageIndex(pageIndex); return screenCustomerGridDao.pageListByCustomerId(formDTO); @@ -165,16 +331,15 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { /** - * @param customerId - * @param monthId + * @param formDTO * @return java.util.List * @author yinzuomei * @description 党建能力-网格相关事实表 当前客户下,所有网格的党建能力相关五级指标 * @Date 2020/8/26 15:52 **/ @Override - public List> queryListPartyAblityGrid(String customerId, String monthId) { - return factIndexPartyAblityGridMonthlyDao.selectListPartyAblityGrid(customerId, monthId); + public List> queryListPartyAblityGrid(PageQueryGridFormDTO formDTO) { + return factIndexPartyAblityGridMonthlyDao.selectListPartyAblityGrid(formDTO); } /*网格群众用户数 @@ -191,29 +356,29 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { 网格议题转项目率 组织“三会一课”次数 党员参加“三会一课”人次*/ + /** - * @return java.util.Map * @param customerId * @param monthId + * @return java.util.Map * @author yinzuomei * @description 查询党建能力,网格相关,各五级指标最大值,最小值 - * @Date 2020/8/27 12:47 + * @Date 2020/8/27 12:47 **/ - public Map queryPartyAblityGridMinAndMax(String customerId, String monthId){ - return factIndexPartyAblityGridMonthlyDao.selectPartyAblityGridMinAndMax(customerId,monthId); + public Map queryPartyAblityGridMinAndMax(String customerId, String monthId) { + return factIndexPartyAblityGridMonthlyDao.selectPartyAblityGridMinAndMax(customerId, monthId); } - - + + /** - * @param customerId - * @param monthId + * @param formDTO * @return java.util.List * @author yinzuomei * @description 当前客户下,所有网格的治理能力相关五级指标 * @Date 2020/8/26 15:55 **/ - public List> queryListGovrnAblityGrid(String customerId, String monthId) { - return factIndexGovrnAblityGridMonthlyDao.selectListGovrnAblityGrid(customerId, monthId); + public List> queryListGovrnAblityGrid(PageQueryGridFormDTO formDTO) { + return factIndexGovrnAblityGridMonthlyDao.selectListGovrnAblityGrid(formDTO); } @@ -230,23 +395,22 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { } /** - * @param customerId - * @param monthId + * @param formDTO * @return java.util.List * @author yinzuomei * @description 当前客户下,所有网格的服务能力相关五级指标 * @Date 2020/8/26 15:55 **/ - public List> queryListServiceAblityGrid(String customerId, String monthId) { - return factIndexServiceAblityGridMonthlyDao.selectListServiceAblityGrid(customerId, monthId); + public List> queryListServiceAblityGrid(PageQueryGridFormDTO formDTO) { + return factIndexServiceAblityGridMonthlyDao.selectListServiceAblityGrid(formDTO); } /** - * @return java.util.Map * @param customerId * @param monthId + * @return java.util.Map * @author yinzuomei - * @description 查询 服务能力,网格相关,各五级指标最大值,最小值 + * @description 查询 服务能力,网格相关,各五级指标最大值,最小值 * @Date 2020/8/27 12:50 **/ public Map queryServiceAblityGridMinAndMax(String customerId, String monthId) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/Correlation.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/Correlation.java index f7a31b1436..acacce6f1a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/Correlation.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/Correlation.java @@ -14,4 +14,33 @@ public enum Correlation { this.code = code; this.desc = desc; } + + public static Correlation getCorrelation(String code){ + if (code == null) { + return Correlation.POSITIVE; + } + Correlation[] values = Correlation.values(); + for (Correlation correlation : values) { + if (code.equals(correlation.getCode())) { + return correlation; + } + } + return Correlation.POSITIVE; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java index df84c2196c..0eab3dcf4b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java @@ -173,7 +173,7 @@ public abstract class ScoreCalculator { */ protected BigDecimal calcuteCoefficient(BigDecimal min, BigDecimal max) { BigDecimal fenmu = max.subtract(min); - if (fenmu.toString().equals("0"))return new BigDecimal(0); + if (fenmu.compareTo(BigDecimal.ZERO)==0)return new BigDecimal(0); BigDecimal fenzi = maxScore.subtract(minScore); BigDecimal divide = fenzi.divide(fenmu, MathContext.DECIMAL32); System.out.println("分子:"+fenzi+"分母:"+fenmu+"系数:"+divide.toString()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml index 504ed412e1..e5780e24fa 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml @@ -86,7 +86,7 @@ - SELECT m.CUSTOMER_ID, m.GRID_ID, @@ -105,6 +105,8 @@ m.DEL_FLAG = '0' and m.CUSTOMER_ID=#{customerId} and m.MONTH_ID=#{monthId} + order by m.GRID_ID asc + LIMIT #{pageIndex}, #{pageSize} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml index e0ca717e07..f0d83bf06c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml @@ -102,7 +102,7 @@ - SELECT m.CUSTOMER_ID, m.GRID_ID, @@ -126,6 +126,8 @@ m.DEL_FLAG = '0' AND m.CUSTOMER_ID =#{customerId} AND m.MONTH_ID =#{monthId} + order by m.GRID_ID asc + LIMIT #{pageIndex}, #{pageSize} @@ -167,4 +169,15 @@ AND m.CUSTOMER_ID =#{customerId} AND m.MONTH_ID =#{monthId} + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml index fb3c488e9e..1ab7d916d0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml @@ -71,7 +71,7 @@ - SELECT m.CUSTOMER_ID, m.GRID_ID, @@ -85,6 +85,8 @@ m.DEL_FLAG = '0' and m.CUSTOMER_ID=#{customerId} and m.MONTH_ID=#{monthId} + order by m.GRID_ID asc + LIMIT #{pageIndex}, #{pageSize} From 33bb7ebfe0dc718d41d05b7db9279e09343cd080 Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 31 Aug 2020 10:05:49 +0800 Subject: [PATCH 092/226] =?UTF-8?q?=E6=89=B9=E9=87=8F=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E5=88=86=E5=80=BC=EF=BC=9A=E6=96=B0=E5=A2=9E=E6=96=B9=E6=B3=95?= =?UTF-8?q?=EF=BC=8C=E8=AE=A1=E7=AE=97=E6=AF=8F=E4=B8=AA=E6=A0=B7=E6=9C=AC?= =?UTF-8?q?=E7=9A=84=E6=89=80=E6=9C=89=E6=8C=87=E6=A0=87=E7=9A=84=E6=80=BB?= =?UTF-8?q?=E5=BE=97=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/GridCorreLationServiceImpl.java | 2 +- .../IndexCalculateCommunityServiceImpl.java | 2 +- .../batch/BatchScoreCalculator.java | 36 +++++++++++++++++-- .../stats/test/normalizing/DemoScoreCal.java | 32 +++++++++++++++-- 4 files changed, 66 insertions(+), 6 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java index 8b052d2638..03bce4449b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java @@ -190,7 +190,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //构造入参 List indexInputVOS = this.getIndexInputVOList(indexMap); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - return batchScoreCalculator.exec(indexInputVOS); + return batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java index 31a1cfe543..15e0b36ff7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java @@ -130,7 +130,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni IndexInputVO index1VO = new IndexInputVO<>(indexGroup.getIndexId(), ll, indexGroup.getWeight(), sc1); List indexInputVOS = Arrays.asList(index1VO); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - List result = batchScoreCalculator.exec(indexInputVOS); + List result = batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); result.get(NumConstant.ZERO).getIndexScoreVOs().forEach(agency -> { communityPublishArticle.forEach(publish -> { if (publish.getAgencyId().equals(agency.getSampleId())){ 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 9ce5ec4913..d42ae98562 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 @@ -3,18 +3,20 @@ package com.epmet.support.normalizing.batch; import com.epmet.support.normalizing.ScoreCalculator; import java.math.BigDecimal; +import java.util.HashMap; import java.util.List; import java.util.stream.Collectors; public class BatchScoreCalculator { /** - * 执行计算 + * 执行计算,每个指标中每个样本的得分明细 * @return 每一条都是一个指标的,所有样本对应的,得分值 */ - public List exec(List indexInputVOS) { + public List getScoreDetailOfIndexId(List indexInputVOS) { return indexInputVOS.stream().map(i -> { + // 每个指标循环一次 String indexId = i.getIndexId(); List indexValueVOs = i.getIndexValueVOs(); BigDecimal weight = i.getWeight(); @@ -30,4 +32,34 @@ public class BatchScoreCalculator { }).collect(Collectors.toList()); } + /** + * 执行计算,以样本的所有指标总得分 + * @param indexInputVOS + * @return + */ + public HashMap getScoreCountOfSampleId(List indexInputVOS) { + + // 每个样本的总得分 + HashMap scoreCountOfSamples = new HashMap<>(); + + for (IndexInputVO idx : indexInputVOS) { + // 每个指标循环一次 + List indexValueVOs = idx.getIndexValueVOs(); + BigDecimal weight = idx.getWeight(); + ScoreCalculator scoreCalculator = idx.getScoreCalculator(); + + for (SampleValue vo : indexValueVOs) { + String sampleId = vo.getSampleId(); + BigDecimal score = scoreCalculator.normalize(vo.getSampleValue(), weight); + if (scoreCountOfSamples.containsKey(sampleId)) { + BigDecimal newScore = scoreCountOfSamples.get(sampleId).add(score); + scoreCountOfSamples.put(sampleId, newScore); + } else { + scoreCountOfSamples.put(sampleId, score); + } + } + } + + return scoreCountOfSamples; + } } 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 fb3f1246d4..c080ffc296 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 @@ -9,6 +9,7 @@ import org.junit.Test; import java.math.BigDecimal; import java.util.Arrays; +import java.util.HashMap; import java.util.List; public class DemoScoreCal { @@ -83,7 +84,7 @@ public class DemoScoreCal { List indexInputVOS = Arrays.asList(index1VO, index2VO); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - List result = batchScoreCalculator.exec(indexInputVOS); + List result = batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); System.err.println("--------------------------------"); result.stream().forEach(r -> System.out.println(r)); @@ -109,7 +110,7 @@ public class DemoScoreCal { List indexInputVOS = Arrays.asList(index1VO, index2VO); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - List result = batchScoreCalculator.exec(indexInputVOS); + List result = batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); System.err.println("--------------------------------"); result.stream().forEach(r -> System.out.println(r)); @@ -117,5 +118,32 @@ public class DemoScoreCal { System.err.println("--------------------------------"); } + @Test + public void testBigDecimalBatchCalculateGroupBySampleId() throws InterruptedException { + //{4,8,1,3,2} + + // 每个指标需要单独的分支计算器,因为每个指标的最大最小值是不同的 + ScoreCalculator sc1 = new BigDecimalScoreCalculator(new BigDecimal(1), new BigDecimal(8), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.NEGATIVE); + ScoreCalculator sc2 = new BigDecimalScoreCalculator(new BigDecimal(1), new BigDecimal(8), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.NEGATIVE); + + List index1SampleValues = Arrays.asList(new SampleValue<>("id1", new BigDecimal(4)), new SampleValue<>("id2", new BigDecimal(1)), new SampleValue<>("id3", new BigDecimal(8))); + 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(1), sc1); + IndexInputVO index2VO = new IndexInputVO("bbb", index2SampleValues, new BigDecimal(1), sc2); + + List indexInputVOS = Arrays.asList(index1VO, index2VO); + + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap result = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + + System.err.println("--------------------------------"); + result.forEach((key, value) -> { + System.out.println(key.concat("的得分为:").concat(value.toString())); + }); + System.err.println("--------------------------------"); + } + } From 8ebe8b6b731bf7393f10f26ee8512432d3b0b40b Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 31 Aug 2020 10:08:53 +0800 Subject: [PATCH 093/226] =?UTF-8?q?=E7=94=9F=E6=88=90fact=5Findex=5Fcpc=5F?= =?UTF-8?q?score=E3=80=81fact=5Findex=5Fgrid=5Fscore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dao/indexscore/CpcScoreDao.java | 33 +++++++ .../epmet/dao/indexscore/GridScoreDao.java | 33 +++++++ .../entity/indexscore/CpcScoreEntity.java | 87 ++++++++++++++++++ .../entity/indexscore/GridScoreEntity.java | 92 +++++++++++++++++++ .../impl/GridCorreLationServiceImpl.java | 47 +++++++--- .../mapper/indexscore/CpcScoreDao.xml | 26 ++++++ .../mapper/indexscore/GridScoreDao.xml | 27 ++++++ 7 files changed, 333 insertions(+), 12 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/CpcScoreDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/GridScoreDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexscore/CpcScoreEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexscore/GridScoreEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/GridScoreDao.xml diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/CpcScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/CpcScoreDao.java new file mode 100644 index 0000000000..74628e78e8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/CpcScoreDao.java @@ -0,0 +1,33 @@ +/** + * 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.indexscore; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.indexscore.CpcScoreEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 党员相关分值 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-31 + */ +@Mapper +public interface CpcScoreDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/GridScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/GridScoreDao.java new file mode 100644 index 0000000000..77de72959f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/GridScoreDao.java @@ -0,0 +1,33 @@ +/** + * 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.indexscore; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.indexscore.GridScoreEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 网格相关分值 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-31 + */ +@Mapper +public interface GridScoreDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexscore/CpcScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexscore/CpcScoreEntity.java new file mode 100644 index 0000000000..59c4269a3b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexscore/CpcScoreEntity.java @@ -0,0 +1,87 @@ +/** + * 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.entity.indexscore; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 党员相关分值 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-31 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_cpc_score") +public class CpcScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属的机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 用户id + */ + private String userId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 党建能力分值 + */ + private BigDecimal partyAblityScore; + + /** + * 参与议事分值 + */ + private BigDecimal joinIssueScore; + + /** + * 党务活动分值 + */ + private BigDecimal partyWorkActScore; + + /** + * 联系群众分值 + */ + private BigDecimal contactMassesScore; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexscore/GridScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexscore/GridScoreEntity.java new file mode 100644 index 0000000000..3b4b4c44c9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexscore/GridScoreEntity.java @@ -0,0 +1,92 @@ +/** + * 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.entity.indexscore; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 网格相关分值 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-31 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_grid_score") +public class GridScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 网格所属的机关Id + */ + private String agencyId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 总指数分值 + */ + private BigDecimal totalScore; + + /** + * 党建能力分值 + */ + private BigDecimal partyAblityScore; + + /** + * 治理能力分值 + */ + private BigDecimal govrnAblityScore; + + /** + * 服务能力分值 + */ + private BigDecimal serviceAblityScore; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java index 8b052d2638..d06d57ee21 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java @@ -136,12 +136,13 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { SampleValue currentGridIndexValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), new BigDecimal(sampleValueStr)); value.getIndexValueVOs().add(currentGridIndexValue); } else if (IndexCodeEnum.ZUZHINEIDANGYDLXQZNLKPFPJZ.getCode().equals(key)) { - //组织内党员的联系群众能力考评分(平均值) TODO - logger.info("组织内党员的联系群众能力考评分(平均值) TODO"); + //组织内党员的联系群众能力考评分(平均值) + logger.info("组织内党员的联系群众能力考评分(平均值) 单独处理"); //网格内党员的联系群众能力考评分(平均值) - /* BigDecimal contactResiAblity = null; - SampleValue contactResiAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), contactResiAblity); - value.getIndexValueVOs().add(contactResiAblityValue);*/ + String gridId=(String) recordMap.get(IndexCalConstant.GRID_ID); + BigDecimal contactMassesAvgValue = getGridContactMassesAvgValue(gridId); + SampleValue contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), contactMassesAvgValue); + value.getIndexValueVOs().add(contactMassesAblityValue); } }); }); @@ -162,6 +163,29 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { } } + /** + * @return java.util.Map + * @param formDTO + * @author yinzuomei + * @description TODO + * @Date 2020/8/31 9:51 + **/ + private Map contactMassesAblityMap(CalculateCommonFormDTO formDTO) { + + return null; + } + + /** + * @return java.math.BigDecimal + * @param gridId 网格id + * @author yinzuomei TODO + * @description 获取网格(组织)内党员的联系群众能力考评分(平均值) + * @Date 2020/8/31 9:50 + **/ + private BigDecimal getGridContactMassesAvgValue(String gridId) { + return null; + } + /** * @param formDTO 客户id 月份id: yyyyMM * @param indexList 指标集合 @@ -230,12 +254,11 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { BigDecimal minValue = null; BigDecimal maxValue = null; if (IndexCodeEnum.ZUZHINEIDANGYDLXQZNLKPFPJZ.getCode().equals(index.getIndexCode())) { - //组织内党员的联系群众能力考评分(平均值) TODO 获取最大值,最小值 - logger.info("组织内党员的联系群众能力考评分(平均值) TODO"); - /*Map contactResiAblityMap=; - minValue=contactResiAblityMap.get(StrConstant.MIN); - maxValue=contactResiAblityMap.get(StrConstant.MAX);*/ - continue; + //组织内党员的联系群众能力考评分(平均值) 获取最大值,最小值 + logger.info("组织内党员的联系群众能力考评分(平均值) 单独处理"); + Map contactMassesAblityMap= this.contactMassesAblityMap(formDTO); + minValue=contactMassesAblityMap.get(StrConstant.MIN); + maxValue=contactMassesAblityMap.get(StrConstant.MAX); } else { //获取指标对应的列名 String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(index.getIndexCode()); @@ -267,7 +290,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { /** * @param formDTO * @param indexList - * @return void + * @return void TODO * @author yinzuomei * @description 计算网格相关-治理能力 * @Date 2020/8/26 16:47 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml new file mode 100644 index 0000000000..3a17dcc82b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/GridScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/GridScoreDao.xml new file mode 100644 index 0000000000..4b1d7f6fcc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/GridScoreDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 2c354ad1af543b451b6985856672618a97d2de5e Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 31 Aug 2020 10:28:52 +0800 Subject: [PATCH 094/226] =?UTF-8?q?=E6=94=AF=E9=83=A8=E5=BB=BA=E8=AE=BE?= =?UTF-8?q?=E6=83=85=E5=86=B5|=E8=81=94=E5=BB=BA=E5=85=B1=E5=BB=BA?= =?UTF-8?q?=E6=83=85=E5=86=B5-=E6=8A=98=E7=BA=BF=E5=9B=BE=20=E5=85=9A?= =?UTF-8?q?=E5=91=98=E5=BF=97=E6=84=BF=E6=9C=8D=E5=8A=A1=20=E4=B8=A4?= =?UTF-8?q?=E4=B8=AA=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=8F=82=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=B8=A4=E4=B8=AA=E5=B1=9E=E6=80=A7=EF=BC=8C=E6=80=BB=E5=8F=82?= =?UTF-8?q?=E4=B8=8E=E6=95=B0=E5=92=8C=E6=80=BB=E7=BB=84=E7=BB=87=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/BranchBuildTrendResultDTO.java | 11 +++++++++++ .../dto/result/VolunteerServiceResultDTO.java | 10 ++++++++++ .../dao/screen/ScreenPartyBranchDataDao.java | 12 ++++++++++++ .../impl/GrassrootsPartyDevServiceImpl.java | 7 ++++++- .../screen/impl/PartyMemberLeadServiceImpl.java | 7 +++++++ .../epmet/datareport/utils/ModuleConstant.java | 10 ++++++++++ .../mapper/screen/ScreenPartyBranchDataDao.xml | 16 +++++++++++++++- 7 files changed, 71 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchBuildTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchBuildTrendResultDTO.java index 58a277322f..ee30981a68 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchBuildTrendResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchBuildTrendResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.screen.dto.result; +import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; import java.io.Serializable; @@ -28,4 +29,14 @@ public class BranchBuildTrendResultDTO implements Serializable { private List seriesData; + /** + * 总组织次数 + * */ + private Integer totalOrganizationCount = NumConstant.ZERO; + + /** + * 总参与人数 + * */ + private Integer totalJoinUserCount = NumConstant.ZERO; + } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResultDTO.java index 18331f9ca7..d856e5081c 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResultDTO.java @@ -33,4 +33,14 @@ public class VolunteerServiceResultDTO implements Serializable { * 平均参与人次 */ private List averageJoinUserData; + + /** + * 总组织次数 + * */ + private Integer totalOrganizationCount; + + /** + * 总参与人数 + * */ + private Integer totalJoinUserCount; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyBranchDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyBranchDataDao.java index 0117eec4a7..f28a23354b 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyBranchDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyBranchDataDao.java @@ -68,4 +68,16 @@ public interface ScreenPartyBranchDataDao { * @date 2020.08.20 09:46 **/ List selectBranchDataByTypeOrder(@Param("agencyId")String agencyId,@Param("category")String category,@Param("monthId")String monthId,@Param("bottomMonthId")String bottomMonthId); + + /** + * @Description 查询组织总数或者总参与人数 + * @param category + * @param type + * @param agencyId + * @param monthId + * @return + * @author wangc + * @date 2020.08.28 17:56 + **/ + Integer selectTotalOrganizationCount(@Param("category") String category,@Param("type") String type, @Param("agencyId") String agencyId,@Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java index aa1b23a448..4fa8a23c20 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java @@ -155,7 +155,12 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService result.setSeriesData(dataArray); result.setLegend(null == result.getLegend() ? new ArrayList<>() : result.getLegend()); - + //总组织次数 + Integer totalOrganizationCount = screenPartyBranchDataDao.selectTotalOrganizationCount(param.getCategory(),ModuleConstant.PARAM_BRANCH_DATA_TYPE_ORGAN,param.getAgencyId(),monthMap.keySet().iterator().next()); + //总参与人数 + Integer totalJoinUserCount = screenPartyBranchDataDao.selectTotalOrganizationCount(param.getCategory(),ModuleConstant.PARAM_BRANCH_DATA_TYPE_JOIN,param.getAgencyId(),monthMap.keySet().iterator().next()); + result.setTotalOrganizationCount(null == totalOrganizationCount ? NumConstant.ZERO : totalOrganizationCount); + result.setTotalJoinUserCount(null == totalJoinUserCount ? NumConstant.ZERO : totalJoinUserCount); return result; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java index a1031a9494..8af422652a 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java @@ -147,6 +147,13 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { result.setOrganizeData(organizeData); result.setJoinData(joinData); result.setAverageJoinUserData(averageJoinUserData); + String bottomMonthId = collect.get(collect.size() - NumConstant.ONE).getMonthId(); + //总组织次数 + Integer totalOrganizationCount = screenPartyBranchDataDao.selectTotalOrganizationCount(ModuleConstant.KEY_BRANCH_CATEGORY_VOLUNTARY_SERVICE,ModuleConstant.PARAM_BRANCH_DATA_TYPE_ORGAN,volunteerServiceFormDTO.getAgencyId(),bottomMonthId); + //总参与人数 + Integer totalJoinUserCount = screenPartyBranchDataDao.selectTotalOrganizationCount(ModuleConstant.KEY_BRANCH_CATEGORY_VOLUNTARY_SERVICE,ModuleConstant.PARAM_BRANCH_DATA_TYPE_JOIN,volunteerServiceFormDTO.getAgencyId(),bottomMonthId); + result.setTotalOrganizationCount(totalOrganizationCount); + result.setTotalJoinUserCount(totalJoinUserCount); return result; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/ModuleConstant.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/ModuleConstant.java index 9314d3ba3b..7e3af9f112 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/ModuleConstant.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/ModuleConstant.java @@ -21,4 +21,14 @@ public interface ModuleConstant { String PARAM_DIFFICULTY_TYPE_MOST_DEPTS = "mostdepts"; String PARAM_DIFFICULTY_TYPE_MOST_HANDLED = "mosthandled"; + + /** + * 支部建设情况折线图 查询数据类型 组织次数 + * */ + String PARAM_BRANCH_DATA_TYPE_ORGAN = "organize"; + + /** + * 支部建设情况折线图 查询数据类型 参与人数 + * */ + String PARAM_BRANCH_DATA_TYPE_JOIN = "joinuser"; } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml index 165b383a81..013f43c74b 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml @@ -29,7 +29,6 @@ screen_party_branch_data WHERE DEL_FLAG = '0' - AND ORG_TYPE = 'agency' AND ORG_ID = #{agencyId} AND TYPE = #{category} AND MONTH_ID = ]]> #{bottomMonthId} @@ -85,4 +84,19 @@ LIMIT 12 + + \ No newline at end of file From 239520b4f5944e62ebe9bd9afff0a941cddd54af Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 31 Aug 2020 10:29:30 +0800 Subject: [PATCH 095/226] =?UTF-8?q?=E5=8F=96=E6=9C=88=E4=BB=BD=E5=8C=BA?= =?UTF-8?q?=E9=97=B4=E7=9A=84=E5=B7=A6=E5=8C=BA=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/screen/impl/PartyMemberLeadServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java index 8af422652a..2cf28aca5a 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java @@ -147,7 +147,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { result.setOrganizeData(organizeData); result.setJoinData(joinData); result.setAverageJoinUserData(averageJoinUserData); - String bottomMonthId = collect.get(collect.size() - NumConstant.ONE).getMonthId(); + String bottomMonthId = collect.get(NumConstant.ZERO).getMonthId(); //总组织次数 Integer totalOrganizationCount = screenPartyBranchDataDao.selectTotalOrganizationCount(ModuleConstant.KEY_BRANCH_CATEGORY_VOLUNTARY_SERVICE,ModuleConstant.PARAM_BRANCH_DATA_TYPE_ORGAN,volunteerServiceFormDTO.getAgencyId(),bottomMonthId); //总参与人数 From be6217395d0be4c1f25fae4a56c40d6aeeebf08d Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 31 Aug 2020 10:37:13 +0800 Subject: [PATCH 096/226] =?UTF-8?q?=E8=AE=A1=E7=AE=97=E5=85=9A=E5=91=98?= =?UTF-8?q?=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/IndexCalConstant.java | 2 + .../FactIndexPartyAblityCpcMonthlyDao.java | 5 +- .../impl/CpcIndexCalculateServiceImpl.java | 166 +++++++++++++++--- .../impl/IndexCalculateServiceImpl.java | 2 +- .../FactIndexPartyAblityCpcMonthlyDao.xml | 74 +++----- 5 files changed, 174 insertions(+), 75 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java index 0cfcdcc2a7..aff436ff3d 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java @@ -15,4 +15,6 @@ public interface IndexCalConstant { String CUSTOMER_ID="CUSTOMER_ID"; String MONTH_ID="MONTH_ID"; + + String USER_ID="USER_ID"; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java index f9c0ad1af2..cdecd48f51 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java @@ -23,7 +23,6 @@ import com.epmet.entity.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; -import java.math.BigDecimal; import java.util.List; import java.util.Map; @@ -70,7 +69,7 @@ public interface FactIndexPartyAblityCpcMonthlyDao extends BaseDao list, @Param("customerId") String customerId); - Map getCountByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); + List> getCountByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("offset") Integer offset, @Param("pageSize") Integer pageSize); - Map getExtremeValue(@Param("customerId") String customerId); + Map getExtremeValue(@Param("customerId") String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java index 0367e90137..c427a81eb9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -1,6 +1,7 @@ package com.epmet.service.indexcal.impl; -import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.constant.IndexCalConstant; import com.epmet.dao.indexcoll.FactIndexPartyAblityCpcMonthlyDao; import com.epmet.dao.screen.IndexCodeFieldReDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; @@ -9,14 +10,24 @@ import com.epmet.eum.IndexCodeEnum; import com.epmet.service.indexcal.CpcIndexCalculateService; import com.epmet.service.indexcal.IndexCodeFieldReService; import com.epmet.service.screen.IndexGroupDetailService; +import com.epmet.support.normalizing.BigDecimalScoreCalculator; +import com.epmet.support.normalizing.Correlation; +import com.epmet.support.normalizing.ScoreCalculator; +import com.epmet.support.normalizing.ScoreConstants; +import com.epmet.support.normalizing.batch.*; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; @Slf4j @Service @@ -29,35 +40,144 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { private IndexGroupDetailService getDetailListByParentCode; @Autowired private IndexCodeFieldReService indexCodeFieldReService; + @Override public Boolean cpcIndexCalculate(CalculateCommonFormDTO formDTO) { - //计算最大最小值 - Map minAndMaxList = factIndexPartyAblityCpcMonthlyDao.getExtremeValue(formDTO.getCustomerId()); - if (CollectionUtils.isEmpty(minAndMaxList)){ - log.warn("cpcIndexCalculate customerId:{} have not any fact record",formDTO.getCustomerId()); - return false; - } - //获取指标权重信息 - List indexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(),IndexCodeEnum.CAN_YU_YI_SHI.getCode()); - if (CollectionUtils.isEmpty(indexDetails)){ - log.warn("cpcIndexCalculate customerId:{} have not any indexGroupDetail",formDTO.getCustomerId()); + + //获取指标权重信息 -参与议事 + List indexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.CAN_YU_YI_SHI.getCode()); + if (CollectionUtils.isEmpty(indexDetails)) { + log.warn("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); return false; } + + canyuyishi(formDTO, indexDetails); + + + //log.info(JSON.toJSONString(minAndMaxList)); + return null; + } + + private void canyuyishi(CalculateCommonFormDTO formDTO, List indexDetails) { Map indexCodeFieldReList = indexCodeFieldReService.getIndexCodeFieldReMap(); - if (CollectionUtils.isEmpty(indexCodeFieldReList)){ - log.warn("cpcIndexCalculate have any indexcodefieldre"); - return false; + if (CollectionUtils.isEmpty(indexCodeFieldReList)) { + log.error("cpcIndexCalculate have any indexcodefieldre"); + return; } - String indexCode = null; - String fieldName = null; - for (IndexGroupDetailEntity indexDetail : indexDetails) { - indexCode = indexDetail.getIndexCode(); - fieldName = indexCodeFieldReService.getFieldNameByIndexCode(indexCode); - + //计算最大最小值 + Map minAndMaxMap = factIndexPartyAblityCpcMonthlyDao.getExtremeValue(formDTO.getCustomerId()); + if (CollectionUtils.isEmpty(minAndMaxMap)) { + log.warn("cpcIndexCalculate getExtremeValue customerId:{} have not any fact record", formDTO.getCustomerId()); + return; } + //指标集合 + Map> indexMap = getIndexInputVO(indexDetails, minAndMaxMap); + List> list = null; + int pageNo = 1; + int pageSize = 10; + do { + String fieldName = null; + list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize); + if (!CollectionUtils.isEmpty(list)) { + //遍历指标 进行计算 + for (Map.Entry> entry : indexMap.entrySet()) { + String indexCode = entry.getKey(); + IndexInputVO value = entry.getValue(); + fieldName = indexCodeFieldReService.getFieldNameByIndexCode(indexCode); + if (StringUtils.isBlank(fieldName)) { + log.error("cpcIndexCalculate fieldName error"); + continue; + } + for (Map cpcIndex : list) { + //对应的数值 + String sampleValueStr = String.valueOf(cpcIndex.get(indexCodeFieldReService.getFieldNameByIndexCode(fieldName))); + //构造样本值对象 + SampleValue currentGridIndexValue = new SampleValue((String) cpcIndex.get(IndexCalConstant.USER_ID), new BigDecimal(sampleValueStr)); + value.getIndexValueVOs().add(currentGridIndexValue); + } - log.info(JSON.toJSONString(minAndMaxList)); - Map list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId()); - return null; + } + } + + List result = calculate(indexMap); + // TODO 处理结果 + saveGridCorreLationDangJian(formDTO, indexDetails, result); + + try { + for (IndexOutputVO m : result) { + log.info("indexId=" + m.getIndexId()); + for (SampleScore sampleScore : m.getIndexScoreVOs()) { + log.info(String.format("网格id:%s,得分:%s", sampleScore.getSampleId(), sampleScore.getSampleScore())); + } + } + } catch (Exception e) { + } + + } while (!CollectionUtils.isEmpty(list) && pageNo++ > 0); + + } + + @Transactional(rollbackFor = Exception.class) + public void saveGridCorreLationDangJian(CalculateCommonFormDTO formDTO, List indexDetails, List result) { + + } + + /** + * @param indexMap + * @return java.util.List + * @author yinzuomei + * @description + * @Date 2020/8/30 21:40 + **/ + private List calculate(Map> indexMap) { + //构造入参 + List indexInputVOS = indexMap.values().stream().collect(Collectors.toList()); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + return batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); + } + + /** + * @param indexList 指标集合 + * @param minAndMaxMap 最大值最小值集合 + * @return java.util.Map + * @author yinzuomei + * @description + * @Date 2020/8/30 15:56 + **/ + private Map> getIndexInputVO(List indexList, Map minAndMaxMap) { + Map> map = new HashMap<>(); + for (int indexNum = 0; indexNum < indexList.size(); indexNum++) { + IndexGroupDetailEntity index = indexList.get(indexNum); + IndexInputVO indexInputVO = new IndexInputVO(); + // 指标code + indexInputVO.setIndexId(index.getIndexCode()); + //权重 + indexInputVO.setWeight(index.getWeight()); + BigDecimal minValue = null; + BigDecimal maxValue = null; + + //获取指标对应的列名 + String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(index.getIndexCode()); + //最小值key + String minValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MIN); + //最大值key + String maxValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MAX); + minValue = new BigDecimal(String.valueOf(minAndMaxMap.get(minValueKey))); + maxValue = new BigDecimal(String.valueOf(minAndMaxMap.get(maxValueKey))); + + //分值计算器 + ScoreCalculator scoreCalculator = new BigDecimalScoreCalculator(minValue, + maxValue, + ScoreConstants.MIN_SCORE, + ScoreConstants.MAX_SCORE, + Correlation.getCorrelation(index.getCorrelation()) + ); + indexInputVO.setScoreCalculator(scoreCalculator); + List> sampleValueList = new ArrayList<>(); + indexInputVO.setIndexValueVOs(sampleValueList); + + map.put(index.getIndexCode(), indexInputVO); + } + return map; } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java index 4163ea074c..fa6c520c96 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java @@ -58,7 +58,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { CalculateCommonFormDTO calculateCommonFormDTO=new CalculateCommonFormDTO(customerId, formDTO.getMonthId()); //计算党员 try { - Map list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(customerId, formDTO.getMonthId()); + Map list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(customerId, formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize); } catch (Exception e) { } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml index 41946192dd..beb5b42a4e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml @@ -3,33 +3,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - delete from fact_index_party_ablity_cpc_monthly where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} AND USER_ID = #{userId} @@ -94,27 +67,7 @@ - + + + + From 00324ad1c760545e702120b5cc170539fde9a423 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 31 Aug 2020 13:33:56 +0800 Subject: [PATCH 097/226] =?UTF-8?q?=E9=94=99=E8=AF=AF=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dao/screen/IndexGroupDetailDao.java | 2 + .../impl/CpcIndexCalculateServiceImpl.java | 79 ++++++++++--------- .../screen/IndexGroupDetailService.java | 8 ++ .../impl/IndexCalculateServiceImpl.java | 4 +- .../impl/IndexGroupDetailServiceImpl.java | 5 ++ .../mapper/screen/IndexGroupDetailDao.xml | 9 +++ 6 files changed, 66 insertions(+), 41 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailDao.java index 8c7a4e82fb..8982bc5f29 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailDao.java @@ -34,4 +34,6 @@ import java.util.List; public interface IndexGroupDetailDao extends BaseDao { List getDetailListByParentCode(@Param("customerId") String customerId, @Param("indexCode") String indexCode); + + List getDetailListLikeParentCode(@Param("customerId") String customerId, @Param("parentIndexCode") String parentIndexCode); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java index c427a81eb9..521c9dd631 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.service.indexcal.impl; +import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.constant.IndexCalConstant; import com.epmet.dao.indexcoll.FactIndexPartyAblityCpcMonthlyDao; @@ -14,7 +15,9 @@ import com.epmet.support.normalizing.BigDecimalScoreCalculator; import com.epmet.support.normalizing.Correlation; import com.epmet.support.normalizing.ScoreCalculator; import com.epmet.support.normalizing.ScoreConstants; -import com.epmet.support.normalizing.batch.*; +import com.epmet.support.normalizing.batch.BatchScoreCalculator; +import com.epmet.support.normalizing.batch.IndexInputVO; +import com.epmet.support.normalizing.batch.SampleValue; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -45,7 +48,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { public Boolean cpcIndexCalculate(CalculateCommonFormDTO formDTO) { //获取指标权重信息 -参与议事 - List indexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.CAN_YU_YI_SHI.getCode()); + List indexDetails = getDetailListByParentCode.getDetailListLikeParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); if (CollectionUtils.isEmpty(indexDetails)) { log.warn("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); return false; @@ -53,7 +56,6 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { canyuyishi(formDTO, indexDetails); - //log.info(JSON.toJSONString(minAndMaxList)); return null; } @@ -71,54 +73,55 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { return; } //指标集合 - Map> indexMap = getIndexInputVO(indexDetails, minAndMaxMap); + //对指标进行分组 + Map> groupIndexDetailsMap = indexDetails.stream().collect(Collectors.groupingBy(IndexGroupDetailEntity::getAllParentIndexCode)); + + + List> list = null; int pageNo = 1; int pageSize = 10; do { - String fieldName = null; list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize); if (!CollectionUtils.isEmpty(list)) { - //遍历指标 进行计算 - for (Map.Entry> entry : indexMap.entrySet()) { - String indexCode = entry.getKey(); - IndexInputVO value = entry.getValue(); - fieldName = indexCodeFieldReService.getFieldNameByIndexCode(indexCode); - if (StringUtils.isBlank(fieldName)) { - log.error("cpcIndexCalculate fieldName error"); - continue; - } - for (Map cpcIndex : list) { - //对应的数值 - String sampleValueStr = String.valueOf(cpcIndex.get(indexCodeFieldReService.getFieldNameByIndexCode(fieldName))); - //构造样本值对象 - SampleValue currentGridIndexValue = new SampleValue((String) cpcIndex.get(IndexCalConstant.USER_ID), new BigDecimal(sampleValueStr)); - value.getIndexValueVOs().add(currentGridIndexValue); - } - - } - } - List result = calculate(indexMap); - // TODO 处理结果 - saveGridCorreLationDangJian(formDTO, indexDetails, result); + //遍历指标分组 计算分数 + List> finalList = list; + groupIndexDetailsMap.forEach((parentIndex, indexDetailList)->{ + Map> indexMap = getIndexInputVO(indexDetailList, minAndMaxMap); + //遍历指标 进行计算 + for (Map.Entry> entry : indexMap.entrySet()) { + String indexCode = entry.getKey(); + IndexInputVO value = entry.getValue(); + String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(indexCode); + if (StringUtils.isBlank(fieldName)) { + log.error("cpcIndexCalculate fieldName error"); + continue; + } + for (Map cpcIndex : finalList) { + //对应的数值 + String sampleValueStr = String.valueOf(cpcIndex.get(indexCodeFieldReService.getFieldNameByIndexCode(fieldName))); + //构造样本值对象 + SampleValue currentGridIndexValue = new SampleValue((String) cpcIndex.get(IndexCalConstant.USER_ID), new BigDecimal(sampleValueStr)); + value.getIndexValueVOs().add(currentGridIndexValue); + } + } + HashMap result = calculate(indexMap); + // TODO 处理结果 + saveGridCorreLationDangJian(formDTO, indexDetails, result); - try { - for (IndexOutputVO m : result) { - log.info("indexId=" + m.getIndexId()); - for (SampleScore sampleScore : m.getIndexScoreVOs()) { - log.info(String.format("网格id:%s,得分:%s", sampleScore.getSampleId(), sampleScore.getSampleScore())); + try { + System.out.println( JSON.toJSONString(result)); + } catch (Exception e) { } - } - } catch (Exception e) { + }); } - } while (!CollectionUtils.isEmpty(list) && pageNo++ > 0); } @Transactional(rollbackFor = Exception.class) - public void saveGridCorreLationDangJian(CalculateCommonFormDTO formDTO, List indexDetails, List result) { + public void saveGridCorreLationDangJian(CalculateCommonFormDTO formDTO, List indexDetails, HashMap result) { } @@ -129,11 +132,11 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { * @description * @Date 2020/8/30 21:40 **/ - private List calculate(Map> indexMap) { + private HashMap calculate(Map> indexMap) { //构造入参 List indexInputVOS = indexMap.values().stream().collect(Collectors.toList()); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - return batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); + return batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailService.java index aa69cba8e7..888b36725d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailService.java @@ -35,4 +35,12 @@ public interface IndexGroupDetailService extends BaseService getDetailListByParentCode(String customerId,String... indexCode); + + /** + * desc:获取所有 包含该指标code的 + * @param customerId + * @param parentIndexCode + * @return + */ + List getDetailListLikeParentCode(String customerId, String parentIndexCode); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java index fa6c520c96..611ad18f4e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java @@ -17,10 +17,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import java.math.BigDecimal; import java.util.Date; import java.util.List; -import java.util.Map; /** * @author liujianjun @@ -58,7 +56,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { CalculateCommonFormDTO calculateCommonFormDTO=new CalculateCommonFormDTO(customerId, formDTO.getMonthId()); //计算党员 try { - Map list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(customerId, formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize); + //Map list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(customerId, formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize); } catch (Exception e) { } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailServiceImpl.java index 0225c956c5..1135b023c8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailServiceImpl.java @@ -48,4 +48,9 @@ public class IndexGroupDetailServiceImpl extends BaseServiceImpl getDetailListLikeParentCode(String customerId, String parentIndexCode) { + return baseDao.getDetailListLikeParentCode(customerId,parentIndexCode); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml index 6038ecbfeb..bb4e5636ae 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml @@ -12,4 +12,13 @@ CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} and STATUS = 'enable' and DEL_FLAG = '0' and ALL_PARENT_INDEX_CODE = #{indexCode,jdbcType=VARCHAR} + + \ No newline at end of file From ac1b8df349d28010118e2f88f607f18cea84f258 Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 31 Aug 2020 15:38:51 +0800 Subject: [PATCH 098/226] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=9A=E5=91=98?= =?UTF-8?q?=E5=BF=97=E6=84=BF=E8=80=85=E6=9C=8D=E5=8A=A1=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/PartyMemberLeadServiceImpl.java | 27 ++++++++++++++++++- .../screen/ScreenPartyBranchDataDao.xml | 8 +++--- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java index 2cf28aca5a..1ed8a24261 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java @@ -19,6 +19,7 @@ import com.epmet.screen.dto.form.VolunteerServiceFormDTO; import com.epmet.screen.dto.result.*; import com.epmet.screen.constant.*; import com.github.pagehelper.PageHelper; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -126,6 +127,13 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { List joinData = new ArrayList<>(); List averageJoinUserData = new ArrayList<>(); result.setXAxis(this.getXPro()); + //创建缺省值对象 + VolunteerServiceResult defaultObj = new VolunteerServiceResult(); + defaultObj.setAverageJoinUserData(NumConstant.ZERO); + defaultObj.setJoinData(NumConstant.ZERO); + defaultObj.setOrganizeData(NumConstant.ZERO); + + //倒叙取十二个月的数据,从本月开始,有可能取不到十二条,要对X轴空白的缺口进行填补 List volunteerServiceResults = screenPartyBranchDataDao.selectVolunteerServiceResult(volunteerServiceFormDTO.getAgencyId()); if (volunteerServiceResults.size() == NumConstant.ZERO){ for (int i = NumConstant.ZERO; i <= NumConstant.TWELVE; i++) { @@ -138,16 +146,33 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { result.setAverageJoinUserData(averageJoinUserData); return result; } + + Set yyyyMMList = dateUtils.getXpro().keySet(); + yyyyMMList.forEach(mm -> { + Optional opt = volunteerServiceResults.stream() + .filter(obj -> StringUtils.equals(mm,obj.getMonthId())).findAny(); + VolunteerServiceResult find = opt.isPresent() ? opt.get() : defaultObj; + //VolunteerServiceResult find = Optional.ofNullable(opt.isPresent() ? opt.get() : null).orElse(defaultObj); + organizeData.add(find.getOrganizeData()); + joinData.add(find.getJoinData()); + averageJoinUserData.add(find.getAverageJoinUserData()); + }); + + + /* List collect = volunteerServiceResults.stream().sorted(Comparator.comparing(VolunteerServiceResult::getMonthId)).collect(Collectors.toList()); collect.forEach(volunteer -> { organizeData.add(volunteer.getOrganizeData()); joinData.add(volunteer.getJoinData()); averageJoinUserData.add(volunteer.getAverageJoinUserData()); }); + */ + + result.setOrganizeData(organizeData); result.setJoinData(joinData); result.setAverageJoinUserData(averageJoinUserData); - String bottomMonthId = collect.get(NumConstant.ZERO).getMonthId(); + String bottomMonthId = yyyyMMList.iterator().next(); //总组织次数 Integer totalOrganizationCount = screenPartyBranchDataDao.selectTotalOrganizationCount(ModuleConstant.KEY_BRANCH_CATEGORY_VOLUNTARY_SERVICE,ModuleConstant.PARAM_BRANCH_DATA_TYPE_ORGAN,volunteerServiceFormDTO.getAgencyId(),bottomMonthId); //总参与人数 diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml index 013f43c74b..2b20c44880 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml @@ -72,14 +72,16 @@ From 9d507ee0331fc04df60e696c01e37dfd668b68ad Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 31 Aug 2020 15:46:42 +0800 Subject: [PATCH 099/226] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-user/epmet-user-server/deploy/docker-compose-prod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml b/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml index 36ea6d03ac..66f5e1a8b4 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-user-server:0.3.120 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-user-server:0.3.121 ports: - "8087:8087" network_mode: host # 不会创建新的网络 From 28f20e7c1c6cc5c1c1dbe3cc9d969df20caf0da4 Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 31 Aug 2020 15:55:38 +0800 Subject: [PATCH 100/226] =?UTF-8?q?=E5=85=9A=E5=91=98=E5=BF=97=E6=84=BF?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=20=E6=8E=A5=E5=8F=A3=20=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E8=AE=BE=E7=BD=AE=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/screen/impl/PartyMemberLeadServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java index 1ed8a24261..902861f5e2 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java @@ -177,8 +177,8 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { Integer totalOrganizationCount = screenPartyBranchDataDao.selectTotalOrganizationCount(ModuleConstant.KEY_BRANCH_CATEGORY_VOLUNTARY_SERVICE,ModuleConstant.PARAM_BRANCH_DATA_TYPE_ORGAN,volunteerServiceFormDTO.getAgencyId(),bottomMonthId); //总参与人数 Integer totalJoinUserCount = screenPartyBranchDataDao.selectTotalOrganizationCount(ModuleConstant.KEY_BRANCH_CATEGORY_VOLUNTARY_SERVICE,ModuleConstant.PARAM_BRANCH_DATA_TYPE_JOIN,volunteerServiceFormDTO.getAgencyId(),bottomMonthId); - result.setTotalOrganizationCount(totalOrganizationCount); - result.setTotalJoinUserCount(totalJoinUserCount); + result.setTotalOrganizationCount(null == totalOrganizationCount ? NumConstant.ZERO : totalOrganizationCount); + result.setTotalJoinUserCount(null == totalJoinUserCount ? NumConstant.ZERO : totalJoinUserCount); return result; } From a89a053552bc4494656cf32ae0d717c86b597d9f Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 31 Aug 2020 16:11:37 +0800 Subject: [PATCH 101/226] =?UTF-8?q?=E5=85=9A=E5=91=98=E5=BF=97=E6=84=BF?= =?UTF-8?q?=E8=80=85=E6=9C=8D=E5=8A=A1=E8=BF=94=E5=8F=82DTO=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/screen/dto/result/VolunteerServiceResultDTO.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResultDTO.java index d856e5081c..e255f61124 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.screen.dto.result; +import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; import java.io.Serializable; @@ -37,10 +38,10 @@ public class VolunteerServiceResultDTO implements Serializable { /** * 总组织次数 * */ - private Integer totalOrganizationCount; + private Integer totalOrganizationCount = NumConstant.ZERO; /** * 总参与人数 * */ - private Integer totalJoinUserCount; + private Integer totalJoinUserCount = NumConstant.ZERO; } From 4d7a82b68038d5078d4d8ef2b62cdf1870f46a6e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 31 Aug 2020 16:47:26 +0800 Subject: [PATCH 102/226] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=9B=B8=E5=85=B3-?= =?UTF-8?q?=E6=9A=82=E5=AD=98V2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/indexcal/GridScoreDTO.java | 52 ++++ .../dto/indexcal/GridScoreDetailDTO.java | 30 ++ .../FactIndexGovrnAblityGridMonthlyDao.java | 10 + .../com/epmet/dao/indexscore/CpcScoreDao.java | 48 ++- .../epmet/dao/indexscore/GridScoreDao.java | 38 ++- .../dao/screen/ScreenCustomerGridDao.java | 10 + .../entity/indexscore/GridScoreEntity.java | 74 ++--- .../java/com/epmet/eum/IndexCodeEnum.java | 1 + .../impl/GridCorreLationServiceImpl.java | 292 ++++++++++++++---- .../FactIndexGovrnAblityGridMonthlyDao.xml | 11 + .../mapper/indexscore/CpcScoreDao.xml | 61 ++++ .../mapper/indexscore/GridScoreDao.xml | 65 +++- .../mapper/screen/ScreenCustomerGridDao.xml | 13 + 13 files changed, 606 insertions(+), 99 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/GridScoreDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/GridScoreDetailDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/GridScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/GridScoreDTO.java new file mode 100644 index 0000000000..5e3b4096f2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/GridScoreDTO.java @@ -0,0 +1,52 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 网格相关分值 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/31 16:38 + */ +@Data +public class GridScoreDTO implements Serializable { + /** + * 网格Id + */ + private String gridId; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属的机关Id + */ + private String agencyId; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + private List detailList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/GridScoreDetailDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/GridScoreDetailDTO.java new file mode 100644 index 0000000000..e2573fbfd9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/GridScoreDetailDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 网格相关分值 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/31 16:39 + */ +@Data +public class GridScoreDetailDTO implements Serializable { + /** + * 1:总分;0不是 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;网格相关:wanggexiangguan + */ + private String indexCode; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java index 90c9a3ea6e..b3002609d1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.PageQueryGridFormDTO; import com.epmet.dto.indexcollect.form.GridGovrnAbilityFormDTO; import com.epmet.entity.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; @@ -85,4 +86,13 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao selectGovrnAblityGridMinAndMax(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @return int + * @param formDTO + * @author yinzuomei + * @description 查询当前月共上传了多少条记录治理能力-网格相关事实表 + * @Date 2020/8/31 14:31 + **/ + int selectCount(CalculateCommonFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/CpcScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/CpcScoreDao.java index 74628e78e8..f93338307f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/CpcScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/CpcScoreDao.java @@ -18,8 +18,13 @@ package com.epmet.dao.indexscore; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.entity.indexscore.CpcScoreEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.math.BigDecimal; +import java.util.List; /** * 党员相关分值 @@ -29,5 +34,46 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface CpcScoreDao extends BaseDao { - + + /** + * @return java.math.BigDecimal + * @param customerId + * @param monthId + * @param gridId + * @author yinzuomei + * @description 获取网格内党员的联系群众能力考评分(平均值) + * @Date 2020/8/31 10:56 + **/ + BigDecimal selectGridContactMassesAvgValue(@Param("customerId") String customerId, + @Param("monthId") String monthId, + @Param("gridId") String gridId); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 获取网格内党员的联系群众能力考评分(平均值)的最大值,最小值 + * @Date 2020/8/31 12:10 + **/ + List selectListGridContactMassesAvgValue(CalculateCommonFormDTO formDTO); + + /** + * @return java.util.List + * @param calculateCommonFormDTO + * @author yinzuomei + * @description 网格内党员的参与议事能力考评分(平均值) 最大值最小值 + * @Date 2020/8/31 14:42 + **/ + List selectListJoinIssueAvgValue(CalculateCommonFormDTO calculateCommonFormDTO); + + /** + * @param customerId + * @param monthId + * @param gridId + * @return java.math.BigDecimal + * @author yinzuomei + * @description 组织内党员的参与议事能力考评分(平均值) + * @Date 2020/8/31 15:51 + **/ + BigDecimal selectGridJoinIssueAvgValue(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("gridId") String gridId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/GridScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/GridScoreDao.java index 77de72959f..30196d21f9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/GridScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/GridScoreDao.java @@ -18,8 +18,13 @@ package com.epmet.dao.indexscore; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.indexcal.GridScoreDTO; import com.epmet.entity.indexscore.GridScoreEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 网格相关分值 @@ -29,5 +34,36 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface GridScoreDao extends BaseDao { - + /** + * @param customerId + * @param monthId + * @param indexCode + * @param isTotal + * @return int + * @author yinzuomei + * @description + * @Date 2020/8/31 14:00 + **/ + int deleteByCusAndMonthId(@Param("customerId") String customerId, + @Param("monthId") String monthId, + @Param("indexCode") String indexCode, + @Param("isTotal") String isTotal); + + /** + * @return int + * @param gridScoreEntityList + * @author yinzuomei + * @description + * @Date 2020/8/31 14:01 + **/ + int insertBatches(List gridScoreEntityList); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description + * @Date 2020/8/31 16:42 + **/ + List selectList(CalculateCommonFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java index dfb0d95a84..b826b7cbcc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java @@ -84,4 +84,14 @@ public interface ScreenCustomerGridDao extends BaseDao * @Date 2020/8/27 14:42 **/ List pageListByCustomerId(PageQueryGridFormDTO formDTO); + + /** + * @param customerId 客户id + * @param gridId 网格id + * @return java.lang.String + * @author yinzuomei + * @description 查询网格所属的组织id + * @Date 2020/8/31 12:35 + **/ + ScreenCustomerGridDTO selectParentAgencyId(@Param("customerId") String customerId, @Param("gridId") String gridId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexscore/GridScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexscore/GridScoreEntity.java index 3b4b4c44c9..9b1bdf2f73 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexscore/GridScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexscore/GridScoreEntity.java @@ -39,54 +39,54 @@ public class GridScoreEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; - /** - * 客户Id - */ + /** + * 客户Id + */ private String customerId; - /** - * 网格Id - */ + /** + * 网格Id + */ private String gridId; - /** - * 网格所属的机关Id - */ + /** + * 网格所属的机关Id + */ private String agencyId; - /** - * 季度ID - */ + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ private String quarterId; - /** - * 年度ID - */ + /** + * 年度ID: yyyy + */ private String yearId; - /** - * 月维度Id: yyyyMM - */ + /** + * 月维度Id: yyyyMM + */ private String monthId; - /** - * 总指数分值 - */ - private BigDecimal totalScore; - - /** - * 党建能力分值 - */ - private BigDecimal partyAblityScore; - - /** - * 治理能力分值 - */ - private BigDecimal govrnAblityScore; - - /** - * 服务能力分值 - */ - private BigDecimal serviceAblityScore; + /** + * 1:总分;0不是 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;网格相关:wanggexiangguan + */ + private String indexCode; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java index 71ef0303d4..620175e5c5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java @@ -24,6 +24,7 @@ public enum IndexCodeEnum { DANG_WU_HUO_DONG("dangwuhuodong", "党务活动", 4), LIAN_XI_QUN_ZHONG("lianxiqunzhong", "联系群众", 4), ZUZHINEIDANGYDLXQZNLKPFPJZ("zuzhineidangydlxqznlkpfpjz","组织内党员的联系群众能力考评分(平均值)",5), + ZUZHINEIDANGYDSYYSNLKPFPJZ("zuzhineidangydsyysnlkpfpjz","组织内党员的参与议事能力考评分(平均值)",5), ; private String code; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java index 556d31f85c..0700e33f7b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java @@ -2,15 +2,20 @@ package com.epmet.service.indexcal.impl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.IndexCalConstant; import com.epmet.dao.indexcoll.FactIndexGovrnAblityGridMonthlyDao; import com.epmet.dao.indexcoll.FactIndexPartyAblityGridMonthlyDao; import com.epmet.dao.indexcoll.FactIndexServiceAblityGridMonthlyDao; +import com.epmet.dao.indexscore.CpcScoreDao; +import com.epmet.dao.indexscore.GridScoreDao; import com.epmet.dao.screen.ScreenCustomerGridDao; import com.epmet.dto.ScreenCustomerGridDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.CustomerGridInfoDTO; +import com.epmet.dto.indexcal.GridScoreDTO; import com.epmet.dto.indexcal.PageQueryGridFormDTO; +import com.epmet.entity.indexscore.GridScoreEntity; import com.epmet.entity.screen.IndexGroupDetailEntity; import com.epmet.eum.IndexCodeEnum; import com.epmet.service.indexcal.GridCorreLationService; @@ -23,12 +28,11 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.util.*; -import java.util.function.Function; -import java.util.stream.Collectors; /** * 网格相关service @@ -51,6 +55,11 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { private IndexGroupDetailService indexGroupDetailService; @Autowired private IndexCodeFieldReService indexCodeFieldReService; + @Autowired + private CpcScoreDao cpcScoreDao; + @Autowired + private GridScoreDao gridScoreDao; + /** * @param formDTO @@ -67,28 +76,28 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); if (!CollectionUtils.isEmpty(dangJianNengLiList)) { //1、计算网格相关-党建能力 - calculateGridCorreLationDangJian(formDTO, dangJianNengLiList); + calculateGridDangJian(formDTO, dangJianNengLiList); } - /* List zhiLiNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), + List zhiLiNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); if (!CollectionUtils.isEmpty(zhiLiNengLiList)) { //2、计算网格相关-治理能力 - calculateGridCorreLationZhiLi(formDTO, zhiLiNengLiList); + calculateGridZhiLi(formDTO, zhiLiNengLiList); } List fuWuNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); if (!CollectionUtils.isEmpty(fuWuNengLiList)) { //3、计算网格相关-服务能力 - calculateGridCorreLationFuWu(formDTO, fuWuNengLiList); + calculateGridFuWu(formDTO, fuWuNengLiList); } //计算网格相关总分 List wgxgList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); if (!CollectionUtils.isEmpty(wgxgList)) { - calculateGridCorreLationTotal(formDTO, wgxgList); - }*/ + calculateGridTotal(formDTO, wgxgList); + } resultFlag = true; return resultFlag; } @@ -101,7 +110,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { * @description 计算网格相关-党建能力 * @Date 2020/8/26 16:47 **/ - private void calculateGridCorreLationDangJian(CalculateCommonFormDTO formDTO, List indexList) { + @Transactional(rollbackFor = Exception.class) + public void calculateGridDangJian(CalculateCommonFormDTO formDTO, List indexList) { //查询总记录数 int total = factIndexPartyAblityGridMonthlyDao.selectCount(formDTO); if (NumConstant.ZERO == total) { @@ -115,6 +125,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { Map minAndMaxMap = queryPartyAblityGridMinAndMax(formDTO.getCustomerId(), formDTO.getMonthId()); //指标集合 Map> indexMap = getIndexInputVO(formDTO, indexList, minAndMaxMap); + List> resultMapList=new ArrayList<>(); //分页查询采集记录 for (int pageNo = 1; pageNo <= totalPage; pageNo++) { int pageIndex = (pageNo - NumConstant.ONE) * IndexCalConstant.PAGE_SIZE; @@ -140,67 +151,136 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { logger.info("组织内党员的联系群众能力考评分(平均值) 单独处理"); //网格内党员的联系群众能力考评分(平均值) String gridId=(String) recordMap.get(IndexCalConstant.GRID_ID); - BigDecimal contactMassesAvgValue = getGridContactMassesAvgValue(gridId); + BigDecimal contactMassesAvgValue = getGridContactMassesAvgValue(formDTO,gridId); SampleValue contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), contactMassesAvgValue); value.getIndexValueVOs().add(contactMassesAblityValue); } }); }); - List result = calculate(indexMap); - // TODO 处理结果 - saveGridCorreLationDangJian(formDTO, indexList, result); - - try { - for (IndexOutputVO m : result) { - logger.info("indexId=" + m.getIndexId()); - for (SampleScore sampleScore : m.getIndexScoreVOs()) { - logger.info(String.format("网格id:%s,得分:%s", sampleScore.getSampleId(), sampleScore.getSampleScore())); - } - } - } catch (Exception e) { - } - + HashMap resultMap = calculate(indexMap); + resultMapList.add(resultMap); } + // 保存中间表 + saveGridCorreLationDangJian(formDTO, resultMapList,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),NumConstant.ZERO_STR); } /** * @return java.util.Map - * @param formDTO + * @param calculateCommonFormDTO * @author yinzuomei - * @description TODO + * @description 获取网格内党员的联系群众能力考评分(平均值)的最大值,最小值 * @Date 2020/8/31 9:51 **/ - private Map contactMassesAblityMap(CalculateCommonFormDTO formDTO) { - - return null; + private Map getContactMassesAblityMap(CalculateCommonFormDTO calculateCommonFormDTO) { + Map map=new HashMap<>(); + List list=cpcScoreDao.selectListGridContactMassesAvgValue(calculateCommonFormDTO); + if(!CollectionUtils.isEmpty(list)){ + BigDecimal minValue=Collections.min(list); + BigDecimal maxValue=Collections.max(list); + map.put(StrConstant.MIN,minValue); + map.put(StrConstant.MAX,maxValue); + return map; + } + map.put(StrConstant.MIN,new BigDecimal(NumConstant.ZERO_STR)); + map.put(StrConstant.MAX,new BigDecimal(NumConstant.ZERO_STR)); + return map; } /** * @return java.math.BigDecimal + * @param calculateCommonFormDTO * @param gridId 网格id - * @author yinzuomei TODO + * @author yinzuomei * @description 获取网格(组织)内党员的联系群众能力考评分(平均值) * @Date 2020/8/31 9:50 **/ - private BigDecimal getGridContactMassesAvgValue(String gridId) { - return null; + private BigDecimal getGridContactMassesAvgValue(CalculateCommonFormDTO calculateCommonFormDTO,String gridId) { + BigDecimal result=cpcScoreDao.selectGridContactMassesAvgValue(calculateCommonFormDTO.getCustomerId(),calculateCommonFormDTO.getMonthId(),gridId); + if(null==result){ + return new BigDecimal(NumConstant.ZERO_STR); + } + return result; } /** - * @param formDTO 客户id 月份id: yyyyMM - * @param indexList 指标集合 - * @param indexOutputVOList + * @return java.math.BigDecimal + * @param formDTO + * @param gridId + * @author yinzuomei + * @description 组织内党员的参与议事能力考评分(平均值) + * @Date 2020/8/31 15:51 + **/ + private BigDecimal getGridJoinIssueAvgValue(CalculateCommonFormDTO formDTO, String gridId) { + BigDecimal result=cpcScoreDao.selectGridJoinIssueAvgValue(formDTO.getCustomerId(),formDTO.getMonthId(),gridId); + if(null==result){ + return new BigDecimal(NumConstant.ZERO_STR); + } + return result; + } + + /** + * @return java.util.Map + * @param calculateCommonFormDTO + * @author yinzuomei + * @description 网格内党员的参与议事能力考评分(平均值) 最大值最小值 + * @Date 2020/8/31 14:41 + **/ + private Map getJoinIssueAblityMap(CalculateCommonFormDTO calculateCommonFormDTO){ + Map map=new HashMap<>(); + List list=cpcScoreDao.selectListJoinIssueAvgValue(calculateCommonFormDTO); + if(!CollectionUtils.isEmpty(list)){ + BigDecimal minValue=Collections.min(list); + BigDecimal maxValue=Collections.max(list); + map.put(StrConstant.MIN,minValue); + map.put(StrConstant.MAX,maxValue); + return map; + } + map.put(StrConstant.MIN,new BigDecimal(NumConstant.ZERO_STR)); + map.put(StrConstant.MAX,new BigDecimal(NumConstant.ZERO_STR)); + return map; + } + + /** + * @param formDTO 客户id 月份id: yyyyMM + * @param resultMapList + * @param indexCode 指标编码 + * @param isTotal 1:总分;0不是 * @return void * @author yinzuomei - * @description 保存网格相关五级指标分值 + * @description 保存网格相关三大能力值 * @Date 2020/8/30 22:50 **/ private void saveGridCorreLationDangJian(CalculateCommonFormDTO formDTO, - List indexList, - List indexOutputVOList) { - Map indexMap = indexList.stream().collect(Collectors.toMap(IndexGroupDetailEntity::getIndexCode, Function.identity())); - - + List> resultMapList, + String indexCode, + String isTotal) { + List gridScoreEntityList = new ArrayList<>(); + String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); + String yearId = DateUtils.getYearId(formDTO.getMonthId()); + for (HashMap resultMap : resultMapList) { + resultMap.forEach((gridId, partyAblityScore) -> { + logger.info("网格id:" + gridId + ";分值:" + partyAblityScore); + GridScoreEntity gridScoreEntity = new GridScoreEntity(); + gridScoreEntity.setCustomerId(formDTO.getCustomerId()); + gridScoreEntity.setGridId(gridId); + gridScoreEntity.setIsTotal(isTotal); + gridScoreEntity.setIndexCode(indexCode); + ScreenCustomerGridDTO screenCustomerGridDTO = screenCustomerGridDao.selectParentAgencyId(formDTO.getCustomerId(), gridId); + if (null != screenCustomerGridDTO) { + gridScoreEntity.setAgencyId(screenCustomerGridDTO.getParentAgencyId()); + gridScoreEntity.setAllParentIds(screenCustomerGridDTO.getAllParentIds()); + } + gridScoreEntity.setQuarterId(quarterId); + gridScoreEntity.setYearId(yearId); + gridScoreEntity.setMonthId(formDTO.getMonthId()); + gridScoreEntity.setScore(partyAblityScore); + gridScoreEntityList.add(gridScoreEntity); + }); + } + if (!CollectionUtils.isEmpty(gridScoreEntityList)) { + gridScoreDao.deleteByCusAndMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode,isTotal); + gridScoreDao.insertBatches(gridScoreEntityList); + } } /** @@ -210,11 +290,11 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { * @description * @Date 2020/8/30 21:40 **/ - private List calculate(Map> indexMap) { + private HashMap calculate(Map> indexMap) { //构造入参 List indexInputVOS = this.getIndexInputVOList(indexMap); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - return batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); + return batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); } /** @@ -256,23 +336,29 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { if (IndexCodeEnum.ZUZHINEIDANGYDLXQZNLKPFPJZ.getCode().equals(index.getIndexCode())) { //组织内党员的联系群众能力考评分(平均值) 获取最大值,最小值 logger.info("组织内党员的联系群众能力考评分(平均值) 单独处理"); - Map contactMassesAblityMap= this.contactMassesAblityMap(formDTO); + Map contactMassesAblityMap= this.getContactMassesAblityMap(formDTO); minValue=contactMassesAblityMap.get(StrConstant.MIN); maxValue=contactMassesAblityMap.get(StrConstant.MAX); + }else if(IndexCodeEnum.ZUZHINEIDANGYDSYYSNLKPFPJZ.getCode().equals(index.getIndexCode())){ + logger.info("组织内党员的参与议事能力考评分(平均值) 单独处理"); + Map joinIssueAblityMap= this.getJoinIssueAblityMap(formDTO); + minValue=joinIssueAblityMap.get(StrConstant.MIN); + maxValue=joinIssueAblityMap.get(StrConstant.MAX); } else { //获取指标对应的列名 String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(index.getIndexCode()); -// logger.info("fieldName=" + fieldName + ";index.getIndexCode()=" + index.getIndexCode()); - //最小值key + if(StringUtils.isBlank(fieldName)){ + logger.error("index_code:"+index.getIndexCode()+"not find field_name"); + continue; + } + logger.info("INDEX_CODE=" + index.getIndexCode()+";FIELD_ID=" + fieldName ); String minValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MIN); - //最大值key String maxValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MAX); minValue = new BigDecimal(String.valueOf(minAndMaxMap.get(minValueKey))); maxValue = new BigDecimal(String.valueOf(minAndMaxMap.get(maxValueKey))); } -// logger.info("minValue="+minValue+";maxValue="+maxValue); //分值计算器 - ScoreCalculator scoreCalculator = new BigDecimalScoreCalculator(minValue, + ScoreCalculator scoreCalculator = new BigDecimalScoreCalculator(minValue, maxValue, ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, @@ -290,15 +376,63 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { /** * @param formDTO * @param indexList - * @return void TODO + * @return void * @author yinzuomei * @description 计算网格相关-治理能力 * @Date 2020/8/26 16:47 **/ - private void calculateGridCorreLationZhiLi(CalculateCommonFormDTO formDTO, List indexList) { - + private void calculateGridZhiLi(CalculateCommonFormDTO formDTO, List indexList) { + //查询总记录数 + int total = factIndexGovrnAblityGridMonthlyDao.selectCount(formDTO); + if (NumConstant.ZERO == total) { + logger.info(String.format("customerId:%s,monthId:%s,没有上传网格相关-治理能力-五级指标数据"), formDTO.getCustomerId(), formDTO.getMonthId()); + return; + } + //总页数,进行批量查询,批量计算 + int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE); + logger.info(String.format("共%s条数据,分%s次计算", total, totalPage)); + //每一组指标的最大值,key:code_MIN/MAX + Map minAndMaxMap = queryGovrnAblityGridMinAndMax(formDTO.getCustomerId(), formDTO.getMonthId()); + //指标集合 + Map> indexMap = getIndexInputVO(formDTO, indexList, minAndMaxMap); + List> resultMapList=new ArrayList<>(); + //分页查询采集记录 + for (int pageNo = 1; pageNo <= totalPage; pageNo++) { + int pageIndex = (pageNo - NumConstant.ONE) * IndexCalConstant.PAGE_SIZE; + //前10条 + List> recordList = queryListGovrnAblityGrid(new PageQueryGridFormDTO(formDTO.getCustomerId(), + formDTO.getMonthId(), + pageIndex, + pageNo, + IndexCalConstant.PAGE_SIZE)); + //遍历每一个网格的记录 + recordList.forEach(recordMap -> { + //遍历所有的指标 + indexMap.forEach((key, value) -> { + //列名不为空 + if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { + //对应的数值 + String sampleValueStr = String.valueOf(recordMap.get(indexCodeFieldReService.getFieldNameByIndexCode(key))); + //构造样本值对象 + SampleValue currentGridIndexValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), new BigDecimal(sampleValueStr)); + value.getIndexValueVOs().add(currentGridIndexValue); + } else if (IndexCodeEnum.ZUZHINEIDANGYDSYYSNLKPFPJZ.getCode().equals(key)) { + logger.info("组织内党员的参与议事能力考评分(平均值) 单独处理"); + String gridId=(String) recordMap.get(IndexCalConstant.GRID_ID); + BigDecimal joinAvgValue = getGridJoinIssueAvgValue(formDTO,gridId); + SampleValue contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), joinAvgValue); + value.getIndexValueVOs().add(contactMassesAblityValue); + } + }); + }); + HashMap resultMap = calculate(indexMap); + resultMapList.add(resultMap); + } + // 保存中间表 + saveGridCorreLationDangJian(formDTO, resultMapList,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),NumConstant.ZERO_STR); } + /** * @param formDTO * @param indexList @@ -307,8 +441,51 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { * @description 计算网格相关-服务能力 * @Date 2020/8/26 16:48 **/ - private void calculateGridCorreLationFuWu(CalculateCommonFormDTO formDTO, List indexList) { - + private void calculateGridFuWu(CalculateCommonFormDTO formDTO, List indexList) { + //查询总记录数 + int total = factIndexGovrnAblityGridMonthlyDao.selectCount(formDTO); + if (NumConstant.ZERO == total) { + logger.info(String.format("customerId:%s,monthId:%s,没有上传网格相关-服务能力-五级指标数据"), formDTO.getCustomerId(), formDTO.getMonthId()); + return; + } + //总页数,进行批量查询,批量计算 + int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE); + logger.info(String.format("共%s条数据,分%s次计算", total, totalPage)); + //每一组指标的最大值,key:code_MIN/MAX + Map minAndMaxMap = queryServiceAblityGridMinAndMax(formDTO.getCustomerId(), formDTO.getMonthId()); + //指标集合 + Map> indexMap = getIndexInputVO(formDTO, indexList, minAndMaxMap); + List> resultMapList=new ArrayList<>(); + //分页查询采集记录 + for (int pageNo = 1; pageNo <= totalPage; pageNo++) { + int pageIndex = (pageNo - NumConstant.ONE) * IndexCalConstant.PAGE_SIZE; + //前10条 + List> recordList = queryListServiceAblityGrid(new PageQueryGridFormDTO(formDTO.getCustomerId(), + formDTO.getMonthId(), + pageIndex, + pageNo, + IndexCalConstant.PAGE_SIZE)); + //遍历每一个网格的记录 + recordList.forEach(recordMap -> { + //遍历所有的指标 + indexMap.forEach((key, value) -> { + //列名不为空 + if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { + //对应的数值 + String sampleValueStr = String.valueOf(recordMap.get(indexCodeFieldReService.getFieldNameByIndexCode(key))); + //构造样本值对象 + SampleValue currentGridIndexValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), new BigDecimal(sampleValueStr)); + value.getIndexValueVOs().add(currentGridIndexValue); + }else{ + logger.error("index_code:"+key+" not find field_name"); + } + }); + }); + HashMap resultMap = calculate(indexMap); + resultMapList.add(resultMap); + } + // 保存中间表 + saveGridCorreLationDangJian(formDTO, resultMapList,IndexCodeEnum.FU_WU_NENG_LI.getCode(),NumConstant.ZERO_STR); } /** @@ -319,8 +496,11 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { * @description 计算网格相关总分 * @Date 2020/8/26 16:50 **/ - private void calculateGridCorreLationTotal(CalculateCommonFormDTO formDTO, List indexList) { - + private void calculateGridTotal(CalculateCommonFormDTO formDTO, List indexList) { + //查询总记录数 + List gridScoreDTOList=gridScoreDao.selectList(formDTO); + // 保存中间表 TODO +// saveGridCorreLationDangJian(formDTO, resultMapList,IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(),NumConstant.ONE_STR); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml index e5780e24fa..11c10755fa 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml @@ -138,4 +138,15 @@ and m.CUSTOMER_ID=#{customerId} and m.MONTH_ID=#{monthId} + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml index 3a17dcc82b..f4866aaffd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml @@ -23,4 +23,65 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/GridScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/GridScoreDao.xml index 4b1d7f6fcc..6f739c3e36 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/GridScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/GridScoreDao.xml @@ -8,13 +8,13 @@ + - - - - + + + @@ -23,5 +23,62 @@ + + DELETE + FROM + fact_index_grid_score + WHERE + CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + AND INDEX_CODE = #{indexCode} + and IS_TOTAL=#{isTotal} + + + 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), + #{item.customerId}, + #{item.gridId}, + #{item.agencyId}, + #{item.allParentIds}, + #{item.quarterId}, + #{item.yearId}, + #{item.monthId}, + #{item.isTotal}, + #{item.score}, + #{item.indexCode}, + 0, + 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/screen/ScreenCustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml index a5bee6054f..a00e0e750a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml @@ -92,4 +92,17 @@ order by m.GRID_ID asc LIMIT #{pageIndex}, #{pageSize} + + + From 13a5e793404576377d5b4e9342dee779cbbd42ce Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 31 Aug 2020 16:49:07 +0800 Subject: [PATCH 103/226] =?UTF-8?q?=E6=BC=8F=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/utils/DateUtils.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index 0a45a6b290..75174f4216 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -9,6 +9,7 @@ package com.epmet.commons.tools.utils; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; import org.apache.commons.lang3.StringUtils; import org.joda.time.DateTime; import org.joda.time.LocalDate; @@ -33,6 +34,11 @@ public class DateUtils { public static final List Q3Months = Arrays.asList(7, 8, 9); public static final List Q4Months = Arrays.asList(10, 11, 12); + public static final List Q1MonthsStrList = Arrays.asList("1", "2", "3","01","02","03"); + public static final List Q2MonthsStrList = Arrays.asList("4", "5", "6","04", "05", "06"); + public static final List Q3MonthsStrList = Arrays.asList("7", "8", "9","07", "08", "09"); + public static final List Q4MonthsStrList = Arrays.asList("10", "11", "12"); + /** 时间格式(yyyy-MM-dd) */ public final static String DATE_PATTERN = "yyyy-MM-dd"; /** 时间格式(yyyy-MM-dd HH:mm:ss) */ @@ -298,6 +304,29 @@ public class DateUtils { return 4; } + /** + * 获取季度 + * @param monthId yyyyMM + * @return yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + public static String getQuarterId(String monthId) { + String year = monthId.substring(0, 4); + String month = monthId.substring(4, 6); + if (Q1MonthsStrList.contains(month)) { + return year.concat("Q1"); + } + if (Q2MonthsStrList.contains(month)) { + return year.concat("Q2"); + } + if (Q3MonthsStrList.contains(month)) { + return year.concat("Q3"); + } + if(Q4MonthsStrList.contains(month)){ + return year.concat("Q4"); + } + return StrConstant.EPMETY_STR; + } + /** * 根据季度查询季度的月份列表 * @param quarterIndex @@ -557,4 +586,11 @@ public class DateUtils { System.out.println(comparteDate(yesterDay,today)); System.out.println(comparteDate(tomorrow,today)); } + + public static String getYearId(String monthId) { + if (StringUtils.isNotBlank(monthId) && monthId.length() > 4) { + return monthId.substring(NumConstant.ZERO, NumConstant.FOUR); + } + return StrConstant.EPMETY_STR; + } } From c1ea0143db61542b5712f32d3c84c15d1e5ca165 Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 31 Aug 2020 16:57:48 +0800 Subject: [PATCH 104/226] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-third-server/deploy/docker-compose-prod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml index a2a223a704..eede66ca29 100644 --- a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-third-server: container_name: epmet-third-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-third-server:0.0.135 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-third-server:0.0.136 ports: - "8110:8110" network_mode: host # 使用现有网络 From 180053a363fb787ed2af83ee55e028ec8afc6244 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 31 Aug 2020 17:11:27 +0800 Subject: [PATCH 105/226] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/IndexCalConstant.java | 2 + .../data-statistical-server/pom.xml | 2 +- .../controller/IndexCalculateController.java | 2 +- .../com/epmet/dao/indexscore/CpcScoreDao.java | 5 + .../entity/indexscore/CpcScoreEntity.java | 35 ++-- .../impl/CpcIndexCalculateServiceImpl.java | 158 +++++++++++++----- .../java/com/epmet/util/Pinyin4jUtil.java | 3 + .../mapper/indexscore/CpcScoreDao.xml | 15 +- .../mapper/screen/IndexGroupDetailDao.xml | 6 +- 9 files changed, 155 insertions(+), 73 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java index aff436ff3d..79321c6026 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java @@ -12,6 +12,8 @@ public interface IndexCalConstant { String GRID_ID="GRID_ID"; + String AGENCY_ID="AGENCY_ID"; + String CUSTOMER_ID="CUSTOMER_ID"; String MONTH_ID="MONTH_ID"; diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 8d0e953c05..a805e4a53c 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -195,7 +195,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java index c2211c0d80..9dab47c148 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java @@ -44,7 +44,7 @@ public class IndexCalculateController { } @PostMapping("getMax") public Result getMax(){ - CalculateCommonFormDTO calculateCommonFormDTO = new CalculateCommonFormDTO("c1","202008"); + CalculateCommonFormDTO calculateCommonFormDTO = new CalculateCommonFormDTO("b09527201c4409e19d1dbc5e3c3429a1","202008"); cpcIndexCalculateService.cpcIndexCalculate(calculateCommonFormDTO); return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/CpcScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/CpcScoreDao.java index f93338307f..2bab7efa56 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/CpcScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/CpcScoreDao.java @@ -25,6 +25,7 @@ import org.apache.ibatis.annotations.Param; import java.math.BigDecimal; import java.util.List; +import java.util.Map; /** * 党员相关分值 @@ -76,4 +77,8 @@ public interface CpcScoreDao extends BaseDao { * @Date 2020/8/31 15:51 **/ BigDecimal selectGridJoinIssueAvgValue(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("gridId") String gridId); + + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode); + + List> getPartScoreByPage(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("offset") int offset, @Param("pageSize") int pageSize); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexscore/CpcScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexscore/CpcScoreEntity.java index 59c4269a3b..a9781ea496 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexscore/CpcScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexscore/CpcScoreEntity.java @@ -18,13 +18,11 @@ package com.epmet.entity.indexscore; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; import java.math.BigDecimal; -import java.util.Date; /** * 党员相关分值 @@ -54,34 +52,29 @@ public class CpcScoreEntity extends BaseEpmetEntity { */ private String gridId; - /** - * 用户id - */ - private String userId; /** - * 月维度Id: yyyyMM + * 年维度Id: yyyy */ - private String monthId; + private String yearId; - /** - * 党建能力分值 - */ - private BigDecimal partyAblityScore; + /** + * 月维度Id: yyyyMM + */ + private String monthId; - /** - * 参与议事分值 - */ - private BigDecimal joinIssueScore; + /** + * 用户id + */ + private String userId; /** - * 党务活动分值 + * 分值 */ - private BigDecimal partyWorkActScore; + private BigDecimal score; /** - * 联系群众分值 + * 指标code */ - private BigDecimal contactMassesScore; - + private String indexCode; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java index 521c9dd631..ee7d161ecb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -1,11 +1,13 @@ package com.epmet.service.indexcal.impl; -import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.IndexCalConstant; import com.epmet.dao.indexcoll.FactIndexPartyAblityCpcMonthlyDao; +import com.epmet.dao.indexscore.CpcScoreDao; import com.epmet.dao.screen.IndexCodeFieldReDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.entity.indexscore.CpcScoreEntity; import com.epmet.entity.screen.IndexGroupDetailEntity; import com.epmet.eum.IndexCodeEnum; import com.epmet.service.indexcal.CpcIndexCalculateService; @@ -18,6 +20,7 @@ import com.epmet.support.normalizing.ScoreConstants; import com.epmet.support.normalizing.batch.BatchScoreCalculator; import com.epmet.support.normalizing.batch.IndexInputVO; import com.epmet.support.normalizing.batch.SampleValue; +import com.epmet.util.DimIdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -26,10 +29,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; @Slf4j @@ -43,24 +43,53 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { private IndexGroupDetailService getDetailListByParentCode; @Autowired private IndexCodeFieldReService indexCodeFieldReService; + @Autowired + private CpcScoreDao cpcScoreDao; @Override public Boolean cpcIndexCalculate(CalculateCommonFormDTO formDTO) { - //获取指标权重信息 -参与议事 - List indexDetails = getDetailListByParentCode.getDetailListLikeParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); - if (CollectionUtils.isEmpty(indexDetails)) { + + calculatePartScore(formDTO); + calculateTotalScore(formDTO); + + + return null; + } + + /** + * desc: 计算总分 + * @param formDTO + */ + private void calculateTotalScore(CalculateCommonFormDTO formDTO) { + //获取指标权重 + List parentIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); + if (CollectionUtils.isEmpty(parentIndexDetails)) { log.warn("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); - return false; + return; } + //获取数据 + List> list = null; + int pageNo = 1; + int pageSize = 10; + do { - canyuyishi(formDTO, indexDetails); + list = cpcScoreDao.getPartScoreByPage(formDTO.getCustomerId(), formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize); + if (!CollectionUtils.isEmpty(list)) { + list.forEach(partScore->{ + partScore.get(IndexCalConstant.USER_ID) + }); + //遍历指标分组 计算分数 + List> finalList = list; + groupIndexDetailsMap.forEach((parentIndexCode, details) -> { + calculate(formDTO, details, finalList, minAndMaxMap, parentIndexCode); + }); + } + } while (!CollectionUtils.isEmpty(list) && pageNo++ > 0); - //log.info(JSON.toJSONString(minAndMaxList)); - return null; } - private void canyuyishi(CalculateCommonFormDTO formDTO, List indexDetails) { + private void calculatePartScore(CalculateCommonFormDTO formDTO) { Map indexCodeFieldReList = indexCodeFieldReService.getIndexCodeFieldReMap(); if (CollectionUtils.isEmpty(indexCodeFieldReList)) { log.error("cpcIndexCalculate have any indexcodefieldre"); @@ -74,9 +103,29 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { } //指标集合 //对指标进行分组 - Map> groupIndexDetailsMap = indexDetails.stream().collect(Collectors.groupingBy(IndexGroupDetailEntity::getAllParentIndexCode)); + //Map> groupIndexDetailsMap = indexDetails.stream().collect(Collectors.groupingBy(IndexGroupDetailEntity::getAllParentIndexCode)); + //获取指标权重信息 -参与议事 + List canyuyishiIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.CAN_YU_YI_SHI.getCode()); + if (CollectionUtils.isEmpty(canyuyishiIndexDetails)) { + log.warn("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + return; + } + List dangwuhongdongIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_WU_HUO_DONG.getCode()); + if (CollectionUtils.isEmpty(canyuyishiIndexDetails)) { + log.warn("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + return; + } + List lianxiqunzhongIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.LIAN_XI_QUN_ZHONG.getCode()); + if (CollectionUtils.isEmpty(canyuyishiIndexDetails)) { + log.warn("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + return; + } + Map> groupIndexDetailsMap = new HashMap<>(); + groupIndexDetailsMap.put(IndexCodeEnum.CAN_YU_YI_SHI.getCode(), canyuyishiIndexDetails); + groupIndexDetailsMap.put(IndexCodeEnum.DANG_WU_HUO_DONG.getCode(), dangwuhongdongIndexDetails); + groupIndexDetailsMap.put(IndexCodeEnum.LIAN_XI_QUN_ZHONG.getCode(), lianxiqunzhongIndexDetails); List> list = null; int pageNo = 1; @@ -87,42 +136,65 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { //遍历指标分组 计算分数 List> finalList = list; - groupIndexDetailsMap.forEach((parentIndex, indexDetailList)->{ - Map> indexMap = getIndexInputVO(indexDetailList, minAndMaxMap); - //遍历指标 进行计算 - for (Map.Entry> entry : indexMap.entrySet()) { - String indexCode = entry.getKey(); - IndexInputVO value = entry.getValue(); - String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(indexCode); - if (StringUtils.isBlank(fieldName)) { - log.error("cpcIndexCalculate fieldName error"); - continue; - } - for (Map cpcIndex : finalList) { - //对应的数值 - String sampleValueStr = String.valueOf(cpcIndex.get(indexCodeFieldReService.getFieldNameByIndexCode(fieldName))); - //构造样本值对象 - SampleValue currentGridIndexValue = new SampleValue((String) cpcIndex.get(IndexCalConstant.USER_ID), new BigDecimal(sampleValueStr)); - value.getIndexValueVOs().add(currentGridIndexValue); - } - } - HashMap result = calculate(indexMap); - // TODO 处理结果 - saveGridCorreLationDangJian(formDTO, indexDetails, result); - - try { - System.out.println( JSON.toJSONString(result)); - } catch (Exception e) { - } + groupIndexDetailsMap.forEach((parentIndexCode, details) -> { + calculate(formDTO, details, finalList, minAndMaxMap, parentIndexCode); }); } } while (!CollectionUtils.isEmpty(list) && pageNo++ > 0); } - @Transactional(rollbackFor = Exception.class) - public void saveGridCorreLationDangJian(CalculateCommonFormDTO formDTO, List indexDetails, HashMap result) { + private void calculate(CalculateCommonFormDTO formDTO, List indexDetailList, List> finalList, Map minAndMaxMap, String parentIndexCode) { + Map> indexMap = getIndexInputVO(indexDetailList, minAndMaxMap); + Map scoreEntityMap = new HashMap<>(); + //遍历指标 进行计算 + for (Map.Entry> entry : indexMap.entrySet()) { + String indexCode = entry.getKey(); + IndexInputVO value = entry.getValue(); + String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(indexCode); + if (StringUtils.isBlank(fieldName)) { + log.error("cpcIndexCalculate fieldName error"); + continue; + } + + for (Map cpcCount : finalList) { + //对应的数值 + String userId = String.valueOf(cpcCount.get(IndexCalConstant.USER_ID)); + String sampleValueStr = String.valueOf(cpcCount.get(fieldName)); + + CpcScoreEntity cpcScoreEntity = new CpcScoreEntity(); + cpcScoreEntity.setYearId(DimIdGenerator.getYearDimId(DateUtils.addDateMonths(new Date(), -1))); + cpcScoreEntity.setCustomerId(formDTO.getCustomerId()); + cpcScoreEntity.setAgencyId(String.valueOf(cpcCount.get(IndexCalConstant.AGENCY_ID))); + cpcScoreEntity.setGridId(String.valueOf(cpcCount.get(IndexCalConstant.GRID_ID))); + cpcScoreEntity.setUserId(userId); + cpcScoreEntity.setMonthId(formDTO.getMonthId()); + cpcScoreEntity.setScore(new BigDecimal(0)); + cpcScoreEntity.setIndexCode(parentIndexCode); + scoreEntityMap.put(userId, cpcScoreEntity); + + //构造样本值对象 + SampleValue currentGridIndexValue = new SampleValue((String) cpcCount.get(IndexCalConstant.USER_ID), new BigDecimal(sampleValueStr)); + value.getIndexValueVOs().add(currentGridIndexValue); + } + } + log.warn("计算的参数:{}", indexMap); + HashMap result = calculate(indexMap); + + //处理结果 + saveCpcScore(formDTO, scoreEntityMap, parentIndexCode, result); + } + + + @Transactional(rollbackFor = Exception.class) + public void saveCpcScore(CalculateCommonFormDTO formDTO, Map indexDetails, String parentIndexCode, HashMap result) { + cpcScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), parentIndexCode); + result.forEach((userId, score) -> { + CpcScoreEntity cpcScoreEntity = indexDetails.get(userId); + cpcScoreEntity.setScore(score); + cpcScoreDao.insert(cpcScoreEntity); + }); } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java index c6e61ffb01..bedaf09f1b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java @@ -25,6 +25,8 @@ public class Pinyin4jUtil { duoyinMap.put('率',new String[]{"lv"}); duoyinMap.put('员',new String[]{"yuan"}); duoyinMap.put('提',new String[]{"ti"}); + duoyinMap.put('被',new String[]{"bei"}); + duoyinMap.put('期',new String[]{"qi"}); } /** @@ -192,5 +194,6 @@ public class Pinyin4jUtil { public static void main(String[] args) { System.out.println(getFirstSpellPinYin("区直部门",false)); System.out.println(getSpellPinYin("党员提出话题数",false,4)); + System.out.println(getSpellPinYin("社区超期项目数",false,4)); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml index f4866aaffd..9696bf3702 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml @@ -10,10 +10,6 @@ - - - - @@ -22,6 +18,17 @@ + + delete from fact_index_cpc_score where CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} and MONTH_ID = #{monthId,jdbcType=VARCHAR} and INDEX_CODE = #{indexCode,jdbcType=VARCHAR} + + + + select - ID, INDEX_GROUP_ID, INDEX_ID, INDEX_CODE, WEIGHT, THRESHOLD + ID,CUSTOMER_ID, INDEX_GROUP_ID, INDEX_ID, INDEX_CODE, WEIGHT, THRESHOLD, ALL_PARENT_INDEX_CODE FROM index_group_detail WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} and STATUS = 'enable' and DEL_FLAG = '0' @@ -15,10 +15,10 @@ \ No newline at end of file From e5df941b4b7d2762c67f68d3c067dd5278e61625 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 31 Aug 2020 17:13:23 +0800 Subject: [PATCH 106/226] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dao/indexscore/CpcScoreDao.java | 3 +-- .../indexcal/impl/CpcIndexCalculateServiceImpl.java | 10 +++------- .../main/resources/mapper/indexscore/CpcScoreDao.xml | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/CpcScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/CpcScoreDao.java index 2bab7efa56..99303193bf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/CpcScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/CpcScoreDao.java @@ -25,7 +25,6 @@ import org.apache.ibatis.annotations.Param; import java.math.BigDecimal; import java.util.List; -import java.util.Map; /** * 党员相关分值 @@ -80,5 +79,5 @@ public interface CpcScoreDao extends BaseDao { int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode); - List> getPartScoreByPage(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("offset") int offset, @Param("pageSize") int pageSize); + List getPartScoreByPage(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("offset") int offset, @Param("pageSize") int pageSize); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java index ee7d161ecb..b9338e4d32 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -69,7 +69,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { return; } //获取数据 - List> list = null; + List list = null; int pageNo = 1; int pageSize = 10; do { @@ -77,13 +77,9 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { list = cpcScoreDao.getPartScoreByPage(formDTO.getCustomerId(), formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize); if (!CollectionUtils.isEmpty(list)) { list.forEach(partScore->{ - partScore.get(IndexCalConstant.USER_ID) - }); - //遍历指标分组 计算分数 - List> finalList = list; - groupIndexDetailsMap.forEach((parentIndexCode, details) -> { - calculate(formDTO, details, finalList, minAndMaxMap, parentIndexCode); + }); + } } while (!CollectionUtils.isEmpty(list) && pageNo++ > 0); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml index 9696bf3702..3694e52024 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml @@ -22,7 +22,7 @@ delete from fact_index_cpc_score where CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} and MONTH_ID = #{monthId,jdbcType=VARCHAR} and INDEX_CODE = #{indexCode,jdbcType=VARCHAR} - select CUSTOMER_ID,AGENCY_ID,GRID_ID,USER_ID,SCORE,INDEX_CODE FROM fact_index_cpc_score WHERE From 4ef2e4a0bdf64127d62f57229c7f17cec070098d Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 31 Aug 2020 17:59:49 +0800 Subject: [PATCH 107/226] =?UTF-8?q?=E8=AE=A1=E7=AE=97=E5=85=9A=E5=91=98?= =?UTF-8?q?=E6=80=BB=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dao/indexscore/CpcScoreDao.java | 13 ++++-- .../entity/indexscore/CpcScoreEntity.java | 5 ++ .../impl/CpcIndexCalculateServiceImpl.java | 45 +++++++++++++----- .../mapper/indexscore/CpcScoreDao.xml | 46 ++++++++++++++++++- 4 files changed, 90 insertions(+), 19 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/CpcScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/CpcScoreDao.java index 99303193bf..2142128e3b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/CpcScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/CpcScoreDao.java @@ -24,6 +24,7 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.math.BigDecimal; +import java.util.Collection; import java.util.List; /** @@ -36,10 +37,10 @@ import java.util.List; public interface CpcScoreDao extends BaseDao { /** - * @return java.math.BigDecimal * @param customerId * @param monthId * @param gridId + * @return java.math.BigDecimal * @author yinzuomei * @description 获取网格内党员的联系群众能力考评分(平均值) * @Date 2020/8/31 10:56 @@ -49,17 +50,17 @@ public interface CpcScoreDao extends BaseDao { @Param("gridId") String gridId); /** - * @return java.util.List * @param formDTO + * @return java.util.List * @author yinzuomei - * @description 获取网格内党员的联系群众能力考评分(平均值)的最大值,最小值 + * @description 获取网格内党员的联系群众能力考评分(平均值)的最大值,最小值 * @Date 2020/8/31 12:10 **/ List selectListGridContactMassesAvgValue(CalculateCommonFormDTO formDTO); /** - * @return java.util.List * @param calculateCommonFormDTO + * @return java.util.List * @author yinzuomei * @description 网格内党员的参与议事能力考评分(平均值) 最大值最小值 * @Date 2020/8/31 14:42 @@ -79,5 +80,7 @@ public interface CpcScoreDao extends BaseDao { int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode); - List getPartScoreByPage(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("offset") int offset, @Param("pageSize") int pageSize); + List getPartScore(@Param("customerId") String customerId, @Param("monthId") String monthId); + + int insertBatch(@Param("list") Collection values); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexscore/CpcScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexscore/CpcScoreEntity.java index a9781ea496..cca1b90ff2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexscore/CpcScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexscore/CpcScoreEntity.java @@ -77,4 +77,9 @@ public class CpcScoreEntity extends BaseEpmetEntity { * 指标code */ private String indexCode; + + /** + * 是否是总分 1是0不是 + */ + private String isTotal; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java index b9338e4d32..1293e23dc9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -1,6 +1,8 @@ package com.epmet.service.indexcal.impl; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.IndexCalConstant; import com.epmet.dao.indexcoll.FactIndexPartyAblityCpcMonthlyDao; @@ -53,12 +55,12 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { calculatePartScore(formDTO); calculateTotalScore(formDTO); - - return null; + return true; } /** * desc: 计算总分 + * * @param formDTO */ private void calculateTotalScore(CalculateCommonFormDTO formDTO) { @@ -70,19 +72,35 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { } //获取数据 List list = null; - int pageNo = 1; - int pageSize = 10; - do { + Map cpcScoreTotalMap = new HashMap<>(); + Map indexWeightMap = parentIndexDetails.stream().collect(Collectors.toMap(IndexGroupDetailEntity::getIndexCode, o -> o)); + + list = cpcScoreDao.getPartScore(formDTO.getCustomerId(), formDTO.getMonthId()); + if (!CollectionUtils.isEmpty(list)) { + Map> userGroupMap = list.stream().collect(Collectors.groupingBy(CpcScoreEntity::getUserId)); + userGroupMap.forEach((userId, partScoreList) -> { + CpcScoreEntity totalEntity = null; + for (CpcScoreEntity part : partScoreList) { + IndexGroupDetailEntity indexGroupDetailEntity = indexWeightMap.get(part.getIndexCode()); + if (totalEntity == null) { + totalEntity = ConvertUtils.sourceToTarget(part, CpcScoreEntity.class); + totalEntity.setIsTotal(NumConstant.ONE_STR); + totalEntity.setIndexCode(indexGroupDetailEntity.getIndexCode()); + cpcScoreTotalMap.put(userId, totalEntity); + } + BigDecimal total = part.getScore().multiply(indexGroupDetailEntity.getWeight()); + totalEntity.setScore(totalEntity.getScore().add(total)); + } + }); + } - list = cpcScoreDao.getPartScoreByPage(formDTO.getCustomerId(), formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize); - if (!CollectionUtils.isEmpty(list)) { - list.forEach(partScore->{ + insertBatch(cpcScoreTotalMap.values().stream().collect(Collectors.toList())); - }); - } - } while (!CollectionUtils.isEmpty(list) && pageNo++ > 0); + } + private void insertBatch(Collection values) { + cpcScoreDao.insertBatch(values); } private void calculatePartScore(CalculateCommonFormDTO formDTO) { @@ -165,6 +183,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { cpcScoreEntity.setAgencyId(String.valueOf(cpcCount.get(IndexCalConstant.AGENCY_ID))); cpcScoreEntity.setGridId(String.valueOf(cpcCount.get(IndexCalConstant.GRID_ID))); cpcScoreEntity.setUserId(userId); + cpcScoreEntity.setIsTotal(NumConstant.ZERO_STR); cpcScoreEntity.setMonthId(formDTO.getMonthId()); cpcScoreEntity.setScore(new BigDecimal(0)); cpcScoreEntity.setIndexCode(parentIndexCode); @@ -186,11 +205,13 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { @Transactional(rollbackFor = Exception.class) public void saveCpcScore(CalculateCommonFormDTO formDTO, Map indexDetails, String parentIndexCode, HashMap result) { cpcScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), parentIndexCode); + List list = new ArrayList<>(); result.forEach((userId, score) -> { CpcScoreEntity cpcScoreEntity = indexDetails.get(userId); cpcScoreEntity.setScore(score); - cpcScoreDao.insert(cpcScoreEntity); + list.add(cpcScoreEntity); }); + this.insertBatch(list); } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml index 3694e52024..c3b2529e0c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml @@ -22,9 +22,9 @@ delete from fact_index_cpc_score where CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} and MONTH_ID = #{monthId,jdbcType=VARCHAR} and INDEX_CODE = #{indexCode,jdbcType=VARCHAR} - select - CUSTOMER_ID,AGENCY_ID,GRID_ID,USER_ID,SCORE,INDEX_CODE FROM fact_index_cpc_score + CUSTOMER_ID,AGENCY_ID,GRID_ID,YEAR_ID,MONTH_ID,USER_ID,SCORE,INDEX_CODE FROM fact_index_cpc_score WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} and MONTH_ID = #{monthId,jdbcType=VARCHAR} AND IS_TOTAL = '0' @@ -91,4 +91,46 @@ GROUP BY m.GRID_ID + + + INSERT INTO `fact_index_cpc_score` ( + `ID`, + `CUSTOMER_ID`, + `GRID_ID`, + `AGENCY_ID`, + `YEAR_ID`, + `MONTH_ID`, + `USER_ID`, + `IS_TOTAL`, + `SCORE`, + `INDEX_CODE`, + `DEL_FLAG`, + `REVISION`, + `CREATED_BY`, + `CREATED_TIME`, + `UPDATED_BY`, + `UPDATED_TIME` + ) + VALUES + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.gridId}, + #{item.agencyId}, + #{item.yearId}, + #{item.monthId}, + #{item.userId}, + #{item.isTotal}, + #{item.score}, + #{item.indexCode}, + '0', + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + \ No newline at end of file From 4d6adb90b30943ce7c55580d14b152ff4f8ea251 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 31 Aug 2020 18:10:07 +0800 Subject: [PATCH 108/226] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=9B=B8=E5=85=B3-?= =?UTF-8?q?=E6=9A=82=E5=AD=98V3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dao/indexscore/GridScoreDao.java | 2 +- .../impl/GridCorreLationServiceImpl.java | 47 +++++++++++++++---- .../mapper/indexscore/GridScoreDao.xml | 35 +++++++++++++- 3 files changed, 71 insertions(+), 13 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/GridScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/GridScoreDao.java index 30196d21f9..71316cf4f4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/GridScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/GridScoreDao.java @@ -38,7 +38,7 @@ public interface GridScoreDao extends BaseDao { * @param customerId * @param monthId * @param indexCode - * @param isTotal + * @param isTotal 1:总分;0不是 * @return int * @author yinzuomei * @description diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java index 0700e33f7b..74afb589f3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java @@ -11,10 +11,7 @@ import com.epmet.dao.indexscore.CpcScoreDao; import com.epmet.dao.indexscore.GridScoreDao; import com.epmet.dao.screen.ScreenCustomerGridDao; import com.epmet.dto.ScreenCustomerGridDTO; -import com.epmet.dto.indexcal.CalculateCommonFormDTO; -import com.epmet.dto.indexcal.CustomerGridInfoDTO; -import com.epmet.dto.indexcal.GridScoreDTO; -import com.epmet.dto.indexcal.PageQueryGridFormDTO; +import com.epmet.dto.indexcal.*; import com.epmet.entity.indexscore.GridScoreEntity; import com.epmet.entity.screen.IndexGroupDetailEntity; import com.epmet.eum.IndexCodeEnum; @@ -33,6 +30,8 @@ import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; /** * 网格相关service @@ -96,7 +95,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { List wgxgList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); if (!CollectionUtils.isEmpty(wgxgList)) { - calculateGridTotal(formDTO, wgxgList); + calculateGridTotal(formDTO, wgxgList,IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); } resultFlag = true; return resultFlag; @@ -496,14 +495,42 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { * @description 计算网格相关总分 * @Date 2020/8/26 16:50 **/ - private void calculateGridTotal(CalculateCommonFormDTO formDTO, List indexList) { + private void calculateGridTotal(CalculateCommonFormDTO formDTO, List indexList, String indexCode) { //查询总记录数 - List gridScoreDTOList=gridScoreDao.selectList(formDTO); - // 保存中间表 TODO -// saveGridCorreLationDangJian(formDTO, resultMapList,IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(),NumConstant.ONE_STR); + List gridScoreDTOList = gridScoreDao.selectList(formDTO); + Map indexMap = indexList.stream().collect(Collectors.toMap(IndexGroupDetailEntity::getIndexCode, Function.identity())); + List gridScoreEntityList = new ArrayList<>(); + gridScoreDTOList.forEach(gridScoreDTO -> { + GridScoreEntity gridScoreEntity = new GridScoreEntity(); + gridScoreEntity.setCustomerId(gridScoreDTO.getCustomerId()); + gridScoreEntity.setGridId(gridScoreDTO.getGridId()); + gridScoreEntity.setIsTotal(NumConstant.ONE_STR); + gridScoreEntity.setIndexCode(indexCode); + gridScoreEntity.setAgencyId(gridScoreDTO.getAgencyId()); + gridScoreEntity.setAllParentIds(gridScoreDTO.getAllParentIds()); + gridScoreEntity.setQuarterId(gridScoreDTO.getQuarterId()); + gridScoreEntity.setYearId(gridScoreDTO.getYearId()); + gridScoreEntity.setMonthId(gridScoreDTO.getMonthId()); + gridScoreEntity.setScore(BigDecimal.ZERO); + for(GridScoreDetailDTO gridScoreDetailDTO:gridScoreDTO.getDetailList()){ + BigDecimal indexScore=gridScoreDetailDTO.getScore().multiply(indexMap.get(gridScoreDetailDTO.getIndexCode()).getWeight()); + gridScoreEntity.setScore(gridScoreEntity.getScore().add(indexScore)); + } + gridScoreEntityList.add(gridScoreEntity); + }); + if (!CollectionUtils.isEmpty(gridScoreEntityList)) { + gridScoreDao.deleteByCusAndMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode, NumConstant.ONE_STR); + gridScoreDao.insertBatches(gridScoreEntityList); + } } - + public static void main(String[] args) { + BigDecimal totalScore=BigDecimal.ZERO; + for(int i=1;i<5;i++){ + totalScore=totalScore.add(new BigDecimal("1.00")); + } + System.out.println(totalScore); + } /** * @param customerId * @return com.epmet.dto.indexcal.CustomerGridInfoDTO diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/GridScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/GridScoreDao.xml index 6f739c3e36..35a12160ce 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/GridScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/GridScoreDao.xml @@ -78,7 +78,38 @@ - + SELECT + m.GRID_ID, + m.CUSTOMER_ID, + m.AGENCY_ID, + m.ALL_PARENT_IDS, + m.QUARTER_ID, + m.YEAR_ID, + m.MONTH_ID, + m.IS_TOTAL, + M.SCORE, + M.INDEX_CODE + FROM + fact_index_grid_score m + WHERE + m.DEL_FLAG = '0' + AND m.IS_TOTAL='0' + AND m.CUSTOMER_ID =#{customerId} + AND m.MONTH_ID =#{monthId} \ No newline at end of file From 255971ad11aa3d5556f6e711d11dc96a3060da27 Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 31 Aug 2020 18:19:48 +0800 Subject: [PATCH 109/226] =?UTF-8?q?=E5=88=86=E5=80=BC=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E5=99=A8=E4=BF=9D=E7=95=996=E4=BD=8D=E5=B0=8F=E6=95=B0?= =?UTF-8?q?=EF=BC=8C=E5=9B=9B=E8=88=8D=E4=BA=94=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../support/normalizing/batch/BatchScoreCalculator.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 d42ae98562..361d81f95f 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 @@ -3,6 +3,7 @@ package com.epmet.support.normalizing.batch; import com.epmet.support.normalizing.ScoreCalculator; import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.HashMap; import java.util.List; import java.util.stream.Collectors; @@ -24,7 +25,7 @@ public class BatchScoreCalculator { // 循环同一个指标内的多个样本值的SampleValue列表 List scores4OneIndex = indexValueVOs.stream().map(vo -> { - BigDecimal score = scoreCalculator.normalize(vo.getSampleValue(), weight); + BigDecimal score = scoreCalculator.normalize(vo.getSampleValue(), weight).setScale(6, RoundingMode.HALF_UP);; return new SampleScore(vo.getSampleId(), score); }).collect(Collectors.toList()); @@ -52,9 +53,10 @@ public class BatchScoreCalculator { String sampleId = vo.getSampleId(); BigDecimal score = scoreCalculator.normalize(vo.getSampleValue(), weight); if (scoreCountOfSamples.containsKey(sampleId)) { - BigDecimal newScore = scoreCountOfSamples.get(sampleId).add(score); + BigDecimal newScore = scoreCountOfSamples.get(sampleId).add(score).setScale(6, RoundingMode.HALF_UP); scoreCountOfSamples.put(sampleId, newScore); } else { + score.setScale(6, RoundingMode.HALF_UP); scoreCountOfSamples.put(sampleId, score); } } From 93fdcc50e97815fb9af9e516569884133d7d765d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 31 Aug 2020 18:46:31 +0800 Subject: [PATCH 110/226] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=9B=B8=E5=85=B3-?= =?UTF-8?q?=E6=9A=82=E5=AD=98V3.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/GridCorreLationServiceImpl.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java index 74afb589f3..7897c2560b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java @@ -123,7 +123,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //每一组指标的最大值,key:code_MIN/MAX Map minAndMaxMap = queryPartyAblityGridMinAndMax(formDTO.getCustomerId(), formDTO.getMonthId()); //指标集合 - Map> indexMap = getIndexInputVO(formDTO, indexList, minAndMaxMap); + Map> indexMap = getGridCorrelationIndexInputVO(formDTO, indexList, minAndMaxMap); List> resultMapList=new ArrayList<>(); //分页查询采集记录 for (int pageNo = 1; pageNo <= totalPage; pageNo++) { @@ -318,10 +318,10 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { * @param minAndMaxMap 最大值最小值集合 * @return java.util.Map * @author yinzuomei - * @description + * @description 构造网格相关 指标计算参数 * @Date 2020/8/30 15:56 **/ - private Map> getIndexInputVO(CalculateCommonFormDTO formDTO, List indexList, Map minAndMaxMap) { + private Map> getGridCorrelationIndexInputVO(CalculateCommonFormDTO formDTO, List indexList, Map minAndMaxMap) { Map> map = new HashMap<>(); for (int indexNum = 0; indexNum < indexList.size(); indexNum++) { IndexGroupDetailEntity index = indexList.get(indexNum); @@ -347,7 +347,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //获取指标对应的列名 String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(index.getIndexCode()); if(StringUtils.isBlank(fieldName)){ - logger.error("index_code:"+index.getIndexCode()+"not find field_name"); + logger.error("index_code:"+index.getIndexCode()+" not find field_name"); continue; } logger.info("INDEX_CODE=" + index.getIndexCode()+";FIELD_ID=" + fieldName ); @@ -393,7 +393,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //每一组指标的最大值,key:code_MIN/MAX Map minAndMaxMap = queryGovrnAblityGridMinAndMax(formDTO.getCustomerId(), formDTO.getMonthId()); //指标集合 - Map> indexMap = getIndexInputVO(formDTO, indexList, minAndMaxMap); + Map> indexMap = getGridCorrelationIndexInputVO(formDTO, indexList, minAndMaxMap); List> resultMapList=new ArrayList<>(); //分页查询采集记录 for (int pageNo = 1; pageNo <= totalPage; pageNo++) { @@ -453,7 +453,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //每一组指标的最大值,key:code_MIN/MAX Map minAndMaxMap = queryServiceAblityGridMinAndMax(formDTO.getCustomerId(), formDTO.getMonthId()); //指标集合 - Map> indexMap = getIndexInputVO(formDTO, indexList, minAndMaxMap); + Map> indexMap = getGridCorrelationIndexInputVO(formDTO, indexList, minAndMaxMap); List> resultMapList=new ArrayList<>(); //分页查询采集记录 for (int pageNo = 1; pageNo <= totalPage; pageNo++) { @@ -500,7 +500,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { List gridScoreDTOList = gridScoreDao.selectList(formDTO); Map indexMap = indexList.stream().collect(Collectors.toMap(IndexGroupDetailEntity::getIndexCode, Function.identity())); List gridScoreEntityList = new ArrayList<>(); - gridScoreDTOList.forEach(gridScoreDTO -> { + for(GridScoreDTO gridScoreDTO:gridScoreDTOList){ GridScoreEntity gridScoreEntity = new GridScoreEntity(); gridScoreEntity.setCustomerId(gridScoreDTO.getCustomerId()); gridScoreEntity.setGridId(gridScoreDTO.getGridId()); @@ -512,12 +512,16 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { gridScoreEntity.setYearId(gridScoreDTO.getYearId()); gridScoreEntity.setMonthId(gridScoreDTO.getMonthId()); gridScoreEntity.setScore(BigDecimal.ZERO); + if(!CollectionUtils.isEmpty(gridScoreDTO.getDetailList())&&gridScoreDTO.getDetailList().size()!=3){ + logger.error("customerId:"+gridScoreDTO.getCustomerId()+";gridId:"+gridScoreDTO.getGridId()+";monthId:"+gridScoreDTO.getMonthId()+"能力值缺失,无法计算总值"); + continue; + } for(GridScoreDetailDTO gridScoreDetailDTO:gridScoreDTO.getDetailList()){ BigDecimal indexScore=gridScoreDetailDTO.getScore().multiply(indexMap.get(gridScoreDetailDTO.getIndexCode()).getWeight()); gridScoreEntity.setScore(gridScoreEntity.getScore().add(indexScore)); } gridScoreEntityList.add(gridScoreEntity); - }); + } if (!CollectionUtils.isEmpty(gridScoreEntityList)) { gridScoreDao.deleteByCusAndMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode, NumConstant.ONE_STR); gridScoreDao.insertBatches(gridScoreEntityList); From 19634b110b9ede3a5548162e6e65e0218e082c42 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 31 Aug 2020 21:19:33 +0800 Subject: [PATCH 111/226] =?UTF-8?q?=E8=AE=A1=E7=AE=97=E5=85=9A=E5=91=98?= =?UTF-8?q?=E6=80=BB=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/indexcal/impl/CpcIndexCalculateServiceImpl.java | 3 ++- .../src/main/resources/mapper/indexscore/CpcScoreDao.xml | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java index 1293e23dc9..214076fc6a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -89,6 +89,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { cpcScoreTotalMap.put(userId, totalEntity); } BigDecimal total = part.getScore().multiply(indexGroupDetailEntity.getWeight()); + log.warn("userId:{},分数:{},权重:{},total:{}", userId, part.getScore(), indexGroupDetailEntity.getWeight(), total); totalEntity.setScore(totalEntity.getScore().add(total)); } }); @@ -147,7 +148,6 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { do { list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize); if (!CollectionUtils.isEmpty(list)) { - //遍历指标分组 计算分数 List> finalList = list; groupIndexDetailsMap.forEach((parentIndexCode, details) -> { @@ -196,6 +196,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { } log.warn("计算的参数:{}", indexMap); HashMap result = calculate(indexMap); + log.warn("计算的结果:{}", result); //处理结果 saveCpcScore(formDTO, scoreEntityMap, parentIndexCode, result); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml index c3b2529e0c..c3483cbc32 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml @@ -124,8 +124,8 @@ #{item.isTotal}, #{item.score}, #{item.indexCode}, - '0', - 0, + 0, + 0, 'APP_USER', now(), 'APP_USER', From cbf7212c686f0f1bc2acc03462abaa8d1b6de4bc Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 31 Aug 2020 22:09:06 +0800 Subject: [PATCH 112/226] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/IndexCalConstant.java | 1 + .../impl/CpcIndexCalculateServiceImpl.java | 184 ++++++++++-------- .../FactIndexPartyAblityCpcMonthlyDao.xml | 3 + 3 files changed, 108 insertions(+), 80 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java index 79321c6026..13b27760a5 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java @@ -19,4 +19,5 @@ public interface IndexCalConstant { String MONTH_ID="MONTH_ID"; String USER_ID="USER_ID"; + String YEAR_ID = "YEAR_ID"; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java index 214076fc6a..c15620850d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -2,8 +2,8 @@ package com.epmet.service.indexcal.impl; 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.utils.ConvertUtils; -import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.IndexCalConstant; import com.epmet.dao.indexcoll.FactIndexPartyAblityCpcMonthlyDao; import com.epmet.dao.indexscore.CpcScoreDao; @@ -22,7 +22,6 @@ import com.epmet.support.normalizing.ScoreConstants; import com.epmet.support.normalizing.batch.BatchScoreCalculator; import com.epmet.support.normalizing.batch.IndexInputVO; import com.epmet.support.normalizing.batch.SampleValue; -import com.epmet.util.DimIdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -50,11 +49,8 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { @Override public Boolean cpcIndexCalculate(CalculateCommonFormDTO formDTO) { - - calculatePartScore(formDTO); calculateTotalScore(formDTO); - return true; } @@ -68,36 +64,35 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { List parentIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); if (CollectionUtils.isEmpty(parentIndexDetails)) { log.warn("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); - return; + throw new RenException("客户【党员相关】指标权重信息不存在"); } - //获取数据 - List list = null; Map cpcScoreTotalMap = new HashMap<>(); Map indexWeightMap = parentIndexDetails.stream().collect(Collectors.toMap(IndexGroupDetailEntity::getIndexCode, o -> o)); - list = cpcScoreDao.getPartScore(formDTO.getCustomerId(), formDTO.getMonthId()); - if (!CollectionUtils.isEmpty(list)) { - Map> userGroupMap = list.stream().collect(Collectors.groupingBy(CpcScoreEntity::getUserId)); - userGroupMap.forEach((userId, partScoreList) -> { - CpcScoreEntity totalEntity = null; - for (CpcScoreEntity part : partScoreList) { - IndexGroupDetailEntity indexGroupDetailEntity = indexWeightMap.get(part.getIndexCode()); - if (totalEntity == null) { - totalEntity = ConvertUtils.sourceToTarget(part, CpcScoreEntity.class); - totalEntity.setIsTotal(NumConstant.ONE_STR); - totalEntity.setIndexCode(indexGroupDetailEntity.getIndexCode()); - cpcScoreTotalMap.put(userId, totalEntity); - } - BigDecimal total = part.getScore().multiply(indexGroupDetailEntity.getWeight()); - log.warn("userId:{},分数:{},权重:{},total:{}", userId, part.getScore(), indexGroupDetailEntity.getWeight(), total); - totalEntity.setScore(totalEntity.getScore().add(total)); - } - }); + //获取数据 + List list = cpcScoreDao.getPartScore(formDTO.getCustomerId(), formDTO.getMonthId()); + if (CollectionUtils.isEmpty(list)) { + log.error("calculateTotalScore cpcScoreDao.getPartScore return empty,customerId:{},monthId:{}", formDTO.getCustomerId(), formDTO.getMonthId()); + throw new RenException("客户四级指标分值记录不存在"); } - + Map> userGroupMap = list.stream().collect(Collectors.groupingBy(CpcScoreEntity::getUserId)); + userGroupMap.forEach((userId, partScoreList) -> { + CpcScoreEntity totalEntity = null; + for (CpcScoreEntity part : partScoreList) { + IndexGroupDetailEntity indexGroupDetailEntity = indexWeightMap.get(part.getIndexCode()); + if (totalEntity == null) { + totalEntity = ConvertUtils.sourceToTarget(part, CpcScoreEntity.class); + totalEntity.setIsTotal(NumConstant.ONE_STR); + totalEntity.setIndexCode(indexGroupDetailEntity.getIndexCode()); + cpcScoreTotalMap.put(userId, totalEntity); + } + //todo 自建群活跃度——议题转项目率 有阈值 >60%按60%算 + BigDecimal total = part.getScore().multiply(indexGroupDetailEntity.getWeight()); + log.debug("userId:{},分数:{},权重:{},total:{}", userId, part.getScore(), indexGroupDetailEntity.getWeight(), total); + totalEntity.setScore(totalEntity.getScore().add(total)); + } + }); insertBatch(cpcScoreTotalMap.values().stream().collect(Collectors.toList())); - - } private void insertBatch(Collection values) { @@ -113,56 +108,44 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { //计算最大最小值 Map minAndMaxMap = factIndexPartyAblityCpcMonthlyDao.getExtremeValue(formDTO.getCustomerId()); if (CollectionUtils.isEmpty(minAndMaxMap)) { - log.warn("cpcIndexCalculate getExtremeValue customerId:{} have not any fact record", formDTO.getCustomerId()); + log.error("cpcIndexCalculate getExtremeValue customerId:{} have not any fact record", formDTO.getCustomerId()); return; } //指标集合 - //对指标进行分组 - //Map> groupIndexDetailsMap = indexDetails.stream().collect(Collectors.groupingBy(IndexGroupDetailEntity::getAllParentIndexCode)); - - //获取指标权重信息 -参与议事 - List canyuyishiIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.CAN_YU_YI_SHI.getCode()); - if (CollectionUtils.isEmpty(canyuyishiIndexDetails)) { - log.warn("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); - return; - } - List dangwuhongdongIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_WU_HUO_DONG.getCode()); - if (CollectionUtils.isEmpty(canyuyishiIndexDetails)) { - log.warn("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); - return; - } - List lianxiqunzhongIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.LIAN_XI_QUN_ZHONG.getCode()); - if (CollectionUtils.isEmpty(canyuyishiIndexDetails)) { - log.warn("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + Map> groupIndexDetailsMap = getIndexDetailMap(formDTO); + if (groupIndexDetailsMap == null) { return; } - Map> groupIndexDetailsMap = new HashMap<>(); - groupIndexDetailsMap.put(IndexCodeEnum.CAN_YU_YI_SHI.getCode(), canyuyishiIndexDetails); - groupIndexDetailsMap.put(IndexCodeEnum.DANG_WU_HUO_DONG.getCode(), dangwuhongdongIndexDetails); - groupIndexDetailsMap.put(IndexCodeEnum.LIAN_XI_QUN_ZHONG.getCode(), lianxiqunzhongIndexDetails); - - List> list = null; int pageNo = 1; int pageSize = 10; + //分页查询 要计算的原始数据 + List> list = null; do { list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize); if (!CollectionUtils.isEmpty(list)) { //遍历指标分组 计算分数 List> finalList = list; groupIndexDetailsMap.forEach((parentIndexCode, details) -> { - calculate(formDTO, details, finalList, minAndMaxMap, parentIndexCode); + calculateScore(formDTO, details, finalList, minAndMaxMap, parentIndexCode); }); } } while (!CollectionUtils.isEmpty(list) && pageNo++ > 0); - } - private void calculate(CalculateCommonFormDTO formDTO, List indexDetailList, List> finalList, Map minAndMaxMap, String parentIndexCode) { - Map> indexMap = getIndexInputVO(indexDetailList, minAndMaxMap); + /** + * desc:计算并保存中间结果 + * + * @param formDTO + * @param indexDetailList + * @param finalList + * @param minAndMaxMap + * @param parentIndexCode remark:1.遍历指标和原始数据;2.构建指标归一算法计算器,计算分值;3.将分值保存到中间表 + */ + private void calculateScore(CalculateCommonFormDTO formDTO, List indexDetailList, List> finalList, Map minAndMaxMap, String parentIndexCode) { + Map> indexMap = buildIndexInputVO(indexDetailList, minAndMaxMap); Map scoreEntityMap = new HashMap<>(); //遍历指标 进行计算 - for (Map.Entry> entry : indexMap.entrySet()) { String indexCode = entry.getKey(); IndexInputVO value = entry.getValue(); @@ -175,10 +158,10 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { for (Map cpcCount : finalList) { //对应的数值 String userId = String.valueOf(cpcCount.get(IndexCalConstant.USER_ID)); - String sampleValueStr = String.valueOf(cpcCount.get(fieldName)); + BigDecimal sampleValue = new BigDecimal(String.valueOf(cpcCount.get(fieldName))); CpcScoreEntity cpcScoreEntity = new CpcScoreEntity(); - cpcScoreEntity.setYearId(DimIdGenerator.getYearDimId(DateUtils.addDateMonths(new Date(), -1))); + cpcScoreEntity.setYearId(String.valueOf(cpcCount.get(IndexCalConstant.YEAR_ID))); cpcScoreEntity.setCustomerId(formDTO.getCustomerId()); cpcScoreEntity.setAgencyId(String.valueOf(cpcCount.get(IndexCalConstant.AGENCY_ID))); cpcScoreEntity.setGridId(String.valueOf(cpcCount.get(IndexCalConstant.GRID_ID))); @@ -187,22 +170,30 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { cpcScoreEntity.setMonthId(formDTO.getMonthId()); cpcScoreEntity.setScore(new BigDecimal(0)); cpcScoreEntity.setIndexCode(parentIndexCode); + scoreEntityMap.put(userId, cpcScoreEntity); //构造样本值对象 - SampleValue currentGridIndexValue = new SampleValue((String) cpcCount.get(IndexCalConstant.USER_ID), new BigDecimal(sampleValueStr)); - value.getIndexValueVOs().add(currentGridIndexValue); + SampleValue currentUserIndexValue = new SampleValue(userId, sampleValue); + value.getIndexValueVOs().add(currentUserIndexValue); } } log.warn("计算的参数:{}", indexMap); - HashMap result = calculate(indexMap); + HashMap result = calculateScore(indexMap); log.warn("计算的结果:{}", result); //处理结果 saveCpcScore(formDTO, scoreEntityMap, parentIndexCode, result); } - + /** + * desc:保存分值 到中间表 + * + * @param formDTO + * @param indexDetails + * @param parentIndexCode + * @param result + */ @Transactional(rollbackFor = Exception.class) public void saveCpcScore(CalculateCommonFormDTO formDTO, Map indexDetails, String parentIndexCode, HashMap result) { cpcScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), parentIndexCode); @@ -215,21 +206,10 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { this.insertBatch(list); } - /** - * @param indexMap - * @return java.util.List - * @author yinzuomei - * @description - * @Date 2020/8/30 21:40 - **/ - private HashMap calculate(Map> indexMap) { - //构造入参 - List indexInputVOS = indexMap.values().stream().collect(Collectors.toList()); - BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - return batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - } /** + * desc:构建分值计算器 + * * @param indexList 指标集合 * @param minAndMaxMap 最大值最小值集合 * @return java.util.Map @@ -237,10 +217,9 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { * @description * @Date 2020/8/30 15:56 **/ - private Map> getIndexInputVO(List indexList, Map minAndMaxMap) { + private Map> buildIndexInputVO(List indexList, Map minAndMaxMap) { Map> map = new HashMap<>(); - for (int indexNum = 0; indexNum < indexList.size(); indexNum++) { - IndexGroupDetailEntity index = indexList.get(indexNum); + for (IndexGroupDetailEntity index : indexList) { IndexInputVO indexInputVO = new IndexInputVO(); // 指标code indexInputVO.setIndexId(index.getIndexCode()); @@ -273,4 +252,49 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { } return map; } + + /** + * desc:调用计算器计算每个人的分数值 + * + * @param indexMap + * @return + */ + private HashMap calculateScore(Map> indexMap) { + //构造入参 + List indexInputVOS = indexMap.values().stream().collect(Collectors.toList()); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + return batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + } + + + /** + * desc:构建党员相关4级指标明细map + * + * @param formDTO + * @return + */ + private Map> getIndexDetailMap(CalculateCommonFormDTO formDTO) { + //获取指标权重信息 -参与议事 + List canyuyishiIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.CAN_YU_YI_SHI.getCode()); + if (CollectionUtils.isEmpty(canyuyishiIndexDetails)) { + log.error("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + return null; + } + List dangwuhongdongIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_WU_HUO_DONG.getCode()); + if (CollectionUtils.isEmpty(canyuyishiIndexDetails)) { + log.error("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + return null; + } + List lianxiqunzhongIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.LIAN_XI_QUN_ZHONG.getCode()); + if (CollectionUtils.isEmpty(canyuyishiIndexDetails)) { + log.error("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + return null; + } + + Map> groupIndexDetailsMap = new HashMap<>(); + groupIndexDetailsMap.put(IndexCodeEnum.CAN_YU_YI_SHI.getCode(), canyuyishiIndexDetails); + groupIndexDetailsMap.put(IndexCodeEnum.DANG_WU_HUO_DONG.getCode(), dangwuhongdongIndexDetails); + groupIndexDetailsMap.put(IndexCodeEnum.LIAN_XI_QUN_ZHONG.getCode(), lianxiqunzhongIndexDetails); + return groupIndexDetailsMap; + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml index beb5b42a4e..c9f807d881 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml @@ -101,6 +101,9 @@ AGENCY_ID, PARENT_ID, GRID_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, USER_ID, CREATE_TOPIC_COUNT, JOIN_TOPIC_COUNT, From 82b959325b6d243dcdfe8192b488d3f57ff8a82f Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 1 Sep 2020 09:09:21 +0800 Subject: [PATCH 113/226] =?UTF-8?q?=E6=89=93=E5=BC=80nacos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/data-statistical/data-statistical-server/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index a805e4a53c..8d0e953c05 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -195,7 +195,7 @@ 6379 123456 - false + true 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 From 9f9a3903cebbbf4acbc9e5fedc762ac5a689fe5f Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 1 Sep 2020 09:57:01 +0800 Subject: [PATCH 114/226] =?UTF-8?q?=E5=88=86=E6=94=AF=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=EF=BC=8C=E5=A2=9E=E5=8A=A0=E9=98=88=E5=80=BC?= =?UTF-8?q?=E7=9A=84=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../batch/BatchScoreCalculator.java | 23 +++++++++++++++++-- .../normalizing/batch/IndexInputVO.java | 7 +++++- .../stats/test/normalizing/DemoScoreCal.java | 12 +++++----- 3 files changed, 33 insertions(+), 9 deletions(-) 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 361d81f95f..6c17298ad6 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 @@ -22,10 +22,11 @@ public class BatchScoreCalculator { List indexValueVOs = i.getIndexValueVOs(); BigDecimal weight = i.getWeight(); ScoreCalculator scoreCalculator = i.getScoreCalculator(); + BigDecimal threshold = i.getThreshold(); // 循环同一个指标内的多个样本值的SampleValue列表 List scores4OneIndex = indexValueVOs.stream().map(vo -> { - BigDecimal score = scoreCalculator.normalize(vo.getSampleValue(), weight).setScale(6, RoundingMode.HALF_UP);; + BigDecimal score = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold), weight).setScale(6, RoundingMode.HALF_UP);; return new SampleScore(vo.getSampleId(), score); }).collect(Collectors.toList()); @@ -48,10 +49,11 @@ public class BatchScoreCalculator { List indexValueVOs = idx.getIndexValueVOs(); BigDecimal weight = idx.getWeight(); ScoreCalculator scoreCalculator = idx.getScoreCalculator(); + BigDecimal threshold = idx.getThreshold(); for (SampleValue vo : indexValueVOs) { String sampleId = vo.getSampleId(); - BigDecimal score = scoreCalculator.normalize(vo.getSampleValue(), weight); + BigDecimal score = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold), weight); if (scoreCountOfSamples.containsKey(sampleId)) { BigDecimal newScore = scoreCountOfSamples.get(sampleId).add(score).setScale(6, RoundingMode.HALF_UP); scoreCountOfSamples.put(sampleId, newScore); @@ -64,4 +66,21 @@ public class BatchScoreCalculator { return scoreCountOfSamples; } + + /** + * 获取最终样本值 + * @param realValue + * @param threshold + * @return + */ + public BigDecimal getFinalSampleValue(Object realValue, BigDecimal threshold) { + BigDecimal bdRealValue = new BigDecimal(realValue.toString()); + if (threshold.equals(-1)) { + // -1表示不使用阈值 + return bdRealValue; + } + return (bdRealValue.compareTo(threshold) < 0) || (bdRealValue.equals(threshold)) + ? bdRealValue + : threshold ; + } } 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 94ea1ef0ad..47ca728d5a 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 @@ -11,7 +11,7 @@ import java.util.List; @Data @AllArgsConstructor @NoArgsConstructor -public class IndexInputVO { +public class IndexInputVO { /** * 指标标记,由使用者传入,用以标记该条指标的独有特性,一般用id或者code @@ -24,6 +24,11 @@ public class IndexInputVO { */ private List> indexValueVOs; + /** + * 样本阈值 + */ + private BigDecimal threshold; + /** * 权重 */ 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 c080ffc296..6da70db9c8 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 @@ -78,8 +78,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(1), sc1); - IndexInputVO index2VO = new IndexInputVO<>("bbb", index2SampleValues, new BigDecimal(1), sc2); + 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); List indexInputVOS = Arrays.asList(index1VO, index2VO); @@ -104,8 +104,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(1), sc1); - IndexInputVO index2VO = new IndexInputVO("bbb", index2SampleValues, new BigDecimal(1), sc2); + 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); List indexInputVOS = Arrays.asList(index1VO, index2VO); @@ -130,8 +130,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(1), sc1); - IndexInputVO index2VO = new IndexInputVO("bbb", index2SampleValues, new BigDecimal(1), sc2); + 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); List indexInputVOS = Arrays.asList(index1VO, index2VO); From e8c33cf1fe306abd3bdcf84cfd00b5eab5ba0be8 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 1 Sep 2020 10:10:02 +0800 Subject: [PATCH 115/226] =?UTF-8?q?=E6=80=BB=E5=88=86=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/model/IndexExcelDataListener.java | 48 +++++++++---------- .../impl/CpcIndexCalculateServiceImpl.java | 5 +- 2 files changed, 28 insertions(+), 25 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 24770d1bd2..9267d562a8 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 @@ -123,49 +123,49 @@ public class IndexExcelDataListener extends AnalysisEventListener { group1.setIndexId(indexDictEntity.getId()); group1.setParentIndexGroupId("0"); group1.setId(UniqueIdGenerator.generate()); - group1.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(),true,4)); + group1.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(), true, 4)); indexGroupMap.put(index.getLevel1Index(), group1); } StringBuilder allIndexCodeSb = new StringBuilder(group1.getIndexCode()); String level4Index = index.getLevel4Index(); indexDictEntity = indexDicMap.get(level4Index); - IndexGroupTemplateEntity group2 = indexGroupMap.get(index.getLevel1Index()+level4Index); + IndexGroupTemplateEntity group2 = indexGroupMap.get(index.getLevel1Index() + level4Index); IndexGroupDetailTemplateEntity templateEntity = null; if (group2 == null) { group2 = new IndexGroupTemplateEntity(); group2.setIndexId(indexDictEntity.getId()); group2.setParentIndexGroupId(group1.getId()); group2.setId(UniqueIdGenerator.generate()); - group2.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(),false,4 )); - indexGroupMap.put(index.getLevel1Index()+level4Index, group2); + group2.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(), false, 4)); + indexGroupMap.put(index.getLevel1Index() + level4Index, group2); //构建 分组明细 - templateEntity = indexGroupDetailMap.get(index.getLevel1Index()+level4Index); + templateEntity = indexGroupDetailMap.get(index.getLevel1Index() + level4Index); if (templateEntity == null) { - templateEntity = new IndexGroupDetailTemplateEntity(); + templateEntity = new IndexGroupDetailTemplateEntity(); templateEntity.setIndexGroupId(group1.getId()); templateEntity.setIndexId(indexDictEntity.getId()); templateEntity.setAllParentIndexCode(allIndexCodeSb.toString()); templateEntity.setId(UniqueIdGenerator.generate()); templateEntity.setCorrelation(index.getCorrelation()); - buildIndexGroupDetail(templateEntity,indexDictEntity, index, group1, 2); - indexGroupDetailMap.put(index.getLevel1Index()+level4Index,templateEntity); + buildIndexGroupDetail(templateEntity, indexDictEntity, index, 2); + indexGroupDetailMap.put(index.getLevel1Index() + level4Index, templateEntity); } } indexDictEntity = indexDicMap.get(index.getLevel5Index()); allIndexCodeSb.append(StrConstant.COLON); allIndexCodeSb.append(group2.getIndexCode()); - templateEntity = indexGroupDetailMap.get(index.getLevel1Index()+index.getLevel5Index()); + templateEntity = indexGroupDetailMap.get(index.getLevel1Index() + index.getLevel5Index()); if (templateEntity == null) { - templateEntity = new IndexGroupDetailTemplateEntity(); + templateEntity = new IndexGroupDetailTemplateEntity(); templateEntity.setIndexGroupId(group2.getId()); templateEntity.setIndexId(indexDictEntity.getId()); templateEntity.setAllParentIndexCode(allIndexCodeSb.toString()); templateEntity.setId(UniqueIdGenerator.generate()); templateEntity.setCorrelation(index.getCorrelation()); - buildIndexGroupDetail(templateEntity,indexDictEntity, index, group2, 5); - indexGroupDetailMap.put(index.getLevel1Index()+index.getLevel5Index(),templateEntity); + buildIndexGroupDetail(templateEntity, indexDictEntity, index, 5); + indexGroupDetailMap.put(index.getLevel1Index() + index.getLevel5Index(), templateEntity); } } else { //todo 测试完去掉 @@ -177,7 +177,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { group1.setIndexId(indexDictEntity.getId()); group1.setParentIndexGroupId("0"); group1.setId(UniqueIdGenerator.generate()); - group1.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(),false,4 )); + group1.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(), false, 4)); indexGroupMap.put(index.getLevel1Index(), group1); } StringBuilder allIndexCodeSb = new StringBuilder(group1.getIndexCode()); @@ -191,35 +191,35 @@ public class IndexExcelDataListener extends AnalysisEventListener { group2.setIndexId(indexDictEntity.getId()); group2.setParentIndexGroupId(group1.getId()); group2.setId(UniqueIdGenerator.generate()); - group2.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(),false,4 )); + group2.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(), false, 4)); indexGroupMap.put(groupMapKey, group2); //构建 分组明细 templateEntity = indexGroupDetailMap.get(level2Index); if (templateEntity == null) { - templateEntity = new IndexGroupDetailTemplateEntity(); + templateEntity = new IndexGroupDetailTemplateEntity(); templateEntity.setIndexGroupId(group2.getId()); templateEntity.setIndexId(indexDictEntity.getId()); templateEntity.setAllParentIndexCode(allIndexCodeSb.toString()); templateEntity.setId(UniqueIdGenerator.generate()); templateEntity.setCorrelation(index.getCorrelation()); - buildIndexGroupDetail(templateEntity,indexDictEntity, index, group1, 2); - indexGroupDetailMap.put(level2Index,templateEntity); + buildIndexGroupDetail(templateEntity, indexDictEntity, index, 2); + indexGroupDetailMap.put(groupMapKey, templateEntity); } } indexDictEntity = indexDicMap.get(index.getLevel5Index()); allIndexCodeSb.append(StrConstant.COLON); allIndexCodeSb.append(group2.getIndexCode()); - templateEntity = indexGroupDetailMap.get(index.getLevel1Index()+index.getLevel5Index()); + templateEntity = indexGroupDetailMap.get(index.getLevel1Index() + index.getLevel5Index()); if (templateEntity == null) { - templateEntity = new IndexGroupDetailTemplateEntity(); + templateEntity = new IndexGroupDetailTemplateEntity(); templateEntity.setIndexGroupId(group2.getId()); templateEntity.setIndexId(indexDictEntity.getId()); templateEntity.setAllParentIndexCode(allIndexCodeSb.toString()); templateEntity.setId(UniqueIdGenerator.generate()); templateEntity.setCorrelation(index.getCorrelation()); - buildIndexGroupDetail(templateEntity, indexDictEntity, index, group2, 5); - indexGroupDetailMap.put(index.getLevel1Index()+index.getLevel5Index(),templateEntity); + buildIndexGroupDetail(templateEntity, indexDictEntity, index, 5); + indexGroupDetailMap.put(index.getLevel1Index() + index.getLevel5Index(), templateEntity); } } //} @@ -228,13 +228,13 @@ public class IndexExcelDataListener extends AnalysisEventListener { LOGGER.info("所有指标分组明细数据解析完成:{}", JSON.toJSONString(indexGroupDetailMap.values())); } - private void buildIndexGroupDetail( IndexGroupDetailTemplateEntity templateEntity,IndexDictEntity indexDictEntity, IndexModel index, IndexGroupTemplateEntity parentGroup, Integer level) { + private void buildIndexGroupDetail(IndexGroupDetailTemplateEntity templateEntity, IndexDictEntity indexDictEntity, IndexModel index, Integer level) { if (level == 5) { - templateEntity.setIndexCode(Pinyin4jUtil.getSpellPinYin(index.getLevel5Index(),false,4 )); + templateEntity.setIndexCode(Pinyin4jUtil.getSpellPinYin(index.getLevel5Index(), false, 4)); String level5WeightStr = index.getLevel5Weight().replace("%", ""); templateEntity.setWeight(new BigDecimal(level5WeightStr).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP)); } else { - templateEntity.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(),false,4 )); + templateEntity.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(), false, 4)); templateEntity.setWeight(new BigDecimal(index.getWeight()).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP)); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java index c15620850d..aa937dc3d6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -84,11 +84,12 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { totalEntity = ConvertUtils.sourceToTarget(part, CpcScoreEntity.class); totalEntity.setIsTotal(NumConstant.ONE_STR); totalEntity.setIndexCode(indexGroupDetailEntity.getIndexCode()); + totalEntity.setScore(new BigDecimal(0)); cpcScoreTotalMap.put(userId, totalEntity); } //todo 自建群活跃度——议题转项目率 有阈值 >60%按60%算 BigDecimal total = part.getScore().multiply(indexGroupDetailEntity.getWeight()); - log.debug("userId:{},分数:{},权重:{},total:{}", userId, part.getScore(), indexGroupDetailEntity.getWeight(), total); + log.info("userId:{},分数:{},权重:{},total:{}", userId, part.getScore(), indexGroupDetailEntity.getWeight(), total); totalEntity.setScore(totalEntity.getScore().add(total)); } }); @@ -225,6 +226,8 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { indexInputVO.setIndexId(index.getIndexCode()); //权重 indexInputVO.setWeight(index.getWeight()); + //阈值 + indexInputVO.setThreshold(index.getThreshold()); BigDecimal minValue = null; BigDecimal maxValue = null; From 73012448d1869eab543f0bae61b7dd5e34529540 Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 1 Sep 2020 10:17:02 +0800 Subject: [PATCH 116/226] =?UTF-8?q?=E5=88=86=E5=80=BC=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=EF=BC=8C=E5=8E=BB=E6=8E=89=E6=97=A0=E5=8F=82?= =?UTF-8?q?=E6=9E=84=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/support/normalizing/batch/IndexInputVO.java | 1 - 1 file changed, 1 deletion(-) 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 47ca728d5a..abf62aef2b 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 @@ -10,7 +10,6 @@ import java.util.List; @Data @AllArgsConstructor -@NoArgsConstructor public class IndexInputVO { /** From 358ced173b7f1851514f797be1a96aa402a11ce7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 1 Sep 2020 10:20:39 +0800 Subject: [PATCH 117/226] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=98=88=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/GridCorreLationServiceImpl.java | 208 ++++++++++-------- 1 file changed, 121 insertions(+), 87 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java index 7897c2560b..98a35e93fe 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java @@ -2,6 +2,7 @@ package com.epmet.service.indexcal.impl; 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.utils.DateUtils; import com.epmet.constant.IndexCalConstant; import com.epmet.dao.indexcoll.FactIndexGovrnAblityGridMonthlyDao; @@ -70,33 +71,45 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { @Override public Boolean calculateGridCorreLation(CalculateCommonFormDTO formDTO) { boolean resultFlag = false; + //1、计算网格相关-党建能力 List dangJianNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); - if (!CollectionUtils.isEmpty(dangJianNengLiList)) { - //1、计算网格相关-党建能力 - calculateGridDangJian(formDTO, dangJianNengLiList); + if (CollectionUtils.isEmpty(dangJianNengLiList)) { + logger.warn("calculateGridDangJian customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + throw new RenException("客户【网格相关:党建能力】指标权重信息不存在"); } + calculateGridDangJian(formDTO, dangJianNengLiList); + + //2、计算网格相关-治理能力 List zhiLiNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); - if (!CollectionUtils.isEmpty(zhiLiNengLiList)) { - //2、计算网格相关-治理能力 - calculateGridZhiLi(formDTO, zhiLiNengLiList); + if (CollectionUtils.isEmpty(zhiLiNengLiList)) { + logger.warn("calculateGridZhiLi customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + throw new RenException("客户【网格相关:治理能力】指标权重信息不存在"); } + calculateGridZhiLi(formDTO, zhiLiNengLiList); + + //3、计算网格相关-服务能力 List fuWuNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); - if (!CollectionUtils.isEmpty(fuWuNengLiList)) { - //3、计算网格相关-服务能力 - calculateGridFuWu(formDTO, fuWuNengLiList); + if (CollectionUtils.isEmpty(fuWuNengLiList)) { + logger.warn("calculateGridFuWu customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + throw new RenException("客户【网格相关:服务能力】指标权重信息不存在"); } - //计算网格相关总分 + calculateGridFuWu(formDTO, fuWuNengLiList); + + //4、计算网格相关总分 List wgxgList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); - if (!CollectionUtils.isEmpty(wgxgList)) { - calculateGridTotal(formDTO, wgxgList,IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); + if (CollectionUtils.isEmpty(wgxgList)) { + logger.warn("calculateGridTotal customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + throw new RenException("客户【网格相关】指标权重信息不存在"); } + calculateGridTotal(formDTO, wgxgList, IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); + resultFlag = true; return resultFlag; } @@ -122,9 +135,13 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { logger.info(String.format("共%s条数据,分%s次计算", total, totalPage)); //每一组指标的最大值,key:code_MIN/MAX Map minAndMaxMap = queryPartyAblityGridMinAndMax(formDTO.getCustomerId(), formDTO.getMonthId()); + if (CollectionUtils.isEmpty(minAndMaxMap)) { + logger.error("calculateGridDangJian queryPartyAblityGridMinAndMax customerId:{} monthId:{} have not any fact record", formDTO.getCustomerId(),formDTO.getMonthId()); + return; + } //指标集合 - Map> indexMap = getGridCorrelationIndexInputVO(formDTO, indexList, minAndMaxMap); - List> resultMapList=new ArrayList<>(); + Map> indexMap = buildGridCorrelationIndexInputVO(formDTO, indexList, minAndMaxMap); + List> resultMapList = new ArrayList<>(); //分页查询采集记录 for (int pageNo = 1; pageNo <= totalPage; pageNo++) { int pageIndex = (pageNo - NumConstant.ONE) * IndexCalConstant.PAGE_SIZE; @@ -149,8 +166,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //组织内党员的联系群众能力考评分(平均值) logger.info("组织内党员的联系群众能力考评分(平均值) 单独处理"); //网格内党员的联系群众能力考评分(平均值) - String gridId=(String) recordMap.get(IndexCalConstant.GRID_ID); - BigDecimal contactMassesAvgValue = getGridContactMassesAvgValue(formDTO,gridId); + String gridId = (String) recordMap.get(IndexCalConstant.GRID_ID); + BigDecimal contactMassesAvgValue = getGridContactMassesAvgValue(formDTO, gridId); SampleValue contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), contactMassesAvgValue); value.getIndexValueVOs().add(contactMassesAblityValue); } @@ -160,96 +177,96 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { resultMapList.add(resultMap); } // 保存中间表 - saveGridCorreLationDangJian(formDTO, resultMapList,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),NumConstant.ZERO_STR); + saveGridCorreLationResult(formDTO, resultMapList, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), NumConstant.ZERO_STR); } /** - * @return java.util.Map * @param calculateCommonFormDTO + * @return java.util.Map * @author yinzuomei * @description 获取网格内党员的联系群众能力考评分(平均值)的最大值,最小值 * @Date 2020/8/31 9:51 **/ private Map getContactMassesAblityMap(CalculateCommonFormDTO calculateCommonFormDTO) { - Map map=new HashMap<>(); - List list=cpcScoreDao.selectListGridContactMassesAvgValue(calculateCommonFormDTO); - if(!CollectionUtils.isEmpty(list)){ - BigDecimal minValue=Collections.min(list); - BigDecimal maxValue=Collections.max(list); - map.put(StrConstant.MIN,minValue); - map.put(StrConstant.MAX,maxValue); + Map map = new HashMap<>(); + List list = cpcScoreDao.selectListGridContactMassesAvgValue(calculateCommonFormDTO); + if (!CollectionUtils.isEmpty(list)) { + BigDecimal minValue = Collections.min(list); + BigDecimal maxValue = Collections.max(list); + map.put(StrConstant.MIN, minValue); + map.put(StrConstant.MAX, maxValue); return map; } - map.put(StrConstant.MIN,new BigDecimal(NumConstant.ZERO_STR)); - map.put(StrConstant.MAX,new BigDecimal(NumConstant.ZERO_STR)); + map.put(StrConstant.MIN, new BigDecimal(NumConstant.ZERO_STR)); + map.put(StrConstant.MAX, new BigDecimal(NumConstant.ZERO_STR)); return map; } /** - * @return java.math.BigDecimal * @param calculateCommonFormDTO - * @param gridId 网格id + * @param gridId 网格id + * @return java.math.BigDecimal * @author yinzuomei * @description 获取网格(组织)内党员的联系群众能力考评分(平均值) * @Date 2020/8/31 9:50 **/ - private BigDecimal getGridContactMassesAvgValue(CalculateCommonFormDTO calculateCommonFormDTO,String gridId) { - BigDecimal result=cpcScoreDao.selectGridContactMassesAvgValue(calculateCommonFormDTO.getCustomerId(),calculateCommonFormDTO.getMonthId(),gridId); - if(null==result){ + private BigDecimal getGridContactMassesAvgValue(CalculateCommonFormDTO calculateCommonFormDTO, String gridId) { + BigDecimal result = cpcScoreDao.selectGridContactMassesAvgValue(calculateCommonFormDTO.getCustomerId(), calculateCommonFormDTO.getMonthId(), gridId); + if (null == result) { return new BigDecimal(NumConstant.ZERO_STR); } return result; } /** - * @return java.math.BigDecimal * @param formDTO * @param gridId + * @return java.math.BigDecimal * @author yinzuomei - * @description 组织内党员的参与议事能力考评分(平均值) + * @description 组织内党员的参与议事能力考评分(平均值) * @Date 2020/8/31 15:51 **/ private BigDecimal getGridJoinIssueAvgValue(CalculateCommonFormDTO formDTO, String gridId) { - BigDecimal result=cpcScoreDao.selectGridJoinIssueAvgValue(formDTO.getCustomerId(),formDTO.getMonthId(),gridId); - if(null==result){ + BigDecimal result = cpcScoreDao.selectGridJoinIssueAvgValue(formDTO.getCustomerId(), formDTO.getMonthId(), gridId); + if (null == result) { return new BigDecimal(NumConstant.ZERO_STR); } return result; } - + /** - * @return java.util.Map * @param calculateCommonFormDTO + * @return java.util.Map * @author yinzuomei * @description 网格内党员的参与议事能力考评分(平均值) 最大值最小值 * @Date 2020/8/31 14:41 **/ - private Map getJoinIssueAblityMap(CalculateCommonFormDTO calculateCommonFormDTO){ - Map map=new HashMap<>(); - List list=cpcScoreDao.selectListJoinIssueAvgValue(calculateCommonFormDTO); - if(!CollectionUtils.isEmpty(list)){ - BigDecimal minValue=Collections.min(list); - BigDecimal maxValue=Collections.max(list); - map.put(StrConstant.MIN,minValue); - map.put(StrConstant.MAX,maxValue); + private Map getJoinIssueAblityMap(CalculateCommonFormDTO calculateCommonFormDTO) { + Map map = new HashMap<>(); + List list = cpcScoreDao.selectListJoinIssueAvgValue(calculateCommonFormDTO); + if (!CollectionUtils.isEmpty(list)) { + BigDecimal minValue = Collections.min(list); + BigDecimal maxValue = Collections.max(list); + map.put(StrConstant.MIN, minValue); + map.put(StrConstant.MAX, maxValue); return map; } - map.put(StrConstant.MIN,new BigDecimal(NumConstant.ZERO_STR)); - map.put(StrConstant.MAX,new BigDecimal(NumConstant.ZERO_STR)); + map.put(StrConstant.MIN, new BigDecimal(NumConstant.ZERO_STR)); + map.put(StrConstant.MAX, new BigDecimal(NumConstant.ZERO_STR)); return map; } /** - * @param formDTO 客户id 月份id: yyyyMM + * @param formDTO 客户id 月份id: yyyyMM * @param resultMapList - * @param indexCode 指标编码 - * @param isTotal 1:总分;0不是 + * @param indexCode 指标编码: 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli; + * @param isTotal 1:总分;0不是 * @return void * @author yinzuomei * @description 保存网格相关三大能力值 * @Date 2020/8/30 22:50 **/ - private void saveGridCorreLationDangJian(CalculateCommonFormDTO formDTO, + private void saveGridCorreLationResult(CalculateCommonFormDTO formDTO, List> resultMapList, String indexCode, String isTotal) { @@ -277,7 +294,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { }); } if (!CollectionUtils.isEmpty(gridScoreEntityList)) { - gridScoreDao.deleteByCusAndMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode,isTotal); + gridScoreDao.deleteByCusAndMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode, isTotal); gridScoreDao.insertBatches(gridScoreEntityList); } } @@ -286,21 +303,24 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { * @param indexMap * @return java.util.List * @author yinzuomei - * @description + * @description 调用计算器计算每个指标下,各个网格的总分 * @Date 2020/8/30 21:40 **/ private HashMap calculate(Map> indexMap) { //构造入参 List indexInputVOS = this.getIndexInputVOList(indexMap); + logger.info("计算的参数:{}", indexInputVOS); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - return batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + HashMap resultMap = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + logger.info("计算的结果:{}", resultMap); + return resultMap; } /** * @param indexMap * @return java.util.List * @author yinzuomei - * @description + * @description map遍历,转为List * @Date 2020/8/30 18:34 **/ private List getIndexInputVOList(Map> indexMap) { @@ -321,13 +341,14 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { * @description 构造网格相关 指标计算参数 * @Date 2020/8/30 15:56 **/ - private Map> getGridCorrelationIndexInputVO(CalculateCommonFormDTO formDTO, List indexList, Map minAndMaxMap) { + private Map> buildGridCorrelationIndexInputVO(CalculateCommonFormDTO formDTO, List indexList, Map minAndMaxMap) { Map> map = new HashMap<>(); - for (int indexNum = 0; indexNum < indexList.size(); indexNum++) { - IndexGroupDetailEntity index = indexList.get(indexNum); + for (IndexGroupDetailEntity index : indexList) { IndexInputVO indexInputVO = new IndexInputVO(); // 指标code indexInputVO.setIndexId(index.getIndexCode()); + //阈值 + indexInputVO.setThreshold(index.getThreshold()); //权重 indexInputVO.setWeight(index.getWeight()); BigDecimal minValue = null; @@ -335,22 +356,22 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { if (IndexCodeEnum.ZUZHINEIDANGYDLXQZNLKPFPJZ.getCode().equals(index.getIndexCode())) { //组织内党员的联系群众能力考评分(平均值) 获取最大值,最小值 logger.info("组织内党员的联系群众能力考评分(平均值) 单独处理"); - Map contactMassesAblityMap= this.getContactMassesAblityMap(formDTO); - minValue=contactMassesAblityMap.get(StrConstant.MIN); - maxValue=contactMassesAblityMap.get(StrConstant.MAX); - }else if(IndexCodeEnum.ZUZHINEIDANGYDSYYSNLKPFPJZ.getCode().equals(index.getIndexCode())){ + Map contactMassesAblityMap = this.getContactMassesAblityMap(formDTO); + minValue = contactMassesAblityMap.get(StrConstant.MIN); + maxValue = contactMassesAblityMap.get(StrConstant.MAX); + } else if (IndexCodeEnum.ZUZHINEIDANGYDSYYSNLKPFPJZ.getCode().equals(index.getIndexCode())) { logger.info("组织内党员的参与议事能力考评分(平均值) 单独处理"); - Map joinIssueAblityMap= this.getJoinIssueAblityMap(formDTO); - minValue=joinIssueAblityMap.get(StrConstant.MIN); - maxValue=joinIssueAblityMap.get(StrConstant.MAX); + Map joinIssueAblityMap = this.getJoinIssueAblityMap(formDTO); + minValue = joinIssueAblityMap.get(StrConstant.MIN); + maxValue = joinIssueAblityMap.get(StrConstant.MAX); } else { //获取指标对应的列名 String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(index.getIndexCode()); - if(StringUtils.isBlank(fieldName)){ - logger.error("index_code:"+index.getIndexCode()+" not find field_name"); + if (StringUtils.isBlank(fieldName)) { + logger.error("index_code:{} ",index.getIndexCode(),"not find field_name"); continue; } - logger.info("INDEX_CODE=" + index.getIndexCode()+";FIELD_ID=" + fieldName ); + logger.info("index_code:{} ",index.getIndexCode(),"field_id :{} ",fieldName); String minValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MIN); String maxValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MAX); minValue = new BigDecimal(String.valueOf(minAndMaxMap.get(minValueKey))); @@ -392,9 +413,13 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { logger.info(String.format("共%s条数据,分%s次计算", total, totalPage)); //每一组指标的最大值,key:code_MIN/MAX Map minAndMaxMap = queryGovrnAblityGridMinAndMax(formDTO.getCustomerId(), formDTO.getMonthId()); + if (CollectionUtils.isEmpty(minAndMaxMap)) { + logger.error("calculateGridZhiLi queryGovrnAblityGridMinAndMax customerId:{} monthId:{} have not any fact record", formDTO.getCustomerId(),formDTO.getMonthId()); + return; + } //指标集合 - Map> indexMap = getGridCorrelationIndexInputVO(formDTO, indexList, minAndMaxMap); - List> resultMapList=new ArrayList<>(); + Map> indexMap = buildGridCorrelationIndexInputVO(formDTO, indexList, minAndMaxMap); + List> resultMapList = new ArrayList<>(); //分页查询采集记录 for (int pageNo = 1; pageNo <= totalPage; pageNo++) { int pageIndex = (pageNo - NumConstant.ONE) * IndexCalConstant.PAGE_SIZE; @@ -417,8 +442,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { value.getIndexValueVOs().add(currentGridIndexValue); } else if (IndexCodeEnum.ZUZHINEIDANGYDSYYSNLKPFPJZ.getCode().equals(key)) { logger.info("组织内党员的参与议事能力考评分(平均值) 单独处理"); - String gridId=(String) recordMap.get(IndexCalConstant.GRID_ID); - BigDecimal joinAvgValue = getGridJoinIssueAvgValue(formDTO,gridId); + String gridId = (String) recordMap.get(IndexCalConstant.GRID_ID); + BigDecimal joinAvgValue = getGridJoinIssueAvgValue(formDTO, gridId); SampleValue contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), joinAvgValue); value.getIndexValueVOs().add(contactMassesAblityValue); } @@ -428,7 +453,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { resultMapList.add(resultMap); } // 保存中间表 - saveGridCorreLationDangJian(formDTO, resultMapList,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),NumConstant.ZERO_STR); + saveGridCorreLationResult(formDTO, resultMapList, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), NumConstant.ZERO_STR); } @@ -452,9 +477,13 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { logger.info(String.format("共%s条数据,分%s次计算", total, totalPage)); //每一组指标的最大值,key:code_MIN/MAX Map minAndMaxMap = queryServiceAblityGridMinAndMax(formDTO.getCustomerId(), formDTO.getMonthId()); + if (CollectionUtils.isEmpty(minAndMaxMap)) { + logger.error("calculateGridFuWu queryServiceAblityGridMinAndMax customerId:{} monthId:{} have not any fact record", formDTO.getCustomerId(),formDTO.getMonthId()); + return; + } //指标集合 - Map> indexMap = getGridCorrelationIndexInputVO(formDTO, indexList, minAndMaxMap); - List> resultMapList=new ArrayList<>(); + Map> indexMap = buildGridCorrelationIndexInputVO(formDTO, indexList, minAndMaxMap); + List> resultMapList = new ArrayList<>(); //分页查询采集记录 for (int pageNo = 1; pageNo <= totalPage; pageNo++) { int pageIndex = (pageNo - NumConstant.ONE) * IndexCalConstant.PAGE_SIZE; @@ -475,8 +504,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //构造样本值对象 SampleValue currentGridIndexValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), new BigDecimal(sampleValueStr)); value.getIndexValueVOs().add(currentGridIndexValue); - }else{ - logger.error("index_code:"+key+" not find field_name"); + } else { + logger.error("index_code:" + key + " not find field_name"); } }); }); @@ -484,7 +513,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { resultMapList.add(resultMap); } // 保存中间表 - saveGridCorreLationDangJian(formDTO, resultMapList,IndexCodeEnum.FU_WU_NENG_LI.getCode(),NumConstant.ZERO_STR); + saveGridCorreLationResult(formDTO, resultMapList, IndexCodeEnum.FU_WU_NENG_LI.getCode(), NumConstant.ZERO_STR); } /** @@ -498,9 +527,13 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { private void calculateGridTotal(CalculateCommonFormDTO formDTO, List indexList, String indexCode) { //查询总记录数 List gridScoreDTOList = gridScoreDao.selectList(formDTO); + if(CollectionUtils.isEmpty(gridScoreDTOList)){ + logger.error("calculateGridTotal gridScoreDao.selectList return empty,customerId:{},monthId:{}", formDTO.getCustomerId(), formDTO.getMonthId()); + throw new RenException("客户一级指标分值记录不存在"); + } Map indexMap = indexList.stream().collect(Collectors.toMap(IndexGroupDetailEntity::getIndexCode, Function.identity())); List gridScoreEntityList = new ArrayList<>(); - for(GridScoreDTO gridScoreDTO:gridScoreDTOList){ + for (GridScoreDTO gridScoreDTO : gridScoreDTOList) { GridScoreEntity gridScoreEntity = new GridScoreEntity(); gridScoreEntity.setCustomerId(gridScoreDTO.getCustomerId()); gridScoreEntity.setGridId(gridScoreDTO.getGridId()); @@ -512,12 +545,12 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { gridScoreEntity.setYearId(gridScoreDTO.getYearId()); gridScoreEntity.setMonthId(gridScoreDTO.getMonthId()); gridScoreEntity.setScore(BigDecimal.ZERO); - if(!CollectionUtils.isEmpty(gridScoreDTO.getDetailList())&&gridScoreDTO.getDetailList().size()!=3){ - logger.error("customerId:"+gridScoreDTO.getCustomerId()+";gridId:"+gridScoreDTO.getGridId()+";monthId:"+gridScoreDTO.getMonthId()+"能力值缺失,无法计算总值"); + if (!CollectionUtils.isEmpty(gridScoreDTO.getDetailList()) && gridScoreDTO.getDetailList().size() != 3) { + logger.error("customerId:" + gridScoreDTO.getCustomerId() + ";gridId:" + gridScoreDTO.getGridId() + ";monthId:" + gridScoreDTO.getMonthId() + "能力值缺失,无法计算总值"); continue; } - for(GridScoreDetailDTO gridScoreDetailDTO:gridScoreDTO.getDetailList()){ - BigDecimal indexScore=gridScoreDetailDTO.getScore().multiply(indexMap.get(gridScoreDetailDTO.getIndexCode()).getWeight()); + for (GridScoreDetailDTO gridScoreDetailDTO : gridScoreDTO.getDetailList()) { + BigDecimal indexScore = gridScoreDetailDTO.getScore().multiply(indexMap.get(gridScoreDetailDTO.getIndexCode()).getWeight()); gridScoreEntity.setScore(gridScoreEntity.getScore().add(indexScore)); } gridScoreEntityList.add(gridScoreEntity); @@ -529,12 +562,13 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { } public static void main(String[] args) { - BigDecimal totalScore=BigDecimal.ZERO; - for(int i=1;i<5;i++){ - totalScore=totalScore.add(new BigDecimal("1.00")); + BigDecimal totalScore = BigDecimal.ZERO; + for (int i = 1; i < 5; i++) { + totalScore = totalScore.add(new BigDecimal("1.00")); } System.out.println(totalScore); } + /** * @param customerId * @return com.epmet.dto.indexcal.CustomerGridInfoDTO From 1f62005bcb953122426798719abbec0f3b3b3a1b Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 1 Sep 2020 10:21:34 +0800 Subject: [PATCH 118/226] =?UTF-8?q?=E5=88=86=E5=80=BC=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=EF=BC=8C=E5=8E=BB=E6=8E=89=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E6=9E=84=E9=80=A0=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/support/normalizing/batch/IndexInputVO.java | 6 ------ 1 file changed, 6 deletions(-) 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 abf62aef2b..c67b1c494d 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 @@ -34,10 +34,4 @@ public class IndexInputVO { private BigDecimal weight; private ScoreCalculator scoreCalculator; - - public IndexInputVO(List> indexValueVOs, BigDecimal weight, ScoreCalculator scoreCalculator) { - this.indexValueVOs = indexValueVOs; - this.weight = weight; - this.scoreCalculator = scoreCalculator; - } } From 10fa49c2b23c86fdc80f5d2afdd4743fb3ca861e Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 1 Sep 2020 10:27:37 +0800 Subject: [PATCH 119/226] =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/IndexCalConstant.java | 14 + .../FactIndexCommunityGovrnFiveScoreDTO.java | 109 ----- .../FactIndexCommunityPartyFiveScoreDTO.java | 110 ------ .../screen/FactIndexCommunityScoreDTO.java | 55 ++- ...FactIndexCommunityServiceFiveScoreDTO.java | 107 ----- .../CommunityActivityCountResultDTO.java | 59 +++ ...CommunityPublishArticleCountResultDTO.java | 5 + .../result/MaxAndMinBigDecimalResultDTO.java | 21 + .../result/SubGridGovernAvgResultDTO.java | 46 +++ .../result/SubGridPartyAvgResultDTO.java | 5 + .../result/SubGridServiceAvgResultDTO.java | 51 +++ .../com/epmet/controller/DemoController.java | 20 +- .../FactIndexGovrnAblityOrgMonthlyDao.java | 3 +- .../FactIndexServiceAblityOrgMonthlyDao.java | 11 + .../FactIndexCommunityGovrnFiveScoreDao.java | 33 -- .../FactIndexCommunityPartyFiveScoreDao.java | 45 --- .../screen/FactIndexCommunityScoreDao.java | 35 +- ...FactIndexCommunityServiceFiveScoreDao.java | 33 -- .../dao/screen/FactIndexGridScoreDao.java | 20 + ...=> FactIndexCommunityFiveScoreEntity.java} | 4 +- ...actIndexCommunityGovrnFiveScoreEntity.java | 77 ---- .../screen/FactIndexCommunityScoreEntity.java | 34 +- ...tIndexCommunityServiceFiveScoreEntity.java | 77 ---- .../IndexCalculateCommunityService.java | 23 +- .../IndexCalculateCommunityServiceImpl.java | 373 +++++++++++++++--- .../FactIndexGovrnAblityOrgMonthlyDao.xml | 24 +- .../FactIndexPartyAblityOrgMonthlyDao.xml | 3 +- .../FactIndexServiceAblityOrgMonthlyDao.xml | 19 + .../FactIndexCommunityGovrnFiveScoreDao.xml | 6 - .../FactIndexCommunityPartyFiveScoreDao.xml | 27 -- .../screen/FactIndexCommunityScoreDao.xml | 56 +++ .../FactIndexCommunityServiceFiveScoreDao.xml | 6 - .../mapper/screen/FactIndexGridScoreDao.xml | 44 ++- 33 files changed, 819 insertions(+), 736 deletions(-) delete mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityGovrnFiveScoreDTO.java delete mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityPartyFiveScoreDTO.java delete mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityServiceFiveScoreDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityActivityCountResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinBigDecimalResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridGovernAvgResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridServiceAvgResultDTO.java delete mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityGovrnFiveScoreDao.java delete mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityPartyFiveScoreDao.java delete mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityServiceFiveScoreDao.java rename epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/{FactIndexCommunityPartyFiveScoreEntity.java => FactIndexCommunityFiveScoreEntity.java} (92%) delete mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityGovrnFiveScoreEntity.java delete mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityServiceFiveScoreEntity.java delete mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityGovrnFiveScoreDao.xml delete mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityPartyFiveScoreDao.xml delete mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityServiceFiveScoreDao.xml diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java index 13b27760a5..12b5c2a136 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java @@ -20,4 +20,18 @@ public interface IndexCalConstant { String USER_ID="USER_ID"; String YEAR_ID = "YEAR_ID"; + + String COMMUNITY_GOVERN = "zhilinengli"; + + String COMMUNITY_PARTY = "dangjiannengli"; + + String COMMUNITY_SERVICE = "fuwunengli"; + + String COMMUNITY_SERVICE_AVG = "shequxiajisywgfwnldfpjz"; + + String COMMUNITY_GOVERN_AVG = "shequxiashusywgzlnlhzpyz"; + + String COMMUNITY_PARTY_AVG = "xiazhusuoyouwgddjnlpjz"; + + String COMMUNITY_RELATE = "shequxiangguan"; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityGovrnFiveScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityGovrnFiveScoreDTO.java deleted file mode 100644 index 5f2fbf85b7..0000000000 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityGovrnFiveScoreDTO.java +++ /dev/null @@ -1,109 +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.dto.screen; - -import java.io.Serializable; -import java.math.BigDecimal; - -import lombok.Data; - -/** - * 社区相关-治理能力【五级权重】分数表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-08-27 - */ -@Data -public class FactIndexCommunityGovrnFiveScoreDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * - */ - private String id; - - /** - * 机关iD - */ - private String agencyId; - - /** - * 月份ID - */ - private String monthId; - - /** - * 指标ID - */ - private String indexId; - - /** - * 总指数分值 - */ - private BigDecimal totalScore; - - /** - * 党建能力分值 - */ - private BigDecimal partyAbilityScore; - - /** - * 治理能力分值 - */ - private BigDecimal govrnAbilityScore; - - /** - * 服务能力分值 - */ - private BigDecimal serviceAbilityScore; - - /** - * 删除状态,0正常,1删除 - */ - private Integer delFlag; - - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 更新人 - */ - private String updatedBy ; - - public FactIndexCommunityGovrnFiveScoreDTO() { - this.agencyId = ""; - this.monthId = ""; - this.indexId = ""; - this.totalScore = new BigDecimal(0); - this.partyAbilityScore = new BigDecimal(0); - this.govrnAbilityScore = new BigDecimal(0); - this.serviceAbilityScore = new BigDecimal(0); - this.delFlag = 0; - this.revision = 0; - this.createdBy = "APP_USER"; - this.updatedBy = "APP_USER"; - } -} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityPartyFiveScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityPartyFiveScoreDTO.java deleted file mode 100644 index 79024c60ca..0000000000 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityPartyFiveScoreDTO.java +++ /dev/null @@ -1,110 +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.dto.screen; - -import java.io.Serializable; -import java.math.BigDecimal; - -import lombok.Data; - -/** - * 社区相关-党建能力【五级权重】分数表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-08-27 - */ -@Data -public class FactIndexCommunityPartyFiveScoreDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * id - */ - private String id; - - /** - * 机关ID - */ - private String agencyId; - - /** - * 月度ID - */ - private String monthId; - - /** - * 指标ID - */ - private String indexId; - - /** - * 总指数分值 - */ - private BigDecimal totalScore; - - /** - * 党建能力分值 - */ - private BigDecimal partyAbilityScore; - - /** - * 治理能力分值 - */ - private BigDecimal govrnAbilityScore; - - /** - * 服务能力分值 - */ - private BigDecimal serviceAbilityScore; - - /** - * 删除状态,0正常,1删除 - */ - private Integer delFlag; - - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 更新人 - */ - private String updatedBy; - - public FactIndexCommunityPartyFiveScoreDTO() { - this.agencyId = ""; - this.monthId = ""; - this.indexId = ""; - this.totalScore = new BigDecimal(0); - this.partyAbilityScore = new BigDecimal(0); - this.govrnAbilityScore = new BigDecimal(0); - this.serviceAbilityScore = new BigDecimal(0); - this.delFlag = 0; - this.revision = 0; - this.createdBy = "APP_USER"; - this.updatedBy = "APP_USER"; - } - -} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java index 805e28ef7f..8ad2ec6658 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java @@ -27,7 +27,7 @@ import java.math.BigDecimal; * 社区相关分数表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-08-27 + * @since v1.0.0 2020-08-31 */ @Data public class FactIndexCommunityScoreDTO implements Serializable { @@ -35,49 +35,59 @@ public class FactIndexCommunityScoreDTO implements Serializable { private static final long serialVersionUID = 1L; /** - * + * ID 主键 */ private String id; /** - * 机关ID + * 客户Id + */ + private String customerId; + + /** + * 组织id */ private String agencyId; /** - * 月份ID + * 社区上一级组织id */ - private String monthId; + private String parentAgencyId; + + /** + * 年度ID: yyyy + */ + private String yearId; /** - * 季度ID + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 */ private String quarterId; /** - * 年度ID + * 月维度Id: yyyyMM */ - private String yearId; + private String monthId; /** - * 指标ID + * 1:总分;0不是;默认0 */ - private String indexId; + private String isTotal; /** - * 分数 + * 分值 */ private BigDecimal score; /** - * 党建能力:party,治理能力:govrn,服务能力:service + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;社区相关:shequxiangguan */ - private String type; + private String indexCode; /** - * 删除状态,0正常,1删除 + * 删除状态 */ - private Integer delFlag; + private Integer delFlag; /** * 乐观锁 @@ -104,4 +114,19 @@ public class FactIndexCommunityScoreDTO implements Serializable { */ private Date updatedTime; + public FactIndexCommunityScoreDTO() { + this.customerId = ""; + this.agencyId = ""; + this.parentAgencyId = ""; + this.yearId = ""; + this.quarterId = ""; + this.monthId = ""; + this.isTotal = "0"; + this.score = new BigDecimal(0); + this.indexCode = ""; + this.delFlag = 0; + this.revision = 0; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityServiceFiveScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityServiceFiveScoreDTO.java deleted file mode 100644 index 1eb6386bcc..0000000000 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityServiceFiveScoreDTO.java +++ /dev/null @@ -1,107 +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.dto.screen; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - -import java.math.BigDecimal; - -/** - * 社区相关-服务能力【五级权重】分数表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-08-27 - */ -@Data -public class FactIndexCommunityServiceFiveScoreDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * - */ - private String id; - - /** - * 机关ID - */ - private String agencyId; - - /** - * 月度ID - */ - private String monthId; - - /** - * 指标ID - */ - private String indexId; - - /** - * 总指数分值 - */ - private BigDecimal totalScore; - - /** - * 党建能力分值 - */ - private BigDecimal partyAbilityScore; - - /** - * 治理能力分值 - */ - private BigDecimal govrnAbilityScore; - - /** - * 服务能力分值 - */ - private BigDecimal serviceAbilityScore; - - /** - * 删除状态,0正常,1删除 - */ - private Integer delFlag; - - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 创建时间 - */ - private Date createdTime; - - /** - * 更新人 - */ - private String updatedBy; - - /** - * 更新时间 - */ - private Date updatedTime; - -} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityActivityCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityActivityCountResultDTO.java new file mode 100644 index 0000000000..ec3b17f615 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityActivityCountResultDTO.java @@ -0,0 +1,59 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/31 2:12 下午 + */ +@Data +public class CommunityActivityCountResultDTO implements Serializable { + + private static final long serialVersionUID = -6623426101220283941L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 发文数 + */ + public Integer activityCount; + + public CommunityActivityCountResultDTO() { + this.agencyId = ""; + this.parentId = ""; + this.monthId = ""; + this.quarterId = ""; + this.yearId = ""; + this.activityCount = 0; + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityPublishArticleCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityPublishArticleCountResultDTO.java index fe50bbf597..cf29133001 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityPublishArticleCountResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityPublishArticleCountResultDTO.java @@ -13,6 +13,11 @@ public class CommunityPublishArticleCountResultDTO implements Serializable { private static final long serialVersionUID = -8260746179353253237L; + /** + * 客户ID + */ + private String customerId; + /** * 机关ID */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinBigDecimalResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinBigDecimalResultDTO.java new file mode 100644 index 0000000000..aa9f471405 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinBigDecimalResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/8/30 8:11 下午 + */ +@Data +public class MaxAndMinBigDecimalResultDTO implements Serializable { + + private static final long serialVersionUID = 76227645470470839L; + + private BigDecimal min; + + private BigDecimal max; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridGovernAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridGovernAvgResultDTO.java new file mode 100644 index 0000000000..64f3cc7319 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridGovernAvgResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/8/31 9:11 上午 + */ +@Data +public class SubGridGovernAvgResultDTO implements Serializable { + + private static final long serialVersionUID = -1354963771895272899L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 分数 + */ + private BigDecimal score; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridPartyAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridPartyAvgResultDTO.java index 38263c4dc1..48b4501606 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridPartyAvgResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridPartyAvgResultDTO.java @@ -19,6 +19,11 @@ public class SubGridPartyAvgResultDTO implements Serializable { */ private String agencyId; + /** + * 客户ID + */ + private String customerId; + /** * 上级组织ID */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridServiceAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridServiceAvgResultDTO.java new file mode 100644 index 0000000000..ba6329aef1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridServiceAvgResultDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/8/31 1:53 下午 + */ +@Data +public class SubGridServiceAvgResultDTO implements Serializable { + + private static final long serialVersionUID = -405197363477213644L; + + /** + * + */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 分数 + */ + private BigDecimal score; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 5f18b920f9..2b88f53f42 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -120,7 +120,25 @@ public class DemoController { @PostMapping("zxc") public Result getZxc(){ // indexCalculateCommunityService.communityPublishArticleCountCalculate("b09527201c4409e19d1dbc5e3c3429a1","202008"); - indexCalculateCommunityService.communityPublishArticleCountCalculate("","202008"); + indexCalculateCommunityService.communityGovernAbilityCalculate("b09527201c4409e19d1dbc5e3c3429a1","202008"); + return new Result(); + } + + @PostMapping("zxc1") + public Result getZxc1(){ + indexCalculateCommunityService.communityPartyCalculate("b09527201c4409e19d1dbc5e3c3429a1","202008"); + return new Result(); + } + + @PostMapping("zxc2") + public Result getZxc2(){ + indexCalculateCommunityService.communityServiceAbilityCalculate("b09527201c4409e19d1dbc5e3c3429a1","202008"); + return new Result(); + } + + @PostMapping("zxcAll") + public Result getZxcAll(){ + indexCalculateCommunityService.communityRelate("b09527201c4409e19d1dbc5e3c3429a1","202008"); return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java index fa9b8569b9..f28e6a2fd3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java @@ -25,6 +25,7 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 治理能力-街道及社区相关数据 @@ -70,5 +71,5 @@ public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao selectCommunityGovernAbility(@Param("customerId")String customerId, @Param("monthId")String monthId); + List> selectCommunityGovernAbility(@Param("customerId")String customerId, @Param("monthId")String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java index 31c268cd75..261fb8b945 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java @@ -19,6 +19,8 @@ package com.epmet.dao.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcollect.form.OrgServiceAbilityFormDTO; +import com.epmet.dto.screen.result.CommunityActivityCountResultDTO; +import com.epmet.dto.screen.result.CommunityPublishArticleCountResultDTO; import com.epmet.entity.indexcoll.FactIndexServiceAblityOrgMonthlyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -62,4 +64,13 @@ public interface FactIndexServiceAblityOrgMonthlyDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * @Description 社区活动组织次数 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/31 2:15 下午 + */ + List selectActivityCount(@Param("customerId")String customerId, @Param("monthId")String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityGovrnFiveScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityGovrnFiveScoreDao.java deleted file mode 100644 index 52cd149927..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityGovrnFiveScoreDao.java +++ /dev/null @@ -1,33 +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.screen; - -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.screen.FactIndexCommunityGovrnFiveScoreEntity; -import org.apache.ibatis.annotations.Mapper; - -/** - * 社区相关-治理能力【五级权重】分数表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-08-27 - */ -@Mapper -public interface FactIndexCommunityGovrnFiveScoreDao extends BaseDao { - -} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityPartyFiveScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityPartyFiveScoreDao.java deleted file mode 100644 index 4c628a1ec0..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityPartyFiveScoreDao.java +++ /dev/null @@ -1,45 +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.screen; - -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.screen.FactIndexCommunityPartyFiveScoreDTO; -import com.epmet.entity.screen.FactIndexCommunityPartyFiveScoreEntity; -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-27 - */ -@Mapper -public interface FactIndexCommunityPartyFiveScoreDao extends BaseDao { - - /** - * @Description 党建能力【社区】中间表插入 - * @param lists - * @author zxc - * @date 2020/8/27 5:05 下午 - */ - void insertCommunityPartyRecord(@Param("lists")List lists); - -} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityScoreDao.java index 9ea796d24a..607132ea18 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityScoreDao.java @@ -18,16 +18,47 @@ package com.epmet.dao.screen; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screen.FactIndexCommunityScoreDTO; import com.epmet.entity.screen.FactIndexCommunityScoreEntity; 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-27 + * @since v1.0.0 2020-08-31 */ @Mapper public interface FactIndexCommunityScoreDao extends BaseDao { - + + /** + * @Description 党建能力【社区】中间表插入 + * @param lists + * @author zxc + * @date 2020/8/27 5:05 下午 + */ + void insertCommunityPartyRecord(@Param("lists") List lists); + + /** + * @Description 删除旧记录 + * @param customerId + * @param monthId + * @param indexCode + * @author zxc + * @date 2020/9/1 9:03 上午 + */ + void deleteOldRecord(@Param("customerId") String customerId,@Param("monthId")String monthId,@Param("indexCode")String indexCode); + + /** + * @Description 查询社区相关信息 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/1 9:41 上午 + */ + List selectCommunityInfo(@Param("customerId") String customerId,@Param("monthId")String monthId); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityServiceFiveScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityServiceFiveScoreDao.java deleted file mode 100644 index 97a03ad2c9..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityServiceFiveScoreDao.java +++ /dev/null @@ -1,33 +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.screen; - -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.screen.FactIndexCommunityServiceFiveScoreEntity; -import org.apache.ibatis.annotations.Mapper; - -/** - * 社区相关-服务能力【五级权重】分数表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-08-27 - */ -@Mapper -public interface FactIndexCommunityServiceFiveScoreDao extends BaseDao { - -} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexGridScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexGridScoreDao.java index b95b41ff55..223a297db4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexGridScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexGridScoreDao.java @@ -18,7 +18,9 @@ package com.epmet.dao.screen; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screen.result.SubGridGovernAvgResultDTO; import com.epmet.dto.screen.result.SubGridPartyAvgResultDTO; +import com.epmet.dto.screen.result.SubGridServiceAvgResultDTO; import com.epmet.entity.screen.FactIndexGridScoreEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -43,4 +45,22 @@ public interface FactIndexGridScoreDao extends BaseDao */ List selectSubGridPartyAvgScore(@Param("customerId")String customerId,@Param("monthId")String monthId); + /** + * @Description 社区下属所有网格治理能力汇总平均值 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/31 9:19 上午 + */ + List selectSubGridGovernAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * @Description 社区下级所有网格服务能力得分平均值 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/31 1:51 下午 + */ + List selectSubGridServiceAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityPartyFiveScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityFiveScoreEntity.java similarity index 92% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityPartyFiveScoreEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityFiveScoreEntity.java index c42849dd0b..b43e51ad7c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityPartyFiveScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityFiveScoreEntity.java @@ -34,8 +34,8 @@ import java.util.Date; */ @Data @EqualsAndHashCode(callSuper=false) -@TableName("fact_index_community_party_five_score") -public class FactIndexCommunityPartyFiveScoreEntity extends BaseEpmetEntity { +@TableName("fact_index_community_five_score") +public class FactIndexCommunityFiveScoreEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityGovrnFiveScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityGovrnFiveScoreEntity.java deleted file mode 100644 index bf0bcbeac0..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityGovrnFiveScoreEntity.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.entity.screen; - -import com.baomidou.mybatisplus.annotation.TableName; - -import com.epmet.commons.mybatis.entity.BaseEpmetEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; -import java.util.Date; - -/** - * 社区相关-治理能力【五级权重】分数表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-08-27 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("fact_index_community_govrn_five_score") -public class FactIndexCommunityGovrnFiveScoreEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 机关iD - */ - private String agencyId; - - /** - * 月份ID - */ - private String monthId; - - /** - * 季度ID - */ - private String quarterId; - - /** - * 年度ID - */ - private String yearId; - - /** - * 指标ID - */ - private String indexId; - - /** - * 分数 - */ - private BigDecimal score; - - /** - * 社区被吹哨次数:transfered,社区办结项目数:closed_project,社区项目响应度:resp_project_ratio,社区超期项目率:overdue_project_ratio,社区办结项目率:closed_project_ratio,社区办结项目满意度:satisfaction_ratio - */ - private String type; - -} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityScoreEntity.java index 1c3899ef2d..01b0ff363f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityScoreEntity.java @@ -30,7 +30,7 @@ import java.util.Date; * 社区相关分数表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-08-27 + * @since v1.0.0 2020-08-31 */ @Data @EqualsAndHashCode(callSuper=false) @@ -40,38 +40,48 @@ public class FactIndexCommunityScoreEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; /** - * 机关ID + * 客户Id + */ + private String customerId; + + /** + * 组织id */ private String agencyId; /** - * 月份ID + * 社区上一级组织id */ - private String monthId; + private String parentAgencyId; + + /** + * 年度ID: yyyy + */ + private String yearId; /** - * 季度ID + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 */ private String quarterId; /** - * 年度ID + * 月维度Id: yyyyMM */ - private String yearId; + private String monthId; /** - * 指标ID + * 1:总分;0不是;默认0 */ - private String indexId; + private String isTotal; /** - * 分数 + * 分值 */ private BigDecimal score; /** - * 党建能力:party,治理能力:govrn,服务能力:service + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;社区相关:shequxiangguan */ - private String type; + private String indexCode; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityServiceFiveScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityServiceFiveScoreEntity.java deleted file mode 100644 index 8d0fb8857f..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/FactIndexCommunityServiceFiveScoreEntity.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.entity.screen; - -import com.baomidou.mybatisplus.annotation.TableName; - -import com.epmet.commons.mybatis.entity.BaseEpmetEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; -import java.util.Date; - -/** - * 社区相关-服务能力【五级权重】分数表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-08-27 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("fact_index_community_service_five_score") -public class FactIndexCommunityServiceFiveScoreEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 机关ID - */ - private String agencyId; - - /** - * 月度ID - */ - private String monthId; - - /** - * 季度ID - */ - private String quarterId; - - /** - * 年度ID - */ - private String yearId; - - /** - * 指标ID - */ - private String indexId; - - /** - * 分数 - */ - private BigDecimal score; - - /** - * 社区活动组织次数:activity - */ - private String type; - -} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateCommunityService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateCommunityService.java index daf11c1519..f597e3748f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateCommunityService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateCommunityService.java @@ -12,13 +12,13 @@ import java.util.List; public interface IndexCalculateCommunityService { /** - * @Description 社区名义发文数量计算 + * @Description 社区党建能力 * @param customerId * @param monthId * @author zxc * @date 2020/8/26 10:46 上午 */ - void communityPublishArticleCountCalculate(String customerId, String monthId); + void communityPartyCalculate(String customerId, String monthId); /** * @Description 社区治理能力 @@ -27,6 +27,23 @@ public interface IndexCalculateCommunityService { * @author zxc * @date 2020/8/26 1:40 下午 */ - void CommunityGovernAbilityCalculate(String customerId, String monthId); + void communityGovernAbilityCalculate(String customerId, String monthId); + /** + * @Description 社区服务能力 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/31 1:38 下午 + */ + void communityServiceAbilityCalculate(String customerId, String monthId); + + /** + * @Description 社区相关计算 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/1 9:21 上午 + */ + void communityRelate(String customerId, String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java index 15e0b36ff7..89554a0cf2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java @@ -1,30 +1,25 @@ package com.epmet.service.screen.impl; +import com.alibaba.druid.util.StringUtils; import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.IndexCalConstant; import com.epmet.dao.indexcoll.FactIndexGovrnAblityOrgMonthlyDao; -import com.epmet.dao.indexcoll.FactIndexPartyAblityCpcMonthlyDao; import com.epmet.dao.indexcoll.FactIndexPartyAblityOrgMonthlyDao; +import com.epmet.dao.indexcoll.FactIndexServiceAblityOrgMonthlyDao; import com.epmet.dao.screen.*; -import com.epmet.dto.indexcal.ExtremeValueCommonDTO; -import com.epmet.dto.screen.FactIndexCommunityPartyFiveScoreDTO; +import com.epmet.dto.screen.FactIndexCommunityScoreDTO; import com.epmet.dto.screen.result.*; import com.epmet.entity.screen.IndexGroupDetailEntity; import com.epmet.eum.IndexCodeEnum; import com.epmet.service.indexcal.IndexCodeFieldReService; import com.epmet.service.screen.IndexCalculateCommunityService; import com.epmet.service.screen.IndexGroupDetailService; -import com.epmet.support.normalizing.Correlation; -import com.epmet.support.normalizing.IntegerScoreCalculator; -import com.epmet.support.normalizing.ScoreCalculator; -import com.epmet.support.normalizing.ScoreConstants; +import com.epmet.support.normalizing.*; import com.epmet.support.normalizing.batch.BatchScoreCalculator; import com.epmet.support.normalizing.batch.IndexInputVO; import com.epmet.support.normalizing.batch.IndexOutputVO; import com.epmet.support.normalizing.batch.SampleValue; -import com.github.pagehelper.Page; -import com.github.pagehelper.PageHelper; -import io.swagger.models.auth.In; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -48,19 +43,15 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni @Autowired private FactIndexGovrnAblityOrgMonthlyDao factIndexGovrnAblityOrgMonthlyDao; @Autowired + private FactIndexServiceAblityOrgMonthlyDao factIndexServiceAblityOrgMonthlyDao; + @Autowired private IndexGroupDetailService indexGroupDetailService; @Autowired private IndexCodeFieldReService indexCodeFieldReService; @Autowired - private FactIndexCommunityPartyFiveScoreDao factIndexCommunityPartyFiveScoreDao; + private FactIndexCommunityScoreDao factIndexCommunityScoreDao; @Autowired private FactIndexGridScoreDao factIndexGridScoreDao; - @Autowired - private FactIndexCommunityServiceFiveScoreDao factIndexCommunityServiceFiveScoreDao; - @Autowired - private FactIndexCommunityGovrnFiveScoreDao factIndexCommunityGovrnFiveScoreDao; - @Autowired - private FactIndexCommunityScoreDao factIndexCommunityScoreDao; /** * @Description 社区名义发文数量计算【党建能力】 @@ -70,32 +61,48 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni */ @Transactional(rollbackFor = Exception.class) @Override - public void communityPublishArticleCountCalculate(String customerId, String monthId) { + public void communityPartyCalculate(String customerId, String monthId) { customerId = "b09527201c4409e19d1dbc5e3c3429a1"; // 党建能力 // 根据all_parent_index_code 获取指标明细 List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(),IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); - - List subAllGridList = new ArrayList<>(); - List communityPublishArticle = new ArrayList<>(); - + List subAllGridList = new ArrayList<>(); + List communityPublishArticle = new ArrayList<>(); //下属所有网格的党建能力平均值 String finalCustomerId = customerId; detailListByParentCode.forEach(indexGroup -> { - if (indexGroup.getIndexCode().equals("xiazhusuoyouwgddjnlpjz")){ + if (indexGroup.getIndexCode().equals(IndexCalConstant.COMMUNITY_PARTY_AVG)){ List subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridPartyAvgScore(finalCustomerId, monthId); if (subGridPartyAvgScore.size() != NumConstant.ZERO){ - subGridPartyAvgScore.forEach(subGridParty -> { - BigDecimal multiply = subGridParty.getScore().multiply(indexGroup.getWeight()); - subGridParty.setScore(multiply); - FactIndexCommunityPartyFiveScoreDTO dto = new FactIndexCommunityPartyFiveScoreDTO(); - BeanUtils.copyProperties(subGridParty,dto); - dto.setIndexId(indexGroup.getIndexId()); - dto.setTotalScore(dto.getPartyAbilityScore()); - subAllGridList.add(dto); - }); - factIndexCommunityPartyFiveScoreDao.insertCommunityPartyRecord(subAllGridList); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); + Integer indexStart = NumConstant.ZERO; + Integer indexEnd = NumConstant.TEN; + List collect; + do { + collect = subGridPartyAvgScore.stream().skip(indexEnd * indexStart).limit(indexEnd).collect(Collectors.toList()); + BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + List index1SampleValues = new ArrayList<>(); + collect.forEach(c -> { + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + FactIndexCommunityScoreDTO dto = new FactIndexCommunityScoreDTO(); + BeanUtils.copyProperties(c,dto); + subAllGridList.add(dto); + }); + IndexInputVO index1VO = new IndexInputVO(indexGroup.getIndexId(), index1SampleValues,indexGroup.getThreshold(), indexGroup.getWeight(), sc1); + List indexInputVOS = Arrays.asList(index1VO); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + List result = batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); + result.get(NumConstant.ZERO).getIndexScoreVOs().forEach(agency -> { + subAllGridList.forEach(grid -> { + if (grid.getAgencyId().equals(agency.getSampleId())){ + grid.setScore(agency.getSampleScore()); + } + }); + }); + indexStart++; + }while (collect.size() == NumConstant.TEN); } } }); @@ -105,13 +112,13 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni if (indexGroup.getIndexCode().equals("shequmingyifwsl")) { if (publishArticleCounts.size() == NumConstant.ONE) { //TODO 计算之后的分数 - FactIndexCommunityPartyFiveScoreDTO dto = new FactIndexCommunityPartyFiveScoreDTO(); + FactIndexCommunityScoreDTO dto = new FactIndexCommunityScoreDTO(); BeanUtils.copyProperties(detailListByParentCode.get(NumConstant.ZERO), dto); - dto.setPartyAbilityScore(BigDecimal.valueOf(50.00)); - dto.setIndexId(detailListByParentCode.get(NumConstant.ZERO).getIndexId()); + dto.setScore(BigDecimal.valueOf(50.00)); + dto.setIndexCode(detailListByParentCode.get(NumConstant.ZERO).getIndexCode()); communityPublishArticle.add(dto); - factIndexCommunityPartyFiveScoreDao.insertCommunityPartyRecord(communityPublishArticle); - } else if (publishArticleCounts.size() != NumConstant.ZERO) { + factIndexCommunityScoreDao.insertCommunityPartyRecord(communityPublishArticle); + } else if (publishArticleCounts.size() > NumConstant.ONE) { Integer indexStart = NumConstant.ZERO; Integer indexEnd = NumConstant.TEN; List collect; @@ -123,32 +130,37 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni collect.forEach(c -> { SampleValue s = new SampleValue(c.getAgencyId(), c.getPublishArticleCount()); ll.add(s); - FactIndexCommunityPartyFiveScoreDTO publishArticle = new FactIndexCommunityPartyFiveScoreDTO(); + FactIndexCommunityScoreDTO publishArticle = new FactIndexCommunityScoreDTO(); BeanUtils.copyProperties(c,publishArticle); communityPublishArticle.add(publishArticle); }); - IndexInputVO index1VO = new IndexInputVO<>(indexGroup.getIndexId(), ll, indexGroup.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO<>(indexGroup.getIndexId(), ll,indexGroup.getThreshold(), indexGroup.getWeight(), sc1); List indexInputVOS = Arrays.asList(index1VO); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); List result = batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); result.get(NumConstant.ZERO).getIndexScoreVOs().forEach(agency -> { communityPublishArticle.forEach(publish -> { if (publish.getAgencyId().equals(agency.getSampleId())){ - publish.setIndexId(indexGroup.getIndexId()); - publish.setPartyAbilityScore(agency.getSampleScore()); - publish.setTotalScore(agency.getSampleScore()); + publish.setIndexCode(indexGroup.getIndexCode()); + publish.setScore(agency.getSampleScore()); } }); }); indexStart++; - } while (collect.size() == 10); - factIndexCommunityPartyFiveScoreDao.insertCommunityPartyRecord(communityPublishArticle); + } while (collect.size() == NumConstant.TEN); } } }); - - - + subAllGridList.forEach(grid -> { + communityPublishArticle.forEach(publish -> { + if (grid.getAgencyId().equals(publish.getAgencyId())){ + grid.setScore(grid.getScore().add(publish.getScore())); + grid.setIndexCode(IndexCalConstant.COMMUNITY_PARTY); + } + }); + }); + factIndexCommunityScoreDao.deleteOldRecord(customerId,monthId,IndexCalConstant.COMMUNITY_PARTY); + factIndexCommunityScoreDao.insertCommunityPartyRecord(subAllGridList); } /** @@ -160,21 +172,260 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni */ @Transactional(rollbackFor = Exception.class) @Override - public void CommunityGovernAbilityCalculate(String customerId, String monthId) { - List communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(customerId, monthId); + public void communityGovernAbilityCalculate(String customerId, String monthId) { + customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + + List subAllGridList = new ArrayList<>(); + + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + + String finalCustomerId = customerId; + detailListByParentCode.forEach(detail -> { + if (detail.getIndexCode().equals(IndexCalConstant.COMMUNITY_GOVERN_AVG)){ + List subGridGovernAvg = factIndexGridScoreDao.selectSubGridGovernAvgScore(finalCustomerId, monthId); + if (subGridGovernAvg.size() == NumConstant.ONE){ + + // TODO + + }else if (subGridGovernAvg.size() > NumConstant.ONE){ + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); + Integer indexStart = NumConstant.ZERO; + Integer indexEnd = NumConstant.TEN; + List collect; + do { + collect = subGridGovernAvg.stream().skip(indexEnd * indexStart).limit(indexEnd).collect(Collectors.toList()); + BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + List index1SampleValues = new ArrayList<>(); + collect.forEach(c -> { + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + FactIndexCommunityScoreDTO dto = new FactIndexCommunityScoreDTO(); + BeanUtils.copyProperties(c,dto); + subAllGridList.add(dto); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold() ,detail.getWeight(), sc1); + List indexInputVOS = Arrays.asList(index1VO); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + scoreCountOfSampleId.forEach((key,value) -> { + subAllGridList.forEach(grid -> { + if (grid.getAgencyId().equals(key)){ + grid.setScore(value); + } + }); + }); + indexStart++; + }while (collect.size() == NumConstant.TEN); + } + } + else { + + } + }); + + List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(finalCustomerId, monthId); if (communityGovernAbility.size() == NumConstant.ONE){ - List result = new ArrayList<>(); - CommunityGovernAbilityCalculateResultDTO governAbility = new CommunityGovernAbilityCalculateResultDTO(); - BeanUtils.copyProperties(communityGovernAbility.get(NumConstant.ZERO),governAbility); - // TODO 计算之后的分数 + // TODO - result.add(governAbility); + }else if (communityGovernAbility.size() > NumConstant.ONE){ + List indexInputVOS = new ArrayList<>(); + detailListByParentCode.forEach(detail -> { + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (!StringUtils.isEmpty(fieldNameByIndexCode)){ + if (communityGovernAbility.get(NumConstant.ZERO).containsKey(fieldNameByIndexCode)) { + List decimalList = communityGovernAbility.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + Integer indexStart = NumConstant.ZERO; + Integer indexEnd = NumConstant.TEN; + List> collect; + do { + collect = communityGovernAbility.stream().skip(indexEnd * indexStart).limit(indexEnd).collect(Collectors.toList()); + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + List index1SampleValues = new ArrayList<>(); + collect.forEach(c -> { + 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); + indexInputVOS.add(index1VO); + } while (collect.size() == NumConstant.TEN); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + scoreCountOfSampleId.forEach((key,value) -> { + subAllGridList.forEach(grid -> { + if (key.equals(grid.getAgencyId())) { + grid.setCustomerId(finalCustomerId); + grid.setIndexCode(IndexCalConstant.COMMUNITY_GOVERN); + grid.setScore(grid.getScore().add(value)); + } + }); + }); + } + } + }); } + factIndexCommunityScoreDao.deleteOldRecord(customerId,monthId,IndexCalConstant.COMMUNITY_GOVERN); + factIndexCommunityScoreDao.insertCommunityPartyRecord(subAllGridList); } + /** + * @Description 社区服务能力 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/31 1:38 下午 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void communityServiceAbilityCalculate(String customerId, String monthId) { + + + List subAllGridList = new ArrayList<>(); + List communityPublishArticle = new ArrayList<>(); + + + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); + detailListByParentCode.forEach(detail -> { + switch (detail.getIndexCode()){ + case IndexCalConstant.COMMUNITY_SERVICE_AVG: + List subGridServiceAvg = factIndexGridScoreDao.selectSubGridServiceAvgScore(customerId, monthId); + if (subGridServiceAvg.size() == NumConstant.ONE){ + + // TODO 只有一条记录时 + + }else if (subGridServiceAvg.size() > NumConstant.ONE ){ + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); + Integer indexStart = NumConstant.ZERO; + Integer indexEnd = NumConstant.TEN; + List collect; + do { + collect = subGridServiceAvg.stream().skip(indexEnd * indexStart).limit(indexEnd).collect(Collectors.toList()); + BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + List index1SampleValues = new ArrayList<>(); + collect.forEach(c -> { + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + FactIndexCommunityScoreDTO dto = new FactIndexCommunityScoreDTO(); + BeanUtils.copyProperties(c,dto); + subAllGridList.add(dto); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues,detail.getThreshold(), detail.getWeight(), sc1); + List indexInputVOS = Arrays.asList(index1VO); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + List result = batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); + result.get(NumConstant.ZERO).getIndexScoreVOs().forEach(agency -> { + subAllGridList.forEach(grid -> { + if (grid.getAgencyId().equals(agency.getSampleId())){ + grid.setScore(agency.getSampleScore()); + } + }); + }); + indexStart++; + }while (collect.size() == NumConstant.TEN); + } + break; + case "shequhuodongzzcs": + List communityActivityCount = factIndexServiceAblityOrgMonthlyDao.selectActivityCount(customerId, monthId); + if (communityActivityCount.size() == NumConstant.ONE){ + + // TODO + + }else if (communityActivityCount.size() > NumConstant.ONE){ + Integer indexStart = NumConstant.ZERO; + Integer indexEnd = NumConstant.TEN; + List collect; + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(communityActivityCount.stream().map(o -> new BigDecimal(o.getActivityCount())).collect(Collectors.toList())); + do { + collect = communityActivityCount.stream().skip(indexEnd * indexStart).limit(indexEnd).collect(Collectors.toList()); + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + List> ll = new ArrayList<>(); + collect.forEach(c -> { + SampleValue s = new SampleValue(c.getAgencyId(), c.getActivityCount()); + ll.add(s); + FactIndexCommunityScoreDTO publishArticle = new FactIndexCommunityScoreDTO(); + BeanUtils.copyProperties(c,publishArticle); + communityPublishArticle.add(publishArticle); + }); + IndexInputVO index1VO = new IndexInputVO<>(detail.getIndexId(), ll, detail.getThreshold(),detail.getWeight(), sc1); + List indexInputVOS = Arrays.asList(index1VO); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + List result = batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); + result.get(NumConstant.ZERO).getIndexScoreVOs().forEach(agency -> { + communityPublishArticle.forEach(publish -> { + if (publish.getAgencyId().equals(agency.getSampleId())){ + publish.setScore(agency.getSampleScore()); + } + }); + }); + indexStart++; + } while (collect.size() == NumConstant.TEN); + } + break; + default: + } + }); + subAllGridList.forEach(grid -> { + grid.setIndexCode(IndexCalConstant.COMMUNITY_SERVICE); + communityPublishArticle.forEach(publish -> { + if (grid.getAgencyId().equals(publish.getAgencyId())){ + grid.setScore(grid.getScore().add(publish.getScore())); + grid.setCustomerId(customerId); + } + }); + }); + factIndexCommunityScoreDao.deleteOldRecord(customerId,monthId,IndexCalConstant.COMMUNITY_SERVICE); + factIndexCommunityScoreDao.insertCommunityPartyRecord(subAllGridList); + + } + + /** + * @Description 社区相关计算 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/1 9:21 上午 + */ + @Override + public void communityRelate(String customerId, String monthId) { + + this.communityPartyCalculate(customerId, monthId); //党建能力 + this.communityGovernAbilityCalculate(customerId, monthId); // 治理能力 + this.communityServiceAbilityCalculate(customerId, monthId); // 服务能力 + + List communityPublishArticle = new ArrayList<>(); + + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); + List factIndexCommunityScoreEntities = factIndexCommunityScoreDao.selectCommunityInfo(customerId, monthId); + detailListByParentCode.forEach(detail -> { + factIndexCommunityScoreEntities.forEach(community -> { + if (detail.getIndexCode().equals(community.getIndexCode())){ + community.setScore(community.getScore().multiply(detail.getWeight())); + } + }); + }); + + Map> collect = factIndexCommunityScoreEntities.stream().collect(Collectors.groupingBy(FactIndexCommunityScoreDTO::getAgencyId)); + List result = new ArrayList<>(); + collect.forEach((key,value) -> { + FactIndexCommunityScoreDTO score = new FactIndexCommunityScoreDTO(); + score.setIsTotal(NumConstant.ONE_STR); + score.setCustomerId(customerId); + score.setAgencyId(key); + score.setMonthId(monthId); + score.setYearId(DateUtils.getYearId(monthId)); + score.setQuarterId(DateUtils.getQuarterId(monthId)); + factIndexCommunityScoreEntities.forEach(community -> { + score.setScore(score.getScore().add(community.getScore())); + }); + result.add(score); + }); + factIndexCommunityScoreDao.deleteOldRecord(customerId,monthId,IndexCalConstant.COMMUNITY_RELATE); + factIndexCommunityScoreDao.insertCommunityPartyRecord(result); + } + /** * @Description Integer类型获取最大数和最小数 * @param list @@ -190,6 +441,16 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return result; } + + public MaxAndMinBigDecimalResultDTO getMaxAndMinBigDecimal(List list){ + BigDecimal max = Collections.max(list); + BigDecimal min = Collections.min(list); + MaxAndMinBigDecimalResultDTO result = new MaxAndMinBigDecimalResultDTO(); + result.setMax(max); + result.setMin(min); + return result; + } + /** * @Description Double类型获取最大数和最小数 * @param list diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml index 11b87f6eb8..76d61d7b83 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml @@ -87,19 +87,19 @@ - SELECT - agency_id AS agencyId, - parent_id AS parentId, - month_id AS monthId, - quarter_id AS quarterId, - year_id AS yearId, - transfered_count AS transferedCount, - closed_project_count AS closedProjectCount, - resp_project_ratio AS respProjectRatio, - overdue_project_ratio AS overDueProjectRatio, - closed_project_ratio AS closedProjectRatio, - satisfaction_ratio AS satisfactionRatio + AGENCY_ID, + PARENT_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + TRANSFERED_COUNT, + CLOSED_PROJECT_COUNT, + RESP_PROJECT_RATIO, + OVERDUE_PROJECT_RATIO, + CLOSED_PROJECT_RATIO, + SATISFACTION_RATIO FROM fact_index_govrn_ablity_org_monthly WHERE diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml index ff41b99bd4..4e6bd0cd6c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml @@ -79,7 +79,8 @@ month_id, quarter_id, year_id, - publish_article_count + publish_article_count, + customer_id FROM fact_index_party_ablity_org_monthly WHERE diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml index c475e2aca1..d223423e17 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml @@ -70,4 +70,23 @@ ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityGovrnFiveScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityGovrnFiveScoreDao.xml deleted file mode 100644 index 721b8181ef..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityGovrnFiveScoreDao.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityPartyFiveScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityPartyFiveScoreDao.xml deleted file mode 100644 index 7110ba2c04..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityPartyFiveScoreDao.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - INSERT INTO fact_index_community_party_five_score ( ID, AGENCY_ID, MONTH_ID, INDEX_ID, TOTAL_SCORE, PARTY_ABILITY_SCORE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) - VALUES - - ( - REPLACE ( UUID(), '-', '' ), - #{item.agencyId}, - #{item.monthId}, - #{item.indexId}, - #{item.totalScore}, - #{item.partyAbilityScore}, - #{item.delFlag}, - #{item.revision}, - #{item.createdBy}, - NOW(), - #{item.updatedBy}, - NOW() - ) - - - \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityScoreDao.xml index 54611e0f02..91bebf545b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityScoreDao.xml @@ -3,4 +3,60 @@ + + + INSERT INTO fact_index_community_score ( ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, IS_TOTAL, SCORE, INDEX_CODE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + VALUES + + ( + REPLACE(UUID(),'-',''), + #{item.customerId}, + #{item.agencyId}, + #{item.parentAgencyId}, + #{item.yearId}, + #{item.quarterId}, + #{item.monthId}, + #{item.isTotal}, + #{item.score}, + #{item.indexCode}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW() + ) + + + + + + DELETE + FROM + fact_index_community_score + WHERE + del_flag = '0' + AND customer_id = #{customerId} + AND month_id = #{monthId} + AND index_code = #{indexCode} + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityServiceFiveScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityServiceFiveScoreDao.xml deleted file mode 100644 index 509f723548..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityServiceFiveScoreDao.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexGridScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexGridScoreDao.xml index 7e4ad04732..b38cf57c0a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexGridScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexGridScoreDao.xml @@ -8,13 +8,55 @@ SELECT agency_id, month_id, - AVG( party_ablity_score ) AS score + quarter_id, + year_id, + AVG( score ) AS score, + customer_id FROM fact_index_grid_score WHERE del_flag = '0' AND customer_id = #{customerId} AND month_id = #{monthId} + AND index_code = 'dangjiannengli' GROUP BY agency_id + + + + + + \ No newline at end of file From ee00f86b5b6aa0f2725e3bb43eaf5acae8df134b Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 1 Sep 2020 10:27:51 +0800 Subject: [PATCH 120/226] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E5=BD=92=E4=B8=80=E7=AE=97=E6=B3=95=E6=9E=84=E9=80=A0?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcal/impl/CpcIndexCalculateServiceImpl.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java index aa937dc3d6..26ed23abaa 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -221,13 +221,6 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { private Map> buildIndexInputVO(List indexList, Map minAndMaxMap) { Map> map = new HashMap<>(); for (IndexGroupDetailEntity index : indexList) { - IndexInputVO indexInputVO = new IndexInputVO(); - // 指标code - indexInputVO.setIndexId(index.getIndexCode()); - //权重 - indexInputVO.setWeight(index.getWeight()); - //阈值 - indexInputVO.setThreshold(index.getThreshold()); BigDecimal minValue = null; BigDecimal maxValue = null; @@ -247,10 +240,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { ScoreConstants.MAX_SCORE, Correlation.getCorrelation(index.getCorrelation()) ); - indexInputVO.setScoreCalculator(scoreCalculator); - List> sampleValueList = new ArrayList<>(); - indexInputVO.setIndexValueVOs(sampleValueList); - + IndexInputVO indexInputVO = new IndexInputVO(index.getIndexCode(),new ArrayList>(),index.getWeight(),index.getThreshold(),scoreCalculator); map.put(index.getIndexCode(), indexInputVO); } return map; From ea5250d1f9572fc1bd4ab2c68a7877aae5a80839 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 1 Sep 2020 10:28:04 +0800 Subject: [PATCH 121/226] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=98=88=E5=80=BCv1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/GridCorreLationServiceImpl.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java index 98a35e93fe..7fa8281f15 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java @@ -344,13 +344,13 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { private Map> buildGridCorrelationIndexInputVO(CalculateCommonFormDTO formDTO, List indexList, Map minAndMaxMap) { Map> map = new HashMap<>(); for (IndexGroupDetailEntity index : indexList) { - IndexInputVO indexInputVO = new IndexInputVO(); +// IndexInputVO indexInputVO = new IndexInputVO(); // 指标code - indexInputVO.setIndexId(index.getIndexCode()); +// indexInputVO.setIndexId(index.getIndexCode()); //阈值 - indexInputVO.setThreshold(index.getThreshold()); +// indexInputVO.setThreshold(index.getThreshold()); //权重 - indexInputVO.setWeight(index.getWeight()); +// indexInputVO.setWeight(index.getWeight()); BigDecimal minValue = null; BigDecimal maxValue = null; if (IndexCodeEnum.ZUZHINEIDANGYDLXQZNLKPFPJZ.getCode().equals(index.getIndexCode())) { @@ -384,11 +384,15 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { ScoreConstants.MAX_SCORE, Correlation.getCorrelation(index.getCorrelation()) ); - indexInputVO.setScoreCalculator(scoreCalculator); +// indexInputVO.setScoreCalculator(scoreCalculator); List> sampleValueList = new ArrayList<>(); - indexInputVO.setIndexValueVOs(sampleValueList); - - map.put(index.getIndexCode(), indexInputVO); +// indexInputVO.setIndexValueVOs(sampleValueList); + IndexInputVO indexInputVO1 = new IndexInputVO(index.getIndexCode(), + sampleValueList, + index.getThreshold(), + index.getWeight(), + scoreCalculator); + map.put(index.getIndexCode(), indexInputVO1); } return map; } From 4581826873537ce0faa0e916715a71dda1b3bbd4 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 1 Sep 2020 10:32:12 +0800 Subject: [PATCH 122/226] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E5=BD=92=E4=B8=80=E7=AE=97=E6=B3=95=E6=9E=84=E9=80=A0?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/indexcal/impl/CpcIndexCalculateServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java index 26ed23abaa..c2d8a924cb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -240,7 +240,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { ScoreConstants.MAX_SCORE, Correlation.getCorrelation(index.getCorrelation()) ); - IndexInputVO indexInputVO = new IndexInputVO(index.getIndexCode(),new ArrayList>(),index.getWeight(),index.getThreshold(),scoreCalculator); + IndexInputVO indexInputVO = new IndexInputVO(index.getIndexCode(),new ArrayList<>(),index.getThreshold(),index.getWeight(),scoreCalculator); map.put(index.getIndexCode(), indexInputVO); } return map; From 990a81c5f9bfa3d5c1c7c8cc3b2b52e54f298f88 Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 1 Sep 2020 10:57:16 +0800 Subject: [PATCH 123/226] =?UTF-8?q?=E5=85=9A=E5=91=98=E8=81=94=E7=B3=BB?= =?UTF-8?q?=E7=BE=A4=E4=BC=97=E6=9F=B1=E7=8A=B6=E5=9B=BE=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=80=BB=E5=92=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/ContactMassLineChartResultDTO.java | 10 ++++++++++ .../screen/impl/PartyMemberLeadServiceImpl.java | 2 ++ 2 files changed, 12 insertions(+) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResultDTO.java index e57b0cc54f..17e31e33ee 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResultDTO.java @@ -28,4 +28,14 @@ public class ContactMassLineChartResultDTO implements Serializable { * 群成员数 */ private List groupMemberData; + + /** + * 党员建群数 + **/ + private Integer groupTotal; + + /** + * 党成员数 + * */ + private Integer groupMemberTotal; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java index 902861f5e2..b895b49651 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java @@ -110,6 +110,8 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { result.setXAxis(xAxis); result.setGroupData(groupData); result.setGroupMemberData(groupMemberData); + result.setGroupTotal(groupData.stream().mapToInt(Integer :: intValue).sum()); + result.setGroupMemberTotal(groupMemberData.stream().mapToInt(Integer :: intValue).sum()); return result; } From 5d41c26b04503b9ee92abc67493b149342faa972 Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 1 Sep 2020 11:04:02 +0800 Subject: [PATCH 124/226] =?UTF-8?q?=E5=85=9A=E5=91=98=E8=81=94=E7=B3=BB?= =?UTF-8?q?=E7=BE=A4=E4=BC=97=E6=9F=B1=E7=8A=B6=E5=9B=BE=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=BF=94=E5=8F=82dto=E8=AE=BE=E7=BD=AE=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/dto/result/ContactMassLineChartResultDTO.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResultDTO.java index 17e31e33ee..5a2b93acd9 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.screen.dto.result; +import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; import java.io.Serializable; @@ -32,10 +33,10 @@ public class ContactMassLineChartResultDTO implements Serializable { /** * 党员建群数 **/ - private Integer groupTotal; + private Integer groupTotal = NumConstant.ZERO; /** * 党成员数 * */ - private Integer groupMemberTotal; + private Integer groupMemberTotal = NumConstant.ZERO; } From cd78c492d046f7ea9af7369b7dae33b810a99b6e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 1 Sep 2020 11:14:31 +0800 Subject: [PATCH 125/226] =?UTF-8?q?=E6=97=A5=E5=BF=97=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcal/impl/GridCorreLationServiceImpl.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java index 7fa8281f15..c6c160509e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java @@ -1,9 +1,11 @@ package com.epmet.service.indexcal.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; 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.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; import com.epmet.dao.indexcoll.FactIndexGovrnAblityGridMonthlyDao; import com.epmet.dao.indexcoll.FactIndexPartyAblityGridMonthlyDao; @@ -68,6 +70,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { * @description 网格相关,分值计算 * @Date 2020/8/26 10:51 **/ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) @Override public Boolean calculateGridCorreLation(CalculateCommonFormDTO formDTO) { boolean resultFlag = false; @@ -127,7 +130,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //查询总记录数 int total = factIndexPartyAblityGridMonthlyDao.selectCount(formDTO); if (NumConstant.ZERO == total) { - logger.info(String.format("customerId:%s,monthId:%s,没有上传网格相关-党建能力-五级指标数据"), formDTO.getCustomerId(), formDTO.getMonthId()); + logger.warn(String.format("customerId=%s,monthId=%s,没有上传网格相关-党建能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); return; } //总页数,进行批量查询,批量计算 @@ -155,6 +158,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { recordList.forEach(recordMap -> { //遍历所有的指标 indexMap.forEach((key, value) -> { + logger.info("index_code :{}",key); //列名不为空 if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { //对应的数值 @@ -371,7 +375,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { logger.error("index_code:{} ",index.getIndexCode(),"not find field_name"); continue; } - logger.info("index_code:{} ",index.getIndexCode(),"field_id :{} ",fieldName); +// logger.info("index_code:{} ",index.getIndexCode(),"field_id :{} ",fieldName); String minValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MIN); String maxValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MAX); minValue = new BigDecimal(String.valueOf(minAndMaxMap.get(minValueKey))); @@ -409,7 +413,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //查询总记录数 int total = factIndexGovrnAblityGridMonthlyDao.selectCount(formDTO); if (NumConstant.ZERO == total) { - logger.info(String.format("customerId:%s,monthId:%s,没有上传网格相关-治理能力-五级指标数据"), formDTO.getCustomerId(), formDTO.getMonthId()); + logger.warn(String.format("customerId%s,monthId%s,没有上传网格相关-治理能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); return; } //总页数,进行批量查询,批量计算 @@ -473,7 +477,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //查询总记录数 int total = factIndexGovrnAblityGridMonthlyDao.selectCount(formDTO); if (NumConstant.ZERO == total) { - logger.info(String.format("customerId:%s,monthId:%s,没有上传网格相关-服务能力-五级指标数据"), formDTO.getCustomerId(), formDTO.getMonthId()); + logger.warn(String.format("customerId:%s,monthId:%s,没有上传网格相关-服务能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); return; } //总页数,进行批量查询,批量计算 From f1bfcf2678245081c7b39aa06828dfe5ce647fc3 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 1 Sep 2020 14:18:14 +0800 Subject: [PATCH 126/226] =?UTF-8?q?bug=E4=BF=AE=E6=94=B91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/GridCorreLationServiceImpl.java | 54 ++++++++++--------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java index c6c160509e..9bb3560246 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java @@ -4,6 +4,7 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; 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.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; @@ -160,13 +161,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { indexMap.forEach((key, value) -> { logger.info("index_code :{}",key); //列名不为空 - if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { - //对应的数值 - String sampleValueStr = String.valueOf(recordMap.get(indexCodeFieldReService.getFieldNameByIndexCode(key))); - //构造样本值对象 - SampleValue currentGridIndexValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), new BigDecimal(sampleValueStr)); - value.getIndexValueVOs().add(currentGridIndexValue); - } else if (IndexCodeEnum.ZUZHINEIDANGYDLXQZNLKPFPJZ.getCode().equals(key)) { + if (IndexCodeEnum.ZUZHINEIDANGYDLXQZNLKPFPJZ.getCode().equals(key)) { //组织内党员的联系群众能力考评分(平均值) logger.info("组织内党员的联系群众能力考评分(平均值) 单独处理"); //网格内党员的联系群众能力考评分(平均值) @@ -174,6 +169,13 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { BigDecimal contactMassesAvgValue = getGridContactMassesAvgValue(formDTO, gridId); SampleValue contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), contactMassesAvgValue); value.getIndexValueVOs().add(contactMassesAblityValue); + }else if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { + //对应的数值 + String sampleValueStr = String.valueOf(recordMap.get(indexCodeFieldReService.getFieldNameByIndexCode(key))); + logger.info("===================="+sampleValueStr); + //构造样本值对象 + SampleValue currentGridIndexValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), new BigDecimal(sampleValueStr)); + value.getIndexValueVOs().add(currentGridIndexValue); } }); }); @@ -287,8 +289,12 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { gridScoreEntity.setIndexCode(indexCode); ScreenCustomerGridDTO screenCustomerGridDTO = screenCustomerGridDao.selectParentAgencyId(formDTO.getCustomerId(), gridId); if (null != screenCustomerGridDTO) { - gridScoreEntity.setAgencyId(screenCustomerGridDTO.getParentAgencyId()); - gridScoreEntity.setAllParentIds(screenCustomerGridDTO.getAllParentIds()); + if(StringUtils.isNotBlank(screenCustomerGridDTO.getParentAgencyId())){ + gridScoreEntity.setAgencyId(screenCustomerGridDTO.getParentAgencyId()); + } + if(StringUtils.isNotBlank(screenCustomerGridDTO.getAllParentIds())){ + gridScoreEntity.setAllParentIds(screenCustomerGridDTO.getAllParentIds()); + } } gridScoreEntity.setQuarterId(quarterId); gridScoreEntity.setYearId(yearId); @@ -442,18 +448,18 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //遍历所有的指标 indexMap.forEach((key, value) -> { //列名不为空 - if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { - //对应的数值 - String sampleValueStr = String.valueOf(recordMap.get(indexCodeFieldReService.getFieldNameByIndexCode(key))); - //构造样本值对象 - SampleValue currentGridIndexValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), new BigDecimal(sampleValueStr)); - value.getIndexValueVOs().add(currentGridIndexValue); - } else if (IndexCodeEnum.ZUZHINEIDANGYDSYYSNLKPFPJZ.getCode().equals(key)) { + if (IndexCodeEnum.ZUZHINEIDANGYDSYYSNLKPFPJZ.getCode().equals(key)) { logger.info("组织内党员的参与议事能力考评分(平均值) 单独处理"); String gridId = (String) recordMap.get(IndexCalConstant.GRID_ID); BigDecimal joinAvgValue = getGridJoinIssueAvgValue(formDTO, gridId); SampleValue contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), joinAvgValue); value.getIndexValueVOs().add(contactMassesAblityValue); + }else if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { + //对应的数值 + String sampleValueStr = String.valueOf(recordMap.get(indexCodeFieldReService.getFieldNameByIndexCode(key))); + //构造样本值对象 + SampleValue currentGridIndexValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), new BigDecimal(sampleValueStr)); + value.getIndexValueVOs().add(currentGridIndexValue); } }); }); @@ -542,16 +548,16 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { Map indexMap = indexList.stream().collect(Collectors.toMap(IndexGroupDetailEntity::getIndexCode, Function.identity())); List gridScoreEntityList = new ArrayList<>(); for (GridScoreDTO gridScoreDTO : gridScoreDTOList) { - GridScoreEntity gridScoreEntity = new GridScoreEntity(); - gridScoreEntity.setCustomerId(gridScoreDTO.getCustomerId()); - gridScoreEntity.setGridId(gridScoreDTO.getGridId()); + GridScoreEntity gridScoreEntity = ConvertUtils.sourceToTarget(gridScoreDTO, GridScoreEntity.class); gridScoreEntity.setIsTotal(NumConstant.ONE_STR); gridScoreEntity.setIndexCode(indexCode); - gridScoreEntity.setAgencyId(gridScoreDTO.getAgencyId()); - gridScoreEntity.setAllParentIds(gridScoreDTO.getAllParentIds()); - gridScoreEntity.setQuarterId(gridScoreDTO.getQuarterId()); - gridScoreEntity.setYearId(gridScoreDTO.getYearId()); - gridScoreEntity.setMonthId(gridScoreDTO.getMonthId()); +// gridScoreEntity.setCustomerId(gridScoreDTO.getCustomerId()); +// gridScoreEntity.setGridId(gridScoreDTO.getGridId()); +// gridScoreEntity.setAgencyId(gridScoreDTO.getAgencyId()); +// gridScoreEntity.setAllParentIds(gridScoreDTO.getAllParentIds()); +// gridScoreEntity.setQuarterId(gridScoreDTO.getQuarterId()); +// gridScoreEntity.setYearId(gridScoreDTO.getYearId()); +// gridScoreEntity.setMonthId(gridScoreDTO.getMonthId()); gridScoreEntity.setScore(BigDecimal.ZERO); if (!CollectionUtils.isEmpty(gridScoreDTO.getDetailList()) && gridScoreDTO.getDetailList().size() != 3) { logger.error("customerId:" + gridScoreDTO.getCustomerId() + ";gridId:" + gridScoreDTO.getGridId() + ";monthId:" + gridScoreDTO.getMonthId() + "能力值缺失,无法计算总值"); From f880ce436fc1c593b0f10b2615f700c37f84296b Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 1 Sep 2020 14:24:10 +0800 Subject: [PATCH 127/226] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=98=88=E5=80=BC?= =?UTF-8?q?=E5=BC=95=E8=B5=B7=E7=9A=84=E5=A4=8D=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/support/normalizing/batch/BatchScoreCalculator.java | 2 +- 1 file changed, 1 insertion(+), 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 6c17298ad6..1ede9a4aae 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 @@ -75,7 +75,7 @@ public class BatchScoreCalculator { */ public BigDecimal getFinalSampleValue(Object realValue, BigDecimal threshold) { BigDecimal bdRealValue = new BigDecimal(realValue.toString()); - if (threshold.equals(-1)) { + if (threshold.compareTo(new BigDecimal(-1)) == 0) { // -1表示不使用阈值 return bdRealValue; } From efbc456eae8fccd61243565ac4e773d67f4f3fce Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 1 Sep 2020 15:44:25 +0800 Subject: [PATCH 128/226] =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CpcIndexCalculateServiceImpl.java | 2 +- .../BigDecimalScoreCalculator.java | 22 ++++++-- .../support/normalizing/ScoreCalculator.java | 3 +- .../normalizing/batch/IndexInputVO.java | 5 +- .../normalizing/batch/SampleValue.java | 5 +- .../FactIndexPartyAblityCpcMonthlyDao.xml | 2 +- .../stats/test/normalizing/DemoScoreCal.java | 56 +++++++++++++++---- 7 files changed, 73 insertions(+), 22 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java index c2d8a924cb..b7370217ed 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -240,7 +240,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(), new ArrayList<>(), index.getThreshold(), index.getWeight(), scoreCalculator); map.put(index.getIndexCode(), indexInputVO); } return map; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/BigDecimalScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/BigDecimalScoreCalculator.java index 1655c73a6d..fe0412ba3f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/BigDecimalScoreCalculator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/BigDecimalScoreCalculator.java @@ -1,6 +1,9 @@ package com.epmet.support.normalizing; +import com.alibaba.fastjson.JSON; + import java.math.BigDecimal; +import java.util.Arrays; import java.util.List; /** @@ -9,14 +12,14 @@ import java.util.List; */ public class BigDecimalScoreCalculator extends ScoreCalculator { - /** + /* *//** * 初始化基于原数组的整数分值计算 * ☆☆☆ 务必在该构造方法最后调用父类的prepare()方法 ☆☆☆ * @param sourceArray 源数据完整数组 * @param minScore 分值区间的左边界 * @param maxScore 分值区间的右边界 * @param correlation 相关性 - */ + *//* public BigDecimalScoreCalculator(BigDecimal[] sourceArray, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { this.sourceArrary = sourceArray.clone(); this.minScore = minScore; @@ -26,13 +29,13 @@ public class BigDecimalScoreCalculator extends ScoreCalculator { System.out.println("最小值:"+minScore+";最大值:"+maxScore); } - /** + *//** * 初始化基于原数组的整数分值计算 * @param sourceList 源数据完整列表 * @param minScore 分值区间的左边界 * @param maxScore 分值区间的右边界 * @param correlation 相关性 - */ + *//* public BigDecimalScoreCalculator(List sourceList, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { this.sourceArrary = sourceList.toArray(); this.minScore = minScore; @@ -40,7 +43,7 @@ public class BigDecimalScoreCalculator extends ScoreCalculator { this.correlation = correlation; prepare4SourceArray(); System.out.println("最小值:"+minScore+";最大值:"+maxScore); - } + }*/ /** * 初始化基于边界值的整数分值计算 @@ -77,4 +80,13 @@ public class BigDecimalScoreCalculator extends ScoreCalculator { public BigDecimal convertValue2BigDecimal(Object sourceValue) { return (BigDecimal) sourceValue; } + + public static void main(String[] args) { + BigDecimal minScore = new BigDecimal(0); + BigDecimal maxScore = new BigDecimal(100); + ScoreCalculator sc = new BigDecimalScoreCalculator(new BigDecimal("0.1"),new BigDecimal("1"), minScore, maxScore, Correlation.POSITIVE); + List ts = Arrays.asList(new BigDecimal("0.1"),new BigDecimal("1")); + List normalize = sc.normalize(ts); + System.out.println(JSON.toJSONString(normalize)); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java index 0eab3dcf4b..07407d5032 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java @@ -55,8 +55,8 @@ public abstract class ScoreCalculator { maxValue = getMaxFromSourceArray(); minValue = getMinFromSourceArray(); //计算系数 - System.out.println("最小值:"+minScore+";最大值:"+maxScore); coefficient = calcuteCoefficient(minValue, maxValue); + //System.out.println("最小分值:"+minScore+";最大分值:"+maxScore+";系数:"+coefficient); } /** @@ -176,7 +176,6 @@ public abstract class ScoreCalculator { if (fenmu.compareTo(BigDecimal.ZERO)==0)return new BigDecimal(0); BigDecimal fenzi = maxScore.subtract(minScore); BigDecimal divide = fenzi.divide(fenmu, MathContext.DECIMAL32); - System.out.println("分子:"+fenzi+"分母:"+fenmu+"系数:"+divide.toString()); return divide; } 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 c67b1c494d..57c6fbc396 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 @@ -3,15 +3,16 @@ package com.epmet.support.normalizing.batch; import com.epmet.support.normalizing.ScoreCalculator; import lombok.AllArgsConstructor; import lombok.Data; -import lombok.NoArgsConstructor; +import java.io.Serializable; import java.math.BigDecimal; import java.util.List; @Data @AllArgsConstructor -public class IndexInputVO { +public class IndexInputVO implements Serializable { + private static final long serialVersionUID = -4855313801481921595L; /** * 指标标记,由使用者传入,用以标记该条指标的独有特性,一般用id或者code * 非必填 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/SampleValue.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/SampleValue.java index 0818cc8d97..5a42508e64 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/SampleValue.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/SampleValue.java @@ -3,13 +3,16 @@ package com.epmet.support.normalizing.batch; import lombok.AllArgsConstructor; import lombok.Data; +import java.io.Serializable; + /** * 样本值对象 */ @Data @AllArgsConstructor -public class SampleValue { +public class SampleValue implements Serializable { + private static final long serialVersionUID = 8661385412757324539L; private String sampleId; private T sampleValue; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml index c9f807d881..edd55c90ea 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml @@ -73,7 +73,7 @@ SELECT MIN( CREATE_TOPIC_COUNT ) CREATE_TOPIC_COUNT_MIN, MAX( CREATE_TOPIC_COUNT ) CREATE_TOPIC_COUNT_MAX, - MAX( JOIN_TOPIC_COUNT ) JOIN_TOPIC_COUNT_MIN, + MIN( JOIN_TOPIC_COUNT ) JOIN_TOPIC_COUNT_MIN, MAX( JOIN_TOPIC_COUNT ) JOIN_TOPIC_COUNT_MAX, MIN( SHIFT_ISSUE_COUNT ) SHIFT_ISSUE_COUNT_MIN, MAX( SHIFT_ISSUE_COUNT ) SHIFT_ISSUE_COUNT_MAX, 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 6da70db9c8..443055b1f9 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 @@ -122,27 +122,63 @@ public class DemoScoreCal { public void testBigDecimalBatchCalculateGroupBySampleId() throws InterruptedException { //{4,8,1,3,2} - // 每个指标需要单独的分支计算器,因为每个指标的最大最小值是不同的 - ScoreCalculator sc1 = new BigDecimalScoreCalculator(new BigDecimal(1), new BigDecimal(8), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.NEGATIVE); - ScoreCalculator sc2 = new BigDecimalScoreCalculator(new BigDecimal(1), new BigDecimal(8), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.NEGATIVE); + //分值计算器 每个指标需要单独的分值计算器,因为每个指标的最大最小值是不同的 + ScoreCalculator sc1 = new BigDecimalScoreCalculator(new BigDecimal(50), new BigDecimal(100), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + ScoreCalculator sc2 = new BigDecimalScoreCalculator(new BigDecimal(20), new BigDecimal(100), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + ScoreCalculator sc3 = new BigDecimalScoreCalculator(new BigDecimal(20), new BigDecimal(40), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + ScoreCalculator sc4 = new BigDecimalScoreCalculator(new BigDecimal(10), new BigDecimal(100), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + + //每个指标的数值 比如 a指标里有5条数据 + List index1SampleValues = Arrays.asList( + new SampleValue<>("id1", new BigDecimal(100)), + new SampleValue<>("id2", new BigDecimal(50)), + new SampleValue<>("id3", new BigDecimal(60)), + new SampleValue<>("id4", new BigDecimal(80)), + new SampleValue<>("id5", new BigDecimal(80)) + ); + + List index1SampleValues2 = Arrays.asList( + new SampleValue<>("id1", new BigDecimal(100)), + new SampleValue<>("id2", new BigDecimal(80)), + new SampleValue<>("id3", new BigDecimal(80)), + new SampleValue<>("id4", new BigDecimal(20)), + new SampleValue<>("id5", new BigDecimal(20)) + ); + + List index1SampleValues3 = Arrays.asList( + new SampleValue<>("id1", new BigDecimal(40)), + new SampleValue<>("id2", new BigDecimal(20)), + new SampleValue<>("id3", new BigDecimal(40)), + new SampleValue<>("id4", new BigDecimal(30)), + new SampleValue<>("id5", new BigDecimal(20)) + ); + + List index1SampleValues4 = Arrays.asList( + new SampleValue<>("id1", new BigDecimal(20)), + new SampleValue<>("id2", new BigDecimal(100)), + new SampleValue<>("id3", new BigDecimal(10)), + new SampleValue<>("id4", new BigDecimal(50)), + new SampleValue<>("id5", new BigDecimal(20)) + ); - List index1SampleValues = Arrays.asList(new SampleValue<>("id1", new BigDecimal(4)), new SampleValue<>("id2", new BigDecimal(1)), new SampleValue<>("id3", new BigDecimal(8))); - 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("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); - List indexInputVOS = Arrays.asList(index1VO, index2VO); + + List indexInputVOS = Arrays.asList(index1VO, index2VO,index3VO,index4VO); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); HashMap result = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - System.err.println("--------------------------------"); + System.err.println("----------------1----------------"); result.forEach((key, value) -> { System.out.println(key.concat("的得分为:").concat(value.toString())); }); - System.err.println("--------------------------------"); + System.err.println("-----------------2---------------"); } From c87d2ef361515f6f27dcfd154d0f3fe7560c6935 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 1 Sep 2020 16:11:50 +0800 Subject: [PATCH 129/226] =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/DemoController.java | 2 +- .../FactIndexServiceAblityOrgMonthlyDao.java | 2 + .../IndexCalculateCommunityService.java | 9 +- .../IndexCalculateCommunityServiceImpl.java | 265 +++++++----------- .../support/normalizing/ScoreConstants.java | 2 +- .../FactIndexServiceAblityOrgMonthlyDao.xml | 19 ++ .../screen/FactIndexCommunityScoreDao.xml | 1 + 7 files changed, 133 insertions(+), 167 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 2b88f53f42..f8274a7f10 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -132,7 +132,7 @@ public class DemoController { @PostMapping("zxc2") public Result getZxc2(){ - indexCalculateCommunityService.communityServiceAbilityCalculate("b09527201c4409e19d1dbc5e3c3429a1","202008"); + indexCalculateCommunityService.calAll("b09527201c4409e19d1dbc5e3c3429a1","202008"); return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java index 261fb8b945..c557c74ac2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java @@ -26,6 +26,7 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 服务能力-组织(街道|社区|全区)相关事实表 @@ -73,4 +74,5 @@ public interface FactIndexServiceAblityOrgMonthlyDao extends BaseDao selectActivityCount(@Param("customerId")String customerId, @Param("monthId")String monthId); + List> selectActivityCountMap(@Param("customerId")String customerId, @Param("monthId")String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateCommunityService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateCommunityService.java index f597e3748f..dee16a06f7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateCommunityService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateCommunityService.java @@ -38,12 +38,5 @@ public interface IndexCalculateCommunityService { */ void communityServiceAbilityCalculate(String customerId, String monthId); - /** - * @Description 社区相关计算 - * @param customerId - * @param monthId - * @author zxc - * @date 2020/9/1 9:21 上午 - */ - void communityRelate(String customerId, String monthId); + void calAll(String customerId, String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java index 89554a0cf2..cdd6470ccf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java @@ -62,7 +62,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni @Transactional(rollbackFor = Exception.class) @Override public void communityPartyCalculate(String customerId, String monthId) { - customerId = "b09527201c4409e19d1dbc5e3c3429a1"; // 党建能力 // 根据all_parent_index_code 获取指标明细 @@ -70,10 +69,9 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni List subAllGridList = new ArrayList<>(); List communityPublishArticle = new ArrayList<>(); //下属所有网格的党建能力平均值 - String finalCustomerId = customerId; detailListByParentCode.forEach(indexGroup -> { if (indexGroup.getIndexCode().equals(IndexCalConstant.COMMUNITY_PARTY_AVG)){ - List subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridPartyAvgScore(finalCustomerId, monthId); + List subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridPartyAvgScore(customerId, monthId); if (subGridPartyAvgScore.size() != NumConstant.ZERO){ MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); Integer indexStart = NumConstant.ZERO; @@ -81,7 +79,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni List collect; do { collect = subGridPartyAvgScore.stream().skip(indexEnd * indexStart).limit(indexEnd).collect(Collectors.toList()); - BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); List index1SampleValues = new ArrayList<>(); collect.forEach(c -> { SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); @@ -90,14 +87,11 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni BeanUtils.copyProperties(c,dto); subAllGridList.add(dto); }); - IndexInputVO index1VO = new IndexInputVO(indexGroup.getIndexId(), index1SampleValues,indexGroup.getThreshold(), indexGroup.getWeight(), sc1); - List indexInputVOS = Arrays.asList(index1VO); - BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - List result = batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); - result.get(NumConstant.ZERO).getIndexScoreVOs().forEach(agency -> { + HashMap result = this.getCalResult(maxAndMinBigDecimal, index1SampleValues, indexGroup); + result.forEach((key,value) -> { subAllGridList.forEach(grid -> { - if (grid.getAgencyId().equals(agency.getSampleId())){ - grid.setScore(agency.getSampleScore()); + if (grid.getAgencyId().equals(key)){ + grid.setScore(value); } }); }); @@ -122,11 +116,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni Integer indexStart = NumConstant.ZERO; Integer indexEnd = NumConstant.TEN; List collect; - MaxAndMinIntegerResultDTO maxAndMinInteger = this.getMaxAndMinInteger(publishArticleCounts.stream().map(CommunityPublishArticleCountResultDTO::getPublishArticleCount).collect(Collectors.toList())); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(publishArticleCounts.stream().map(o -> new BigDecimal(o.getPublishArticleCount())).collect(Collectors.toList())); do { collect = publishArticleCounts.stream().skip(indexEnd * indexStart).limit(indexEnd).collect(Collectors.toList()); - ScoreCalculator sc1 = new IntegerScoreCalculator(maxAndMinInteger.getMin(), maxAndMinInteger.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); - List> ll = new ArrayList<>(); + List ll = new ArrayList<>(); collect.forEach(c -> { SampleValue s = new SampleValue(c.getAgencyId(), c.getPublishArticleCount()); ll.add(s); @@ -134,15 +127,12 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni BeanUtils.copyProperties(c,publishArticle); communityPublishArticle.add(publishArticle); }); - IndexInputVO index1VO = new IndexInputVO<>(indexGroup.getIndexId(), ll,indexGroup.getThreshold(), indexGroup.getWeight(), sc1); - List indexInputVOS = Arrays.asList(index1VO); - BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - List result = batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); - result.get(NumConstant.ZERO).getIndexScoreVOs().forEach(agency -> { + HashMap result = this.getCalResult(maxAndMinBigDecimal, ll, indexGroup); + result.forEach((key,value) -> { communityPublishArticle.forEach(publish -> { - if (publish.getAgencyId().equals(agency.getSampleId())){ + if (publish.getAgencyId().equals(key)){ publish.setIndexCode(indexGroup.getIndexCode()); - publish.setScore(agency.getSampleScore()); + publish.setScore(value); } }); }); @@ -163,6 +153,14 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni factIndexCommunityScoreDao.insertCommunityPartyRecord(subAllGridList); } + public HashMap getCalResult(MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal,List ll, IndexGroupDetailEntity indexGroup){ + BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + IndexInputVO index1VO = new IndexInputVO(indexGroup.getIndexId(), ll,indexGroup.getThreshold(), indexGroup.getWeight(), sc); + List indexInputVOS = Arrays.asList(index1VO); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + return batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + } + /** * @Description 社区治理能力 * @param customerId @@ -173,16 +171,11 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni @Transactional(rollbackFor = Exception.class) @Override public void communityGovernAbilityCalculate(String customerId, String monthId) { - customerId = "b09527201c4409e19d1dbc5e3c3429a1"; - List subAllGridList = new ArrayList<>(); - List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); - - String finalCustomerId = customerId; detailListByParentCode.forEach(detail -> { if (detail.getIndexCode().equals(IndexCalConstant.COMMUNITY_GOVERN_AVG)){ - List subGridGovernAvg = factIndexGridScoreDao.selectSubGridGovernAvgScore(finalCustomerId, monthId); + List subGridGovernAvg = factIndexGridScoreDao.selectSubGridGovernAvgScore(customerId, monthId); if (subGridGovernAvg.size() == NumConstant.ONE){ // TODO @@ -194,7 +187,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni List collect; do { collect = subGridGovernAvg.stream().skip(indexEnd * indexStart).limit(indexEnd).collect(Collectors.toList()); - BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); List index1SampleValues = new ArrayList<>(); collect.forEach(c -> { SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); @@ -203,11 +195,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni BeanUtils.copyProperties(c,dto); subAllGridList.add(dto); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold() ,detail.getWeight(), sc1); - List indexInputVOS = Arrays.asList(index1VO); - BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - scoreCountOfSampleId.forEach((key,value) -> { + HashMap result = this.getCalResult(maxAndMinBigDecimal, index1SampleValues, detail); + result.forEach((key,value) -> { subAllGridList.forEach(grid -> { if (grid.getAgencyId().equals(key)){ grid.setScore(value); @@ -218,12 +207,9 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni }while (collect.size() == NumConstant.TEN); } } - else { - - } }); - List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(finalCustomerId, monthId); + List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(customerId, monthId); if (communityGovernAbility.size() == NumConstant.ONE){ // TODO @@ -250,21 +236,20 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); } while (collect.size() == NumConstant.TEN); - BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - scoreCountOfSampleId.forEach((key,value) -> { - subAllGridList.forEach(grid -> { - if (key.equals(grid.getAgencyId())) { - grid.setCustomerId(finalCustomerId); - grid.setIndexCode(IndexCalConstant.COMMUNITY_GOVERN); - grid.setScore(grid.getScore().add(value)); - } - }); - }); } } }); - + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + scoreCountOfSampleId.forEach((key,value) -> { + subAllGridList.forEach(grid -> { + if (key.equals(grid.getAgencyId())) { + grid.setCustomerId(customerId); + grid.setIndexCode(IndexCalConstant.COMMUNITY_GOVERN); + grid.setScore(grid.getScore().add(value)); + } + }); + }); } factIndexCommunityScoreDao.deleteOldRecord(customerId,monthId,IndexCalConstant.COMMUNITY_GOVERN); factIndexCommunityScoreDao.insertCommunityPartyRecord(subAllGridList); @@ -289,82 +274,75 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); detailListByParentCode.forEach(detail -> { - switch (detail.getIndexCode()){ - case IndexCalConstant.COMMUNITY_SERVICE_AVG: - List subGridServiceAvg = factIndexGridScoreDao.selectSubGridServiceAvgScore(customerId, monthId); - if (subGridServiceAvg.size() == NumConstant.ONE){ + String indexCode = detail.getIndexCode(); + if (indexCode.equals(IndexCalConstant.COMMUNITY_SERVICE_AVG)){ + List subGridServiceAvg = factIndexGridScoreDao.selectSubGridServiceAvgScore(customerId, monthId); + if (subGridServiceAvg.size() == NumConstant.ONE){ - // TODO 只有一条记录时 + // TODO 只有一条记录时 - }else if (subGridServiceAvg.size() > NumConstant.ONE ){ - MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); - Integer indexStart = NumConstant.ZERO; - Integer indexEnd = NumConstant.TEN; - List collect; - do { - collect = subGridServiceAvg.stream().skip(indexEnd * indexStart).limit(indexEnd).collect(Collectors.toList()); - BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); - List index1SampleValues = new ArrayList<>(); - collect.forEach(c -> { - SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); - index1SampleValues.add(s); - FactIndexCommunityScoreDTO dto = new FactIndexCommunityScoreDTO(); - BeanUtils.copyProperties(c,dto); - subAllGridList.add(dto); - }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues,detail.getThreshold(), detail.getWeight(), sc1); - List indexInputVOS = Arrays.asList(index1VO); - BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - List result = batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); - result.get(NumConstant.ZERO).getIndexScoreVOs().forEach(agency -> { - subAllGridList.forEach(grid -> { - if (grid.getAgencyId().equals(agency.getSampleId())){ - grid.setScore(agency.getSampleScore()); - } - }); + }else if (subGridServiceAvg.size() > NumConstant.ONE ){ + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); + Integer indexStart = NumConstant.ZERO; + Integer indexEnd = NumConstant.TEN; + List collect; + do { + collect = subGridServiceAvg.stream().skip(indexEnd * indexStart).limit(indexEnd).collect(Collectors.toList()); + BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + List index1SampleValues = new ArrayList<>(); + collect.forEach(c -> { + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + FactIndexCommunityScoreDTO dto = new FactIndexCommunityScoreDTO(); + BeanUtils.copyProperties(c,dto); + subAllGridList.add(dto); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues,detail.getThreshold(), detail.getWeight(), sc1); + List indexInputVOS = Arrays.asList(index1VO); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + List result = batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); + result.get(NumConstant.ZERO).getIndexScoreVOs().forEach(agency -> { + subAllGridList.forEach(grid -> { + if (grid.getAgencyId().equals(agency.getSampleId())){ + grid.setScore(agency.getSampleScore()); + } }); - indexStart++; - }while (collect.size() == NumConstant.TEN); - } - break; - case "shequhuodongzzcs": - List communityActivityCount = factIndexServiceAblityOrgMonthlyDao.selectActivityCount(customerId, monthId); - if (communityActivityCount.size() == NumConstant.ONE){ + }); + indexStart++; + }while (collect.size() == NumConstant.TEN); + } + }else{ + List communityActivityCount = factIndexServiceAblityOrgMonthlyDao.selectActivityCount(customerId, monthId); + if (communityActivityCount.size() == NumConstant.ONE){ - // TODO + // TODO - }else if (communityActivityCount.size() > NumConstant.ONE){ - Integer indexStart = NumConstant.ZERO; - Integer indexEnd = NumConstant.TEN; - List collect; - MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(communityActivityCount.stream().map(o -> new BigDecimal(o.getActivityCount())).collect(Collectors.toList())); - do { - collect = communityActivityCount.stream().skip(indexEnd * indexStart).limit(indexEnd).collect(Collectors.toList()); - ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); - List> ll = new ArrayList<>(); - collect.forEach(c -> { - SampleValue s = new SampleValue(c.getAgencyId(), c.getActivityCount()); - ll.add(s); - FactIndexCommunityScoreDTO publishArticle = new FactIndexCommunityScoreDTO(); - BeanUtils.copyProperties(c,publishArticle); - communityPublishArticle.add(publishArticle); - }); - IndexInputVO index1VO = new IndexInputVO<>(detail.getIndexId(), ll, detail.getThreshold(),detail.getWeight(), sc1); - List indexInputVOS = Arrays.asList(index1VO); - BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - List result = batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); - result.get(NumConstant.ZERO).getIndexScoreVOs().forEach(agency -> { - communityPublishArticle.forEach(publish -> { - if (publish.getAgencyId().equals(agency.getSampleId())){ - publish.setScore(agency.getSampleScore()); - } - }); + }else if (communityActivityCount.size() > NumConstant.ONE){ + Integer indexStart = NumConstant.ZERO; + Integer indexEnd = NumConstant.TEN; + List collect; + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(communityActivityCount.stream().map(o -> new BigDecimal(o.getActivityCount())).collect(Collectors.toList())); + do { + collect = communityActivityCount.stream().skip(indexEnd * indexStart).limit(indexEnd).collect(Collectors.toList()); + List ll = new ArrayList<>(); + collect.forEach(c -> { + SampleValue s = new SampleValue(c.getAgencyId(), c.getActivityCount()); + ll.add(s); + FactIndexCommunityScoreDTO publishArticle = new FactIndexCommunityScoreDTO(); + BeanUtils.copyProperties(c,publishArticle); + communityPublishArticle.add(publishArticle); + }); + HashMap result = this.getCalResult(maxAndMinBigDecimal, ll, detail); + result.forEach((k,v) -> { + communityPublishArticle.forEach(publish -> { + if (publish.getAgencyId().equals(k)){ + publish.setScore(v); + } }); - indexStart++; - } while (collect.size() == NumConstant.TEN); - } - break; - default: + }); + indexStart++; + } while (collect.size() == NumConstant.TEN); + } } }); subAllGridList.forEach(grid -> { @@ -388,15 +366,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni * @author zxc * @date 2020/9/1 9:21 上午 */ - @Override public void communityRelate(String customerId, String monthId) { - - this.communityPartyCalculate(customerId, monthId); //党建能力 - this.communityGovernAbilityCalculate(customerId, monthId); // 治理能力 - this.communityServiceAbilityCalculate(customerId, monthId); // 服务能力 - - List communityPublishArticle = new ArrayList<>(); - List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); List factIndexCommunityScoreEntities = factIndexCommunityScoreDao.selectCommunityInfo(customerId, monthId); detailListByParentCode.forEach(detail -> { @@ -406,7 +376,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni } }); }); - Map> collect = factIndexCommunityScoreEntities.stream().collect(Collectors.groupingBy(FactIndexCommunityScoreDTO::getAgencyId)); List result = new ArrayList<>(); collect.forEach((key,value) -> { @@ -417,7 +386,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni score.setMonthId(monthId); score.setYearId(DateUtils.getYearId(monthId)); score.setQuarterId(DateUtils.getQuarterId(monthId)); - factIndexCommunityScoreEntities.forEach(community -> { + score.setIndexCode(IndexCalConstant.COMMUNITY_RELATE); + value.forEach(community -> { score.setScore(score.getScore().add(community.getScore())); }); result.add(score); @@ -426,22 +396,20 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni factIndexCommunityScoreDao.insertCommunityPartyRecord(result); } + public void calAll(String customerId,String monthId){ + this.communityPartyCalculate(customerId, monthId); //党建能力 + this.communityGovernAbilityCalculate(customerId, monthId); // 治理能力 + this.communityServiceAbilityCalculate(customerId, monthId); // 服务能力 + + communityRelate(customerId, monthId); + } + /** - * @Description Integer类型获取最大数和最小数 + * @Description BigDecimal类型获取最大数和最小数 * @param list * @author zxc * @date 2020/8/27 1:30 下午 */ - public MaxAndMinIntegerResultDTO getMaxAndMinInteger(List list){ - Integer max = Collections.max(list); - Integer min = Collections.min(list); - MaxAndMinIntegerResultDTO result = new MaxAndMinIntegerResultDTO(); - result.setMax(max); - result.setMin(min); - return result; - } - - public MaxAndMinBigDecimalResultDTO getMaxAndMinBigDecimal(List list){ BigDecimal max = Collections.max(list); BigDecimal min = Collections.min(list); @@ -450,21 +418,4 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni result.setMin(min); return result; } - - /** - * @Description Double类型获取最大数和最小数 - * @param list - * @author zxc - * @date 2020/8/27 1:32 下午 - */ - public MaxAndMinDoubleResultDTO getMaxAndMinDouble(List list){ - Double max = Collections.max(list); - Double min = Collections.min(list); - MaxAndMinDoubleResultDTO result = new MaxAndMinDoubleResultDTO(); - result.setMax(max); - result.setMin(min); - return result; - } - - } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java index 1eecc8cf36..43688efa21 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java @@ -7,7 +7,7 @@ import java.math.BigDecimal; */ public class ScoreConstants { - public static final BigDecimal MIN_SCORE = new BigDecimal(0); + public static final BigDecimal MIN_SCORE = new BigDecimal(1); public static final BigDecimal MAX_SCORE = new BigDecimal(100); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml index d223423e17..8315280f89 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml @@ -89,4 +89,23 @@ AND customer_id = #{customerId} AND month_id = #{monthId} + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityScoreDao.xml index 91bebf545b..68b9d5344b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/FactIndexCommunityScoreDao.xml @@ -57,6 +57,7 @@ del_flag = 0 AND CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + AND INDEX_CODE != "shequxiangguan" \ No newline at end of file From c3385bee816fd9dfe861d1333ca5ee7cb284d467 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 1 Sep 2020 16:15:38 +0800 Subject: [PATCH 130/226] =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/DemoController.java | 6 ------ .../screen/IndexCalculateCommunityService.java | 7 +++++++ .../impl/IndexCalculateCommunityServiceImpl.java | 16 ++++++++-------- .../support/normalizing/ScoreConstants.java | 2 +- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index f8274a7f10..bccb9ad479 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -136,12 +136,6 @@ public class DemoController { return new Result(); } - @PostMapping("zxcAll") - public Result getZxcAll(){ - indexCalculateCommunityService.communityRelate("b09527201c4409e19d1dbc5e3c3429a1","202008"); - return new Result(); - } - @PostMapping("testcalculategridcorrelation") public Result testcalculateGridCorreLation(){ CalculateCommonFormDTO formDTO=new CalculateCommonFormDTO("b09527201c4409e19d1dbc5e3c3429a1","202008"); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateCommunityService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateCommunityService.java index dee16a06f7..5a6f1bbaa9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateCommunityService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateCommunityService.java @@ -38,5 +38,12 @@ public interface IndexCalculateCommunityService { */ void communityServiceAbilityCalculate(String customerId, String monthId); + /** + * @Description 计算社区相关 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/1 4:12 下午 + */ void calAll(String customerId, String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java index cdd6470ccf..4ff69ef236 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java @@ -153,14 +153,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni factIndexCommunityScoreDao.insertCommunityPartyRecord(subAllGridList); } - public HashMap getCalResult(MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal,List ll, IndexGroupDetailEntity indexGroup){ - BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); - IndexInputVO index1VO = new IndexInputVO(indexGroup.getIndexId(), ll,indexGroup.getThreshold(), indexGroup.getWeight(), sc); - List indexInputVOS = Arrays.asList(index1VO); - BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - return batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - } - /** * @Description 社区治理能力 * @param customerId @@ -418,4 +410,12 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni result.setMin(min); return result; } + + public HashMap getCalResult(MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal,List ll, IndexGroupDetailEntity indexGroup){ + BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + IndexInputVO index1VO = new IndexInputVO(indexGroup.getIndexId(), ll,indexGroup.getThreshold(), indexGroup.getWeight(), sc); + List indexInputVOS = Arrays.asList(index1VO); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + return batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java index 43688efa21..1eecc8cf36 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java @@ -7,7 +7,7 @@ import java.math.BigDecimal; */ public class ScoreConstants { - public static final BigDecimal MIN_SCORE = new BigDecimal(1); + public static final BigDecimal MIN_SCORE = new BigDecimal(0); public static final BigDecimal MAX_SCORE = new BigDecimal(100); } From a4a50b60a5979dc5754c463a25dfe95a57a5d1c7 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 1 Sep 2020 16:23:48 +0800 Subject: [PATCH 131/226] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/redis/IndexCodeFieldReRedis.java | 8 ++ .../impl/CpcIndexCalculateServiceImpl.java | 12 +-- .../impl/IndexCalculateServiceImpl.java | 85 ++++++++++++------- .../BigDecimalScoreCalculator.java | 6 ++ 4 files changed, 74 insertions(+), 37 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/redis/IndexCodeFieldReRedis.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/redis/IndexCodeFieldReRedis.java index 2863952420..8a99d62890 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/redis/IndexCodeFieldReRedis.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/redis/IndexCodeFieldReRedis.java @@ -51,4 +51,12 @@ public class IndexCodeFieldReRedis { hashOperations.putAll(RedisKeys.getIndexCodeFieldReKey(), records); redisTemplate.expire(RedisKeys.getIndexCodeFieldReKey(), 1, TimeUnit.DAYS); } + + /** + * desc:删除指标字段关系缓存 + * @return + */ + public Boolean deleteIndexCodeFromRedis() { + return redisTemplate.delete(RedisKeys.getIndexCodeFieldReKey()); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java index b7370217ed..dabeade3f1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.service.indexcal.impl; +import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.RenException; @@ -104,17 +105,18 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { Map indexCodeFieldReList = indexCodeFieldReService.getIndexCodeFieldReMap(); if (CollectionUtils.isEmpty(indexCodeFieldReList)) { log.error("cpcIndexCalculate have any indexcodefieldre"); - return; + throw new RenException("指标code与字段关系记录不存在"); } //计算最大最小值 Map minAndMaxMap = factIndexPartyAblityCpcMonthlyDao.getExtremeValue(formDTO.getCustomerId()); if (CollectionUtils.isEmpty(minAndMaxMap)) { log.error("cpcIndexCalculate getExtremeValue customerId:{} have not any fact record", formDTO.getCustomerId()); - return; + throw new RenException("指标原始数据记录不存在"); } //指标集合 Map> groupIndexDetailsMap = getIndexDetailMap(formDTO); if (groupIndexDetailsMap == null) { + log.error("calculatePartScore"); return; } @@ -152,7 +154,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { IndexInputVO value = entry.getValue(); String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(indexCode); if (StringUtils.isBlank(fieldName)) { - log.error("cpcIndexCalculate fieldName error"); + log.error("calculateScore indexCode:{} get fieldName return blank", indexCode); continue; } @@ -179,9 +181,9 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { value.getIndexValueVOs().add(currentUserIndexValue); } } - log.warn("计算的参数:{}", indexMap); + log.info("计算的参数:{}", JSON.toJSONString(indexMap)); HashMap result = calculateScore(indexMap); - log.warn("计算的结果:{}", result); + log.info("计算的结果:{}", result); //处理结果 saveCpcScore(formDTO, scoreEntityMap, parentIndexCode, result); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java index 611ad18f4e..12bbbbad27 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java @@ -1,14 +1,15 @@ package com.epmet.service.screen.impl; +import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.dao.indexcoll.FactIndexPartyAblityCpcMonthlyDao; -import com.epmet.dao.screen.IndexGroupDao; -import com.epmet.dao.screen.IndexGroupDetailDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.screen.form.IndexCalculateForm; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import com.epmet.redis.IndexCodeFieldReRedis; +import com.epmet.service.indexcal.CpcIndexCalculateService; import com.epmet.service.indexcal.GridCorreLationService; +import com.epmet.service.screen.IndexCalculateCommunityService; import com.epmet.service.screen.IndexCalculateService; import com.epmet.util.DimIdGenerator; import lombok.extern.slf4j.Slf4j; @@ -29,45 +30,65 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { @Autowired private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient; @Autowired - private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; - @Autowired private GridCorreLationService gridCorreLationService; @Autowired - private IndexGroupDao indexGroupDao; + private CpcIndexCalculateService cpcIndexCalculateService; + @Autowired + private IndexCodeFieldReRedis indexCodeFieldReRedis; @Autowired - private IndexGroupDetailDao indexGroupDetailDao; + private IndexCalculateCommunityService indexCalculateCommunityService; @Override public Boolean indexCalculate(IndexCalculateForm formDTO) { - if (StringUtils.isBlank(formDTO.getMonthId())) { - //默认 当前月份-1 - formDTO.setMonthId(DimIdGenerator.getMonthDimId(DateUtils.addDateMonths(new Date(), -1))); - } - //按照客户分组 - if (CollectionUtils.isEmpty(formDTO.getCustomerIds())) { - Result> externalCustomerIdsResult = epmetCommonServiceOpenFeignClient.getExternalCustomerIds(); - if (!externalCustomerIdsResult.success()) { - log.error("cpcIndexCalculate epmetCommonServiceOpenFeignClient.getExternalCustomerIds return fail"); - return false; + try { + if (StringUtils.isBlank(formDTO.getMonthId())) { + //默认 当前月份-1 + formDTO.setMonthId(DimIdGenerator.getMonthDimId(DateUtils.addDateMonths(new Date(), -1))); } - formDTO.setCustomerIds(externalCustomerIdsResult.getData()); - } - formDTO.getCustomerIds().forEach(customerId -> { - CalculateCommonFormDTO calculateCommonFormDTO=new CalculateCommonFormDTO(customerId, formDTO.getMonthId()); - //计算党员 - try { - //Map list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(customerId, formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize); - } catch (Exception e) { - + //按照客户分组 + if (CollectionUtils.isEmpty(formDTO.getCustomerIds())) { + Result> externalCustomerIdsResult = epmetCommonServiceOpenFeignClient.getExternalCustomerIds(); + if (!externalCustomerIdsResult.success()) { + log.error("indexCalculate epmetCommonServiceOpenFeignClient.getExternalCustomerIds return fail"); + return false; + } + formDTO.setCustomerIds(externalCustomerIdsResult.getData()); } + formDTO.getCustomerIds().forEach(customerId -> { + CalculateCommonFormDTO calculateCommonFormDTO = new CalculateCommonFormDTO(customerId, formDTO.getMonthId()); + //计算党员相关的 + Boolean flag = false; + try { + CalculateCommonFormDTO param = new CalculateCommonFormDTO(customerId, formDTO.getMonthId()); + flag = cpcIndexCalculateService.cpcIndexCalculate(param); + log.info("indexCalculate cpcIndexCalculate return result:{}", flag); + } catch (Exception e) { + log.error("indexCalculate cpcIndexCalculate exception", e); + } - //计算网格 - //TODO - gridCorreLationService.calculateGridCorreLation(calculateCommonFormDTO); - //计算社区 - //TODO + //计算网格 + try { + flag = gridCorreLationService.calculateGridCorreLation(calculateCommonFormDTO); + log.info("indexCalculate calculateGridCorreLation return result:{}", flag); + } catch (Exception e) { + log.error("indexCalculate calculateGridCorreLation exception", e); + } + //计算社区 + try { + indexCalculateCommunityService.calAll(customerId, formDTO.getMonthId()); + log.info("indexCalculate calAll return result:{}", flag); + } catch (Exception e) { + log.error("indexCalculate calAll exception", e); + } - }); + }); + indexCodeFieldReRedis.deleteIndexCodeFromRedis(); + } catch (Exception e) { + log.error("indexCalculate exception,param:{}", JSON.toJSONString(formDTO)); + } finally { + //清除缓存 + indexCodeFieldReRedis.deleteIndexCodeFromRedis(); + } return true; } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/BigDecimalScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/BigDecimalScoreCalculator.java index fe0412ba3f..b86c347d24 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/BigDecimalScoreCalculator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/BigDecimalScoreCalculator.java @@ -66,12 +66,18 @@ public class BigDecimalScoreCalculator extends ScoreCalculator { @Override public BigDecimal getMaxFromSourceArray() { + if (this.sourceArrary == null){ + return null; + } BigDecimal[] intSourceArrary = (BigDecimal[]) this.sourceArrary; return intSourceArrary[intSourceArrary.length - 1]; } @Override public BigDecimal getMinFromSourceArray() { + if (this.sourceArrary == null){ + return null; + } BigDecimal[] intSourceArrary = (BigDecimal[]) this.sourceArrary; return intSourceArrary[0]; } From 3edb4d72b7a321bdae5dc605983ab1ef4a74687b Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 1 Sep 2020 16:26:24 +0800 Subject: [PATCH 132/226] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/screen/impl/IndexCalculateServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java index 12bbbbad27..7283af07c3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java @@ -80,15 +80,15 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { } catch (Exception e) { log.error("indexCalculate calAll exception", e); } - }); indexCodeFieldReRedis.deleteIndexCodeFromRedis(); + return true; } catch (Exception e) { log.error("indexCalculate exception,param:{}", JSON.toJSONString(formDTO)); } finally { //清除缓存 indexCodeFieldReRedis.deleteIndexCodeFromRedis(); } - return true; + return false; } } From 9059e8f518a3d8441d23b7f0faa02b3f2036fd8b Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 1 Sep 2020 16:27:25 +0800 Subject: [PATCH 133/226] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/IndexCalConstant.java | 19 ++ .../com/epmet/controller/DemoController.java | 318 +++++++++++++++++- .../impl/GridCorreLationServiceImpl.java | 59 +++- .../support/normalizing/ScoreConstants.java | 2 +- 4 files changed, 382 insertions(+), 16 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java index 12b5c2a136..e89cc969b3 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java @@ -34,4 +34,23 @@ public interface IndexCalConstant { String COMMUNITY_PARTY_AVG = "xiazhusuoyouwgddjnlpjz"; String COMMUNITY_RELATE = "shequxiangguan"; + + + + + // 测试插入数据用 + String customerId="b09527201c4409e19d1dbc5e3c3429a1"; + //社区S1-C1 + String SHE_QU_S1_C1="S1-C1"; + //社区S1-C2 + String SHE_QU_S1_C2="S1-C2"; + //网格S1-C1-G1 + String S1_C1_G1="S1-C1-G1"; + //网格S1-C1-G2 + String S1_C1_G2="S1-C1-G2"; + //网格S1-C2-G1 + String S1_C2_G1="S1-C2-G1"; + + String monthId="202008"; + String insertUser="yinzuomei"; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 2b88f53f42..cabca06a1a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -1,22 +1,35 @@ package com.epmet.controller; -import com.baomidou.mybatisplus.extension.api.R; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.IndexCalConstant; +import com.epmet.dao.indexcoll.FactIndexGovrnAblityGridMonthlyDao; +import com.epmet.dao.indexcoll.FactIndexPartyAblityGridMonthlyDao; +import com.epmet.dao.indexcoll.FactIndexServiceAblityGridMonthlyDao; +import com.epmet.dao.indexscore.GridScoreDao; +import com.epmet.dao.screen.ScreenCustomerGridDao; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.entity.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; +import com.epmet.entity.indexcoll.FactIndexPartyAblityGridMonthlyEntity; +import com.epmet.entity.indexcoll.FactIndexServiceAblityGridMonthlyEntity; +import com.epmet.entity.screen.ScreenCustomerGridEntity; import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.service.StatsDemoService; import com.epmet.service.indexcal.GridCorreLationService; import com.epmet.service.screen.IndexCalculateCommunityService; import com.epmet.service.stats.DimAgencyService; import lombok.extern.slf4j.Slf4j; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.List; import java.util.concurrent.ExecutionException; @@ -27,7 +40,6 @@ import java.util.concurrent.Future; @RestController @Slf4j public class DemoController { - @Autowired private StatsDemoService demoService; @@ -149,4 +161,306 @@ public class DemoController { return new Result(); } + @Autowired + private GridScoreDao gridScoreDao; + @Autowired + private FactIndexPartyAblityGridMonthlyDao factIndexPartyAblityGridMonthlyDao; + @Autowired + private FactIndexGovrnAblityGridMonthlyDao factIndexGovrnAblityGridMonthlyDao; + @Autowired + private FactIndexServiceAblityGridMonthlyDao factIndexServiceAblityGridMonthlyDao; + @Autowired + private ScreenCustomerGridDao screenCustomerGridDao; +// private static Integer testcal=100; + + @PostMapping("testcal") + public Result testCal(){ + CalculateCommonFormDTO formDTO=new CalculateCommonFormDTO("b09527201c4409e19d1dbc5e3c3429a1","202008"); +// //查询总记录数 +// List gridScoreDTOList=gridScoreDao.selectList(formDTO); +// return new Result>().ok(gridScoreDTOList); + gridCorreLationService.calculateGridCorreLation(formDTO); + return new Result(); + } + + @PostMapping("insertgridinfo") + public Result insertScreenCustomerGrid(){ + ScreenCustomerGridEntity entity1=new ScreenCustomerGridEntity(); + entity1.setCustomerId(IndexCalConstant.customerId); + entity1.setGridId(IndexCalConstant.S1_C1_G1); + entity1.setGridName("网格S1-C1-G1"); + entity1.setParentAgencyId(IndexCalConstant.SHE_QU_S1_C1); + entity1.setAllParentIds("S1,C1"); + entity1.setCreatedBy(IndexCalConstant.insertUser); + entity1.setUpdatedBy(IndexCalConstant.insertUser); + entity1.setDataEndTime("20200901"); + screenCustomerGridDao.insert(entity1); + + ScreenCustomerGridEntity entity2=new ScreenCustomerGridEntity(); + entity2.setCustomerId(IndexCalConstant.customerId); + entity2.setGridId(IndexCalConstant.S1_C1_G2); + entity2.setGridName("网格S1-C1-G2"); + entity2.setParentAgencyId(IndexCalConstant.SHE_QU_S1_C1); + entity2.setAllParentIds("S1,C1"); + entity2.setCreatedBy(IndexCalConstant.insertUser); + entity2.setUpdatedBy(IndexCalConstant.insertUser); + entity2.setDataEndTime("20200901"); + screenCustomerGridDao.insert(entity2); + + ScreenCustomerGridEntity entity3=new ScreenCustomerGridEntity(); + entity3.setCustomerId(IndexCalConstant.customerId); + entity3.setGridId(IndexCalConstant.S1_C2_G1); + entity3.setGridName("网格S1-C2-G1"); + entity3.setParentAgencyId(IndexCalConstant.SHE_QU_S1_C2); + entity3.setAllParentIds("S1,C2"); + entity3.setCreatedBy(IndexCalConstant.insertUser); + entity3.setUpdatedBy(IndexCalConstant.insertUser); + entity3.setDataEndTime("20200901"); + screenCustomerGridDao.insert(entity3); + + return new Result(); + } + @PostMapping("inserttestdata") + public Result test(){ + //网格相关-党建能力 + FactIndexPartyAblityGridMonthlyEntity entity1=this.getPartyAblityGridMonthlyEntity1(); + factIndexPartyAblityGridMonthlyDao.insert(entity1); + FactIndexPartyAblityGridMonthlyEntity entity2=this.getPartyAblityGridMonthlyEntity2(); + factIndexPartyAblityGridMonthlyDao.insert(entity2); + FactIndexPartyAblityGridMonthlyEntity entity3=this.getPartyAblityGridMonthlyEntity3(); + factIndexPartyAblityGridMonthlyDao.insert(entity3); + + //网格相关-治理能力 + FactIndexGovrnAblityGridMonthlyEntity zhiliEntity1=this.getGovrnAblityGridMonthlyEntity1(); + factIndexGovrnAblityGridMonthlyDao.insert(zhiliEntity1); + FactIndexGovrnAblityGridMonthlyEntity zhiliEntity2=this.getGovrnAblityGridMonthlyEntity2(); + factIndexGovrnAblityGridMonthlyDao.insert(zhiliEntity2); + FactIndexGovrnAblityGridMonthlyEntity zhiliEntity3=this.getGovrnAblityGridMonthlyEntity3(); + factIndexGovrnAblityGridMonthlyDao.insert(zhiliEntity3); + + //网格相关-服务能力 + FactIndexServiceAblityGridMonthlyEntity fuwuEntity1=this.getServiceAblityGridMonthlyEntity1(); + factIndexServiceAblityGridMonthlyDao.insert(fuwuEntity1); + FactIndexServiceAblityGridMonthlyEntity fuwuEntity2=this.getServiceAblityGridMonthlyEntity2(); + factIndexServiceAblityGridMonthlyDao.insert(fuwuEntity2); + FactIndexServiceAblityGridMonthlyEntity fuwuEntity3=this.getServiceAblityGridMonthlyEntity3(); + factIndexServiceAblityGridMonthlyDao.insert(fuwuEntity3); + + return new Result(); + } + + //网格相关-党建能力-网格1 + private FactIndexPartyAblityGridMonthlyEntity getPartyAblityGridMonthlyEntity1() { + FactIndexPartyAblityGridMonthlyEntity entity1=new FactIndexPartyAblityGridMonthlyEntity(); + entity1.setCustomerId(IndexCalConstant.customerId); + entity1.setAgencyId(IndexCalConstant.SHE_QU_S1_C1); + entity1.setGridId(IndexCalConstant.S1_C1_G1); + entity1.setMonthId(IndexCalConstant.monthId); + entity1.setQuarterId(DateUtils.getQuarterId(IndexCalConstant.monthId)); + entity1.setYearId(DateUtils.getYearId(IndexCalConstant.monthId)); + + entity1.setUserCount(10); // 网格群众用户数 + entity1.setPartyCount(50); // 网格党员用户数 + entity1.setActiveUserCount(100); // 网格活跃群众用户数 + entity1.setActivePartyCount(80); //网格活跃党员用户数 + entity1.setPartyAvgTopicCount(30); //网格党员人均提出话题数 + entity1.setUserAvgTopicCount(10); //网格群众人均提出话题数 + entity1.setPartyAvgShiftProjectCount(50); //网格党员人均提出的议题转项目数 + entity1.setUserAvgShiftProjectCount(50); //网格群众人均提出的议题转项目数 + entity1.setCreateGroupPartyCount(35); //建群党员数(累计值) 去重 + entity1.setPublishArticleCount(35); //网格发文数 + entity1.setIssueToProjectRatio(new BigDecimal("50")); //网格议题转项目率 + entity1.setCreateThreeMeetsCount(10); //组织三会一课次数 + entity1.setJoinThreeMeetsCount(30); //党员参加三会一课人次 + + entity1.setCreatedBy(IndexCalConstant.insertUser); + entity1.setUpdatedBy(IndexCalConstant.insertUser); + return entity1; + } + + //网格相关-党建能力-网格2 + private FactIndexPartyAblityGridMonthlyEntity getPartyAblityGridMonthlyEntity2() { + FactIndexPartyAblityGridMonthlyEntity entity2=new FactIndexPartyAblityGridMonthlyEntity(); + entity2.setCustomerId(IndexCalConstant.customerId); + entity2.setAgencyId(IndexCalConstant.SHE_QU_S1_C1); + entity2.setGridId(IndexCalConstant.S1_C1_G2); + entity2.setMonthId(IndexCalConstant.monthId); + entity2.setQuarterId(DateUtils.getQuarterId(IndexCalConstant.monthId)); + entity2.setYearId(DateUtils.getYearId(IndexCalConstant.monthId)); + + entity2.setUserCount(20); // 网格群众用户数 + entity2.setPartyCount(30); // 网格党员用户数 + entity2.setActiveUserCount(20); // 网格活跃群众用户数 + entity2.setActivePartyCount(20); //网格活跃党员用户数 + entity2.setPartyAvgTopicCount(10); //网格党员人均提出话题数 + entity2.setUserAvgTopicCount(50); //网格群众人均提出话题数 + entity2.setPartyAvgShiftProjectCount(35); //网格党员人均提出的议题转项目数 + entity2.setUserAvgShiftProjectCount(55); //网格群众人均提出的议题转项目数 + entity2.setCreateGroupPartyCount(30); //建群党员数(累计值) 去重 + entity2.setPublishArticleCount(30); //网格发文数 + entity2.setIssueToProjectRatio(new BigDecimal("30")); //网格议题转项目率 + entity2.setCreateThreeMeetsCount(25); //组织三会一课次数 + entity2.setJoinThreeMeetsCount(20); //党员参加三会一课人次 + + entity2.setCreatedBy(IndexCalConstant.insertUser); + entity2.setUpdatedBy(IndexCalConstant.insertUser); + return entity2; + } + //网格相关-党建能力-网格3 + private FactIndexPartyAblityGridMonthlyEntity getPartyAblityGridMonthlyEntity3() { + FactIndexPartyAblityGridMonthlyEntity entity3=new FactIndexPartyAblityGridMonthlyEntity(); + entity3.setCustomerId(IndexCalConstant.customerId); + entity3.setAgencyId(IndexCalConstant.SHE_QU_S1_C2); + entity3.setGridId(IndexCalConstant.S1_C2_G1); + entity3.setMonthId(IndexCalConstant.monthId); + entity3.setQuarterId(DateUtils.getQuarterId(IndexCalConstant.monthId)); + entity3.setYearId(DateUtils.getYearId(IndexCalConstant.monthId)); + + entity3.setUserCount(60); // 网格群众用户数 + entity3.setPartyCount(80); // 网格党员用户数 + entity3.setActiveUserCount(70); // 网格活跃群众用户数 + entity3.setActivePartyCount(70); //网格活跃党员用户数 + entity3.setPartyAvgTopicCount(40); //网格党员人均提出话题数 + entity3.setUserAvgTopicCount(20); //网格群众人均提出话题数 + entity3.setPartyAvgShiftProjectCount(30); //网格党员人均提出的议题转项目数 + entity3.setUserAvgShiftProjectCount(30); //网格群众人均提出的议题转项目数 + entity3.setCreateGroupPartyCount(20); //建群党员数(累计值) 去重 + entity3.setPublishArticleCount(80); //网格发文数 + entity3.setIssueToProjectRatio(new BigDecimal("80")); //网格议题转项目率 + entity3.setCreateThreeMeetsCount(100); //组织三会一课次数 + entity3.setJoinThreeMeetsCount(100); //党员参加三会一课人次 + + entity3.setCreatedBy(IndexCalConstant.insertUser); + entity3.setUpdatedBy(IndexCalConstant.insertUser); + return entity3; + } + //网格相关-治理能力-网格1 + private FactIndexGovrnAblityGridMonthlyEntity getGovrnAblityGridMonthlyEntity1() { + FactIndexGovrnAblityGridMonthlyEntity entity=new FactIndexGovrnAblityGridMonthlyEntity(); + entity.setCustomerId(IndexCalConstant.customerId); + entity.setAgencyId(IndexCalConstant.SHE_QU_S1_C1); + entity.setGridId(IndexCalConstant.S1_C1_G1); + entity.setMonthId(IndexCalConstant.monthId); + entity.setQuarterId(DateUtils.getQuarterId(IndexCalConstant.monthId)); + entity.setYearId(DateUtils.getYearId(IndexCalConstant.monthId)); + + entity.setIssueTotal(100); //网格总议题数 + entity.setAvgIssueCount(100); //网格人均议题数目 + entity.setAvgShiftProjectRatio(new BigDecimal("20")); //网格议题转项目率 + entity.setProjectTotal(20);// 网格总项目数 + entity.setSelfSolveProjectCount(10); // 网格自治项目数 统计期网格自身内办结的项目数目 + entity.setResolveProjectCount(100);//网格办结项目数 统计期内办结的项目数目 + entity.setTransferRightRatio(new BigDecimal("100"));//网格吹哨部门准确率 + entity.setSatisfactionRatio(new BigDecimal("100"));//网格内解决的项目的满意度 + + entity.setCreatedBy(IndexCalConstant.insertUser); + entity.setUpdatedBy(IndexCalConstant.insertUser); + return entity; + } + + //网格相关-治理能力-网格2 + private FactIndexGovrnAblityGridMonthlyEntity getGovrnAblityGridMonthlyEntity2() { + FactIndexGovrnAblityGridMonthlyEntity entity=new FactIndexGovrnAblityGridMonthlyEntity(); + entity.setCustomerId(IndexCalConstant.customerId); + entity.setAgencyId(IndexCalConstant.SHE_QU_S1_C1); + entity.setGridId(IndexCalConstant.S1_C1_G2); + entity.setMonthId(IndexCalConstant.monthId); + entity.setQuarterId(DateUtils.getQuarterId(IndexCalConstant.monthId)); + entity.setYearId(DateUtils.getYearId(IndexCalConstant.monthId)); + + entity.setIssueTotal(70); //网格总议题数 + entity.setAvgIssueCount(10); //网格人均议题数目 + entity.setAvgShiftProjectRatio(new BigDecimal("20")); //网格议题转项目率 + entity.setProjectTotal(40);// 网格总项目数 + entity.setSelfSolveProjectCount(15); // 网格自治项目数 统计期网格自身内办结的项目数目 + entity.setResolveProjectCount(20);//网格办结项目数 统计期内办结的项目数目 + entity.setTransferRightRatio(new BigDecimal("10"));//网格吹哨部门准确率 + entity.setSatisfactionRatio(new BigDecimal("70"));//网格内解决的项目的满意度 + + entity.setCreatedBy(IndexCalConstant.insertUser); + entity.setUpdatedBy(IndexCalConstant.insertUser); + + return entity; + } + //网格相关-治理能力-网格3 + private FactIndexGovrnAblityGridMonthlyEntity getGovrnAblityGridMonthlyEntity3() { + FactIndexGovrnAblityGridMonthlyEntity entity=new FactIndexGovrnAblityGridMonthlyEntity(); + entity.setCustomerId(IndexCalConstant.customerId); + entity.setAgencyId(IndexCalConstant.SHE_QU_S1_C2); + entity.setGridId(IndexCalConstant.S1_C2_G1); + entity.setMonthId(IndexCalConstant.monthId); + entity.setQuarterId(DateUtils.getQuarterId(IndexCalConstant.monthId)); + entity.setYearId(DateUtils.getYearId(IndexCalConstant.monthId)); + + entity.setIssueTotal(80); //网格总议题数 + entity.setAvgIssueCount(70); //网格人均议题数目 + entity.setAvgShiftProjectRatio(new BigDecimal("100")); //网格议题转项目率 + entity.setProjectTotal(100);// 网格总项目数 + entity.setSelfSolveProjectCount(20); // 网格自治项目数 统计期网格自身内办结的项目数目 + entity.setResolveProjectCount(20);//网格办结项目数 统计期内办结的项目数目 + entity.setTransferRightRatio(new BigDecimal("70"));//网格吹哨部门准确率 + entity.setSatisfactionRatio(new BigDecimal("10"));//网格内解决的项目的满意度 + + entity.setCreatedBy(IndexCalConstant.insertUser); + entity.setUpdatedBy(IndexCalConstant.insertUser); + + return entity; + } + + //网格相关-服务能力-网格1 + private FactIndexServiceAblityGridMonthlyEntity getServiceAblityGridMonthlyEntity1() { + FactIndexServiceAblityGridMonthlyEntity entity=new FactIndexServiceAblityGridMonthlyEntity(); + entity.setCustomerId(IndexCalConstant.customerId); + entity.setAgencyId(IndexCalConstant.SHE_QU_S1_C1); + entity.setGridId(IndexCalConstant.S1_C1_G1); + entity.setMonthId(IndexCalConstant.monthId); + entity.setQuarterId(DateUtils.getQuarterId(IndexCalConstant.monthId)); + entity.setYearId(DateUtils.getYearId(IndexCalConstant.monthId)); + + entity.setActivityCount(80);//网格活动组织次数 爱心活动 + entity.setVolunteerRatio(new BigDecimal("70"));//网格志愿者占比 + entity.setPartyVolunteerRatio(new BigDecimal("60"));// 网格党员志愿者率 + + entity.setCreatedBy(IndexCalConstant.insertUser); + entity.setUpdatedBy(IndexCalConstant.insertUser); + return entity; + } + + //网格相关-服务能力-网格2 + private FactIndexServiceAblityGridMonthlyEntity getServiceAblityGridMonthlyEntity2() { + FactIndexServiceAblityGridMonthlyEntity entity=new FactIndexServiceAblityGridMonthlyEntity(); + entity.setCustomerId(IndexCalConstant.customerId); + entity.setAgencyId(IndexCalConstant.SHE_QU_S1_C1); + entity.setGridId(IndexCalConstant.S1_C1_G2); + entity.setMonthId(IndexCalConstant.monthId); + entity.setQuarterId(DateUtils.getQuarterId(IndexCalConstant.monthId)); + entity.setYearId(DateUtils.getYearId(IndexCalConstant.monthId)); + + entity.setActivityCount(40);//网格活动组织次数 爱心活动 + entity.setVolunteerRatio(new BigDecimal("30"));//网格志愿者占比 + entity.setPartyVolunteerRatio(new BigDecimal("80"));// 网格党员志愿者率 + + entity.setCreatedBy(IndexCalConstant.insertUser); + entity.setUpdatedBy(IndexCalConstant.insertUser); + return entity; + } + + //网格相关-服务能力-网格3 + private FactIndexServiceAblityGridMonthlyEntity getServiceAblityGridMonthlyEntity3() { + FactIndexServiceAblityGridMonthlyEntity entity=new FactIndexServiceAblityGridMonthlyEntity(); + entity.setCustomerId(IndexCalConstant.customerId); + entity.setAgencyId(IndexCalConstant.SHE_QU_S1_C2); + entity.setGridId(IndexCalConstant.S1_C2_G1); + entity.setMonthId(IndexCalConstant.monthId); + entity.setQuarterId(DateUtils.getQuarterId(IndexCalConstant.monthId)); + entity.setYearId(DateUtils.getYearId(IndexCalConstant.monthId)); + + entity.setActivityCount(20);//网格活动组织次数 爱心活动 + entity.setVolunteerRatio(new BigDecimal("80"));//网格志愿者占比 + entity.setPartyVolunteerRatio(new BigDecimal("20"));// 网格党员志愿者率 + + entity.setCreatedBy(IndexCalConstant.insertUser); + entity.setUpdatedBy(IndexCalConstant.insertUser); + return entity; + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java index 9bb3560246..9169fbfc16 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.service.indexcal.impl; +import com.alibaba.fastjson.JSON; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; @@ -83,8 +84,9 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { logger.warn("calculateGridDangJian customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); throw new RenException("客户【网格相关:党建能力】指标权重信息不存在"); } + logger.info("=================================计算网格相关-党建能力 start==================================================================================="); calculateGridDangJian(formDTO, dangJianNengLiList); - + logger.info("=================================计算网格相关-党建能力 end==================================================================================="); //2、计算网格相关-治理能力 List zhiLiNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), @@ -93,8 +95,9 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { logger.warn("calculateGridZhiLi customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); throw new RenException("客户【网格相关:治理能力】指标权重信息不存在"); } + logger.info("=================================计算网格相关-治理能力 start==================================================================================="); calculateGridZhiLi(formDTO, zhiLiNengLiList); - + logger.info("=================================计算网格相关-治理能力 end==================================================================================="); //3、计算网格相关-服务能力 List fuWuNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), @@ -103,8 +106,9 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { logger.warn("calculateGridFuWu customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); throw new RenException("客户【网格相关:服务能力】指标权重信息不存在"); } + logger.info("=================================计算网格相关-服务能力 start==================================================================================="); calculateGridFuWu(formDTO, fuWuNengLiList); - + logger.info("=================================计算网格相关-服务能力 end==================================================================================="); //4、计算网格相关总分 List wgxgList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); @@ -172,7 +176,6 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { }else if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { //对应的数值 String sampleValueStr = String.valueOf(recordMap.get(indexCodeFieldReService.getFieldNameByIndexCode(key))); - logger.info("===================="+sampleValueStr); //构造样本值对象 SampleValue currentGridIndexValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), new BigDecimal(sampleValueStr)); value.getIndexValueVOs().add(currentGridIndexValue); @@ -195,7 +198,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { **/ private Map getContactMassesAblityMap(CalculateCommonFormDTO calculateCommonFormDTO) { Map map = new HashMap<>(); - List list = cpcScoreDao.selectListGridContactMassesAvgValue(calculateCommonFormDTO); + //TODO + /*List list = cpcScoreDao.selectListGridContactMassesAvgValue(calculateCommonFormDTO); if (!CollectionUtils.isEmpty(list)) { BigDecimal minValue = Collections.min(list); BigDecimal maxValue = Collections.max(list); @@ -204,7 +208,9 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { return map; } map.put(StrConstant.MIN, new BigDecimal(NumConstant.ZERO_STR)); - map.put(StrConstant.MAX, new BigDecimal(NumConstant.ZERO_STR)); + map.put(StrConstant.MAX, new BigDecimal(NumConstant.ZERO_STR));*/ + map.put(StrConstant.MIN, new BigDecimal("24.35")); + map.put(StrConstant.MAX, new BigDecimal("46.13")); return map; } @@ -217,9 +223,18 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { * @Date 2020/8/31 9:50 **/ private BigDecimal getGridContactMassesAvgValue(CalculateCommonFormDTO calculateCommonFormDTO, String gridId) { - BigDecimal result = cpcScoreDao.selectGridContactMassesAvgValue(calculateCommonFormDTO.getCustomerId(), calculateCommonFormDTO.getMonthId(), gridId); + //TODO + /*BigDecimal result = cpcScoreDao.selectGridContactMassesAvgValue(calculateCommonFormDTO.getCustomerId(), calculateCommonFormDTO.getMonthId(), gridId); if (null == result) { return new BigDecimal(NumConstant.ZERO_STR); + }*/ + BigDecimal result=null; + if(IndexCalConstant.S1_C1_G1.equals(gridId)){ + result= new BigDecimal("24.43"); + }else if(IndexCalConstant.S1_C1_G2.equals(gridId)){ + result=new BigDecimal("46.13"); + }else if(IndexCalConstant.S1_C2_G1.equals(gridId)){ + result=new BigDecimal("24.35"); } return result; } @@ -233,9 +248,18 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { * @Date 2020/8/31 15:51 **/ private BigDecimal getGridJoinIssueAvgValue(CalculateCommonFormDTO formDTO, String gridId) { - BigDecimal result = cpcScoreDao.selectGridJoinIssueAvgValue(formDTO.getCustomerId(), formDTO.getMonthId(), gridId); + // TODO + /*BigDecimal result = cpcScoreDao.selectGridJoinIssueAvgValue(formDTO.getCustomerId(), formDTO.getMonthId(), gridId); if (null == result) { return new BigDecimal(NumConstant.ZERO_STR); + }*/ + BigDecimal result=null; + if(IndexCalConstant.S1_C1_G1.equals(gridId)){ + result= new BigDecimal("29.40"); + }else if(IndexCalConstant.S1_C1_G2.equals(gridId)){ + result=new BigDecimal("18.30"); + }else if(IndexCalConstant.S1_C2_G1.equals(gridId)){ + result=new BigDecimal("9.15"); } return result; } @@ -249,7 +273,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { **/ private Map getJoinIssueAblityMap(CalculateCommonFormDTO calculateCommonFormDTO) { Map map = new HashMap<>(); - List list = cpcScoreDao.selectListJoinIssueAvgValue(calculateCommonFormDTO); + //TODO + /* List list = cpcScoreDao.selectListJoinIssueAvgValue(calculateCommonFormDTO); if (!CollectionUtils.isEmpty(list)) { BigDecimal minValue = Collections.min(list); BigDecimal maxValue = Collections.max(list); @@ -258,7 +283,9 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { return map; } map.put(StrConstant.MIN, new BigDecimal(NumConstant.ZERO_STR)); - map.put(StrConstant.MAX, new BigDecimal(NumConstant.ZERO_STR)); + map.put(StrConstant.MAX, new BigDecimal(NumConstant.ZERO_STR));*/ + map.put(StrConstant.MIN, new BigDecimal("9.15")); + map.put(StrConstant.MAX, new BigDecimal("29.4")); return map; } @@ -319,10 +346,15 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { private HashMap calculate(Map> indexMap) { //构造入参 List indexInputVOS = this.getIndexInputVOList(indexMap); - logger.info("计算的参数:{}", indexInputVOS); +// logger.info("计算的参数:{}", indexInputVOS); + logger.info("..........计算的参数(List)"+JSON.toJSONString(indexInputVOS)); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + + List listTemp=batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); + logger.info("..........计算的结果(List)"+JSON.toJSONString(listTemp)); + HashMap resultMap = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - logger.info("计算的结果:{}", resultMap); + logger.info("计算的结果(HashMap):{}", resultMap); return resultMap; } @@ -399,7 +431,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { // indexInputVO.setIndexValueVOs(sampleValueList); IndexInputVO indexInputVO1 = new IndexInputVO(index.getIndexCode(), sampleValueList, - index.getThreshold(), +// index.getThreshold(), TODO + new BigDecimal("-1"), index.getWeight(), scoreCalculator); map.put(index.getIndexCode(), indexInputVO1); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java index 1eecc8cf36..43688efa21 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java @@ -7,7 +7,7 @@ import java.math.BigDecimal; */ public class ScoreConstants { - public static final BigDecimal MIN_SCORE = new BigDecimal(0); + public static final BigDecimal MIN_SCORE = new BigDecimal(1); public static final BigDecimal MAX_SCORE = new BigDecimal(100); } From ff3eaf8b0c8ce945ddf5f5e5dde433de9e073412 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 1 Sep 2020 16:34:30 +0800 Subject: [PATCH 134/226] =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E4=BC=98=E5=8C=96=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IndexCalculateCommunityService.java | 31 +------ .../IndexCalculateCommunityServiceImpl.java | 93 +++++++++++-------- 2 files changed, 56 insertions(+), 68 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateCommunityService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateCommunityService.java index 5a6f1bbaa9..b0803ae2be 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateCommunityService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateCommunityService.java @@ -12,38 +12,11 @@ import java.util.List; public interface IndexCalculateCommunityService { /** - * @Description 社区党建能力 - * @param customerId - * @param monthId - * @author zxc - * @date 2020/8/26 10:46 上午 - */ - void communityPartyCalculate(String customerId, String monthId); - - /** - * @Description 社区治理能力 - * @param customerId - * @param monthId - * @author zxc - * @date 2020/8/26 1:40 下午 - */ - void communityGovernAbilityCalculate(String customerId, String monthId); - - /** - * @Description 社区服务能力 - * @param customerId - * @param monthId - * @author zxc - * @date 2020/8/31 1:38 下午 - */ - void communityServiceAbilityCalculate(String customerId, String monthId); - - /** - * @Description 计算社区相关 + * @Description 计算社区相关总分 * @param customerId * @param monthId * @author zxc * @date 2020/9/1 4:12 下午 */ - void calAll(String customerId, String monthId); + Boolean calCommunityAll(String customerId, String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java index 4ff69ef236..bb7962faf6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java @@ -2,6 +2,7 @@ package com.epmet.service.screen.impl; import com.alibaba.druid.util.StringUtils; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.IndexCalConstant; import com.epmet.dao.indexcoll.FactIndexGovrnAblityOrgMonthlyDao; @@ -60,8 +61,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni * @date 2020/8/26 10:46 上午 */ @Transactional(rollbackFor = Exception.class) - @Override - public void communityPartyCalculate(String customerId, String monthId) { + public Boolean communityPartyCalculate(String customerId, String monthId) { // 党建能力 // 根据all_parent_index_code 获取指标明细 @@ -100,18 +100,12 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni } } }); - + // 社区名义发文数量 List publishArticleCounts = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCount(customerId, monthId); detailListByParentCode.forEach(indexGroup -> { if (indexGroup.getIndexCode().equals("shequmingyifwsl")) { if (publishArticleCounts.size() == NumConstant.ONE) { - //TODO 计算之后的分数 - FactIndexCommunityScoreDTO dto = new FactIndexCommunityScoreDTO(); - BeanUtils.copyProperties(detailListByParentCode.get(NumConstant.ZERO), dto); - dto.setScore(BigDecimal.valueOf(50.00)); - dto.setIndexCode(detailListByParentCode.get(NumConstant.ZERO).getIndexCode()); - communityPublishArticle.add(dto); - factIndexCommunityScoreDao.insertCommunityPartyRecord(communityPublishArticle); + //TODO 结果为一条时 } else if (publishArticleCounts.size() > NumConstant.ONE) { Integer indexStart = NumConstant.ZERO; Integer indexEnd = NumConstant.TEN; @@ -149,8 +143,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni } }); }); - factIndexCommunityScoreDao.deleteOldRecord(customerId,monthId,IndexCalConstant.COMMUNITY_PARTY); - factIndexCommunityScoreDao.insertCommunityPartyRecord(subAllGridList); + deleteAndInsert(customerId,monthId,IndexCalConstant.COMMUNITY_PARTY,subAllGridList); + return true; } /** @@ -161,8 +155,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni * @date 2020/8/26 1:40 下午 */ @Transactional(rollbackFor = Exception.class) - @Override - public void communityGovernAbilityCalculate(String customerId, String monthId) { + public Boolean communityGovernAbilityCalculate(String customerId, String monthId) { List subAllGridList = new ArrayList<>(); List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); detailListByParentCode.forEach(detail -> { @@ -243,9 +236,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni }); }); } - factIndexCommunityScoreDao.deleteOldRecord(customerId,monthId,IndexCalConstant.COMMUNITY_GOVERN); - factIndexCommunityScoreDao.insertCommunityPartyRecord(subAllGridList); - + deleteAndInsert(customerId,monthId,IndexCalConstant.COMMUNITY_GOVERN,subAllGridList); + return true; } /** @@ -256,23 +248,16 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni * @date 2020/8/31 1:38 下午 */ @Transactional(rollbackFor = Exception.class) - @Override - public void communityServiceAbilityCalculate(String customerId, String monthId) { - - + public Boolean communityServiceAbilityCalculate(String customerId, String monthId) { List subAllGridList = new ArrayList<>(); List communityPublishArticle = new ArrayList<>(); - - List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (indexCode.equals(IndexCalConstant.COMMUNITY_SERVICE_AVG)){ List subGridServiceAvg = factIndexGridScoreDao.selectSubGridServiceAvgScore(customerId, monthId); if (subGridServiceAvg.size() == NumConstant.ONE){ - // TODO 只有一条记录时 - }else if (subGridServiceAvg.size() > NumConstant.ONE ){ MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); Integer indexStart = NumConstant.ZERO; @@ -306,9 +291,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni }else{ List communityActivityCount = factIndexServiceAblityOrgMonthlyDao.selectActivityCount(customerId, monthId); if (communityActivityCount.size() == NumConstant.ONE){ - // TODO - }else if (communityActivityCount.size() > NumConstant.ONE){ Integer indexStart = NumConstant.ZERO; Integer indexEnd = NumConstant.TEN; @@ -346,9 +329,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni } }); }); - factIndexCommunityScoreDao.deleteOldRecord(customerId,monthId,IndexCalConstant.COMMUNITY_SERVICE); - factIndexCommunityScoreDao.insertCommunityPartyRecord(subAllGridList); - + deleteAndInsert(customerId,monthId,IndexCalConstant.COMMUNITY_SERVICE,subAllGridList); + return true; } /** @@ -358,7 +340,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni * @author zxc * @date 2020/9/1 9:21 上午 */ - public void communityRelate(String customerId, String monthId) { + public Boolean communityRelate(String customerId, String monthId) { List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); List factIndexCommunityScoreEntities = factIndexCommunityScoreDao.selectCommunityInfo(customerId, monthId); detailListByParentCode.forEach(detail -> { @@ -384,16 +366,35 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni }); result.add(score); }); - factIndexCommunityScoreDao.deleteOldRecord(customerId,monthId,IndexCalConstant.COMMUNITY_RELATE); - factIndexCommunityScoreDao.insertCommunityPartyRecord(result); + deleteAndInsert(customerId,monthId,IndexCalConstant.COMMUNITY_RELATE,result); + return true; } - public void calAll(String customerId,String monthId){ - this.communityPartyCalculate(customerId, monthId); //党建能力 - this.communityGovernAbilityCalculate(customerId, monthId); // 治理能力 - this.communityServiceAbilityCalculate(customerId, monthId); // 服务能力 - - communityRelate(customerId, monthId); + /** + * @Description 计算社区相关总分 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/1 4:12 下午 + */ + public Boolean calCommunityAll(String customerId,String monthId){ + Boolean aBoolean = communityPartyCalculate(customerId, monthId);//党建能力 + if (!aBoolean.equals(true)){ + throw new RenException("calculate community-party-ability failure ......"); + } + Boolean bBoolean = communityGovernAbilityCalculate(customerId, monthId);// 治理能力 + if (!bBoolean.equals(true)){ + throw new RenException("calculate community-govern-ability failure ......"); + } + Boolean cBoolean = communityServiceAbilityCalculate(customerId, monthId);// 服务能力 + if (!cBoolean.equals(true)){ + throw new RenException("calculate community-service-ability failure ......"); + } + Boolean dBoolean = communityRelate(customerId, monthId); + if (!dBoolean.equals(true)){ + throw new RenException("calculate community-all insert failure ......"); + } + return true; } /** @@ -418,4 +419,18 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); return batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); } + + /** + * @Description 先删除记录,在插入 + * @param customerId + * @param monthId + * @param indexCode + * @param subAllGridList + * @author zxc + * @date 2020/9/1 4:24 下午 + */ + public void deleteAndInsert(String customerId,String monthId,String indexCode,List subAllGridList){ + factIndexCommunityScoreDao.deleteOldRecord(customerId,monthId,indexCode); + factIndexCommunityScoreDao.insertCommunityPartyRecord(subAllGridList); + } } From ec598da9e36e329c86cad41a0b7f4430603b9edd Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 1 Sep 2020 16:53:40 +0800 Subject: [PATCH 135/226] =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E4=BC=98=E5=8C=96=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/DemoController.java | 15 +------ .../FactIndexPartyAblityOrgMonthlyDao.java | 10 +++++ .../IndexCalculateCommunityServiceImpl.java | 45 ++++++++++++++++--- .../impl/IndexCalculateServiceImpl.java | 2 +- .../FactIndexPartyAblityOrgMonthlyDao.xml | 19 ++++++++ 5 files changed, 71 insertions(+), 20 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index da152b8ae3..37f3480b63 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -129,22 +129,9 @@ public class DemoController { return new Result().ok(list); } - @PostMapping("zxc") - public Result getZxc(){ -// indexCalculateCommunityService.communityPublishArticleCountCalculate("b09527201c4409e19d1dbc5e3c3429a1","202008"); - indexCalculateCommunityService.communityGovernAbilityCalculate("b09527201c4409e19d1dbc5e3c3429a1","202008"); - return new Result(); - } - - @PostMapping("zxc1") - public Result getZxc1(){ - indexCalculateCommunityService.communityPartyCalculate("b09527201c4409e19d1dbc5e3c3429a1","202008"); - return new Result(); - } - @PostMapping("zxc2") public Result getZxc2(){ - indexCalculateCommunityService.calAll("b09527201c4409e19d1dbc5e3c3429a1","202008"); + indexCalculateCommunityService.calCommunityAll("b09527201c4409e19d1dbc5e3c3429a1","202008"); return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java index 144ecd1d0a..ef7cc36de8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java @@ -25,6 +25,7 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 党建能力-街道及社区相关事实表 @@ -72,4 +73,13 @@ public interface FactIndexPartyAblityOrgMonthlyDao extends BaseDao selectPublishArticleCount(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * @Description 查询社区下的发文数 Map + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/26 10:49 上午 + */ + List> selectPublishArticleCountMap(@Param("customerId")String customerId, @Param("monthId")String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java index bb7962faf6..072c6c6e36 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java @@ -62,7 +62,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni */ @Transactional(rollbackFor = Exception.class) public Boolean communityPartyCalculate(String customerId, String monthId) { - // 党建能力 // 根据all_parent_index_code 获取指标明细 List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(),IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); @@ -98,10 +97,48 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni indexStart++; }while (collect.size() == NumConstant.TEN); } + }else { + List indexInputVOS = new ArrayList<>(); + List> maps = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId); + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(indexGroup.getIndexCode()); + if (!StringUtils.isEmpty(fieldNameByIndexCode)) { + if (maps.get(NumConstant.ZERO).containsKey(fieldNameByIndexCode)) { + List decimalList = maps.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + Integer indexStart = NumConstant.ZERO; + Integer indexEnd = NumConstant.TEN; + List> collect; + do { + collect = maps.stream().skip(indexEnd * indexStart).limit(indexEnd).collect(Collectors.toList()); + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + List index1SampleValues = new ArrayList<>(); + collect.forEach(c -> { + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); + FactIndexCommunityScoreDTO publishArticle = new FactIndexCommunityScoreDTO(); + BeanUtils.copyProperties(c,publishArticle); + communityPublishArticle.add(publishArticle); + }); + IndexInputVO index1VO = new IndexInputVO(indexGroup.getIndexId(), index1SampleValues, indexGroup.getThreshold(), indexGroup.getWeight(), sc1); + indexInputVOS.add(index1VO); + } while (collect.size() == NumConstant.TEN); + } + } + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + scoreCountOfSampleId.forEach((key,value) -> { + communityPublishArticle.forEach(grid -> { + if (key.equals(grid.getAgencyId())) { + grid.setCustomerId(customerId); + grid.setIndexCode(IndexCalConstant.COMMUNITY_GOVERN); + grid.setScore(grid.getScore().add(value)); + } + }); + }); } }); // 社区名义发文数量 - List publishArticleCounts = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCount(customerId, monthId); + /*List publishArticleCounts = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCount(customerId, monthId); detailListByParentCode.forEach(indexGroup -> { if (indexGroup.getIndexCode().equals("shequmingyifwsl")) { if (publishArticleCounts.size() == NumConstant.ONE) { @@ -134,7 +171,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni } while (collect.size() == NumConstant.TEN); } } - }); + });*/ subAllGridList.forEach(grid -> { communityPublishArticle.forEach(publish -> { if (grid.getAgencyId().equals(publish.getAgencyId())){ @@ -196,9 +233,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(customerId, monthId); if (communityGovernAbility.size() == NumConstant.ONE){ - // TODO - }else if (communityGovernAbility.size() > NumConstant.ONE){ List indexInputVOS = new ArrayList<>(); detailListByParentCode.forEach(detail -> { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java index 7283af07c3..dde54c76f2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java @@ -75,7 +75,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { } //计算社区 try { - indexCalculateCommunityService.calAll(customerId, formDTO.getMonthId()); + indexCalculateCommunityService.calCommunityAll(customerId, formDTO.getMonthId()); log.info("indexCalculate calAll return result:{}", flag); } catch (Exception e) { log.error("indexCalculate calAll exception", e); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml index 4e6bd0cd6c..50df452642 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml @@ -90,4 +90,23 @@ AND month_id = #{monthId} + + + From f5990b0c6bbbb2aa5527d7e890e6ead277dc4de0 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 1 Sep 2020 21:55:16 +0800 Subject: [PATCH 136/226] =?UTF-8?q?1=E5=A4=9A=E9=9F=B3=E5=AD=97=E5=A4=84?= =?UTF-8?q?=E7=90=86=EF=BC=9B2=EF=BC=9A=E6=8C=87=E6=A0=87=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E5=88=86=E7=BB=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/IndexCalculateController.java | 36 +++++++++++-------- .../epmet/model/IndexExcelDataListener.java | 25 +++++++------ .../impl/IndexCalculateServiceImpl.java | 12 ++++--- .../java/com/epmet/util/Pinyin4jUtil.java | 2 ++ 4 files changed, 44 insertions(+), 31 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java index 9dab47c148..de9f746130 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java @@ -1,6 +1,5 @@ package com.epmet.controller; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.screen.form.IndexCalculateForm; @@ -23,33 +22,40 @@ import org.springframework.web.bind.annotation.RestController; public class IndexCalculateController { @Autowired - private IndexCalculateService indexCalculateService; - + private IndexCalculateService indexCalculateService; + @Autowired private CpcIndexCalculateService cpcIndexCalculateService; /** - * 1、按照客户计算指标(按照月份) + * 按照客户计算所有指标(按照月份) * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-20 **/ - @PostMapping("cpc") - public Result cpcIndexCalculate(ExternalAppRequestParam externalAppRequestParam, @RequestBody IndexCalculateForm formDTO) { - indexCalculateService.indexCalculate(formDTO); - return new Result(); + @PostMapping("all") + public Result indexCalculate(@RequestBody IndexCalculateForm formDTO) { + Boolean aBoolean = indexCalculateService.indexCalculate(formDTO); + if (aBoolean){ + return new Result().ok(true); + } + return new Result().error("指标计算失败"); } - @PostMapping("getMax") - public Result getMax(){ - CalculateCommonFormDTO calculateCommonFormDTO = new CalculateCommonFormDTO("b09527201c4409e19d1dbc5e3c3429a1","202008"); - cpcIndexCalculateService.cpcIndexCalculate(calculateCommonFormDTO); - return new Result(); + + /** + * desc:计算党员指标分数 + * + * @return + */ + @PostMapping("cpc") + public Result cpc(CalculateCommonFormDTO formDTO) { + + return new Result().ok(cpcIndexCalculateService.cpcIndexCalculate(formDTO)); } - /* *//** + /* *//** * 2、党建能力-网格相关指标上报(按照月份) * * @param externalAppRequestParam 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 9267d562a8..9c41161089 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 @@ -130,7 +130,8 @@ public class IndexExcelDataListener extends AnalysisEventListener { String level4Index = index.getLevel4Index(); indexDictEntity = indexDicMap.get(level4Index); - IndexGroupTemplateEntity group2 = indexGroupMap.get(index.getLevel1Index() + level4Index); + String level4IndexDetailKey = index.getLevel1Index() + index.getLevel2Index() + level4Index; + IndexGroupTemplateEntity group2 = indexGroupMap.get(level4IndexDetailKey); IndexGroupDetailTemplateEntity templateEntity = null; if (group2 == null) { group2 = new IndexGroupTemplateEntity(); @@ -138,7 +139,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { group2.setParentIndexGroupId(group1.getId()); group2.setId(UniqueIdGenerator.generate()); group2.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(), false, 4)); - indexGroupMap.put(index.getLevel1Index() + level4Index, group2); + indexGroupMap.put(level4IndexDetailKey, group2); //构建 分组明细 templateEntity = indexGroupDetailMap.get(index.getLevel1Index() + level4Index); if (templateEntity == null) { @@ -154,9 +155,10 @@ public class IndexExcelDataListener extends AnalysisEventListener { } indexDictEntity = indexDicMap.get(index.getLevel5Index()); + String level5IndexDetailKey = index.getLevel1Index() + index.getLevel2Index() + index.getLevel5Index(); allIndexCodeSb.append(StrConstant.COLON); allIndexCodeSb.append(group2.getIndexCode()); - templateEntity = indexGroupDetailMap.get(index.getLevel1Index() + index.getLevel5Index()); + templateEntity = indexGroupDetailMap.get(level5IndexDetailKey); if (templateEntity == null) { templateEntity = new IndexGroupDetailTemplateEntity(); templateEntity.setIndexGroupId(group2.getId()); @@ -165,7 +167,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { templateEntity.setId(UniqueIdGenerator.generate()); templateEntity.setCorrelation(index.getCorrelation()); buildIndexGroupDetail(templateEntity, indexDictEntity, index, 5); - indexGroupDetailMap.put(index.getLevel1Index() + index.getLevel5Index(), templateEntity); + indexGroupDetailMap.put(level5IndexDetailKey, templateEntity); } } else { //todo 测试完去掉 @@ -183,8 +185,8 @@ public class IndexExcelDataListener extends AnalysisEventListener { StringBuilder allIndexCodeSb = new StringBuilder(group1.getIndexCode()); String level2Index = index.getLevel2Index(); indexDictEntity = indexDicMap.get(level2Index); - String groupMapKey = index.getLevel1Index() + level2Index; - IndexGroupTemplateEntity group2 = indexGroupMap.get(groupMapKey); + String level2IndexGroupKey = index.getLevel1Index() + level2Index; + IndexGroupTemplateEntity group2 = indexGroupMap.get(level2IndexGroupKey); IndexGroupDetailTemplateEntity templateEntity = null; if (group2 == null) { group2 = new IndexGroupTemplateEntity(); @@ -193,9 +195,9 @@ public class IndexExcelDataListener extends AnalysisEventListener { group2.setId(UniqueIdGenerator.generate()); group2.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(), false, 4)); - indexGroupMap.put(groupMapKey, group2); + indexGroupMap.put(level2IndexGroupKey, group2); //构建 分组明细 - templateEntity = indexGroupDetailMap.get(level2Index); + templateEntity = indexGroupDetailMap.get(level2IndexGroupKey); if (templateEntity == null) { templateEntity = new IndexGroupDetailTemplateEntity(); templateEntity.setIndexGroupId(group2.getId()); @@ -204,13 +206,14 @@ public class IndexExcelDataListener extends AnalysisEventListener { templateEntity.setId(UniqueIdGenerator.generate()); templateEntity.setCorrelation(index.getCorrelation()); buildIndexGroupDetail(templateEntity, indexDictEntity, index, 2); - indexGroupDetailMap.put(groupMapKey, templateEntity); + indexGroupDetailMap.put(level2IndexGroupKey, templateEntity); } } indexDictEntity = indexDicMap.get(index.getLevel5Index()); allIndexCodeSb.append(StrConstant.COLON); allIndexCodeSb.append(group2.getIndexCode()); - templateEntity = indexGroupDetailMap.get(index.getLevel1Index() + index.getLevel5Index()); + String level5IndexGroupKey = index.getLevel1Index() + index.getLevel2Index() + index.getLevel5Index(); + templateEntity = indexGroupDetailMap.get(level5IndexGroupKey); if (templateEntity == null) { templateEntity = new IndexGroupDetailTemplateEntity(); templateEntity.setIndexGroupId(group2.getId()); @@ -219,7 +222,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { templateEntity.setId(UniqueIdGenerator.generate()); templateEntity.setCorrelation(index.getCorrelation()); buildIndexGroupDetail(templateEntity, indexDictEntity, index, 5); - indexGroupDetailMap.put(index.getLevel1Index() + index.getLevel5Index(), templateEntity); + indexGroupDetailMap.put(level5IndexGroupKey, templateEntity); } } //} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java index dde54c76f2..a7100121f7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java @@ -54,16 +54,17 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { } formDTO.setCustomerIds(externalCustomerIdsResult.getData()); } - formDTO.getCustomerIds().forEach(customerId -> { + Boolean flag = false; + for (String customerId : formDTO.getCustomerIds()) { CalculateCommonFormDTO calculateCommonFormDTO = new CalculateCommonFormDTO(customerId, formDTO.getMonthId()); //计算党员相关的 - Boolean flag = false; try { CalculateCommonFormDTO param = new CalculateCommonFormDTO(customerId, formDTO.getMonthId()); flag = cpcIndexCalculateService.cpcIndexCalculate(param); log.info("indexCalculate cpcIndexCalculate return result:{}", flag); } catch (Exception e) { log.error("indexCalculate cpcIndexCalculate exception", e); + break; } //计算网格 @@ -72,6 +73,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { log.info("indexCalculate calculateGridCorreLation return result:{}", flag); } catch (Exception e) { log.error("indexCalculate calculateGridCorreLation exception", e); + break; } //计算社区 try { @@ -79,10 +81,10 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { log.info("indexCalculate calAll return result:{}", flag); } catch (Exception e) { log.error("indexCalculate calAll exception", e); + break; } - }); - indexCodeFieldReRedis.deleteIndexCodeFromRedis(); - return true; + } + return flag; } catch (Exception e) { log.error("indexCalculate exception,param:{}", JSON.toJSONString(formDTO)); } finally { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java index bedaf09f1b..727de4bbeb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java @@ -27,6 +27,8 @@ public class Pinyin4jUtil { duoyinMap.put('提',new String[]{"ti"}); duoyinMap.put('被',new String[]{"bei"}); duoyinMap.put('期',new String[]{"qi"}); + duoyinMap.put('参',new String[]{"can"}); + duoyinMap.put('均',new String[]{"jun"}); } /** From 10c0794eec84287f29b61938efb7f4a8e959fa3e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 2 Sep 2020 09:59:33 +0800 Subject: [PATCH 137/226] avgShiftProjectRatio=>issueToProjectRatio --- .../indexcollect/form/GridGovrnAbilityFormDTO.java | 2 +- .../java/com/epmet/controller/DemoController.java | 6 +++--- .../FactIndexGovrnAblityGridMonthlyEntity.java | 2 +- .../src/main/java/com/epmet/eum/IndexCodeEnum.java | 2 +- .../indexcal/impl/GridCorreLationServiceImpl.java | 4 +++- .../indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml | 12 ++++++------ 6 files changed, 15 insertions(+), 13 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityFormDTO.java index ef4efd6a24..021533fe59 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityFormDTO.java @@ -73,7 +73,7 @@ public class GridGovrnAbilityFormDTO implements Serializable { /** * 网格议题转项目率 */ - private BigDecimal avgShiftProjectRatio; + private BigDecimal issueToProjectRatio; /** * 网格自治项目数 统计期网格自身内办结的项目数目 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 37f3480b63..08034ab72a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -327,7 +327,7 @@ public class DemoController { entity.setIssueTotal(100); //网格总议题数 entity.setAvgIssueCount(100); //网格人均议题数目 - entity.setAvgShiftProjectRatio(new BigDecimal("20")); //网格议题转项目率 + entity.setIssueToProjectRatio(new BigDecimal("20")); //网格议题转项目率 entity.setProjectTotal(20);// 网格总项目数 entity.setSelfSolveProjectCount(10); // 网格自治项目数 统计期网格自身内办结的项目数目 entity.setResolveProjectCount(100);//网格办结项目数 统计期内办结的项目数目 @@ -351,7 +351,7 @@ public class DemoController { entity.setIssueTotal(70); //网格总议题数 entity.setAvgIssueCount(10); //网格人均议题数目 - entity.setAvgShiftProjectRatio(new BigDecimal("20")); //网格议题转项目率 + entity.setIssueToProjectRatio(new BigDecimal("20")); //网格议题转项目率 entity.setProjectTotal(40);// 网格总项目数 entity.setSelfSolveProjectCount(15); // 网格自治项目数 统计期网格自身内办结的项目数目 entity.setResolveProjectCount(20);//网格办结项目数 统计期内办结的项目数目 @@ -375,7 +375,7 @@ public class DemoController { entity.setIssueTotal(80); //网格总议题数 entity.setAvgIssueCount(70); //网格人均议题数目 - entity.setAvgShiftProjectRatio(new BigDecimal("100")); //网格议题转项目率 + entity.setIssueToProjectRatio(new BigDecimal("100")); //网格议题转项目率 entity.setProjectTotal(100);// 网格总项目数 entity.setSelfSolveProjectCount(20); // 网格自治项目数 统计期网格自身内办结的项目数目 entity.setResolveProjectCount(20);//网格办结项目数 统计期内办结的项目数目 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.java index c1c6553ef5..46e4472664 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.java @@ -82,7 +82,7 @@ public class FactIndexGovrnAblityGridMonthlyEntity extends BaseEpmetEntity { /** * 网格议题转项目率 */ - private BigDecimal avgShiftProjectRatio; + private BigDecimal issueToProjectRatio; /** * 网格总项目数 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java index 620175e5c5..9697e84fcf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java @@ -24,7 +24,7 @@ public enum IndexCodeEnum { DANG_WU_HUO_DONG("dangwuhuodong", "党务活动", 4), LIAN_XI_QUN_ZHONG("lianxiqunzhong", "联系群众", 4), ZUZHINEIDANGYDLXQZNLKPFPJZ("zuzhineidangydlxqznlkpfpjz","组织内党员的联系群众能力考评分(平均值)",5), - ZUZHINEIDANGYDSYYSNLKPFPJZ("zuzhineidangydsyysnlkpfpjz","组织内党员的参与议事能力考评分(平均值)",5), + ZUZHINEIDANGYDSYYSNLKPFPJZ("zuzhineidangydcyysnlkpfpjz","组织内党员的参与议事能力考评分(平均值)",5), ; private String code; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java index 9169fbfc16..f84b32d66e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java @@ -410,8 +410,10 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //获取指标对应的列名 String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(index.getIndexCode()); if (StringUtils.isBlank(fieldName)) { - logger.error("index_code:{} ",index.getIndexCode(),"not find field_name"); + logger.error("index_code1:{} not find field_name",index.getIndexCode()); continue; + }else{ + logger.info("index_code2:{} ,field_name:{}",index.getIndexCode(),fieldName); } // logger.info("index_code:{} ",index.getIndexCode(),"field_id :{} ",fieldName); String minValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MIN); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml index 11c10755fa..52d6ad6c20 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml @@ -13,7 +13,7 @@ - + @@ -45,7 +45,7 @@ YEAR_ID, ISSUE_TOTAL, AVG_ISSUE_COUNT, - AVG_SHIFT_PROJECT_RATIO, + ISSUE_TO_PROJECT_RATIO, PROJECT_TOTAL, SELF_SOLVE_PROJECT_COUNT, RESOLVE_PROJECT_COUNT, @@ -69,7 +69,7 @@ #{item.yearId}, #{item.issueTotal}, #{item.avgIssueCount}, - #{item.avgShiftProjectRatio}, + #{item.issueToProjectRatio}, #{item.projectTotal}, #{item.selfSolveProjectCount}, #{item.resolveProjectCount}, @@ -93,7 +93,7 @@ m.MONTH_ID, m.ISSUE_TOTAL, m.AVG_ISSUE_COUNT, - m.AVG_SHIFT_PROJECT_RATIO, + m.ISSUE_TO_PROJECT_RATIO, m.PROJECT_TOTAL, m.SELF_SOLVE_PROJECT_COUNT, m.RESOLVE_PROJECT_COUNT, @@ -119,8 +119,8 @@ MAX(m.ISSUE_TOTAL) AS ISSUE_TOTAL_MAX, MIN(m.AVG_ISSUE_COUNT) AS AVG_ISSUE_COUNT_MIN, MAX(m.AVG_ISSUE_COUNT) AS AVG_ISSUE_COUNT_MAX, - MIN(m.AVG_SHIFT_PROJECT_RATIO) AS AVG_SHIFT_PROJECT_RATIO_MIN, - MAX(m.AVG_SHIFT_PROJECT_RATIO) AS AVG_SHIFT_PROJECT_RATIO_MAX, + MIN(m.ISSUE_TO_PROJECT_RATIO) AS ISSUE_TO_PROJECT_RATIO_MIN, + MAX(m.ISSUE_TO_PROJECT_RATIO) AS ISSUE_TO_PROJECT_RATIO_MAX, MIN(m.PROJECT_TOTAL) AS PROJECT_TOTAL_MIN, MAX(m.PROJECT_TOTAL) AS PROJECT_TOTAL_MAX, MIN(m.SELF_SOLVE_PROJECT_COUNT) AS SELF_SOLVE_PROJECT_COUNT_MIN, From c64fc58d60b73edf8e170316318b1a24ece81984 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 2 Sep 2020 10:42:15 +0800 Subject: [PATCH 138/226] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FactIndexPartyAblityCpcMonthlyEntity.java | 2 +- .../impl/GridCorreLationServiceImpl.java | 100 ++++++------------ 2 files changed, 35 insertions(+), 67 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java index 689c396b2a..e78dc23b0a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java @@ -50,7 +50,7 @@ public class FactIndexPartyAblityCpcMonthlyEntity extends BaseEpmetEntity { private String agencyId; /** - * 上级组织Id + * agency_id的上级组织Id */ private String parentId; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java index f84b32d66e..da0c80ab78 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java @@ -84,9 +84,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { logger.warn("calculateGridDangJian customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); throw new RenException("客户【网格相关:党建能力】指标权重信息不存在"); } - logger.info("=================================计算网格相关-党建能力 start==================================================================================="); calculateGridDangJian(formDTO, dangJianNengLiList); - logger.info("=================================计算网格相关-党建能力 end==================================================================================="); //2、计算网格相关-治理能力 List zhiLiNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), @@ -95,9 +93,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { logger.warn("calculateGridZhiLi customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); throw new RenException("客户【网格相关:治理能力】指标权重信息不存在"); } - logger.info("=================================计算网格相关-治理能力 start==================================================================================="); calculateGridZhiLi(formDTO, zhiLiNengLiList); - logger.info("=================================计算网格相关-治理能力 end==================================================================================="); //3、计算网格相关-服务能力 List fuWuNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), @@ -106,9 +102,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { logger.warn("calculateGridFuWu customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); throw new RenException("客户【网格相关:服务能力】指标权重信息不存在"); } - logger.info("=================================计算网格相关-服务能力 start==================================================================================="); calculateGridFuWu(formDTO, fuWuNengLiList); - logger.info("=================================计算网格相关-服务能力 end==================================================================================="); //4、计算网格相关总分 List wgxgList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); @@ -167,7 +161,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //列名不为空 if (IndexCodeEnum.ZUZHINEIDANGYDLXQZNLKPFPJZ.getCode().equals(key)) { //组织内党员的联系群众能力考评分(平均值) - logger.info("组织内党员的联系群众能力考评分(平均值) 单独处理"); +// logger.info("组织内党员的联系群众能力考评分(平均值) 单独处理"); //网格内党员的联系群众能力考评分(平均值) String gridId = (String) recordMap.get(IndexCalConstant.GRID_ID); BigDecimal contactMassesAvgValue = getGridContactMassesAvgValue(formDTO, gridId); @@ -198,8 +192,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { **/ private Map getContactMassesAblityMap(CalculateCommonFormDTO calculateCommonFormDTO) { Map map = new HashMap<>(); - //TODO - /*List list = cpcScoreDao.selectListGridContactMassesAvgValue(calculateCommonFormDTO); + List list = cpcScoreDao.selectListGridContactMassesAvgValue(calculateCommonFormDTO); if (!CollectionUtils.isEmpty(list)) { BigDecimal minValue = Collections.min(list); BigDecimal maxValue = Collections.max(list); @@ -208,9 +201,10 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { return map; } map.put(StrConstant.MIN, new BigDecimal(NumConstant.ZERO_STR)); - map.put(StrConstant.MAX, new BigDecimal(NumConstant.ZERO_STR));*/ - map.put(StrConstant.MIN, new BigDecimal("24.35")); - map.put(StrConstant.MAX, new BigDecimal("46.13")); + map.put(StrConstant.MAX, new BigDecimal(NumConstant.ZERO_STR)); + //FOR TEST + /*map.put(StrConstant.MIN, new BigDecimal("24.35")); + map.put(StrConstant.MAX, new BigDecimal("46.13"));*/ return map; } @@ -223,19 +217,19 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { * @Date 2020/8/31 9:50 **/ private BigDecimal getGridContactMassesAvgValue(CalculateCommonFormDTO calculateCommonFormDTO, String gridId) { - //TODO - /*BigDecimal result = cpcScoreDao.selectGridContactMassesAvgValue(calculateCommonFormDTO.getCustomerId(), calculateCommonFormDTO.getMonthId(), gridId); + BigDecimal result = cpcScoreDao.selectGridContactMassesAvgValue(calculateCommonFormDTO.getCustomerId(), calculateCommonFormDTO.getMonthId(), gridId); if (null == result) { return new BigDecimal(NumConstant.ZERO_STR); - }*/ - BigDecimal result=null; + } + //FOR TEST + /* BigDecimal result=null; if(IndexCalConstant.S1_C1_G1.equals(gridId)){ result= new BigDecimal("24.43"); }else if(IndexCalConstant.S1_C1_G2.equals(gridId)){ result=new BigDecimal("46.13"); }else if(IndexCalConstant.S1_C2_G1.equals(gridId)){ result=new BigDecimal("24.35"); - } + }*/ return result; } @@ -248,19 +242,19 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { * @Date 2020/8/31 15:51 **/ private BigDecimal getGridJoinIssueAvgValue(CalculateCommonFormDTO formDTO, String gridId) { - // TODO - /*BigDecimal result = cpcScoreDao.selectGridJoinIssueAvgValue(formDTO.getCustomerId(), formDTO.getMonthId(), gridId); + BigDecimal result = cpcScoreDao.selectGridJoinIssueAvgValue(formDTO.getCustomerId(), formDTO.getMonthId(), gridId); if (null == result) { return new BigDecimal(NumConstant.ZERO_STR); - }*/ - BigDecimal result=null; + } + //FOR TEST + /*BigDecimal result=null; if(IndexCalConstant.S1_C1_G1.equals(gridId)){ result= new BigDecimal("29.40"); }else if(IndexCalConstant.S1_C1_G2.equals(gridId)){ result=new BigDecimal("18.30"); }else if(IndexCalConstant.S1_C2_G1.equals(gridId)){ result=new BigDecimal("9.15"); - } + }*/ return result; } @@ -273,8 +267,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { **/ private Map getJoinIssueAblityMap(CalculateCommonFormDTO calculateCommonFormDTO) { Map map = new HashMap<>(); - //TODO - /* List list = cpcScoreDao.selectListJoinIssueAvgValue(calculateCommonFormDTO); + List list = cpcScoreDao.selectListJoinIssueAvgValue(calculateCommonFormDTO); if (!CollectionUtils.isEmpty(list)) { BigDecimal minValue = Collections.min(list); BigDecimal maxValue = Collections.max(list); @@ -283,9 +276,10 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { return map; } map.put(StrConstant.MIN, new BigDecimal(NumConstant.ZERO_STR)); - map.put(StrConstant.MAX, new BigDecimal(NumConstant.ZERO_STR));*/ - map.put(StrConstant.MIN, new BigDecimal("9.15")); - map.put(StrConstant.MAX, new BigDecimal("29.4")); + map.put(StrConstant.MAX, new BigDecimal(NumConstant.ZERO_STR)); + // FOR TEST + /*map.put(StrConstant.MIN, new BigDecimal("9.15")); + map.put(StrConstant.MAX, new BigDecimal("29.4"));*/ return map; } @@ -308,7 +302,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { String yearId = DateUtils.getYearId(formDTO.getMonthId()); for (HashMap resultMap : resultMapList) { resultMap.forEach((gridId, partyAblityScore) -> { - logger.info("网格id:" + gridId + ";分值:" + partyAblityScore); + logger.info("网格id:" + gridId + ";index_Code:"+indexCode+";分值:" + partyAblityScore); GridScoreEntity gridScoreEntity = new GridScoreEntity(); gridScoreEntity.setCustomerId(formDTO.getCustomerId()); gridScoreEntity.setGridId(gridId); @@ -346,15 +340,15 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { private HashMap calculate(Map> indexMap) { //构造入参 List indexInputVOS = this.getIndexInputVOList(indexMap); -// logger.info("计算的参数:{}", indexInputVOS); - logger.info("..........计算的参数(List)"+JSON.toJSONString(indexInputVOS)); + logger.info("计算的参数"+JSON.toJSONString(indexInputVOS)); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - List listTemp=batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); - logger.info("..........计算的结果(List)"+JSON.toJSONString(listTemp)); + //如果想看每一个指标的分值调用下面的方法 + /*List listTemp=batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); + logger.info("计算的结果(List)"+JSON.toJSONString(listTemp));*/ HashMap resultMap = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - logger.info("计算的结果(HashMap):{}", resultMap); + logger.info("计算的结果{}", resultMap); return resultMap; } @@ -386,23 +380,16 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { private Map> buildGridCorrelationIndexInputVO(CalculateCommonFormDTO formDTO, List indexList, Map minAndMaxMap) { Map> map = new HashMap<>(); for (IndexGroupDetailEntity index : indexList) { -// IndexInputVO indexInputVO = new IndexInputVO(); - // 指标code -// indexInputVO.setIndexId(index.getIndexCode()); - //阈值 -// indexInputVO.setThreshold(index.getThreshold()); - //权重 -// indexInputVO.setWeight(index.getWeight()); BigDecimal minValue = null; BigDecimal maxValue = null; if (IndexCodeEnum.ZUZHINEIDANGYDLXQZNLKPFPJZ.getCode().equals(index.getIndexCode())) { //组织内党员的联系群众能力考评分(平均值) 获取最大值,最小值 - logger.info("组织内党员的联系群众能力考评分(平均值) 单独处理"); +// logger.info("组织内党员的联系群众能力考评分(平均值) 单独处理"); Map contactMassesAblityMap = this.getContactMassesAblityMap(formDTO); minValue = contactMassesAblityMap.get(StrConstant.MIN); maxValue = contactMassesAblityMap.get(StrConstant.MAX); } else if (IndexCodeEnum.ZUZHINEIDANGYDSYYSNLKPFPJZ.getCode().equals(index.getIndexCode())) { - logger.info("组织内党员的参与议事能力考评分(平均值) 单独处理"); +// logger.info("组织内党员的参与议事能力考评分(平均值) 单独处理"); Map joinIssueAblityMap = this.getJoinIssueAblityMap(formDTO); minValue = joinIssueAblityMap.get(StrConstant.MIN); maxValue = joinIssueAblityMap.get(StrConstant.MAX); @@ -410,12 +397,10 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //获取指标对应的列名 String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(index.getIndexCode()); if (StringUtils.isBlank(fieldName)) { - logger.error("index_code1:{} not find field_name",index.getIndexCode()); + logger.error("index_code:{} not find field_name",index.getIndexCode()); continue; - }else{ - logger.info("index_code2:{} ,field_name:{}",index.getIndexCode(),fieldName); } -// logger.info("index_code:{} ",index.getIndexCode(),"field_id :{} ",fieldName); +// logger.info("index_code2:{} ,field_name:{}",index.getIndexCode(),fieldName); String minValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MIN); String maxValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MAX); minValue = new BigDecimal(String.valueOf(minAndMaxMap.get(minValueKey))); @@ -428,13 +413,11 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { ScoreConstants.MAX_SCORE, Correlation.getCorrelation(index.getCorrelation()) ); -// indexInputVO.setScoreCalculator(scoreCalculator); List> sampleValueList = new ArrayList<>(); -// indexInputVO.setIndexValueVOs(sampleValueList); IndexInputVO indexInputVO1 = new IndexInputVO(index.getIndexCode(), sampleValueList, -// index.getThreshold(), TODO - new BigDecimal("-1"), + index.getThreshold(), +// new BigDecimal("-1"),//FOR TEST index.getWeight(), scoreCalculator); map.put(index.getIndexCode(), indexInputVO1); @@ -484,7 +467,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { indexMap.forEach((key, value) -> { //列名不为空 if (IndexCodeEnum.ZUZHINEIDANGYDSYYSNLKPFPJZ.getCode().equals(key)) { - logger.info("组织内党员的参与议事能力考评分(平均值) 单独处理"); +// logger.info("组织内党员的参与议事能力考评分(平均值) 单独处理"); String gridId = (String) recordMap.get(IndexCalConstant.GRID_ID); BigDecimal joinAvgValue = getGridJoinIssueAvgValue(formDTO, gridId); SampleValue contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), joinAvgValue); @@ -586,13 +569,6 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { GridScoreEntity gridScoreEntity = ConvertUtils.sourceToTarget(gridScoreDTO, GridScoreEntity.class); gridScoreEntity.setIsTotal(NumConstant.ONE_STR); gridScoreEntity.setIndexCode(indexCode); -// gridScoreEntity.setCustomerId(gridScoreDTO.getCustomerId()); -// gridScoreEntity.setGridId(gridScoreDTO.getGridId()); -// gridScoreEntity.setAgencyId(gridScoreDTO.getAgencyId()); -// gridScoreEntity.setAllParentIds(gridScoreDTO.getAllParentIds()); -// gridScoreEntity.setQuarterId(gridScoreDTO.getQuarterId()); -// gridScoreEntity.setYearId(gridScoreDTO.getYearId()); -// gridScoreEntity.setMonthId(gridScoreDTO.getMonthId()); gridScoreEntity.setScore(BigDecimal.ZERO); if (!CollectionUtils.isEmpty(gridScoreDTO.getDetailList()) && gridScoreDTO.getDetailList().size() != 3) { logger.error("customerId:" + gridScoreDTO.getCustomerId() + ";gridId:" + gridScoreDTO.getGridId() + ";monthId:" + gridScoreDTO.getMonthId() + "能力值缺失,无法计算总值"); @@ -610,14 +586,6 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { } } - public static void main(String[] args) { - BigDecimal totalScore = BigDecimal.ZERO; - for (int i = 1; i < 5; i++) { - totalScore = totalScore.add(new BigDecimal("1.00")); - } - System.out.println(totalScore); - } - /** * @param customerId * @return com.epmet.dto.indexcal.CustomerGridInfoDTO From b21973d9e8be166a02c48238b8a9cf44e9c85dc7 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 2 Sep 2020 10:50:53 +0800 Subject: [PATCH 139/226] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=8C=87=E6=A0=87?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/IndexCalculateController.java | 12 ++++- .../impl/CpcIndexCalculateServiceImpl.java | 3 ++ .../impl/IndexCodeFieldReServiceImpl.java | 9 +++- .../screen/impl/IndexGroupServiceImpl.java | 54 +++++++++++++------ .../java/com/epmet/util/Pinyin4jUtil.java | 1 + 5 files changed, 60 insertions(+), 19 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java index de9f746130..09276f3184 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java @@ -1,16 +1,21 @@ package com.epmet.controller; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.screen.form.IndexCalculateForm; import com.epmet.service.indexcal.CpcIndexCalculateService; import com.epmet.service.screen.IndexCalculateService; +import com.epmet.util.DimIdGenerator; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.Date; + /** * 指标计算controller * @@ -50,8 +55,11 @@ public class IndexCalculateController { * @return */ @PostMapping("cpc") - public Result cpc(CalculateCommonFormDTO formDTO) { - + public Result cpc(@RequestBody CalculateCommonFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getMonthId())) { + //默认 当前月份-1 + formDTO.setMonthId(DimIdGenerator.getMonthDimId(DateUtils.addDateMonths(new Date(), -1))); + } return new Result().ok(cpcIndexCalculateService.cpcIndexCalculate(formDTO)); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java index dabeade3f1..588882b83f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -228,6 +228,9 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { //获取指标对应的列名 String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(index.getIndexCode()); + if (StringUtils.isBlank(fieldName)) { + continue; + } //最小值key String minValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MIN); //最大值key diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCodeFieldReServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCodeFieldReServiceImpl.java index 94189a9c77..5d5e58920c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCodeFieldReServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCodeFieldReServiceImpl.java @@ -4,15 +4,18 @@ import com.epmet.dao.screen.IndexCodeFieldReDao; import com.epmet.entity.screen.IndexCodeFieldReEntity; import com.epmet.redis.IndexCodeFieldReRedis; import com.epmet.service.indexcal.IndexCodeFieldReService; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; +@Slf4j @Service public class IndexCodeFieldReServiceImpl implements IndexCodeFieldReService { @Autowired @@ -41,6 +44,10 @@ public class IndexCodeFieldReServiceImpl implements IndexCodeFieldReService { if (CollectionUtils.isEmpty(indexCodeFieldReMap)) { return null; } - return indexCodeFieldReMap.get(indexCode); + String fieldName = indexCodeFieldReMap.get(indexCode); + if (StringUtils.isEmpty(fieldName)){ + log.error("indexCode:{} 在index_code_re表中不存在记录",indexCode); + } + return fieldName; } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupServiceImpl.java index a575ed7b72..3d6e1d3289 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupServiceImpl.java @@ -17,7 +17,6 @@ package com.epmet.service.screen.impl; -import com.alibaba.fastjson.JSON; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; @@ -31,11 +30,14 @@ import com.epmet.entity.screen.IndexGroupDetailTemplateEntity; import com.epmet.entity.screen.IndexGroupEntity; import com.epmet.entity.screen.IndexGroupTemplateEntity; import com.epmet.service.screen.IndexGroupService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -47,6 +49,7 @@ import java.util.stream.Collectors; * @author generator generator@elink-cn.com * @since v1.0.0 2020-08-19 */ +@Slf4j @Service public class IndexGroupServiceImpl extends BaseServiceImpl implements IndexGroupService { @Autowired @@ -67,30 +70,49 @@ private IndexGroupTemplateDao indexGroupTemplateDao; } Map groupMap = groupTempList.stream().collect(Collectors.toMap(IndexGroupTemplateEntity::getId, o -> o)); Map groupEntityMap = new HashMap<>(); + Map groupNewIdMap = new HashMap<>(); - groupDetailTempList.forEach(groupDetailTemp->{ - String indexGroupId = groupDetailTemp.getIndexGroupId(); - IndexGroupTemplateEntity group = groupMap.get(indexGroupId); - if (group == null){ - System.out.println(JSON.toJSONString(groupDetailTemp)); + List insertGroupList = new ArrayList<>(); + groupMap.forEach((oldGroupTempId,o)->{ + IndexGroupEntity newGroupEntity = ConvertUtils.sourceToTarget(o, IndexGroupEntity.class); + String newGroupId = UniqueIdGenerator.generate(); + newGroupEntity.setId(newGroupId); + newGroupEntity.setCustomerId(customerId); + String oldPid = newGroupEntity.getParentIndexGroupId(); + String newPid = groupNewIdMap.get(oldPid); + /*if (StringUtils.isBlank(newPid)){ + newPid = UniqueIdGenerator.generate(); + groupNewIdMap.put(oldPid,newPid); + }*/ + //newGroupEntity.setParentIndexGroupId(newPid); + groupNewIdMap.put(oldGroupTempId,newGroupId); + //groupEntityMap.put(newGroupId,newGroupEntity); + insertGroupList.add(newGroupEntity); + }); + insertGroupList.forEach(o-> { + String parentIndexGroupId = groupNewIdMap.get(o.getParentIndexGroupId()); + if (StringUtils.isBlank(parentIndexGroupId)){ + parentIndexGroupId = "0"; } + o.setParentIndexGroupId(parentIndexGroupId); + }); + groupDetailTempList.forEach(groupDetailTemp->{ + String oldIndexGroupId = groupDetailTemp.getIndexGroupId(); + System.out.println(oldIndexGroupId); - IndexGroupEntity groupEntity = groupEntityMap.get(indexGroupId); - if (groupEntity == null){ - groupEntity = ConvertUtils.sourceToTarget(group, IndexGroupEntity.class); - String groupId = UniqueIdGenerator.generate(); - groupEntity.setId(groupId); - groupEntity.setCustomerId(customerId); - groupEntityMap.put(indexGroupId,groupEntity); - } IndexGroupDetailEntity entity = ConvertUtils.sourceToTarget(groupDetailTemp, IndexGroupDetailEntity.class); entity.setId(UniqueIdGenerator.generate()); - entity.setIndexGroupId(groupEntity.getId()); + String newGroupId = groupNewIdMap.get(oldIndexGroupId); + if (StringUtils.isBlank(newGroupId)){ + log.error("新旧id映射关系有误"); + return; + } + entity.setIndexGroupId(newGroupId); entity.setCustomerId(customerId); indexGroupDetailDao.insert(entity); }); - this.insertBatch(groupEntityMap.values(),10); + this.insertBatch(insertGroupList,10); /* List groupEntityList = groupTempList.stream().map(groupTemp -> { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java index 727de4bbeb..b3a9ac1760 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java @@ -29,6 +29,7 @@ public class Pinyin4jUtil { duoyinMap.put('期',new String[]{"qi"}); duoyinMap.put('参',new String[]{"can"}); duoyinMap.put('均',new String[]{"jun"}); + duoyinMap.put('会',new String[]{"hui"}); } /** From ecc1ee9738e1a93c4479593002aab4ab25ff6380 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 2 Sep 2020 11:59:55 +0800 Subject: [PATCH 140/226] =?UTF-8?q?=E6=80=BB=E5=88=86=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/indexcal/CalculateCommonFormDTO.java | 4 ++++ .../indexcal/impl/CpcIndexCalculateServiceImpl.java | 11 +++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java index 4c43a57890..187f69c960 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java @@ -23,6 +23,10 @@ public class CalculateCommonFormDTO implements Serializable { */ private String customerId; + public CalculateCommonFormDTO() { + super(); + } + public CalculateCommonFormDTO(String customerId, String monthId) { this.monthId=monthId; this.customerId=customerId; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java index 588882b83f..fd79fc52e9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -84,7 +84,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { if (totalEntity == null) { totalEntity = ConvertUtils.sourceToTarget(part, CpcScoreEntity.class); totalEntity.setIsTotal(NumConstant.ONE_STR); - totalEntity.setIndexCode(indexGroupDetailEntity.getIndexCode()); + totalEntity.setIndexCode(IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); totalEntity.setScore(new BigDecimal(0)); cpcScoreTotalMap.put(userId, totalEntity); } @@ -102,11 +102,6 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { } private void calculatePartScore(CalculateCommonFormDTO formDTO) { - Map indexCodeFieldReList = indexCodeFieldReService.getIndexCodeFieldReMap(); - if (CollectionUtils.isEmpty(indexCodeFieldReList)) { - log.error("cpcIndexCalculate have any indexcodefieldre"); - throw new RenException("指标code与字段关系记录不存在"); - } //计算最大最小值 Map minAndMaxMap = factIndexPartyAblityCpcMonthlyDao.getExtremeValue(formDTO.getCustomerId()); if (CollectionUtils.isEmpty(minAndMaxMap)) { @@ -186,6 +181,10 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { log.info("计算的结果:{}", result); //处理结果 + if (CollectionUtils.isEmpty(result)){ + log.error("calculateScore calculateScore return empty"); + return; + } saveCpcScore(formDTO, scoreEntityMap, parentIndexCode, result); } From 7e53f5e9d0a28decabe042c6e0e3548ca8f28a6e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 2 Sep 2020 13:20:13 +0800 Subject: [PATCH 141/226] =?UTF-8?q?=E4=BF=AE=E6=94=B9IndexCalculateService?= =?UTF-8?q?=E5=8C=85=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/DemoController.java | 2 - .../controller/IndexCalculateController.java | 2 +- .../IndexCalculateService.java | 4 +- .../impl/GridCorreLationServiceImpl.java | 100 +++++++++--------- .../impl/IndexCalculateServiceImpl.java | 5 +- 5 files changed, 54 insertions(+), 59 deletions(-) rename epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/{screen => indexcal}/IndexCalculateService.java (76%) rename epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/{screen => indexcal}/impl/IndexCalculateServiceImpl.java (97%) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 08034ab72a..b52596a207 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -21,8 +21,6 @@ import com.epmet.service.indexcal.GridCorreLationService; import com.epmet.service.screen.IndexCalculateCommunityService; import com.epmet.service.stats.DimAgencyService; import lombok.extern.slf4j.Slf4j; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java index 09276f3184..be71b5f513 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java @@ -5,7 +5,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.screen.form.IndexCalculateForm; import com.epmet.service.indexcal.CpcIndexCalculateService; -import com.epmet.service.screen.IndexCalculateService; +import com.epmet.service.indexcal.IndexCalculateService; import com.epmet.util.DimIdGenerator; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/IndexCalculateService.java similarity index 76% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateService.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/IndexCalculateService.java index 70c49c77fe..f83295856b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/IndexCalculateService.java @@ -1,4 +1,4 @@ -package com.epmet.service.screen; +package com.epmet.service.indexcal; import com.epmet.dto.screen.form.IndexCalculateForm; @@ -10,7 +10,7 @@ import com.epmet.dto.screen.form.IndexCalculateForm; */ public interface IndexCalculateService { /** - * desc:计算党员相关指标 + * desc:按照客户计算所有指标(按照月份) * @param formDTO * @return */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java index da0c80ab78..40013cfaf5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java @@ -25,9 +25,8 @@ import com.epmet.service.indexcal.IndexCodeFieldReService; import com.epmet.service.screen.IndexGroupDetailService; import com.epmet.support.normalizing.*; import com.epmet.support.normalizing.batch.*; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -44,9 +43,9 @@ import java.util.stream.Collectors; * @author yinzuomei@elink-cn.com * @date 2020/8/26 10:35 */ +@Slf4j @Service public class GridCorreLationServiceImpl implements GridCorreLationService { - private Logger logger = LogManager.getLogger(GridCorreLationServiceImpl.class); @Autowired private FactIndexGovrnAblityGridMonthlyDao factIndexGovrnAblityGridMonthlyDao; @Autowired @@ -81,7 +80,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); if (CollectionUtils.isEmpty(dangJianNengLiList)) { - logger.warn("calculateGridDangJian customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + log.warn("calculateGridDangJian customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); throw new RenException("客户【网格相关:党建能力】指标权重信息不存在"); } calculateGridDangJian(formDTO, dangJianNengLiList); @@ -90,7 +89,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); if (CollectionUtils.isEmpty(zhiLiNengLiList)) { - logger.warn("calculateGridZhiLi customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + log.warn("calculateGridZhiLi customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); throw new RenException("客户【网格相关:治理能力】指标权重信息不存在"); } calculateGridZhiLi(formDTO, zhiLiNengLiList); @@ -99,7 +98,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); if (CollectionUtils.isEmpty(fuWuNengLiList)) { - logger.warn("calculateGridFuWu customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + log.warn("calculateGridFuWu customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); throw new RenException("客户【网格相关:服务能力】指标权重信息不存在"); } calculateGridFuWu(formDTO, fuWuNengLiList); @@ -107,7 +106,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { List wgxgList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); if (CollectionUtils.isEmpty(wgxgList)) { - logger.warn("calculateGridTotal customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + log.warn("calculateGridTotal customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); throw new RenException("客户【网格相关】指标权重信息不存在"); } calculateGridTotal(formDTO, wgxgList, IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); @@ -129,16 +128,16 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //查询总记录数 int total = factIndexPartyAblityGridMonthlyDao.selectCount(formDTO); if (NumConstant.ZERO == total) { - logger.warn(String.format("customerId=%s,monthId=%s,没有上传网格相关-党建能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); + log.warn(String.format("customerId=%s,monthId=%s,没有上传网格相关-党建能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); return; } //总页数,进行批量查询,批量计算 int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE); - logger.info(String.format("共%s条数据,分%s次计算", total, totalPage)); + log.info(String.format("共%s条数据,分%s次计算", total, totalPage)); //每一组指标的最大值,key:code_MIN/MAX Map minAndMaxMap = queryPartyAblityGridMinAndMax(formDTO.getCustomerId(), formDTO.getMonthId()); if (CollectionUtils.isEmpty(minAndMaxMap)) { - logger.error("calculateGridDangJian queryPartyAblityGridMinAndMax customerId:{} monthId:{} have not any fact record", formDTO.getCustomerId(),formDTO.getMonthId()); + log.error("calculateGridDangJian queryPartyAblityGridMinAndMax customerId:{} monthId:{} have not any fact record", formDTO.getCustomerId(),formDTO.getMonthId()); return; } //指标集合 @@ -157,11 +156,10 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { recordList.forEach(recordMap -> { //遍历所有的指标 indexMap.forEach((key, value) -> { - logger.info("index_code :{}",key); - //列名不为空 + log.info("index_code :{}",key); if (IndexCodeEnum.ZUZHINEIDANGYDLXQZNLKPFPJZ.getCode().equals(key)) { //组织内党员的联系群众能力考评分(平均值) -// logger.info("组织内党员的联系群众能力考评分(平均值) 单独处理"); +// log.info("组织内党员的联系群众能力考评分(平均值) 单独处理"); //网格内党员的联系群众能力考评分(平均值) String gridId = (String) recordMap.get(IndexCalConstant.GRID_ID); BigDecimal contactMassesAvgValue = getGridContactMassesAvgValue(formDTO, gridId); @@ -192,7 +190,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { **/ private Map getContactMassesAblityMap(CalculateCommonFormDTO calculateCommonFormDTO) { Map map = new HashMap<>(); - List list = cpcScoreDao.selectListGridContactMassesAvgValue(calculateCommonFormDTO); + /*List list = cpcScoreDao.selectListGridContactMassesAvgValue(calculateCommonFormDTO); if (!CollectionUtils.isEmpty(list)) { BigDecimal minValue = Collections.min(list); BigDecimal maxValue = Collections.max(list); @@ -201,10 +199,10 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { return map; } map.put(StrConstant.MIN, new BigDecimal(NumConstant.ZERO_STR)); - map.put(StrConstant.MAX, new BigDecimal(NumConstant.ZERO_STR)); + map.put(StrConstant.MAX, new BigDecimal(NumConstant.ZERO_STR));*/ //FOR TEST - /*map.put(StrConstant.MIN, new BigDecimal("24.35")); - map.put(StrConstant.MAX, new BigDecimal("46.13"));*/ + map.put(StrConstant.MIN, new BigDecimal("24.35")); + map.put(StrConstant.MAX, new BigDecimal("46.13")); return map; } @@ -217,19 +215,19 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { * @Date 2020/8/31 9:50 **/ private BigDecimal getGridContactMassesAvgValue(CalculateCommonFormDTO calculateCommonFormDTO, String gridId) { - BigDecimal result = cpcScoreDao.selectGridContactMassesAvgValue(calculateCommonFormDTO.getCustomerId(), calculateCommonFormDTO.getMonthId(), gridId); + /*BigDecimal result = cpcScoreDao.selectGridContactMassesAvgValue(calculateCommonFormDTO.getCustomerId(), calculateCommonFormDTO.getMonthId(), gridId); if (null == result) { return new BigDecimal(NumConstant.ZERO_STR); - } + }*/ //FOR TEST - /* BigDecimal result=null; + BigDecimal result=null; if(IndexCalConstant.S1_C1_G1.equals(gridId)){ result= new BigDecimal("24.43"); }else if(IndexCalConstant.S1_C1_G2.equals(gridId)){ result=new BigDecimal("46.13"); }else if(IndexCalConstant.S1_C2_G1.equals(gridId)){ result=new BigDecimal("24.35"); - }*/ + } return result; } @@ -242,19 +240,19 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { * @Date 2020/8/31 15:51 **/ private BigDecimal getGridJoinIssueAvgValue(CalculateCommonFormDTO formDTO, String gridId) { - BigDecimal result = cpcScoreDao.selectGridJoinIssueAvgValue(formDTO.getCustomerId(), formDTO.getMonthId(), gridId); + /*BigDecimal result = cpcScoreDao.selectGridJoinIssueAvgValue(formDTO.getCustomerId(), formDTO.getMonthId(), gridId); if (null == result) { return new BigDecimal(NumConstant.ZERO_STR); - } + }*/ //FOR TEST - /*BigDecimal result=null; + BigDecimal result=null; if(IndexCalConstant.S1_C1_G1.equals(gridId)){ result= new BigDecimal("29.40"); }else if(IndexCalConstant.S1_C1_G2.equals(gridId)){ result=new BigDecimal("18.30"); }else if(IndexCalConstant.S1_C2_G1.equals(gridId)){ result=new BigDecimal("9.15"); - }*/ + } return result; } @@ -267,7 +265,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { **/ private Map getJoinIssueAblityMap(CalculateCommonFormDTO calculateCommonFormDTO) { Map map = new HashMap<>(); - List list = cpcScoreDao.selectListJoinIssueAvgValue(calculateCommonFormDTO); + /*List list = cpcScoreDao.selectListJoinIssueAvgValue(calculateCommonFormDTO); if (!CollectionUtils.isEmpty(list)) { BigDecimal minValue = Collections.min(list); BigDecimal maxValue = Collections.max(list); @@ -276,10 +274,10 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { return map; } map.put(StrConstant.MIN, new BigDecimal(NumConstant.ZERO_STR)); - map.put(StrConstant.MAX, new BigDecimal(NumConstant.ZERO_STR)); + map.put(StrConstant.MAX, new BigDecimal(NumConstant.ZERO_STR));*/ // FOR TEST - /*map.put(StrConstant.MIN, new BigDecimal("9.15")); - map.put(StrConstant.MAX, new BigDecimal("29.4"));*/ + map.put(StrConstant.MIN, new BigDecimal("9.15")); + map.put(StrConstant.MAX, new BigDecimal("29.4")); return map; } @@ -302,7 +300,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { String yearId = DateUtils.getYearId(formDTO.getMonthId()); for (HashMap resultMap : resultMapList) { resultMap.forEach((gridId, partyAblityScore) -> { - logger.info("网格id:" + gridId + ";index_Code:"+indexCode+";分值:" + partyAblityScore); + log.info("网格id:" + gridId + ";index_Code:"+indexCode+";分值:" + partyAblityScore); GridScoreEntity gridScoreEntity = new GridScoreEntity(); gridScoreEntity.setCustomerId(formDTO.getCustomerId()); gridScoreEntity.setGridId(gridId); @@ -340,15 +338,15 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { private HashMap calculate(Map> indexMap) { //构造入参 List indexInputVOS = this.getIndexInputVOList(indexMap); - logger.info("计算的参数"+JSON.toJSONString(indexInputVOS)); + log.info("计算的参数"+JSON.toJSONString(indexInputVOS)); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); //如果想看每一个指标的分值调用下面的方法 - /*List listTemp=batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); - logger.info("计算的结果(List)"+JSON.toJSONString(listTemp));*/ + List listTemp=batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); + log.info("计算的结果(List)"+JSON.toJSONString(listTemp)); HashMap resultMap = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - logger.info("计算的结果{}", resultMap); + log.info("计算的结果{}", resultMap); return resultMap; } @@ -384,12 +382,12 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { BigDecimal maxValue = null; if (IndexCodeEnum.ZUZHINEIDANGYDLXQZNLKPFPJZ.getCode().equals(index.getIndexCode())) { //组织内党员的联系群众能力考评分(平均值) 获取最大值,最小值 -// logger.info("组织内党员的联系群众能力考评分(平均值) 单独处理"); +// log.info("组织内党员的联系群众能力考评分(平均值) 单独处理"); Map contactMassesAblityMap = this.getContactMassesAblityMap(formDTO); minValue = contactMassesAblityMap.get(StrConstant.MIN); maxValue = contactMassesAblityMap.get(StrConstant.MAX); } else if (IndexCodeEnum.ZUZHINEIDANGYDSYYSNLKPFPJZ.getCode().equals(index.getIndexCode())) { -// logger.info("组织内党员的参与议事能力考评分(平均值) 单独处理"); +// log.info("组织内党员的参与议事能力考评分(平均值) 单独处理"); Map joinIssueAblityMap = this.getJoinIssueAblityMap(formDTO); minValue = joinIssueAblityMap.get(StrConstant.MIN); maxValue = joinIssueAblityMap.get(StrConstant.MAX); @@ -397,10 +395,10 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //获取指标对应的列名 String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(index.getIndexCode()); if (StringUtils.isBlank(fieldName)) { - logger.error("index_code:{} not find field_name",index.getIndexCode()); + log.error("index_code:{} not find field_name",index.getIndexCode()); continue; } -// logger.info("index_code2:{} ,field_name:{}",index.getIndexCode(),fieldName); +// log.info("index_code2:{} ,field_name:{}",index.getIndexCode(),fieldName); String minValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MIN); String maxValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MAX); minValue = new BigDecimal(String.valueOf(minAndMaxMap.get(minValueKey))); @@ -416,8 +414,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { List> sampleValueList = new ArrayList<>(); IndexInputVO indexInputVO1 = new IndexInputVO(index.getIndexCode(), sampleValueList, - index.getThreshold(), -// new BigDecimal("-1"),//FOR TEST +// index.getThreshold(), + new BigDecimal("-1"),//FOR TEST index.getWeight(), scoreCalculator); map.put(index.getIndexCode(), indexInputVO1); @@ -437,16 +435,16 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //查询总记录数 int total = factIndexGovrnAblityGridMonthlyDao.selectCount(formDTO); if (NumConstant.ZERO == total) { - logger.warn(String.format("customerId%s,monthId%s,没有上传网格相关-治理能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); + log.warn(String.format("customerId%s,monthId%s,没有上传网格相关-治理能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); return; } //总页数,进行批量查询,批量计算 int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE); - logger.info(String.format("共%s条数据,分%s次计算", total, totalPage)); + log.info(String.format("共%s条数据,分%s次计算", total, totalPage)); //每一组指标的最大值,key:code_MIN/MAX Map minAndMaxMap = queryGovrnAblityGridMinAndMax(formDTO.getCustomerId(), formDTO.getMonthId()); if (CollectionUtils.isEmpty(minAndMaxMap)) { - logger.error("calculateGridZhiLi queryGovrnAblityGridMinAndMax customerId:{} monthId:{} have not any fact record", formDTO.getCustomerId(),formDTO.getMonthId()); + log.error("calculateGridZhiLi queryGovrnAblityGridMinAndMax customerId:{} monthId:{} have not any fact record", formDTO.getCustomerId(),formDTO.getMonthId()); return; } //指标集合 @@ -465,9 +463,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { recordList.forEach(recordMap -> { //遍历所有的指标 indexMap.forEach((key, value) -> { - //列名不为空 if (IndexCodeEnum.ZUZHINEIDANGYDSYYSNLKPFPJZ.getCode().equals(key)) { -// logger.info("组织内党员的参与议事能力考评分(平均值) 单独处理"); +// log.info("组织内党员的参与议事能力考评分(平均值) 单独处理"); String gridId = (String) recordMap.get(IndexCalConstant.GRID_ID); BigDecimal joinAvgValue = getGridJoinIssueAvgValue(formDTO, gridId); SampleValue contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), joinAvgValue); @@ -501,16 +498,16 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //查询总记录数 int total = factIndexGovrnAblityGridMonthlyDao.selectCount(formDTO); if (NumConstant.ZERO == total) { - logger.warn(String.format("customerId:%s,monthId:%s,没有上传网格相关-服务能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); + log.warn(String.format("customerId:%s,monthId:%s,没有上传网格相关-服务能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); return; } //总页数,进行批量查询,批量计算 int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE); - logger.info(String.format("共%s条数据,分%s次计算", total, totalPage)); + log.info(String.format("共%s条数据,分%s次计算", total, totalPage)); //每一组指标的最大值,key:code_MIN/MAX Map minAndMaxMap = queryServiceAblityGridMinAndMax(formDTO.getCustomerId(), formDTO.getMonthId()); if (CollectionUtils.isEmpty(minAndMaxMap)) { - logger.error("calculateGridFuWu queryServiceAblityGridMinAndMax customerId:{} monthId:{} have not any fact record", formDTO.getCustomerId(),formDTO.getMonthId()); + log.error("calculateGridFuWu queryServiceAblityGridMinAndMax customerId:{} monthId:{} have not any fact record", formDTO.getCustomerId(),formDTO.getMonthId()); return; } //指标集合 @@ -529,7 +526,6 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { recordList.forEach(recordMap -> { //遍历所有的指标 indexMap.forEach((key, value) -> { - //列名不为空 if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { //对应的数值 String sampleValueStr = String.valueOf(recordMap.get(indexCodeFieldReService.getFieldNameByIndexCode(key))); @@ -537,7 +533,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { SampleValue currentGridIndexValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), new BigDecimal(sampleValueStr)); value.getIndexValueVOs().add(currentGridIndexValue); } else { - logger.error("index_code:" + key + " not find field_name"); + log.error("index_code:" + key + " not find field_name"); } }); }); @@ -560,7 +556,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //查询总记录数 List gridScoreDTOList = gridScoreDao.selectList(formDTO); if(CollectionUtils.isEmpty(gridScoreDTOList)){ - logger.error("calculateGridTotal gridScoreDao.selectList return empty,customerId:{},monthId:{}", formDTO.getCustomerId(), formDTO.getMonthId()); + log.error("calculateGridTotal gridScoreDao.selectList return empty,customerId:{},monthId:{}", formDTO.getCustomerId(), formDTO.getMonthId()); throw new RenException("客户一级指标分值记录不存在"); } Map indexMap = indexList.stream().collect(Collectors.toMap(IndexGroupDetailEntity::getIndexCode, Function.identity())); @@ -571,7 +567,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { gridScoreEntity.setIndexCode(indexCode); gridScoreEntity.setScore(BigDecimal.ZERO); if (!CollectionUtils.isEmpty(gridScoreDTO.getDetailList()) && gridScoreDTO.getDetailList().size() != 3) { - logger.error("customerId:" + gridScoreDTO.getCustomerId() + ";gridId:" + gridScoreDTO.getGridId() + ";monthId:" + gridScoreDTO.getMonthId() + "能力值缺失,无法计算总值"); + log.error("customerId:" + gridScoreDTO.getCustomerId() + ";gridId:" + gridScoreDTO.getGridId() + ";monthId:" + gridScoreDTO.getMonthId() + "能力值缺失,无法计算总值"); continue; } for (GridScoreDetailDTO gridScoreDetailDTO : gridScoreDTO.getDetailList()) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCalculateServiceImpl.java similarity index 97% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCalculateServiceImpl.java index a7100121f7..3bd41f9df4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCalculateServiceImpl.java @@ -1,4 +1,4 @@ -package com.epmet.service.screen.impl; +package com.epmet.service.indexcal.impl; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.utils.DateUtils; @@ -9,8 +9,8 @@ import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.redis.IndexCodeFieldReRedis; import com.epmet.service.indexcal.CpcIndexCalculateService; import com.epmet.service.indexcal.GridCorreLationService; +import com.epmet.service.indexcal.IndexCalculateService; import com.epmet.service.screen.IndexCalculateCommunityService; -import com.epmet.service.screen.IndexCalculateService; import com.epmet.util.DimIdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -23,6 +23,7 @@ import java.util.List; /** * @author liujianjun + * 指标计算service */ @Slf4j @Service From 53caf7dc2dc148670e79f28eac33485198630a30 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 2 Sep 2020 13:39:42 +0800 Subject: [PATCH 142/226] =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E4=BC=98=E5=8C=96=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/IndexCalConstant.java | 4 +- .../java/com/epmet/eum/IndexCodeEnum.java | 5 +- .../IndexCalculateCommunityServiceImpl.java | 439 +++++++----------- 3 files changed, 178 insertions(+), 270 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java index e89cc969b3..d56ae32d54 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java @@ -29,9 +29,9 @@ public interface IndexCalConstant { String COMMUNITY_SERVICE_AVG = "shequxiajisywgfwnldfpjz"; - String COMMUNITY_GOVERN_AVG = "shequxiashusywgzlnlhzpyz"; + String COMMUNITY_GOVERN_AVG = "shequxiashusywgzlnlhzpjz"; - String COMMUNITY_PARTY_AVG = "xiazhusuoyouwgddjnlpjz"; + String COMMUNITY_PARTY_AVG = "xiashusuoyouwgddjnlpjz"; String COMMUNITY_RELATE = "shequxiangguan"; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java index 9697e84fcf..88e759af17 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java @@ -24,7 +24,10 @@ public enum IndexCodeEnum { DANG_WU_HUO_DONG("dangwuhuodong", "党务活动", 4), LIAN_XI_QUN_ZHONG("lianxiqunzhong", "联系群众", 4), ZUZHINEIDANGYDLXQZNLKPFPJZ("zuzhineidangydlxqznlkpfpjz","组织内党员的联系群众能力考评分(平均值)",5), - ZUZHINEIDANGYDSYYSNLKPFPJZ("zuzhineidangydcyysnlkpfpjz","组织内党员的参与议事能力考评分(平均值)",5), + ZUZHINEIDANGYDSYYSNLKPFPJZ("zuzhineidangydsyysnlkpfpjz","组织内党员的参与议事能力考评分(平均值)",5), + XIA_SHU_SUO_YOU_WGDDJNLPJZ("xiashusuoyouwgddjnlpjz","下属所有网格的党建能力(平均值)",5), + SHE_QU_XIA_SHU_SYWGZLNLHZPJZ("shequxiashusywgzlnlhzpjz","社区下属所有网格治理能力汇总(平均值)",5), + SHE_QU_XIA_JI_SYWGFWNLDFPJZ("shequxiajisywgfwnldfpjz","社区下级所有网格服务能力得分(平均值) ",5), ; private String code; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java index 072c6c6e36..0e778ae49f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java @@ -19,13 +19,13 @@ import com.epmet.service.screen.IndexGroupDetailService; import com.epmet.support.normalizing.*; import com.epmet.support.normalizing.batch.BatchScoreCalculator; import com.epmet.support.normalizing.batch.IndexInputVO; -import com.epmet.support.normalizing.batch.IndexOutputVO; import com.epmet.support.normalizing.batch.SampleValue; import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.BeanUtils; +import org.apache.commons.collections4.ListUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.util.*; @@ -55,8 +55,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni private FactIndexGridScoreDao factIndexGridScoreDao; /** - * @Description 社区名义发文数量计算【党建能力】 * @param customerId + * @Description 社区名义发文数量计算【党建能力】 * @author zxc * @date 2020/8/26 10:46 上午 */ @@ -64,314 +64,210 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni public Boolean communityPartyCalculate(String customerId, String monthId) { // 党建能力 // 根据all_parent_index_code 获取指标明细 - List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(),IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); - List subAllGridList = new ArrayList<>(); - List communityPublishArticle = new ArrayList<>(); + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error("指标明细查询集合为空"); + return false; + } + List indexInputVOS = new ArrayList<>(); //下属所有网格的党建能力平均值 - detailListByParentCode.forEach(indexGroup -> { - if (indexGroup.getIndexCode().equals(IndexCalConstant.COMMUNITY_PARTY_AVG)){ + detailListByParentCode.forEach(detail -> { + if (IndexCodeEnum.XIA_SHU_SUO_YOU_WGDDJNLPJZ.getCode().equals(detail.getIndexCode())) { List subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridPartyAvgScore(customerId, monthId); - if (subGridPartyAvgScore.size() != NumConstant.ZERO){ - MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); - Integer indexStart = NumConstant.ZERO; - Integer indexEnd = NumConstant.TEN; - List collect; - do { - collect = subGridPartyAvgScore.stream().skip(indexEnd * indexStart).limit(indexEnd).collect(Collectors.toList()); - List index1SampleValues = new ArrayList<>(); - collect.forEach(c -> { - SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); - index1SampleValues.add(s); - FactIndexCommunityScoreDTO dto = new FactIndexCommunityScoreDTO(); - BeanUtils.copyProperties(c,dto); - subAllGridList.add(dto); - }); - HashMap result = this.getCalResult(maxAndMinBigDecimal, index1SampleValues, indexGroup); - result.forEach((key,value) -> { - subAllGridList.forEach(grid -> { - if (grid.getAgencyId().equals(key)){ - grid.setScore(value); - } - }); - }); - indexStart++; - }while (collect.size() == NumConstant.TEN); - } - }else { - List indexInputVOS = new ArrayList<>(); - List> maps = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId); - String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(indexGroup.getIndexCode()); - if (!StringUtils.isEmpty(fieldNameByIndexCode)) { - if (maps.get(NumConstant.ZERO).containsKey(fieldNameByIndexCode)) { - List decimalList = maps.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); - MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); - Integer indexStart = NumConstant.ZERO; - Integer indexEnd = NumConstant.TEN; - List> collect; - do { - collect = maps.stream().skip(indexEnd * indexStart).limit(indexEnd).collect(Collectors.toList()); - ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); - List index1SampleValues = new ArrayList<>(); - collect.forEach(c -> { - SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); - index1SampleValues.add(s); - FactIndexCommunityScoreDTO publishArticle = new FactIndexCommunityScoreDTO(); - BeanUtils.copyProperties(c,publishArticle); - communityPublishArticle.add(publishArticle); - }); - IndexInputVO index1VO = new IndexInputVO(indexGroup.getIndexId(), index1SampleValues, indexGroup.getThreshold(), indexGroup.getWeight(), sc1); - indexInputVOS.add(index1VO); - } while (collect.size() == NumConstant.TEN); - } + if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { + log.error("查询下属所有网格的党建能力平均值集合为空"); + return; } - BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - scoreCountOfSampleId.forEach((key,value) -> { - communityPublishArticle.forEach(grid -> { - if (key.equals(grid.getAgencyId())) { - grid.setCustomerId(customerId); - grid.setIndexCode(IndexCalConstant.COMMUNITY_GOVERN); - grid.setScore(grid.getScore().add(value)); - } + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); + Integer indexEnd = NumConstant.TEN; + List> partition = ListUtils.partition(subGridPartyAvgScore, indexEnd); + partition.forEach(publish -> { + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + 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); + indexInputVOS.add(index1VO); }); - } - }); - // 社区名义发文数量 - /*List publishArticleCounts = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCount(customerId, monthId); - detailListByParentCode.forEach(indexGroup -> { - if (indexGroup.getIndexCode().equals("shequmingyifwsl")) { - if (publishArticleCounts.size() == NumConstant.ONE) { - //TODO 结果为一条时 - } else if (publishArticleCounts.size() > NumConstant.ONE) { - Integer indexStart = NumConstant.ZERO; - Integer indexEnd = NumConstant.TEN; - List collect; - MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(publishArticleCounts.stream().map(o -> new BigDecimal(o.getPublishArticleCount())).collect(Collectors.toList())); - do { - collect = publishArticleCounts.stream().skip(indexEnd * indexStart).limit(indexEnd).collect(Collectors.toList()); - List ll = new ArrayList<>(); - collect.forEach(c -> { - SampleValue s = new SampleValue(c.getAgencyId(), c.getPublishArticleCount()); - ll.add(s); - FactIndexCommunityScoreDTO publishArticle = new FactIndexCommunityScoreDTO(); - BeanUtils.copyProperties(c,publishArticle); - communityPublishArticle.add(publishArticle); - }); - HashMap result = this.getCalResult(maxAndMinBigDecimal, ll, indexGroup); - result.forEach((key,value) -> { - communityPublishArticle.forEach(publish -> { - if (publish.getAgencyId().equals(key)){ - publish.setIndexCode(indexGroup.getIndexCode()); - publish.setScore(value); - } - }); - }); - indexStart++; - } while (collect.size() == NumConstant.TEN); + } else { + // 社区名义发文数量 + List> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId); + if (CollectionUtils.isEmpty(mapList)) { + log.error("查询社区名义发文数量集合为空"); + return; } - } - });*/ - subAllGridList.forEach(grid -> { - communityPublishArticle.forEach(publish -> { - if (grid.getAgencyId().equals(publish.getAgencyId())){ - grid.setScore(grid.getScore().add(publish.getScore())); - grid.setIndexCode(IndexCalConstant.COMMUNITY_PARTY); + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error("指标Code未查询出对应字段 【" + detail.getIndexCode() + "】"); + return; } - }); + List decimalList = mapList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> publishArticleList = ListUtils.partition(mapList, 10); + publishArticleList.forEach(publish -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + 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); + indexInputVOS.add(index1VO); + }); + } }); - deleteAndInsert(customerId,monthId,IndexCalConstant.COMMUNITY_PARTY,subAllGridList); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); return true; } /** - * @Description 社区治理能力 * @param customerId * @param monthId + * @Description 社区治理能力 * @author zxc * @date 2020/8/26 1:40 下午 */ @Transactional(rollbackFor = Exception.class) public Boolean communityGovernAbilityCalculate(String customerId, String monthId) { - List subAllGridList = new ArrayList<>(); List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error("指标明细查询集合为空"); + return false; + } + List indexInputVOS = new ArrayList<>(); detailListByParentCode.forEach(detail -> { - if (detail.getIndexCode().equals(IndexCalConstant.COMMUNITY_GOVERN_AVG)){ + if (IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode().equals(detail.getIndexCode())) { List subGridGovernAvg = factIndexGridScoreDao.selectSubGridGovernAvgScore(customerId, monthId); - if (subGridGovernAvg.size() == NumConstant.ONE){ - + if (subGridGovernAvg.size() == NumConstant.ONE) { // TODO - - }else if (subGridGovernAvg.size() > NumConstant.ONE){ + } else if (subGridGovernAvg.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); - Integer indexStart = NumConstant.ZERO; - Integer indexEnd = NumConstant.TEN; - List collect; - do { - collect = subGridGovernAvg.stream().skip(indexEnd * indexStart).limit(indexEnd).collect(Collectors.toList()); + List> governAvg = ListUtils.partition(subGridGovernAvg, 10); + governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); - collect.forEach(c -> { + avg.forEach(c -> { SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); - FactIndexCommunityScoreDTO dto = new FactIndexCommunityScoreDTO(); - BeanUtils.copyProperties(c,dto); - subAllGridList.add(dto); }); - HashMap result = this.getCalResult(maxAndMinBigDecimal, index1SampleValues, detail); - result.forEach((key,value) -> { - subAllGridList.forEach(grid -> { - if (grid.getAgencyId().equals(key)){ - grid.setScore(value); - } - }); + 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); + indexInputVOS.add(index1VO); + }); + } + } else { + List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(customerId, monthId); + if (communityGovernAbility.size() == NumConstant.ONE) { + // TODO + } else if (communityGovernAbility.size() > NumConstant.ONE) { + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error("指标Code未查询出对应字段 【" + detail.getIndexCode() + "】"); + return; + } + List decimalList = communityGovernAbility.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> governAbilityList = ListUtils.partition(communityGovernAbility, 10); + governAbilityList.forEach(governAbility -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + List index1SampleValues = new ArrayList<>(); + governAbility.forEach(c -> { + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); }); - indexStart++; - }while (collect.size() == NumConstant.TEN); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + indexInputVOS.add(index1VO); + }); } } }); - - List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(customerId, monthId); - if (communityGovernAbility.size() == NumConstant.ONE){ - // TODO - }else if (communityGovernAbility.size() > NumConstant.ONE){ - List indexInputVOS = new ArrayList<>(); - detailListByParentCode.forEach(detail -> { - String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); - if (!StringUtils.isEmpty(fieldNameByIndexCode)){ - if (communityGovernAbility.get(NumConstant.ZERO).containsKey(fieldNameByIndexCode)) { - List decimalList = communityGovernAbility.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); - MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); - Integer indexStart = NumConstant.ZERO; - Integer indexEnd = NumConstant.TEN; - List> collect; - do { - collect = communityGovernAbility.stream().skip(indexEnd * indexStart).limit(indexEnd).collect(Collectors.toList()); - ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); - List index1SampleValues = new ArrayList<>(); - collect.forEach(c -> { - 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); - indexInputVOS.add(index1VO); - } while (collect.size() == NumConstant.TEN); - } - } - }); - BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - scoreCountOfSampleId.forEach((key,value) -> { - subAllGridList.forEach(grid -> { - if (key.equals(grid.getAgencyId())) { - grid.setCustomerId(customerId); - grid.setIndexCode(IndexCalConstant.COMMUNITY_GOVERN); - grid.setScore(grid.getScore().add(value)); - } - }); - }); - } - deleteAndInsert(customerId,monthId,IndexCalConstant.COMMUNITY_GOVERN,subAllGridList); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); return true; } /** - * @Description 社区服务能力 * @param customerId * @param monthId + * @Description 社区服务能力 * @author zxc * @date 2020/8/31 1:38 下午 */ @Transactional(rollbackFor = Exception.class) public Boolean communityServiceAbilityCalculate(String customerId, String monthId) { - List subAllGridList = new ArrayList<>(); - List communityPublishArticle = new ArrayList<>(); List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error("指标明细查询集合为空"); + return false; + } + List indexInputVOS = new ArrayList<>(); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); - if (indexCode.equals(IndexCalConstant.COMMUNITY_SERVICE_AVG)){ + if (IndexCodeEnum.SHE_QU_XIA_JI_SYWGFWNLDFPJZ.getCode().equals(indexCode)) { List subGridServiceAvg = factIndexGridScoreDao.selectSubGridServiceAvgScore(customerId, monthId); - if (subGridServiceAvg.size() == NumConstant.ONE){ + if (subGridServiceAvg.size() == NumConstant.ONE) { // TODO 只有一条记录时 - }else if (subGridServiceAvg.size() > NumConstant.ONE ){ + } else if (subGridServiceAvg.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); - Integer indexStart = NumConstant.ZERO; - Integer indexEnd = NumConstant.TEN; - List collect; - do { - collect = subGridServiceAvg.stream().skip(indexEnd * indexStart).limit(indexEnd).collect(Collectors.toList()); + List> serviceAvgList = ListUtils.partition(subGridServiceAvg, 10); + serviceAvgList.forEach(serviceAvg -> { BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); List index1SampleValues = new ArrayList<>(); - collect.forEach(c -> { + serviceAvg.forEach(c -> { SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); - FactIndexCommunityScoreDTO dto = new FactIndexCommunityScoreDTO(); - BeanUtils.copyProperties(c,dto); - subAllGridList.add(dto); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues,detail.getThreshold(), detail.getWeight(), sc1); - List indexInputVOS = Arrays.asList(index1VO); - BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - List result = batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); - result.get(NumConstant.ZERO).getIndexScoreVOs().forEach(agency -> { - subAllGridList.forEach(grid -> { - if (grid.getAgencyId().equals(agency.getSampleId())){ - grid.setScore(agency.getSampleScore()); - } - }); - }); - indexStart++; - }while (collect.size() == NumConstant.TEN); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + indexInputVOS.add(index1VO); + }); } - }else{ - List communityActivityCount = factIndexServiceAblityOrgMonthlyDao.selectActivityCount(customerId, monthId); - if (communityActivityCount.size() == NumConstant.ONE){ + } else { + List> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMap(customerId, monthId); + if (CollectionUtils.isEmpty(communityActivityCountList)) { + log.error(""); + return; + } + if (communityActivityCountList.size() == NumConstant.ONE) { // TODO - }else if (communityActivityCount.size() > NumConstant.ONE){ - Integer indexStart = NumConstant.ZERO; - Integer indexEnd = NumConstant.TEN; - List collect; - MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(communityActivityCount.stream().map(o -> new BigDecimal(o.getActivityCount())).collect(Collectors.toList())); - do { - collect = communityActivityCount.stream().skip(indexEnd * indexStart).limit(indexEnd).collect(Collectors.toList()); - List ll = new ArrayList<>(); - collect.forEach(c -> { - SampleValue s = new SampleValue(c.getAgencyId(), c.getActivityCount()); - ll.add(s); - FactIndexCommunityScoreDTO publishArticle = new FactIndexCommunityScoreDTO(); - BeanUtils.copyProperties(c,publishArticle); - communityPublishArticle.add(publishArticle); - }); - HashMap result = this.getCalResult(maxAndMinBigDecimal, ll, detail); - result.forEach((k,v) -> { - communityPublishArticle.forEach(publish -> { - if (publish.getAgencyId().equals(k)){ - publish.setScore(v); - } - }); + } else if (communityActivityCountList.size() > NumConstant.ONE) { + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error("指标Code未查询出对应字段 【" + detail.getIndexCode() + "】"); + return; + } + List decimalList = communityActivityCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> communityActivityList = ListUtils.partition(communityActivityCountList, 10); + communityActivityList.forEach(communityActivity -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + List index1SampleValues = new ArrayList<>(); + communityActivity.forEach(c -> { + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); }); - indexStart++; - } while (collect.size() == NumConstant.TEN); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + indexInputVOS.add(index1VO); + }); } } }); - subAllGridList.forEach(grid -> { - grid.setIndexCode(IndexCalConstant.COMMUNITY_SERVICE); - communityPublishArticle.forEach(publish -> { - if (grid.getAgencyId().equals(publish.getAgencyId())){ - grid.setScore(grid.getScore().add(publish.getScore())); - grid.setCustomerId(customerId); - } - }); - }); - deleteAndInsert(customerId,monthId,IndexCalConstant.COMMUNITY_SERVICE,subAllGridList); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode()); + deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); return true; } /** - * @Description 社区相关计算 * @param customerId * @param monthId + * @Description 社区相关计算 * @author zxc * @date 2020/9/1 9:21 上午 */ @@ -380,14 +276,14 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni List factIndexCommunityScoreEntities = factIndexCommunityScoreDao.selectCommunityInfo(customerId, monthId); detailListByParentCode.forEach(detail -> { factIndexCommunityScoreEntities.forEach(community -> { - if (detail.getIndexCode().equals(community.getIndexCode())){ + if (detail.getIndexCode().equals(community.getIndexCode())) { community.setScore(community.getScore().multiply(detail.getWeight())); } }); }); Map> collect = factIndexCommunityScoreEntities.stream().collect(Collectors.groupingBy(FactIndexCommunityScoreDTO::getAgencyId)); List result = new ArrayList<>(); - collect.forEach((key,value) -> { + collect.forEach((key, value) -> { FactIndexCommunityScoreDTO score = new FactIndexCommunityScoreDTO(); score.setIsTotal(NumConstant.ONE_STR); score.setCustomerId(customerId); @@ -401,44 +297,44 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni }); result.add(score); }); - deleteAndInsert(customerId,monthId,IndexCalConstant.COMMUNITY_RELATE,result); + deleteAndInsert(customerId, monthId, IndexCalConstant.COMMUNITY_RELATE, result); return true; } /** - * @Description 计算社区相关总分 * @param customerId * @param monthId + * @Description 计算社区相关总分 * @author zxc * @date 2020/9/1 4:12 下午 */ - public Boolean calCommunityAll(String customerId,String monthId){ + public Boolean calCommunityAll(String customerId, String monthId) { Boolean aBoolean = communityPartyCalculate(customerId, monthId);//党建能力 - if (!aBoolean.equals(true)){ + if (!aBoolean.equals(true)) { throw new RenException("calculate community-party-ability failure ......"); } Boolean bBoolean = communityGovernAbilityCalculate(customerId, monthId);// 治理能力 - if (!bBoolean.equals(true)){ + if (!bBoolean.equals(true)) { throw new RenException("calculate community-govern-ability failure ......"); } Boolean cBoolean = communityServiceAbilityCalculate(customerId, monthId);// 服务能力 - if (!cBoolean.equals(true)){ + if (!cBoolean.equals(true)) { throw new RenException("calculate community-service-ability failure ......"); } Boolean dBoolean = communityRelate(customerId, monthId); - if (!dBoolean.equals(true)){ + if (!dBoolean.equals(true)) { throw new RenException("calculate community-all insert failure ......"); } return true; } /** - * @Description BigDecimal类型获取最大数和最小数 * @param list + * @Description BigDecimal类型获取最大数和最小数 * @author zxc * @date 2020/8/27 1:30 下午 */ - public MaxAndMinBigDecimalResultDTO getMaxAndMinBigDecimal(List list){ + public MaxAndMinBigDecimalResultDTO getMaxAndMinBigDecimal(List list) { BigDecimal max = Collections.max(list); BigDecimal min = Collections.min(list); MaxAndMinBigDecimalResultDTO result = new MaxAndMinBigDecimalResultDTO(); @@ -447,25 +343,34 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return result; } - public HashMap getCalResult(MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal,List ll, IndexGroupDetailEntity indexGroup){ - BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); - IndexInputVO index1VO = new IndexInputVO(indexGroup.getIndexId(), ll,indexGroup.getThreshold(), indexGroup.getWeight(), sc); - List indexInputVOS = Arrays.asList(index1VO); - BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - return batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - } - /** - * @Description 先删除记录,在插入 * @param customerId * @param monthId * @param indexCode * @param subAllGridList + * @Description 先删除记录,在插入 * @author zxc * @date 2020/9/1 4:24 下午 */ - public void deleteAndInsert(String customerId,String monthId,String indexCode,List subAllGridList){ - factIndexCommunityScoreDao.deleteOldRecord(customerId,monthId,indexCode); + public void deleteAndInsert(String customerId, String monthId, String indexCode, List subAllGridList) { + factIndexCommunityScoreDao.deleteOldRecord(customerId, monthId, indexCode); factIndexCommunityScoreDao.insertCommunityPartyRecord(subAllGridList); } + + public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode) { + List result = new ArrayList<>(); + scoreCountOfSampleId.forEach((k, v) -> { + FactIndexCommunityScoreDTO score = new FactIndexCommunityScoreDTO(); + score.setCustomerId(customerId); + score.setAgencyId(k); + score.setMonthId(monthId); + score.setQuarterId(DateUtils.getQuarterId(monthId)); + score.setYearId(DateUtils.getYearId(monthId)); + score.setIsTotal(isTotal); + score.setIndexCode(indexCode); + score.setScore(v); + result.add(score); + }); + return result; + } } From be586db3bf92c9befb3cf8e3cbaeb7942085e1be Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 2 Sep 2020 13:48:15 +0800 Subject: [PATCH 143/226] =?UTF-8?q?=E5=BD=92=E4=B8=80=E5=8C=BA=E9=97=B4?= =?UTF-8?q?=E6=94=B9=E4=B8=BA0-100?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/support/normalizing/BigDecimalScoreCalculator.java | 2 +- .../main/java/com/epmet/support/normalizing/ScoreConstants.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/BigDecimalScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/BigDecimalScoreCalculator.java index b86c347d24..4f884c3e34 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/BigDecimalScoreCalculator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/BigDecimalScoreCalculator.java @@ -61,7 +61,7 @@ public class BigDecimalScoreCalculator extends ScoreCalculator { this.maxValue = maxSourceValue; this.correlation = correlation; prepare4BoundaryValue(); - System.out.println("最小值:"+minScore+";最大值:"+maxScore); + System.out.println("归一区间最小值:"+minScore+";归一区间最大值:"+maxScore+";样本最小值:"+minSourceValue+";样本最大值:"+maxSourceValue); } @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java index 43688efa21..1eecc8cf36 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java @@ -7,7 +7,7 @@ import java.math.BigDecimal; */ public class ScoreConstants { - public static final BigDecimal MIN_SCORE = new BigDecimal(1); + public static final BigDecimal MIN_SCORE = new BigDecimal(0); public static final BigDecimal MAX_SCORE = new BigDecimal(100); } From 543dbeee5f2ae5f43b6f1897438614a1402a1599 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 2 Sep 2020 14:05:14 +0800 Subject: [PATCH 144/226] =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E4=BC=98=E5=8C=96=204?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/constant/IndexCalConstant.java | 12 +----------- .../java/com/epmet/controller/DemoController.java | 2 +- .../indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java | 2 +- .../IndexCalculateCommunityService.java | 7 +------ .../impl/IndexCalculateCommunityServiceImpl.java | 6 +++--- .../indexcal/impl/IndexCalculateServiceImpl.java | 2 +- 6 files changed, 8 insertions(+), 23 deletions(-) rename epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/{screen => indexcal}/IndexCalculateCommunityService.java (60%) rename epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/{screen => indexcal}/impl/IndexCalculateCommunityServiceImpl.java (99%) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java index d56ae32d54..766e778134 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java @@ -21,17 +21,7 @@ public interface IndexCalConstant { String USER_ID="USER_ID"; String YEAR_ID = "YEAR_ID"; - String COMMUNITY_GOVERN = "zhilinengli"; - - String COMMUNITY_PARTY = "dangjiannengli"; - - String COMMUNITY_SERVICE = "fuwunengli"; - - String COMMUNITY_SERVICE_AVG = "shequxiajisywgfwnldfpjz"; - - String COMMUNITY_GOVERN_AVG = "shequxiashusywgzlnlhzpjz"; - - String COMMUNITY_PARTY_AVG = "xiashusuoyouwgddjnlpjz"; + String COMMUNITY_LEVEL = "community"; String COMMUNITY_RELATE = "shequxiangguan"; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index b52596a207..6c6f22f8a2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -18,7 +18,7 @@ import com.epmet.entity.screen.ScreenCustomerGridEntity; import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.service.StatsDemoService; import com.epmet.service.indexcal.GridCorreLationService; -import com.epmet.service.screen.IndexCalculateCommunityService; +import com.epmet.service.indexcal.IndexCalculateCommunityService; import com.epmet.service.stats.DimAgencyService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java index f28e6a2fd3..a9e015067a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java @@ -71,5 +71,5 @@ public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao> selectCommunityGovernAbility(@Param("customerId")String customerId, @Param("monthId")String monthId); + List> selectCommunityGovernAbility(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateCommunityService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/IndexCalculateCommunityService.java similarity index 60% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateCommunityService.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/IndexCalculateCommunityService.java index b0803ae2be..50e5b4a04a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateCommunityService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/IndexCalculateCommunityService.java @@ -1,9 +1,4 @@ -package com.epmet.service.screen; - -import com.epmet.dto.screen.result.CommunityGovernAbilityCalculateResultDTO; -import com.epmet.dto.screen.result.CommunityPublishArticleCountCalculateResultDTO; - -import java.util.List; +package com.epmet.service.indexcal; /** * @Author zxc diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCalculateCommunityServiceImpl.java similarity index 99% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCalculateCommunityServiceImpl.java index 0e778ae49f..49bb6a309b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCalculateCommunityServiceImpl.java @@ -1,4 +1,4 @@ -package com.epmet.service.screen.impl; +package com.epmet.service.indexcal.impl; import com.alibaba.druid.util.StringUtils; import com.epmet.commons.tools.constant.NumConstant; @@ -13,8 +13,8 @@ import com.epmet.dto.screen.FactIndexCommunityScoreDTO; import com.epmet.dto.screen.result.*; import com.epmet.entity.screen.IndexGroupDetailEntity; import com.epmet.eum.IndexCodeEnum; +import com.epmet.service.indexcal.IndexCalculateCommunityService; import com.epmet.service.indexcal.IndexCodeFieldReService; -import com.epmet.service.screen.IndexCalculateCommunityService; import com.epmet.service.screen.IndexGroupDetailService; import com.epmet.support.normalizing.*; import com.epmet.support.normalizing.batch.BatchScoreCalculator; @@ -160,7 +160,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni }); } } else { - List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(customerId, monthId); + List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); if (communityGovernAbility.size() == NumConstant.ONE) { // TODO } else if (communityGovernAbility.size() > NumConstant.ONE) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCalculateServiceImpl.java index 3bd41f9df4..dcc68673bf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCalculateServiceImpl.java @@ -10,7 +10,7 @@ import com.epmet.redis.IndexCodeFieldReRedis; import com.epmet.service.indexcal.CpcIndexCalculateService; import com.epmet.service.indexcal.GridCorreLationService; import com.epmet.service.indexcal.IndexCalculateService; -import com.epmet.service.screen.IndexCalculateCommunityService; +import com.epmet.service.indexcal.IndexCalculateCommunityService; import com.epmet.util.DimIdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; From e456e1d8bf943f006d930647b114a85f115893f9 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 2 Sep 2020 14:12:40 +0800 Subject: [PATCH 145/226] =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E4=BC=98=E5=8C=96=206?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcoll/FactIndexPartyAblityOrgMonthlyDao.java | 2 +- .../FactIndexServiceAblityOrgMonthlyDao.java | 11 ++++++++++- .../impl/IndexCalculateCommunityServiceImpl.java | 6 +++--- .../indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml | 2 +- .../indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml | 2 +- .../indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml | 2 +- 6 files changed, 17 insertions(+), 8 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java index ef7cc36de8..ff0435e326 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java @@ -81,5 +81,5 @@ public interface FactIndexPartyAblityOrgMonthlyDao extends BaseDao> selectPublishArticleCountMap(@Param("customerId")String customerId, @Param("monthId")String monthId); + List> selectPublishArticleCountMap(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java index c557c74ac2..febe328b7b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java @@ -74,5 +74,14 @@ public interface FactIndexServiceAblityOrgMonthlyDao extends BaseDao selectActivityCount(@Param("customerId")String customerId, @Param("monthId")String monthId); - List> selectActivityCountMap(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * @Description 社区活动组织次数 + * @param customerId + * @param monthId + * @param level + * @author zxc + * @date 2020/9/2 2:09 下午 + */ + List> selectActivityCountMap(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCalculateCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCalculateCommunityServiceImpl.java index 49bb6a309b..bea808f8be 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCalculateCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCalculateCommunityServiceImpl.java @@ -93,7 +93,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni }); } else { // 社区名义发文数量 - List> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId); + List> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); if (CollectionUtils.isEmpty(mapList)) { log.error("查询社区名义发文数量集合为空"); return; @@ -228,9 +228,9 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni }); } } else { - List> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMap(customerId, monthId); + List> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMap(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); if (CollectionUtils.isEmpty(communityActivityCountList)) { - log.error(""); + log.error("查询社区活动组织次数集合为空"); return; } if (communityActivityCountList.size() == NumConstant.ONE) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml index 76d61d7b83..8024bb396f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml @@ -104,7 +104,7 @@ fact_index_govrn_ablity_org_monthly WHERE del_flag = '0' - AND data_type = 'community' + AND data_type = #{level} AND customer_id = #{customerId} AND month_id = #{monthId} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml index 50df452642..10264230e8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml @@ -104,7 +104,7 @@ fact_index_party_ablity_org_monthly WHERE del_flag = '0' - AND data_type = 'community' + AND data_type = #{level} AND customer_id = #{customerId} AND month_id = #{monthId} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml index 8315280f89..6cbaedc9cb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml @@ -104,7 +104,7 @@ fact_index_service_ablity_org_monthly WHERE del_flag = '0' - AND data_type = 'community' + AND data_type = #{level} AND customer_id = #{customerId} AND month_id = #{monthId} From 667dd0ef25288143878daad9f3ca1e825f1d9f42 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 2 Sep 2020 14:55:33 +0800 Subject: [PATCH 146/226] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=9B=B8=E5=85=B3-?= =?UTF-8?q?=E5=8F=AA=E4=B8=8A=E4=BC=A0=E4=B8=80=E6=9D=A1=E4=BA=8B=E5=AE=9E?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=EF=BC=8C=E5=88=86=E5=80=BC=E9=BB=98=E8=AE=A4?= =?UTF-8?q?50?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/constant/NumConstant.java | 4 + .../FactIndexGovrnAblityGridMonthlyDao.java | 11 ++- .../FactIndexPartyAblityGridMonthlyDao.java | 16 ++++ .../FactIndexServiceAblityGridMonthlyDao.java | 19 +++++ .../impl/GridCorreLationServiceImpl.java | 75 ++++++++++++++----- .../FactIndexGovrnAblityGridMonthlyDao.xml | 12 +++ .../FactIndexPartyAblityGridMonthlyDao.xml | 13 ++++ .../FactIndexServiceAblityGridMonthlyDao.xml | 24 ++++++ 8 files changed, 154 insertions(+), 20 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java index 0ac7dbf706..e906535166 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java @@ -1,5 +1,7 @@ package com.epmet.commons.tools.constant; +import java.math.BigDecimal; + /** * 常用数字常量 * @@ -56,4 +58,6 @@ public interface NumConstant { String POSITIVE_EIGHT_STR = "+8"; String EMPTY_STR = ""; String ONE_NEG_STR = "-1"; + + String FIFTY_STR="50"; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java index b3002609d1..589a9103c3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java @@ -91,8 +91,17 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao selectPartyAblityGridMinAndMax(@Param("customerId") String customerId, @Param("monthId") String monthId); + /** + * @return java.lang.Integer + * @param formDTO + * @author yinzuomei + * @description 查询(党建能力-网格相关事实表) 这个月共上传记录数 + * @Date 2020/9/2 14:28 + **/ Integer selectCount(CalculateCommonFormDTO formDTO); + + /** + * @return java.lang.String + * @param formDTO + * @author yinzuomei + * @description 场景:客户这个月只上传了一个网格的事实记录 + * @Date 2020/9/2 14:45 + **/ + String selectTheOneGrid(CalculateCommonFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.java index 7357c0cedc..fecd99a00b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.PageQueryGridFormDTO; import com.epmet.dto.indexcollect.FactIndexServiceAblityGridMonthlyDTO; import com.epmet.dto.indexcollect.form.GridServiceAbilityFormDTO; @@ -85,4 +86,22 @@ public interface FactIndexServiceAblityGridMonthlyDao extends BaseDao selectServiceAblityGridMinAndMax(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @return int + * @param formDTO + * @author yinzuomei + * @description 查询(服务能力-网格相关事实表)共上传记录数 + * @Date 2020/9/2 14:28 + **/ + int selectCount(CalculateCommonFormDTO formDTO); + + /** + * @return java.lang.String + * @param formDTO + * @author yinzuomei + * @description 场景:客户这个月只上传了一个网格的事实记录 + * @Date 2020/9/2 14:46 + **/ + String selectTheOneGrid(CalculateCommonFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java index 40013cfaf5..6bb15d784d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java @@ -130,6 +130,10 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { if (NumConstant.ZERO == total) { log.warn(String.format("customerId=%s,monthId=%s,没有上传网格相关-党建能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); return; + } else if (NumConstant.ONE == total) { + //只有一个网格时 + log.warn(String.format("indexCode:%s,customerId:%s,monthId:%s,only one fact_index_party_ablity_grid_monthly record",IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),formDTO.getCustomerId(),formDTO.getMonthId())); + this.handleOneGridScene(formDTO,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); } //总页数,进行批量查询,批量计算 int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE); @@ -181,6 +185,31 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { saveGridCorreLationResult(formDTO, resultMapList, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), NumConstant.ZERO_STR); } + /** + * @param formDTO + * @param indexCode + * @return void + * @author yinzuomei + * @description 只有一条事实记录时,分值默认赋50 + * @Date 2020/9/2 14:35 + **/ + private void handleOneGridScene(CalculateCommonFormDTO formDTO, String indexCode) { + List> resultMapList = new ArrayList<>(); + HashMap resultMap = new HashMap<>(); + String gridId =null; + if (IndexCodeEnum.DANG_JIAN_NENG_LI.getCode().equals(indexCode)) { + gridId = factIndexPartyAblityGridMonthlyDao.selectTheOneGrid(formDTO); + } else if (IndexCodeEnum.ZHI_LI_NENG_LI.getCode().equals(indexCode)) { + gridId = factIndexGovrnAblityGridMonthlyDao.selectTheOneGrid(formDTO); + } else if (IndexCodeEnum.FU_WU_NENG_LI.getCode().equals(indexCode)) { + gridId = factIndexServiceAblityGridMonthlyDao.selectTheOneGrid(formDTO); + } + resultMap.put(gridId, new BigDecimal(NumConstant.FIFTY_STR)); + resultMapList.add(resultMap); + // 保存中间表 + saveGridCorreLationResult(formDTO, resultMapList, indexCode, NumConstant.ZERO_STR); + } + /** * @param calculateCommonFormDTO * @return java.util.Map @@ -190,7 +219,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { **/ private Map getContactMassesAblityMap(CalculateCommonFormDTO calculateCommonFormDTO) { Map map = new HashMap<>(); - /*List list = cpcScoreDao.selectListGridContactMassesAvgValue(calculateCommonFormDTO); + List list = cpcScoreDao.selectListGridContactMassesAvgValue(calculateCommonFormDTO); if (!CollectionUtils.isEmpty(list)) { BigDecimal minValue = Collections.min(list); BigDecimal maxValue = Collections.max(list); @@ -199,10 +228,10 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { return map; } map.put(StrConstant.MIN, new BigDecimal(NumConstant.ZERO_STR)); - map.put(StrConstant.MAX, new BigDecimal(NumConstant.ZERO_STR));*/ + map.put(StrConstant.MAX, new BigDecimal(NumConstant.ZERO_STR)); //FOR TEST - map.put(StrConstant.MIN, new BigDecimal("24.35")); - map.put(StrConstant.MAX, new BigDecimal("46.13")); + /*map.put(StrConstant.MIN, new BigDecimal("24.35")); + map.put(StrConstant.MAX, new BigDecimal("46.13"));*/ return map; } @@ -215,19 +244,19 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { * @Date 2020/8/31 9:50 **/ private BigDecimal getGridContactMassesAvgValue(CalculateCommonFormDTO calculateCommonFormDTO, String gridId) { - /*BigDecimal result = cpcScoreDao.selectGridContactMassesAvgValue(calculateCommonFormDTO.getCustomerId(), calculateCommonFormDTO.getMonthId(), gridId); + BigDecimal result = cpcScoreDao.selectGridContactMassesAvgValue(calculateCommonFormDTO.getCustomerId(), calculateCommonFormDTO.getMonthId(), gridId); if (null == result) { return new BigDecimal(NumConstant.ZERO_STR); - }*/ + } //FOR TEST - BigDecimal result=null; + /*BigDecimal result=null; if(IndexCalConstant.S1_C1_G1.equals(gridId)){ result= new BigDecimal("24.43"); }else if(IndexCalConstant.S1_C1_G2.equals(gridId)){ result=new BigDecimal("46.13"); }else if(IndexCalConstant.S1_C2_G1.equals(gridId)){ result=new BigDecimal("24.35"); - } + }*/ return result; } @@ -240,19 +269,19 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { * @Date 2020/8/31 15:51 **/ private BigDecimal getGridJoinIssueAvgValue(CalculateCommonFormDTO formDTO, String gridId) { - /*BigDecimal result = cpcScoreDao.selectGridJoinIssueAvgValue(formDTO.getCustomerId(), formDTO.getMonthId(), gridId); + BigDecimal result = cpcScoreDao.selectGridJoinIssueAvgValue(formDTO.getCustomerId(), formDTO.getMonthId(), gridId); if (null == result) { return new BigDecimal(NumConstant.ZERO_STR); - }*/ + } //FOR TEST - BigDecimal result=null; + /*BigDecimal result=null; if(IndexCalConstant.S1_C1_G1.equals(gridId)){ result= new BigDecimal("29.40"); }else if(IndexCalConstant.S1_C1_G2.equals(gridId)){ result=new BigDecimal("18.30"); }else if(IndexCalConstant.S1_C2_G1.equals(gridId)){ result=new BigDecimal("9.15"); - } + }*/ return result; } @@ -265,7 +294,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { **/ private Map getJoinIssueAblityMap(CalculateCommonFormDTO calculateCommonFormDTO) { Map map = new HashMap<>(); - /*List list = cpcScoreDao.selectListJoinIssueAvgValue(calculateCommonFormDTO); + List list = cpcScoreDao.selectListJoinIssueAvgValue(calculateCommonFormDTO); if (!CollectionUtils.isEmpty(list)) { BigDecimal minValue = Collections.min(list); BigDecimal maxValue = Collections.max(list); @@ -274,10 +303,10 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { return map; } map.put(StrConstant.MIN, new BigDecimal(NumConstant.ZERO_STR)); - map.put(StrConstant.MAX, new BigDecimal(NumConstant.ZERO_STR));*/ + map.put(StrConstant.MAX, new BigDecimal(NumConstant.ZERO_STR)); // FOR TEST - map.put(StrConstant.MIN, new BigDecimal("9.15")); - map.put(StrConstant.MAX, new BigDecimal("29.4")); + /*map.put(StrConstant.MIN, new BigDecimal("9.15")); + map.put(StrConstant.MAX, new BigDecimal("29.4"));*/ return map; } @@ -414,8 +443,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { List> sampleValueList = new ArrayList<>(); IndexInputVO indexInputVO1 = new IndexInputVO(index.getIndexCode(), sampleValueList, -// index.getThreshold(), - new BigDecimal("-1"),//FOR TEST + index.getThreshold(), +// new BigDecimal("-1"),//FOR TEST index.getWeight(), scoreCalculator); map.put(index.getIndexCode(), indexInputVO1); @@ -437,6 +466,10 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { if (NumConstant.ZERO == total) { log.warn(String.format("customerId%s,monthId%s,没有上传网格相关-治理能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); return; + }else if (NumConstant.ONE == total) { + //只有一个网格时 + log.warn(String.format("indexCode:%s,customerId:%s,monthId:%s,only one fact_index_govrn_ablity_grid_monthly record",IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),formDTO.getCustomerId(),formDTO.getMonthId())); + this.handleOneGridScene(formDTO,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); } //总页数,进行批量查询,批量计算 int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE); @@ -496,10 +529,14 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { **/ private void calculateGridFuWu(CalculateCommonFormDTO formDTO, List indexList) { //查询总记录数 - int total = factIndexGovrnAblityGridMonthlyDao.selectCount(formDTO); + int total = factIndexServiceAblityGridMonthlyDao.selectCount(formDTO); if (NumConstant.ZERO == total) { log.warn(String.format("customerId:%s,monthId:%s,没有上传网格相关-服务能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); return; + }else if (NumConstant.ONE == total) { + //只有一个网格时 + log.warn(String.format("indexCode:%s,customerId:%s,monthId:%s,only one fact_index_service_ablity_grid_monthly record",IndexCodeEnum.FU_WU_NENG_LI.getCode(),formDTO.getCustomerId(),formDTO.getMonthId())); + this.handleOneGridScene(formDTO,IndexCodeEnum.FU_WU_NENG_LI.getCode()); } //总页数,进行批量查询,批量计算 int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml index 52d6ad6c20..976d74e3ca 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml @@ -149,4 +149,16 @@ AND m.CUSTOMER_ID =#{customerId} AND m.MONTH_ID=#{monthId} + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml index f0d83bf06c..239e7c349b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml @@ -170,6 +170,7 @@ AND m.MONTH_ID =#{monthId} + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml index 1ab7d916d0..2afb14cf3c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml @@ -108,4 +108,28 @@ and m.CUSTOMER_ID=#{customerId} and m.MONTH_ID=#{monthId} + + + + + + From 2b907596aaeab321796f4e78e552a7de0345c605 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 2 Sep 2020 15:04:02 +0800 Subject: [PATCH 147/226] =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E4=BC=98=E5=8C=96=207?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IndexCalculateCommunityServiceImpl.java | 112 ++++++++++++------ 1 file changed, 77 insertions(+), 35 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCalculateCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCalculateCommunityServiceImpl.java index bea808f8be..70b539beae 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCalculateCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCalculateCommunityServiceImpl.java @@ -77,20 +77,24 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { log.error("查询下属所有网格的党建能力平均值集合为空"); return; - } - MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); - Integer indexEnd = NumConstant.TEN; - List> partition = ListUtils.partition(subGridPartyAvgScore, indexEnd); - partition.forEach(publish -> { - List index1SampleValues = new ArrayList<>(); - publish.forEach(c -> { - SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); - index1SampleValues.add(s); + }else if (subGridPartyAvgScore.size() == NumConstant.ONE){ + sizeOne(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + return; + }else if (subGridPartyAvgScore.size() > NumConstant.ONE) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); + Integer indexEnd = NumConstant.TEN; + List> partition = ListUtils.partition(subGridPartyAvgScore, indexEnd); + partition.forEach(publish -> { + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + 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); + indexInputVOS.add(index1VO); }); - 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); - indexInputVOS.add(index1VO); - }); + } } else { // 社区名义发文数量 List> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); @@ -102,20 +106,24 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni if (StringUtils.isEmpty(fieldNameByIndexCode)) { log.error("指标Code未查询出对应字段 【" + detail.getIndexCode() + "】"); return; - } - List decimalList = mapList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); - MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); - List>> publishArticleList = ListUtils.partition(mapList, 10); - publishArticleList.forEach(publish -> { - ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); - List index1SampleValues = new ArrayList<>(); - publish.forEach(c -> { - SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); - index1SampleValues.add(s); + }else if (mapList.size() == NumConstant.ONE){ + sizeOne(mapList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + return; + }else if (mapList.size() > NumConstant.ONE) { + List decimalList = mapList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> publishArticleList = ListUtils.partition(mapList, 10); + publishArticleList.forEach(publish -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + 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); + indexInputVOS.add(index1VO); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); - indexInputVOS.add(index1VO); - }); + } } }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); @@ -144,7 +152,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni if (IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode().equals(detail.getIndexCode())) { List subGridGovernAvg = factIndexGridScoreDao.selectSubGridGovernAvgScore(customerId, monthId); if (subGridGovernAvg.size() == NumConstant.ONE) { - // TODO + sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + return; } else if (subGridGovernAvg.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> governAvg = ListUtils.partition(subGridGovernAvg, 10); @@ -160,9 +169,14 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni }); } } else { + // 治理能力的六个五级指标 List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); - if (communityGovernAbility.size() == NumConstant.ONE) { - // TODO + if (CollectionUtils.isEmpty(communityGovernAbility)){ + log.error("查询治理能力的六个五级指标集合为空"); + return; + }else if (communityGovernAbility.size() == NumConstant.ONE) { + sizeOne(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + return; } else if (communityGovernAbility.size() > NumConstant.ONE) { String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { @@ -212,7 +226,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni if (IndexCodeEnum.SHE_QU_XIA_JI_SYWGFWNLDFPJZ.getCode().equals(indexCode)) { List subGridServiceAvg = factIndexGridScoreDao.selectSubGridServiceAvgScore(customerId, monthId); if (subGridServiceAvg.size() == NumConstant.ONE) { - // TODO 只有一条记录时 + sizeOne(subGridServiceAvg.get(NumConstant.ZERO).getAgencyId().toString(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); + return; } else if (subGridServiceAvg.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> serviceAvgList = ListUtils.partition(subGridServiceAvg, 10); @@ -232,9 +247,9 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni if (CollectionUtils.isEmpty(communityActivityCountList)) { log.error("查询社区活动组织次数集合为空"); return; - } - if (communityActivityCountList.size() == NumConstant.ONE) { - // TODO + }else if (communityActivityCountList.size() == NumConstant.ONE) { + sizeOne(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); + return; } else if (communityActivityCountList.size() > NumConstant.ONE) { String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { @@ -353,10 +368,22 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni * @date 2020/9/1 4:24 下午 */ public void deleteAndInsert(String customerId, String monthId, String indexCode, List subAllGridList) { - factIndexCommunityScoreDao.deleteOldRecord(customerId, monthId, indexCode); - factIndexCommunityScoreDao.insertCommunityPartyRecord(subAllGridList); + if (!CollectionUtils.isEmpty(subAllGridList)) { + factIndexCommunityScoreDao.deleteOldRecord(customerId, monthId, indexCode); + factIndexCommunityScoreDao.insertCommunityPartyRecord(subAllGridList); + } } + /** + * @Description + * @param scoreCountOfSampleId 指标计算结果 + * @param customerId 客户ID + * @param monthId 月份ID + * @param isTotal 是否 总分【党建+治理+服务】 + * @param indexCode 党建能力:dangjiannengli,治理能力:zhilinengli,服务能力:fuwunengli,xx相关:xx相关 + * @author zxc + * @date 2020/9/2 2:37 下午 + */ public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode) { List result = new ArrayList<>(); scoreCountOfSampleId.forEach((k, v) -> { @@ -373,4 +400,19 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni }); return result; } + + /** + * @Description 当查询结果为一条时,调用此方法 + * @param agencyId + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/2 2:40 下午 + */ + public void sizeOne(String agencyId,String customerId,String monthId,String indexCode){ + HashMap scoreCountOfSampleId = new HashMap<>(); + scoreCountOfSampleId.put(agencyId,new BigDecimal(NumConstant.FIFTY)); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, indexCode); + deleteAndInsert(customerId, monthId, indexCode, result); + } } From 14142d608dceb0d1bcd0d470541dd3062e38f6a7 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 2 Sep 2020 15:33:06 +0800 Subject: [PATCH 148/226] =?UTF-8?q?=E5=8C=BA/=E8=A1=97=E9=81=93=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E5=88=86=E6=95=B0=E8=A1=A8,=E5=8C=BA=E7=9B=B4?= =?UTF-8?q?=E9=83=A8=E9=97=A8=E5=88=86=E5=80=BC=E8=A1=A8=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/indexcal/AgencyScoreDTO.java | 117 ++++++++++++++++++ .../com/epmet/dto/indexcal/DeptScoreDTO.java | 112 +++++++++++++++++ .../epmet/dao/indexcoll/AgencyScoreDao.java | 33 +++++ .../com/epmet/dao/indexcoll/DeptScoreDao.java | 33 +++++ .../entity/indexcoll/AgencyScoreEntity.java | 87 +++++++++++++ .../entity/indexcoll/DeptScoreEntity.java | 87 +++++++++++++ .../service/indexcal/AgencyScoreService.java | 95 ++++++++++++++ .../service/indexcal/DeptScoreService.java | 95 ++++++++++++++ .../indexcal/IndexCalculateStreetService.java | 18 +++ .../indexcal/impl/AgencyScoreServiceImpl.java | 99 +++++++++++++++ .../indexcal/impl/DeptScoreServiceImpl.java | 99 +++++++++++++++ .../impl/IndexCalculateStreetServiceImpl.java | 26 ++++ .../mapper/indexcoll/AgencyScoreDao.xml | 6 + .../mapper/indexcoll/DeptScoreDao.xml | 6 + 14 files changed, 913 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/AgencyScoreDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/DeptScoreDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/AgencyScoreEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/DeptScoreEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/AgencyScoreService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/DeptScoreService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/IndexCalculateStreetService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/AgencyScoreServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/DeptScoreServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCalculateStreetServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/AgencyScoreDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/DeptScoreDao.xml 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 new file mode 100644 index 0000000000..6e18cb5867 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java @@ -0,0 +1,117 @@ +/** + * 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.dto.indexcal; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 区/街道相关分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@Data +public class AgencyScoreDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织id(eg:社区或者街道id) + */ + private String agencyId; + + /** + * 上级组织id + */ + private String parentAgencyId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 1:总分;0不是;默认0 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;街道相关:jiedaoxiangguan;全区相关:quanquxiangguan + */ + private String indexCode; + + /** + * + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file 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 new file mode 100644 index 0000000000..b7a05696c3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDTO.java @@ -0,0 +1,112 @@ +/** + * 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.dto.indexcal; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 区直部门分值表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@Data +public class DeptScoreDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 部门id + */ + private String deptId; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 1:总分;0不是;默认0 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 治理能力:zhilinengli; + */ + private String indexCode; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/AgencyScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/AgencyScoreDao.java new file mode 100644 index 0000000000..6a076c057c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/AgencyScoreDao.java @@ -0,0 +1,33 @@ +/** + * 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.indexcoll; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.indexcoll.AgencyScoreEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 区/街道相关分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@Mapper +public interface AgencyScoreDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/DeptScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/DeptScoreDao.java new file mode 100644 index 0000000000..101dc3b759 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/DeptScoreDao.java @@ -0,0 +1,33 @@ +/** + * 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.indexcoll; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.indexcoll.DeptScoreEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 区直部门分值表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@Mapper +public interface DeptScoreDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/AgencyScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/AgencyScoreEntity.java new file mode 100644 index 0000000000..02b9bf0fd1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/AgencyScoreEntity.java @@ -0,0 +1,87 @@ +/** + * 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.entity.indexcoll; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 区/街道相关分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_agency_score") +public class AgencyScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织id(eg:社区或者街道id) + */ + private String agencyId; + + /** + * 上级组织id + */ + private String parentAgencyId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 1:总分;0不是;默认0 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;街道相关:jiedaoxiangguan;全区相关:quanquxiangguan + */ + private String indexCode; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/DeptScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/DeptScoreEntity.java new file mode 100644 index 0000000000..4e6db805a5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/DeptScoreEntity.java @@ -0,0 +1,87 @@ +/** + * 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.entity.indexcoll; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 区直部门分值表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_dept_score") +public class DeptScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 部门id + */ + private String deptId; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 1:总分;0不是;默认0 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 治理能力:zhilinengli; + */ + private String indexCode; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/AgencyScoreService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/AgencyScoreService.java new file mode 100644 index 0000000000..6ff75f918f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/AgencyScoreService.java @@ -0,0 +1,95 @@ +/** + * 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.service.indexcal; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.indexcal.AgencyScoreDTO; +import com.epmet.entity.indexcoll.AgencyScoreEntity; + +import java.util.List; +import java.util.Map; + +/** + * 区/街道相关分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +public interface AgencyScoreService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-09-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-09-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return AgencyScoreDTO + * @author generator + * @date 2020-09-02 + */ + AgencyScoreDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-09-02 + */ + void save(AgencyScoreDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-09-02 + */ + void update(AgencyScoreDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-09-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/DeptScoreService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/DeptScoreService.java new file mode 100644 index 0000000000..5d6f090d97 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/DeptScoreService.java @@ -0,0 +1,95 @@ +/** + * 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.service.indexcal; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.indexcal.DeptScoreDTO; +import com.epmet.entity.indexcoll.DeptScoreEntity; + +import java.util.List; +import java.util.Map; + +/** + * 区直部门分值表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +public interface DeptScoreService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-09-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-09-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DeptScoreDTO + * @author generator + * @date 2020-09-02 + */ + DeptScoreDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-09-02 + */ + void save(DeptScoreDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-09-02 + */ + void update(DeptScoreDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-09-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/IndexCalculateStreetService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/IndexCalculateStreetService.java new file mode 100644 index 0000000000..27c5196b6f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/IndexCalculateStreetService.java @@ -0,0 +1,18 @@ +package com.epmet.service.indexcal; + +/** + * @Author zxc + * @DateTime 2020/9/2 3:11 下午 + */ +public interface IndexCalculateStreetService { + + /** + * @Description 计算街道相关总分 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/2 3:12 下午 + */ + Boolean calStreetAll(String customerId, String monthId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/AgencyScoreServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/AgencyScoreServiceImpl.java new file mode 100644 index 0000000000..62be1fc75b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/AgencyScoreServiceImpl.java @@ -0,0 +1,99 @@ +/** + * 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.service.indexcal.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.indexcoll.AgencyScoreDao; +import com.epmet.dto.indexcal.AgencyScoreDTO; +import com.epmet.entity.indexcoll.AgencyScoreEntity; +import com.epmet.service.indexcal.AgencyScoreService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 区/街道相关分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@Service +public class AgencyScoreServiceImpl extends BaseServiceImpl implements AgencyScoreService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, AgencyScoreDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, AgencyScoreDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public AgencyScoreDTO get(String id) { + AgencyScoreEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, AgencyScoreDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(AgencyScoreDTO dto) { + AgencyScoreEntity entity = ConvertUtils.sourceToTarget(dto, AgencyScoreEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(AgencyScoreDTO dto) { + AgencyScoreEntity entity = ConvertUtils.sourceToTarget(dto, AgencyScoreEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/DeptScoreServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/DeptScoreServiceImpl.java new file mode 100644 index 0000000000..611ebfee84 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/DeptScoreServiceImpl.java @@ -0,0 +1,99 @@ +/** + * 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.service.indexcal.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.indexcoll.DeptScoreDao; +import com.epmet.dto.indexcal.DeptScoreDTO; +import com.epmet.entity.indexcoll.DeptScoreEntity; +import com.epmet.service.indexcal.DeptScoreService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 区直部门分值表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@Service +public class DeptScoreServiceImpl extends BaseServiceImpl implements DeptScoreService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DeptScoreDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DeptScoreDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public DeptScoreDTO get(String id) { + DeptScoreEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DeptScoreDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DeptScoreDTO dto) { + DeptScoreEntity entity = ConvertUtils.sourceToTarget(dto, DeptScoreEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DeptScoreDTO dto) { + DeptScoreEntity entity = ConvertUtils.sourceToTarget(dto, DeptScoreEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCalculateStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCalculateStreetServiceImpl.java new file mode 100644 index 0000000000..44654ea7d6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/IndexCalculateStreetServiceImpl.java @@ -0,0 +1,26 @@ +package com.epmet.service.indexcal.impl; + +import com.epmet.service.indexcal.IndexCalculateStreetService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * @Author zxc + * @DateTime 2020/9/2 3:11 下午 + */ +@Service +@Slf4j +public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetService { + + /** + * @Description 计算街道相关总分 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/2 3:12 下午 + */ + @Override + public Boolean calStreetAll(String customerId, String monthId) { + return null; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/AgencyScoreDao.xml new file mode 100644 index 0000000000..8fc48a372d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/AgencyScoreDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/DeptScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/DeptScoreDao.xml new file mode 100644 index 0000000000..176c542927 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/DeptScoreDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file From 09d0e5d94c6931f269a6df377a6a1f157cf8e8cf Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 2 Sep 2020 16:00:01 +0800 Subject: [PATCH 149/226] =?UTF-8?q?=E6=9C=89=E9=98=88=E5=80=BC=EF=BC=8C?= =?UTF-8?q?=E4=B8=94=E6=9C=80=E5=A4=A7=E5=80=BC>=E9=98=88=E5=80=BC?= =?UTF-8?q?=EF=BC=8C=E5=88=99=E6=9C=80=E5=A4=A7=E5=80=BC=E8=B5=8B=E5=80=BC?= =?UTF-8?q?=E4=B8=BA=E9=98=88=E5=80=BC=EF=BC=9BallRegion=3D=E3=80=8Bdistri?= =?UTF-8?q?ct?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/DeptGovrnAbilityFormDTO.java | 5 --- .../form/OrgGovrnAbilityFormDTO.java | 2 +- .../form/OrgPartyAbilityFormDTO.java | 2 +- .../form/OrgServiceAbilityFormDTO.java | 2 +- .../FactIndexGovrnAblityOrgMonthlyEntity.java | 2 +- .../FactIndexPartyAblityOrgMonthlyEntity.java | 2 +- ...actIndexServiceAblityOrgMonthlyEntity.java | 2 +- .../indexcal/DeptCorreLationService.java | 20 +++++++++++ .../impl/DeptCorreLationServiceImpl.java | 33 +++++++++++++++++++ .../impl/GridCorreLationServiceImpl.java | 5 +++ 10 files changed, 64 insertions(+), 11 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/DeptCorreLationService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/DeptCorreLationServiceImpl.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityFormDTO.java index 50cc040c44..b35ca1537a 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityFormDTO.java @@ -40,11 +40,6 @@ public class DeptGovrnAbilityFormDTO implements Serializable { */ private String yearId; - /** - * allRegion:全区;community:社区;street:街道 - */ - private String dataType; - /** * 区直部门被吹哨次数 */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityFormDTO.java index 7ddb9e785a..1534955c75 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityFormDTO.java @@ -41,7 +41,7 @@ public class OrgGovrnAbilityFormDTO implements Serializable { private String yearId; /** - * allRegion:全区;community:社区;street:街道 + * district:全区;community:社区;street:街道 */ private String dataType; diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgPartyAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgPartyAbilityFormDTO.java index e5ad40ef3f..cc1401d424 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgPartyAbilityFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgPartyAbilityFormDTO.java @@ -41,7 +41,7 @@ public class OrgPartyAbilityFormDTO implements Serializable { private String yearId; /** - * allRegion:全区;community:社区;street:街道 + * district:全区;community:社区;street:街道 */ private String dataType; diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityFormDTO.java index 6ef48c6fa4..59050bced2 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityFormDTO.java @@ -41,7 +41,7 @@ public class OrgServiceAbilityFormDTO implements Serializable { private String yearId; /** - * allRegion:全区;community:社区;street:街道 + * district:全区;community:社区;street:街道 */ private String dataType; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java index 94eec97d6f..115fbb4613 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java @@ -70,7 +70,7 @@ public class FactIndexGovrnAblityOrgMonthlyEntity extends BaseEpmetEntity { private String yearId; /** - * 数据类型 allRegion:全区;street:街道;community:社区;grid:网格 + * 数据类型 district:全区;street:街道;community:社区;grid:网格 */ private String dataType; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityOrgMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityOrgMonthlyEntity.java index 1bf023f055..05c3c7ac95 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityOrgMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityOrgMonthlyEntity.java @@ -74,7 +74,7 @@ public class FactIndexPartyAblityOrgMonthlyEntity extends BaseEpmetEntity { private Integer publishArticleCount; /** - * 数据类型 allRegion:全区;community:社区;street:街道 + * 数据类型 district:全区;community:社区;street:街道 */ private String dataType; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexServiceAblityOrgMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexServiceAblityOrgMonthlyEntity.java index 8abeb1c172..de2f8ab6f7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexServiceAblityOrgMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexServiceAblityOrgMonthlyEntity.java @@ -74,7 +74,7 @@ public class FactIndexServiceAblityOrgMonthlyEntity extends BaseEpmetEntity { private Integer activityCount; /** - * 数据类型 allRegion:全区;street:街道;community:社区;grid:网格 + * 数据类型 district:全区;street:街道;community:社区;grid:网格 */ private String dataType; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/DeptCorreLationService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/DeptCorreLationService.java new file mode 100644 index 0000000000..d40cf46f13 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/DeptCorreLationService.java @@ -0,0 +1,20 @@ +package com.epmet.service.indexcal; + +import com.epmet.dto.indexcal.CalculateCommonFormDTO; + +/** + * 区直部门指标计算 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/2 14:57 + */ +public interface DeptCorreLationService { + /** + * @return java.lang.Boolean + * @param formDTO + * @author yinzuomei + * @description 区直部门,分值计算 + * @Date 2020/8/26 10:51 + **/ + Boolean calculateDeptCorreLation(CalculateCommonFormDTO formDTO); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/DeptCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/DeptCorreLationServiceImpl.java new file mode 100644 index 0000000000..70769882f8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/DeptCorreLationServiceImpl.java @@ -0,0 +1,33 @@ +package com.epmet.service.indexcal.impl; + +import com.epmet.dao.indexcoll.FactIndexGovrnAblityDeptMonthlyDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.service.indexcal.DeptCorreLationService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 区直部门指标计算 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/2 14:58 + */ +@Slf4j +@Service +public class DeptCorreLationServiceImpl implements DeptCorreLationService { + @Autowired + private FactIndexGovrnAblityDeptMonthlyDao factIndexGovrnAblityDeptMonthlyDao; + + /** + * @param formDTO + * @return java.lang.Boolean + * @author yinzuomei + * @description 区直部门,分值计算 + * @Date 2020/8/26 10:51 + **/ + @Override + public Boolean calculateDeptCorreLation(CalculateCommonFormDTO formDTO) { + return null; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java index 6bb15d784d..3719f5138b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java @@ -433,6 +433,11 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { minValue = new BigDecimal(String.valueOf(minAndMaxMap.get(minValueKey))); maxValue = new BigDecimal(String.valueOf(minAndMaxMap.get(maxValueKey))); } + //有阈值,且最大值>阈值,则最大值赋值为阈值 + if (new BigDecimal(NumConstant.ONE_NEG_STR).compareTo(index.getThreshold()) != NumConstant.ZERO + && maxValue.compareTo(index.getThreshold()) == NumConstant.ONE) { + maxValue = index.getThreshold(); + } //分值计算器 ScoreCalculator scoreCalculator = new BigDecimalScoreCalculator(minValue, maxValue, From f9b1f60b9b35a791e77ed5462f8d5ab07c8f2f2b Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 2 Sep 2020 16:08:38 +0800 Subject: [PATCH 150/226] =?UTF-8?q?=E8=A1=97=E9=81=93=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/indexcal/AgencyScoreDTO.java | 5 +++ .../com/epmet/dto/indexcal/DeptScoreDTO.java | 5 +++ .../AgencyScoreDao.java | 27 +++++++++++- .../DeptScoreDao.java | 2 +- .../screen/FactIndexCommunityScoreDao.java | 2 +- .../entity/indexcoll/AgencyScoreEntity.java | 5 +++ .../indexcal/impl/AgencyScoreServiceImpl.java | 2 +- .../indexcal/impl/DeptScoreServiceImpl.java | 2 +- .../mapper/indexcoll/AgencyScoreDao.xml | 41 ++++++++++++++++++- .../mapper/indexcoll/DeptScoreDao.xml | 2 +- 10 files changed, 85 insertions(+), 8 deletions(-) rename epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/{indexcoll => indexscore}/AgencyScoreDao.java (60%) rename epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/{indexcoll => indexscore}/DeptScoreDao.java (96%) 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 6e18cb5867..59c0d906c8 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 @@ -84,6 +84,11 @@ public class AgencyScoreDTO implements Serializable { */ private String indexCode; + /** + * 数据类型 district :全区;street:街道 + */ + private String dataType; + /** * */ 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 b7a05696c3..5051aa3d82 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 @@ -84,6 +84,11 @@ public class DeptScoreDTO implements Serializable { */ private String indexCode; + /** + * + */ + private Integer delFlag; + /** * 乐观锁 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/AgencyScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/AgencyScoreDao.java similarity index 60% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/AgencyScoreDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/AgencyScoreDao.java index 6a076c057c..245d72e3fd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/AgencyScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/AgencyScoreDao.java @@ -15,11 +15,15 @@ * along with this program. If not, see . */ -package com.epmet.dao.indexcoll; +package com.epmet.dao.indexscore; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screen.FactIndexCommunityScoreDTO; import com.epmet.entity.indexcoll.AgencyScoreEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 区/街道相关分数表 @@ -29,5 +33,24 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface AgencyScoreDao extends BaseDao { - + + /** + * @Description 【街道】中间表插入 + * @param lists + * @author zxc + * @date 2020/8/27 5:05 下午 + */ + void insertStreetRecord(@Param("lists") List lists); + + /** + * @Description 删除旧记录 + * @param customerId + * @param monthId + * @param indexCode + * @author zxc + * @date 2020/9/2 15:47 + */ + void deleteOldRecord(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/DeptScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/DeptScoreDao.java similarity index 96% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/DeptScoreDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/DeptScoreDao.java index 101dc3b759..6a3d15d529 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/DeptScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/DeptScoreDao.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.dao.indexcoll; +package com.epmet.dao.indexscore; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.indexcoll.DeptScoreEntity; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityScoreDao.java index 607132ea18..0ae188f0c9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/FactIndexCommunityScoreDao.java @@ -35,7 +35,7 @@ import java.util.List; public interface FactIndexCommunityScoreDao extends BaseDao { /** - * @Description 党建能力【社区】中间表插入 + * @Description 【社区】中间表插入 * @param lists * @author zxc * @date 2020/8/27 5:05 下午 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/AgencyScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/AgencyScoreEntity.java index 02b9bf0fd1..4b6182e30f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/AgencyScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/AgencyScoreEntity.java @@ -84,4 +84,9 @@ public class AgencyScoreEntity extends BaseEpmetEntity { */ private String indexCode; + /** + * 数据类型 district :全区;street:街道 + */ + private String dataType; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/AgencyScoreServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/AgencyScoreServiceImpl.java index 62be1fc75b..2d84d1326d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/AgencyScoreServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/AgencyScoreServiceImpl.java @@ -23,7 +23,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.dao.indexcoll.AgencyScoreDao; +import com.epmet.dao.indexscore.AgencyScoreDao; import com.epmet.dto.indexcal.AgencyScoreDTO; import com.epmet.entity.indexcoll.AgencyScoreEntity; import com.epmet.service.indexcal.AgencyScoreService; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/DeptScoreServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/DeptScoreServiceImpl.java index 611ebfee84..da1f056c19 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/DeptScoreServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/DeptScoreServiceImpl.java @@ -23,7 +23,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.dao.indexcoll.DeptScoreDao; +import com.epmet.dao.indexscore.DeptScoreDao; import com.epmet.dto.indexcal.DeptScoreDTO; import com.epmet.entity.indexcoll.DeptScoreEntity; import com.epmet.service.indexcal.DeptScoreService; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/AgencyScoreDao.xml index 8fc48a372d..d19bf16699 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/AgencyScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/AgencyScoreDao.xml @@ -1,6 +1,45 @@ - + + + + INSERT INTO fact_index_agency_score (ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, DATA_TYPE, IS_TOTAL, SCORE, INDEX_CODE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + VALUES + + ( + REPLACE ( UUID(), '-', '' ), + #{item.customerId}, + #{item.agencyId}, + #{item.parentAgencyId}, + #{item.yearId}, + #{item.quarterId}, + #{item.monthId}, + #{item.dataType}, + #{item.isTotal}, + #{item.score}, + #{item.indexCode}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW() + ) + + + + + + DELETE + FROM + fact_index_agency_score + WHERE + del_flag = '0' + AND customer_id = #{customerId} + AND month_id = #{monthId} + AND index_code = #{indexCode} + AND data_type = #{dateType} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/DeptScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/DeptScoreDao.xml index 176c542927..380d746009 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/DeptScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/DeptScoreDao.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file From af9298e087d457ebe7ccb292e2b09ce684b94d6e Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 2 Sep 2020 16:21:50 +0800 Subject: [PATCH 151/226] =?UTF-8?q?=E9=98=88=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CpcIndexCalculateServiceImpl.java | 19 ++++-- .../mapper/indexscore/CpcScoreDao.xml | 6 +- .../stats/test/normalizing/DemoScoreCal.java | 64 +++++++++++++++++++ 3 files changed, 81 insertions(+), 8 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java index fd79fc52e9..5afa73df18 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -88,16 +88,17 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { totalEntity.setScore(new BigDecimal(0)); cpcScoreTotalMap.put(userId, totalEntity); } - //todo 自建群活跃度——议题转项目率 有阈值 >60%按60%算 + //自建群活跃度——议题转项目率 有阈值 >60%按60%算 BigDecimal total = part.getScore().multiply(indexGroupDetailEntity.getWeight()); log.info("userId:{},分数:{},权重:{},total:{}", userId, part.getScore(), indexGroupDetailEntity.getWeight(), total); totalEntity.setScore(totalEntity.getScore().add(total)); } }); - insertBatch(cpcScoreTotalMap.values().stream().collect(Collectors.toList())); + deleteAndInsertBatch(formDTO.getCustomerId(),formDTO.getMonthId(),IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(),cpcScoreTotalMap.values().stream().collect(Collectors.toList())); } - private void insertBatch(Collection values) { + private void deleteAndInsertBatch(String customerId, String monthId, String indexCode, Collection values) { + cpcScoreDao.deleteByMonthId(customerId, monthId, indexCode); cpcScoreDao.insertBatch(values); } @@ -198,14 +199,14 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { */ @Transactional(rollbackFor = Exception.class) public void saveCpcScore(CalculateCommonFormDTO formDTO, Map indexDetails, String parentIndexCode, HashMap result) { - cpcScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), parentIndexCode); + List list = new ArrayList<>(); result.forEach((userId, score) -> { CpcScoreEntity cpcScoreEntity = indexDetails.get(userId); cpcScoreEntity.setScore(score); list.add(cpcScoreEntity); }); - this.insertBatch(list); + this.deleteAndInsertBatch(formDTO.getCustomerId(),formDTO.getMonthId(),parentIndexCode,list); } @@ -234,9 +235,13 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { String minValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MIN); //最大值key String maxValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MAX); - minValue = new BigDecimal(String.valueOf(minAndMaxMap.get(minValueKey))); maxValue = new BigDecimal(String.valueOf(minAndMaxMap.get(maxValueKey))); - + minValue = new BigDecimal(String.valueOf(minAndMaxMap.get(minValueKey))); + //如果最大值超过阈值 则最大值为阈值 + if (new BigDecimal(NumConstant.ONE_NEG).compareTo(index.getThreshold()) != NumConstant.ZERO + && maxValue.compareTo(new BigDecimal(NumConstant.ONE_NEG)) == NumConstant.ONE){ + maxValue = index.getThreshold(); + } //分值计算器 ScoreCalculator scoreCalculator = new BigDecimalScoreCalculator(minValue, maxValue, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml index c3483cbc32..0eb4b7774a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml @@ -19,7 +19,11 @@ - delete from fact_index_cpc_score where CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} and MONTH_ID = #{monthId,jdbcType=VARCHAR} and INDEX_CODE = #{indexCode,jdbcType=VARCHAR} + delete from fact_index_cpc_score + where + CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} + and MONTH_ID = #{monthId,jdbcType=VARCHAR} + and INDEX_CODE = #{indexCode,jdbcType=VARCHAR} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexCodeFieIdReDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexCodeFieIdReDao.xml similarity index 79% rename from epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexCodeFieIdReDao.xml rename to epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexCodeFieIdReDao.xml index 77c97cefa2..fe6a2ad9c9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexCodeFieIdReDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexCodeFieIdReDao.xml @@ -1,7 +1,7 @@ - + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexDictDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexDictDao.xml similarity index 73% rename from epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexDictDao.xml rename to epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexDictDao.xml index a91513e1d5..146fddddb2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexDictDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexDictDao.xml @@ -1,7 +1,7 @@ - + delete from index_dict diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDao.xml similarity index 75% rename from epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDao.xml rename to epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDao.xml index 4597456ae7..668ba89e2d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDao.xml @@ -1,7 +1,7 @@ - + + - SELECT org_name AS NAME, index_total AS totalIndex, From cbf4295b351e01fb64753c328f34aaa7f19c1e32 Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 2 Sep 2020 17:17:15 +0800 Subject: [PATCH 159/226] =?UTF-8?q?mapper=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index 30178d25a0..4122ee8d29 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -16,7 +16,7 @@ AND org_type = 'agency' AND org_id = #{agencyId} - + AND month_id = DATE_FORMAT(NOW(),'%Y%m') From f5ffb40bbf079d15040e136cc22dfa39620b9ef2 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 2 Sep 2020 17:18:44 +0800 Subject: [PATCH 160/226] =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcoll/impl/FactIndexCollectServiceImpl.java | 1 + .../evaluationindex/screen/impl/IndexDictServiceImpl.java | 3 +++ .../screen/impl/IndexGroupDetailServiceImpl.java | 3 +++ .../screen/impl/IndexGroupDetailTemplateServiceImpl.java | 3 +++ .../evaluationindex/screen/impl/IndexGroupServiceImpl.java | 3 +++ .../screen/impl/IndexGroupTemplateServiceImpl.java | 3 +++ .../evaluationindex/screen/impl/ScreenCollServiceImpl.java | 1 + .../resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml | 2 +- 8 files changed, 18 insertions(+), 1 deletion(-) 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 747daa3a09..0e4136eccb 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 @@ -17,6 +17,7 @@ import java.util.List; * @Date: 2020-08-20 10:05 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class FactIndexCollectServiceImpl implements FactIndexCollectService { @Autowired diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexDictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexDictServiceImpl.java index ba47768775..759270bf09 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexDictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexDictServiceImpl.java @@ -17,7 +17,9 @@ package com.epmet.service.evaluationindex.screen.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.screen.IndexDictDao; import com.epmet.entity.evaluationindex.screen.IndexDictEntity; import com.epmet.service.evaluationindex.screen.IndexDictService; @@ -32,6 +34,7 @@ import java.util.Collection; * @since v1.0.0 2020-08-19 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class IndexDictServiceImpl extends BaseServiceImpl implements IndexDictService { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java index ffe55de1ea..8a81ca0af0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java @@ -17,9 +17,11 @@ package com.epmet.service.evaluationindex.screen.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.screen.IndexGroupDetailDao; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; import com.epmet.service.evaluationindex.screen.IndexGroupDetailService; @@ -34,6 +36,7 @@ import java.util.List; * @since v1.0.0 2020-08-19 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class IndexGroupDetailServiceImpl extends BaseServiceImpl implements IndexGroupDetailService { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailTemplateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailTemplateServiceImpl.java index 8d86028a72..dd0d811cfd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailTemplateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailTemplateServiceImpl.java @@ -17,7 +17,9 @@ package com.epmet.service.evaluationindex.screen.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.screen.IndexGroupDetailTemplateDao; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailTemplateEntity; import com.epmet.service.evaluationindex.screen.IndexGroupDetailTemplateService; @@ -32,6 +34,7 @@ import java.util.Collection; * @since v1.0.0 2020-08-19 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class IndexGroupDetailTemplateServiceImpl extends BaseServiceImpl implements IndexGroupDetailTemplateService { @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupServiceImpl.java index 2cf73e9f24..e455120eef 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupServiceImpl.java @@ -17,10 +17,12 @@ package com.epmet.service.evaluationindex.screen.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.UniqueIdGenerator; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.screen.IndexGroupDao; import com.epmet.dao.evaluationindex.screen.IndexGroupDetailDao; import com.epmet.dao.evaluationindex.screen.IndexGroupDetailTemplateDao; @@ -51,6 +53,7 @@ import java.util.stream.Collectors; */ @Slf4j @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class IndexGroupServiceImpl extends BaseServiceImpl implements IndexGroupService { @Autowired private IndexGroupTemplateDao indexGroupTemplateDao; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupTemplateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupTemplateServiceImpl.java index 02137da3d2..868e422b02 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupTemplateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupTemplateServiceImpl.java @@ -17,7 +17,9 @@ package com.epmet.service.evaluationindex.screen.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.screen.IndexGroupTemplateDao; import com.epmet.entity.evaluationindex.screen.IndexGroupTemplateEntity; import com.epmet.service.evaluationindex.screen.IndexGroupTemplateService; @@ -32,6 +34,7 @@ import java.util.Collection; * @since v1.0.0 2020-08-19 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class IndexGroupTemplateServiceImpl extends BaseServiceImpl implements IndexGroupTemplateService { @Override 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 54e0ef9f1f..8a40a66ed5 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 @@ -43,6 +43,7 @@ import java.util.List; * @since v1.0.0 2020-05-11 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class ScreenCollServiceImpl implements ScreenCollService { @Autowired diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml index 32faa3b7d4..3f38b0dbbc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml @@ -26,7 +26,7 @@ and INDEX_CODE = #{indexCode,jdbcType=VARCHAR} - select CUSTOMER_ID,AGENCY_ID,GRID_ID,YEAR_ID,MONTH_ID,USER_ID,SCORE,INDEX_CODE FROM fact_index_cpc_score WHERE From ec29fcc834ce427bbfe5f41ec115147a901523e0 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 2 Sep 2020 17:36:17 +0800 Subject: [PATCH 161/226] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=EF=BC=8C=E5=8C=85=E7=A7=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/constant/DataSourceConstant.java | 2 +- .../screen/constant/ScreenConstant.java | 2 +- .../screen/dto/form/AgencyAndNumFormDTO.java | 2 +- .../screen/dto/form/AgencyFormDTO.java | 2 +- .../dto/form/AgencyNumTypeParamFormDTO.java | 2 +- .../dto/form/BranchBuildRankFormDTO.java | 2 +- .../dto/form/BranchBuildTrendFormDTO.java | 2 +- .../screen/dto/form/BranchFormDTO.java | 2 +- .../screen/dto/form/CompartmentFormDTO.java | 2 +- .../dto/form/ContactMassLineChartFormDTO.java | 2 +- .../screen/dto/form/FineExampleFormDTO.java | 2 +- .../screen/dto/form/MonthBarchartFormDTO.java | 2 +- .../screen/dto/form/MonthPieChartFormDTO.java | 2 +- .../screen/dto/form/ParymemberFormDTO.java | 2 +- .../screen/dto/form/ProjectDetailFormDTO.java | 2 +- .../screen/dto/form/ProjectFormDTO.java | 2 +- .../dto/form/SubAgencyIndexRankFormDTO.java | 2 +- .../screen/dto/form/TopProfileFormDTO.java | 2 +- .../screen/dto/form/UserFormDTO.java | 2 +- .../dto/form/VolunteerServiceFormDTO.java | 2 +- .../dto/form/YearAverageIndexFormDTO.java | 2 +- .../result/AdvanceBranchRankResultDTO.java | 2 +- .../result/AgencyDistributionResultDTO.java | 2 +- .../BranchBuildOrderByCountResultDTO.java | 2 +- .../dto/result/BranchBuildRankResultDTO.java | 2 +- .../dto/result/BranchBuildTrendResultDTO.java | 2 +- .../dto/result/BranchIssueDataResultDTO.java | 2 +- .../screen/dto/result/BranchResultDTO.java | 2 +- .../BranchTrendSeriesDataResultDTO.java | 2 +- .../dto/result/CompartmentResultDTO.java | 2 +- .../result/ContactMassLineChartResult.java | 2 +- .../result/ContactMassLineChartResultDTO.java | 2 +- .../dto/result/DifficultProjectResultDTO.java | 2 +- .../dto/result/FineExampleResultDTO.java | 2 +- .../result/GovernCapacityRankResultDTO.java | 2 +- .../dto/result/GovernCapacityResultDTO.java | 2 +- .../dto/result/MonthBarchartResult.java | 2 +- .../dto/result/MonthBarchartResultDTO.java | 3 +- .../dto/result/MonthPieChartResultDTO.java | 2 +- .../dto/result/OrgRankDataResultDTO.java | 2 +- .../dto/result/PartyUserPointResultDTO.java | 2 +- .../PartymemberAgeDistributionResultDTO.java | 2 +- .../PartymemberAgePercentResultDTO.java | 2 +- .../result/PartymemberPercentResultDTO.java | 2 +- .../ParymemberDistributionResultDTO.java | 2 +- .../dto/result/ParymemberResultDTO.java | 2 +- .../dto/result/ProjectDetailResultDTO.java | 2 +- .../screen/dto/result/ProjectResultDTO.java | 2 +- .../dto/result/PublicPartiChartResultDTO.java | 2 +- .../result/PublicPartiProfileResultDTO.java | 2 +- .../dto/result/PublicPartiRankResultDTO.java | 2 +- .../result/SubAgencyIndexRankResultDTO.java | 2 +- .../dto/result/TopProfileResultDTO.java | 2 +- .../screen/dto/result/TreeResultDTO.java | 2 +- .../dto/result/UserDistributionResultDTO.java | 2 +- .../UserJoinIndicatorGrowthRateResultDTO.java | 2 +- .../dto/result/UserJoinMonthlyResultDTO.java | 3 +- .../dto/result/UserPointRankResultDTO.java | 2 +- .../screen/dto/result/UserPointResultDTO.java | 2 +- .../screen/dto/result/UserResultDTO.java | 2 +- .../dto/result/VolunteerServiceResult.java | 2 +- .../dto/result/VolunteerServiceResultDTO.java | 2 +- .../dto/result/YearAverageIndexResultDTO.java | 2 +- .../data-report/data-report-server/pom.xml | 6 ++++ .../controller/screen/AgencyController.java | 8 ++--- .../screen/DistributionController.java | 6 ++-- .../screen/GrassRootsGovernController.java | 10 +++--- .../screen/GrassrootsPartyDevController.java | 16 ++++----- .../controller/screen/IndexController.java | 19 +++++------ .../screen/PartyMemberLeadController.java | 6 ++-- .../screen/ScreenProjectController.java | 6 ++-- .../screen/ScreenCpcBaseDataDao.java | 4 +-- .../screen/ScreenCustomerAgencyDao.java | 4 +-- .../screen/ScreenCustomerDeptDao.java | 2 +- .../screen/ScreenCustomerGridDao.java | 4 +-- .../screen/ScreenDifficultyDataDao.java | 4 +-- .../screen/ScreenEventDataDao.java | 6 ++-- .../screen/ScreenEventImgDataDao.java | 2 +- .../screen/ScreenGovernRankDataDao.java | 4 +-- .../screen/ScreenIndexDataMonthlyDao.java | 11 +++--- .../screen/ScreenIndexDataYearlyDao.java | 4 +-- .../screen/ScreenOrgRankDataDao.java | 4 +-- .../screen/ScreenPartyBranchDataDao.java | 8 ++--- .../screen/ScreenPartyLinkMassesDataDao.java | 4 +-- .../screen/ScreenPartyUserRankDataDao.java | 6 ++-- .../screen/ScreenPioneerDataDao.java | 4 +-- .../screen/ScreenPublicPartiTotalDataDao.java | 5 ++- .../screen/ScreenUserJoinDao.java | 6 ++-- .../screen/ScreenUserTotalDataDao.java | 8 ++--- .../screen/AgencyService.java | 11 +++--- .../screen/DistributionService.java | 6 ++-- .../screen/GrassRootsGovernService.java | 10 +++--- .../screen/GrassrootsPartyDevService.java | 16 ++++----- .../screen/IndexService.java | 20 +++++------ .../screen/PartyMemberLeadService.java | 12 +++---- .../screen/ScreenProjectService.java | 6 ++-- .../screen/impl/AgencyServiceImpl.java | 23 +++++++------ .../screen/impl/DistributionServiceImpl.java | 29 ++++++++-------- .../impl/GrassRootsGovernServiceImpl.java | 25 +++++++------- .../impl/GrassrootsPartyDevServiceImpl.java | 29 ++++++++-------- .../screen/impl/IndexServiceImpl.java | 28 +++++++-------- .../impl/PartyMemberLeadServiceImpl.java | 34 ++++++++----------- .../screen/impl/ScreenProjectServiceImpl.java | 15 ++++---- .../src/main/resources/bootstrap.yml | 5 +++ .../src/main/resources/logback-spring.xml | 2 +- .../mapper/screen/ScreenCpcBaseDataDao.xml | 4 +-- .../mapper/screen/ScreenCustomerAgencyDao.xml | 14 ++++---- .../mapper/screen/ScreenCustomerDeptDao.xml | 2 +- .../mapper/screen/ScreenCustomerGridDao.xml | 12 +++---- .../mapper/screen/ScreenDifficultyDataDao.xml | 4 +-- .../mapper/screen/ScreenEventDataDao.xml | 6 ++-- .../mapper/screen/ScreenEventImgDataDao.xml | 2 +- .../mapper/screen/ScreenGovernRankDataDao.xml | 4 +-- .../screen/ScreenIndexDataMonthlyDao.xml | 8 ++--- .../screen/ScreenIndexDataYearlyDao.xml | 4 +-- .../mapper/screen/ScreenOrgRankDataDao.xml | 4 +-- .../screen/ScreenPartyBranchDataDao.xml | 8 ++--- .../screen/ScreenPartyLinkMassesDataDao.xml | 4 +-- .../screen/ScreenPartyUserRankDataDao.xml | 6 ++-- .../mapper/screen/ScreenPioneerDataDao.xml | 4 +-- .../screen/ScreenPublicPartiTotalDataDao.xml | 4 +-- .../mapper/screen/ScreenUserJoinDao.xml | 6 ++-- .../mapper/screen/ScreenUserTotalDataDao.xml | 8 ++--- 123 files changed, 336 insertions(+), 334 deletions(-) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/constant/ScreenConstant.java (82%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/form/AgencyAndNumFormDTO.java (93%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/form/AgencyFormDTO.java (92%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/form/AgencyNumTypeParamFormDTO.java (94%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/form/BranchBuildRankFormDTO.java (96%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/form/BranchBuildTrendFormDTO.java (96%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/form/BranchFormDTO.java (89%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/form/CompartmentFormDTO.java (90%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/form/ContactMassLineChartFormDTO.java (90%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/form/FineExampleFormDTO.java (90%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/form/MonthBarchartFormDTO.java (90%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/form/MonthPieChartFormDTO.java (90%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/form/ParymemberFormDTO.java (90%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/form/ProjectDetailFormDTO.java (92%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/form/ProjectFormDTO.java (89%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/form/SubAgencyIndexRankFormDTO.java (93%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/form/TopProfileFormDTO.java (90%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/form/UserFormDTO.java (89%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/form/VolunteerServiceFormDTO.java (90%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/form/YearAverageIndexFormDTO.java (90%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/AdvanceBranchRankResultDTO.java (95%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/AgencyDistributionResultDTO.java (92%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/BranchBuildOrderByCountResultDTO.java (89%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/BranchBuildRankResultDTO.java (92%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/BranchBuildTrendResultDTO.java (95%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/BranchIssueDataResultDTO.java (87%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/BranchResultDTO.java (89%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/BranchTrendSeriesDataResultDTO.java (91%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/CompartmentResultDTO.java (94%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/ContactMassLineChartResult.java (89%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/ContactMassLineChartResultDTO.java (93%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/DifficultProjectResultDTO.java (94%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/FineExampleResultDTO.java (96%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/GovernCapacityRankResultDTO.java (93%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/GovernCapacityResultDTO.java (93%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/MonthBarchartResult.java (88%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/MonthBarchartResultDTO.java (88%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/MonthPieChartResultDTO.java (90%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/OrgRankDataResultDTO.java (94%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/PartyUserPointResultDTO.java (92%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/PartymemberAgeDistributionResultDTO.java (94%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/PartymemberAgePercentResultDTO.java (94%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/PartymemberPercentResultDTO.java (93%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/ParymemberDistributionResultDTO.java (94%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/ParymemberResultDTO.java (94%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/ProjectDetailResultDTO.java (93%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/ProjectResultDTO.java (92%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/PublicPartiChartResultDTO.java (92%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/PublicPartiProfileResultDTO.java (95%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/PublicPartiRankResultDTO.java (90%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/SubAgencyIndexRankResultDTO.java (92%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/TopProfileResultDTO.java (92%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/TreeResultDTO.java (94%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/UserDistributionResultDTO.java (93%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java (94%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/UserJoinMonthlyResultDTO.java (90%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/UserPointRankResultDTO.java (91%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/UserPointResultDTO.java (87%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/UserResultDTO.java (94%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/VolunteerServiceResult.java (90%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/VolunteerServiceResultDTO.java (94%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{ => evaluationindex}/screen/dto/result/YearAverageIndexResultDTO.java (91%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/{ => evaluationindex}/screen/ScreenCpcBaseDataDao.java (89%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/{ => evaluationindex}/screen/ScreenCustomerAgencyDao.java (95%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/{ => evaluationindex}/screen/ScreenCustomerDeptDao.java (94%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/{ => evaluationindex}/screen/ScreenCustomerGridDao.java (95%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/{ => evaluationindex}/screen/ScreenDifficultyDataDao.java (90%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/{ => evaluationindex}/screen/ScreenEventDataDao.java (87%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/{ => evaluationindex}/screen/ScreenEventImgDataDao.java (95%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/{ => evaluationindex}/screen/ScreenGovernRankDataDao.java (90%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/{ => evaluationindex}/screen/ScreenIndexDataMonthlyDao.java (83%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/{ => evaluationindex}/screen/ScreenIndexDataYearlyDao.java (89%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/{ => evaluationindex}/screen/ScreenOrgRankDataDao.java (90%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/{ => evaluationindex}/screen/ScreenPartyBranchDataDao.java (90%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/{ => evaluationindex}/screen/ScreenPartyLinkMassesDataDao.java (90%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/{ => evaluationindex}/screen/ScreenPartyUserRankDataDao.java (88%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/{ => evaluationindex}/screen/ScreenPioneerDataDao.java (90%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/{ => evaluationindex}/screen/ScreenPublicPartiTotalDataDao.java (89%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/{ => evaluationindex}/screen/ScreenUserJoinDao.java (87%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/{ => evaluationindex}/screen/ScreenUserTotalDataDao.java (89%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/{ => evaluationindex}/screen/AgencyService.java (68%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/{ => evaluationindex}/screen/DistributionService.java (87%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/{ => evaluationindex}/screen/GrassRootsGovernService.java (86%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/{ => evaluationindex}/screen/GrassrootsPartyDevService.java (71%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/{ => evaluationindex}/screen/IndexService.java (64%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/{ => evaluationindex}/screen/PartyMemberLeadService.java (79%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/{ => evaluationindex}/screen/ScreenProjectService.java (63%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/{ => evaluationindex}/screen/impl/AgencyServiceImpl.java (85%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/{ => evaluationindex}/screen/impl/DistributionServiceImpl.java (79%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/{ => evaluationindex}/screen/impl/GrassRootsGovernServiceImpl.java (91%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/{ => evaluationindex}/screen/impl/GrassrootsPartyDevServiceImpl.java (90%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/{ => evaluationindex}/screen/impl/IndexServiceImpl.java (88%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/{ => evaluationindex}/screen/impl/PartyMemberLeadServiceImpl.java (90%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/{ => evaluationindex}/screen/impl/ScreenProjectServiceImpl.java (68%) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/DataSourceConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/DataSourceConstant.java index b640b06b67..d1e438d81a 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/DataSourceConstant.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/DataSourceConstant.java @@ -5,7 +5,7 @@ public interface DataSourceConstant { /** * 统计数据库 */ - String STATS = "stats"; + String EVALUATION_INDEX = "evaluationIndex"; String STATS_DISPLAY = "statsDisplay"; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/constant/ScreenConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/constant/ScreenConstant.java similarity index 82% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/constant/ScreenConstant.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/constant/ScreenConstant.java index b1a25cf947..e3ac468fcf 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/constant/ScreenConstant.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/constant/ScreenConstant.java @@ -1,4 +1,4 @@ -package com.epmet.screen.constant; +package com.epmet.evaluationindex.screen.constant; /** * @Author zxc diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/AgencyAndNumFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyAndNumFormDTO.java similarity index 93% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/AgencyAndNumFormDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyAndNumFormDTO.java index a20c10ce80..cd31c9688b 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/AgencyAndNumFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyAndNumFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.form; +package com.epmet.evaluationindex.screen.dto.form; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/AgencyFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyFormDTO.java similarity index 92% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/AgencyFormDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyFormDTO.java index a9e479e3a5..166c9c2aa9 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/AgencyFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.form; +package com.epmet.evaluationindex.screen.dto.form; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/AgencyNumTypeParamFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyNumTypeParamFormDTO.java similarity index 94% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/AgencyNumTypeParamFormDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyNumTypeParamFormDTO.java index 04dfc0625e..9e2e3c74a9 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/AgencyNumTypeParamFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyNumTypeParamFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.form; +package com.epmet.evaluationindex.screen.dto.form; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/BranchBuildRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/BranchBuildRankFormDTO.java similarity index 96% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/BranchBuildRankFormDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/BranchBuildRankFormDTO.java index 458f2e4af5..43604bceb3 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/BranchBuildRankFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/BranchBuildRankFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.form; +package com.epmet.evaluationindex.screen.dto.form; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/BranchBuildTrendFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/BranchBuildTrendFormDTO.java similarity index 96% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/BranchBuildTrendFormDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/BranchBuildTrendFormDTO.java index 1d68458b20..9a0edf4677 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/BranchBuildTrendFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/BranchBuildTrendFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.form; +package com.epmet.evaluationindex.screen.dto.form; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/BranchFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/BranchFormDTO.java similarity index 89% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/BranchFormDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/BranchFormDTO.java index 89a7bc5eaa..4094c81647 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/BranchFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/BranchFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.form; +package com.epmet.evaluationindex.screen.dto.form; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/CompartmentFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/CompartmentFormDTO.java similarity index 90% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/CompartmentFormDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/CompartmentFormDTO.java index 3571ff7bb6..dd4be9746b 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/CompartmentFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/CompartmentFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.form; +package com.epmet.evaluationindex.screen.dto.form; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/ContactMassLineChartFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ContactMassLineChartFormDTO.java similarity index 90% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/ContactMassLineChartFormDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ContactMassLineChartFormDTO.java index e82038de21..c2deeac60b 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/ContactMassLineChartFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ContactMassLineChartFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.form; +package com.epmet.evaluationindex.screen.dto.form; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/FineExampleFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/FineExampleFormDTO.java similarity index 90% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/FineExampleFormDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/FineExampleFormDTO.java index 1840c3048b..5ed5b9fc1a 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/FineExampleFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/FineExampleFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.form; +package com.epmet.evaluationindex.screen.dto.form; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/MonthBarchartFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthBarchartFormDTO.java similarity index 90% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/MonthBarchartFormDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthBarchartFormDTO.java index ad454ff8dc..b6e0141d6a 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/MonthBarchartFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthBarchartFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.form; +package com.epmet.evaluationindex.screen.dto.form; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/MonthPieChartFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthPieChartFormDTO.java similarity index 90% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/MonthPieChartFormDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthPieChartFormDTO.java index 0c188f427e..a5e9c53f26 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/MonthPieChartFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthPieChartFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.form; +package com.epmet.evaluationindex.screen.dto.form; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/ParymemberFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ParymemberFormDTO.java similarity index 90% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/ParymemberFormDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ParymemberFormDTO.java index ee06b313d1..fdf525f37b 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/ParymemberFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ParymemberFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.form; +package com.epmet.evaluationindex.screen.dto.form; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/ProjectDetailFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ProjectDetailFormDTO.java similarity index 92% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/ProjectDetailFormDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ProjectDetailFormDTO.java index 88744ad004..756095fe1c 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/ProjectDetailFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ProjectDetailFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.form; +package com.epmet.evaluationindex.screen.dto.form; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/ProjectFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ProjectFormDTO.java similarity index 89% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/ProjectFormDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ProjectFormDTO.java index 445cefc453..6c906e906f 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/ProjectFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ProjectFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.form; +package com.epmet.evaluationindex.screen.dto.form; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/SubAgencyIndexRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankFormDTO.java similarity index 93% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/SubAgencyIndexRankFormDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankFormDTO.java index 3410d0638f..608c6b0492 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/SubAgencyIndexRankFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.form; +package com.epmet.evaluationindex.screen.dto.form; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/TopProfileFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/TopProfileFormDTO.java similarity index 90% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/TopProfileFormDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/TopProfileFormDTO.java index 6b0d00dae1..ffe73581a2 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/TopProfileFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/TopProfileFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.form; +package com.epmet.evaluationindex.screen.dto.form; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/UserFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/UserFormDTO.java similarity index 89% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/UserFormDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/UserFormDTO.java index 4a3b23da00..31b432e725 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/UserFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/UserFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.form; +package com.epmet.evaluationindex.screen.dto.form; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/VolunteerServiceFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/VolunteerServiceFormDTO.java similarity index 90% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/VolunteerServiceFormDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/VolunteerServiceFormDTO.java index 510bb5ec41..6df6c28ba1 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/VolunteerServiceFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/VolunteerServiceFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.form; +package com.epmet.evaluationindex.screen.dto.form; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/YearAverageIndexFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/YearAverageIndexFormDTO.java similarity index 90% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/YearAverageIndexFormDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/YearAverageIndexFormDTO.java index 80d526bd48..e53a94cfa9 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/YearAverageIndexFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/YearAverageIndexFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.form; +package com.epmet.evaluationindex.screen.dto.form; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/AdvanceBranchRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AdvanceBranchRankResultDTO.java similarity index 95% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/AdvanceBranchRankResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AdvanceBranchRankResultDTO.java index 912aedc1df..60545c7fc4 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/AdvanceBranchRankResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AdvanceBranchRankResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/AgencyDistributionResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AgencyDistributionResultDTO.java similarity index 92% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/AgencyDistributionResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AgencyDistributionResultDTO.java index da0a5a389e..753cf368dd 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/AgencyDistributionResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AgencyDistributionResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchBuildOrderByCountResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchBuildOrderByCountResultDTO.java similarity index 89% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchBuildOrderByCountResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchBuildOrderByCountResultDTO.java index d6ba6ae18b..60448888de 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchBuildOrderByCountResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchBuildOrderByCountResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchBuildRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchBuildRankResultDTO.java similarity index 92% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchBuildRankResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchBuildRankResultDTO.java index f7593319e1..f9c08afaea 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchBuildRankResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchBuildRankResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchBuildTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchBuildTrendResultDTO.java similarity index 95% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchBuildTrendResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchBuildTrendResultDTO.java index ee30981a68..fc3fc3958d 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchBuildTrendResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchBuildTrendResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchIssueDataResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchIssueDataResultDTO.java similarity index 87% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchIssueDataResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchIssueDataResultDTO.java index 65a6888047..7708001e26 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchIssueDataResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchIssueDataResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchResultDTO.java similarity index 89% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchResultDTO.java index f4a611cc10..431859c7d3 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchTrendSeriesDataResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchTrendSeriesDataResultDTO.java similarity index 91% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchTrendSeriesDataResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchTrendSeriesDataResultDTO.java index 7d5f415547..c1a921508f 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchTrendSeriesDataResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/BranchTrendSeriesDataResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/CompartmentResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/CompartmentResultDTO.java similarity index 94% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/CompartmentResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/CompartmentResultDTO.java index 2bf8ffd3d6..b959cf8ea7 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/CompartmentResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/CompartmentResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ContactMassLineChartResult.java similarity index 89% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResult.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ContactMassLineChartResult.java index e77c336fbe..2cac006003 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResult.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ContactMassLineChartResult.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ContactMassLineChartResultDTO.java similarity index 93% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ContactMassLineChartResultDTO.java index 5a2b93acd9..69b5244ae0 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ContactMassLineChartResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/DifficultProjectResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/DifficultProjectResultDTO.java similarity index 94% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/DifficultProjectResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/DifficultProjectResultDTO.java index e89155d00c..fb37328232 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/DifficultProjectResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/DifficultProjectResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/FineExampleResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/FineExampleResultDTO.java similarity index 96% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/FineExampleResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/FineExampleResultDTO.java index a81f45fc05..b522e3166c 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/FineExampleResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/FineExampleResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/GovernCapacityRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityRankResultDTO.java similarity index 93% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/GovernCapacityRankResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityRankResultDTO.java index 318b290840..0f6b481e1c 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/GovernCapacityRankResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityRankResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/GovernCapacityResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityResultDTO.java similarity index 93% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/GovernCapacityResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityResultDTO.java index dd2c09cd94..f51fe26255 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/GovernCapacityResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthBarchartResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthBarchartResult.java similarity index 88% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthBarchartResult.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthBarchartResult.java index ebf0d9d276..ef79775673 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthBarchartResult.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthBarchartResult.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthBarchartResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthBarchartResultDTO.java similarity index 88% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthBarchartResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthBarchartResultDTO.java index 479547a883..ad21904ba2 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthBarchartResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthBarchartResultDTO.java @@ -1,6 +1,5 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; -import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthPieChartResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthPieChartResultDTO.java similarity index 90% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthPieChartResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthPieChartResultDTO.java index 248f69d5ce..89ca2fd383 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthPieChartResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthPieChartResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/OrgRankDataResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/OrgRankDataResultDTO.java similarity index 94% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/OrgRankDataResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/OrgRankDataResultDTO.java index 87a8d482c9..9aff92593f 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/OrgRankDataResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/OrgRankDataResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartyUserPointResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartyUserPointResultDTO.java similarity index 92% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartyUserPointResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartyUserPointResultDTO.java index 5ae10cb73e..3450a623a6 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartyUserPointResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartyUserPointResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartymemberAgeDistributionResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartymemberAgeDistributionResultDTO.java similarity index 94% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartymemberAgeDistributionResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartymemberAgeDistributionResultDTO.java index 6ae70d9a67..4f9785b6b4 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartymemberAgeDistributionResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartymemberAgeDistributionResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartymemberAgePercentResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartymemberAgePercentResultDTO.java similarity index 94% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartymemberAgePercentResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartymemberAgePercentResultDTO.java index c5eec4d539..4a301f0ca0 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartymemberAgePercentResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartymemberAgePercentResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartymemberPercentResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartymemberPercentResultDTO.java similarity index 93% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartymemberPercentResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartymemberPercentResultDTO.java index eb8bc35184..a8ea84d711 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartymemberPercentResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartymemberPercentResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ParymemberDistributionResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ParymemberDistributionResultDTO.java similarity index 94% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ParymemberDistributionResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ParymemberDistributionResultDTO.java index 180d6fd3c8..71efdac8ff 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ParymemberDistributionResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ParymemberDistributionResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ParymemberResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ParymemberResultDTO.java similarity index 94% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ParymemberResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ParymemberResultDTO.java index 710ce303aa..a435dea3d3 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ParymemberResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ParymemberResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ProjectDetailResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ProjectDetailResultDTO.java similarity index 93% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ProjectDetailResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ProjectDetailResultDTO.java index 234fe38034..6ad86b371f 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ProjectDetailResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ProjectDetailResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ProjectResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ProjectResultDTO.java similarity index 92% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ProjectResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ProjectResultDTO.java index 7a0a016b25..5eb58d4f4f 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ProjectResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ProjectResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PublicPartiChartResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiChartResultDTO.java similarity index 92% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PublicPartiChartResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiChartResultDTO.java index 45f4f801ce..8f9ab22851 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PublicPartiChartResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiChartResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PublicPartiProfileResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiProfileResultDTO.java similarity index 95% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PublicPartiProfileResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiProfileResultDTO.java index 52a127fd77..c5744d0cdd 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PublicPartiProfileResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiProfileResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PublicPartiRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiRankResultDTO.java similarity index 90% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PublicPartiRankResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiRankResultDTO.java index b151901bdf..6d4eba5f4b 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PublicPartiRankResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiRankResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/SubAgencyIndexRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/SubAgencyIndexRankResultDTO.java similarity index 92% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/SubAgencyIndexRankResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/SubAgencyIndexRankResultDTO.java index 5b0d89f39f..246b374752 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/SubAgencyIndexRankResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/SubAgencyIndexRankResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/TopProfileResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/TopProfileResultDTO.java similarity index 92% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/TopProfileResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/TopProfileResultDTO.java index 607891f5bf..55c281db6c 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/TopProfileResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/TopProfileResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/TreeResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/TreeResultDTO.java similarity index 94% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/TreeResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/TreeResultDTO.java index 0f28cda5b2..8de1c1d377 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/TreeResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/TreeResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserDistributionResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserDistributionResultDTO.java similarity index 93% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserDistributionResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserDistributionResultDTO.java index de772f423b..2476f0497b 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserDistributionResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserDistributionResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java similarity index 94% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java index cf870c9b18..a64f02a279 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserJoinMonthlyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserJoinMonthlyResultDTO.java similarity index 90% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserJoinMonthlyResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserJoinMonthlyResultDTO.java index b35ce13c58..3b91a42d4e 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserJoinMonthlyResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserJoinMonthlyResultDTO.java @@ -1,7 +1,8 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; + import java.io.Serializable; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserPointRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserPointRankResultDTO.java similarity index 91% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserPointRankResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserPointRankResultDTO.java index 43cc73e066..3a1330fa46 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserPointRankResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserPointRankResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserPointResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserPointResultDTO.java similarity index 87% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserPointResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserPointResultDTO.java index 1f38d6886e..b58be28ff1 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserPointResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserPointResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserResultDTO.java similarity index 94% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserResultDTO.java index 592b3fd4af..f46da9b45e 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/VolunteerServiceResult.java similarity index 90% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResult.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/VolunteerServiceResult.java index bc2d53edff..4ef1fd076a 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResult.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/VolunteerServiceResult.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/VolunteerServiceResultDTO.java similarity index 94% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/VolunteerServiceResultDTO.java index e255f61124..e0df20afee 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/VolunteerServiceResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/YearAverageIndexResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/YearAverageIndexResultDTO.java similarity index 91% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/YearAverageIndexResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/YearAverageIndexResultDTO.java index d05479d5d2..21c82e2e66 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/YearAverageIndexResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/YearAverageIndexResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.screen.dto.result; +package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 455ddbe25f..6e97f8c65d 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -123,6 +123,12 @@ epmet_data_stats_display_user EpmEt-db-UsEr + + + + epmet_evaluation_index_user + EpmEt-db-UsEr + 0 192.168.1.130 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java index 7d4fcfe070..1b063dd470 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java @@ -3,10 +3,10 @@ package com.epmet.datareport.controller.screen; import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.datareport.service.screen.AgencyService; -import com.epmet.screen.dto.form.CompartmentFormDTO; -import com.epmet.screen.dto.result.CompartmentResultDTO; -import com.epmet.screen.dto.result.TreeResultDTO; +import com.epmet.datareport.service.evaluationindex.screen.AgencyService; +import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; +import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; +import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java index 935dd13830..248547cc4c 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java @@ -2,9 +2,9 @@ package com.epmet.datareport.controller.screen; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.datareport.service.screen.DistributionService; -import com.epmet.screen.dto.form.*; -import com.epmet.screen.dto.result.*; +import com.epmet.datareport.service.evaluationindex.screen.DistributionService; +import com.epmet.evaluationindex.screen.dto.form.*; +import com.epmet.evaluationindex.screen.dto.result.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java index 3cad80832d..220fb0ca4a 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java @@ -2,11 +2,11 @@ package com.epmet.datareport.controller.screen; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.datareport.service.screen.GrassRootsGovernService; -import com.epmet.screen.dto.form.AgencyAndNumFormDTO; -import com.epmet.screen.dto.form.AgencyFormDTO; -import com.epmet.screen.dto.form.AgencyNumTypeParamFormDTO; -import com.epmet.screen.dto.result.*; +import com.epmet.datareport.service.evaluationindex.screen.GrassRootsGovernService; +import com.epmet.evaluationindex.screen.dto.form.AgencyAndNumFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AgencyFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AgencyNumTypeParamFormDTO; +import com.epmet.evaluationindex.screen.dto.result.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java index 34823bd3fd..66b7555ac8 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java @@ -2,14 +2,14 @@ package com.epmet.datareport.controller.screen; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.datareport.service.screen.GrassrootsPartyDevService; -import com.epmet.screen.dto.form.BranchBuildRankFormDTO; -import com.epmet.screen.dto.form.BranchBuildTrendFormDTO; -import com.epmet.screen.dto.form.ParymemberFormDTO; -import com.epmet.screen.dto.result.BranchBuildRankResultDTO; -import com.epmet.screen.dto.result.BranchBuildTrendResultDTO; -import com.epmet.screen.dto.result.PartymemberAgeDistributionResultDTO; -import com.epmet.screen.dto.result.PartymemberPercentResultDTO; +import com.epmet.datareport.service.evaluationindex.screen.GrassrootsPartyDevService; +import com.epmet.evaluationindex.screen.dto.form.BranchBuildRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.BranchBuildTrendFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ParymemberFormDTO; +import com.epmet.evaluationindex.screen.dto.result.BranchBuildRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.BranchBuildTrendResultDTO; +import com.epmet.evaluationindex.screen.dto.result.PartymemberAgeDistributionResultDTO; +import com.epmet.evaluationindex.screen.dto.result.PartymemberPercentResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java index ba4a24ec52..d670c65b1c 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java @@ -1,17 +1,16 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.datareport.service.screen.IndexService; -import com.epmet.screen.dto.form.MonthBarchartFormDTO; -import com.epmet.screen.dto.form.MonthPieChartFormDTO; -import com.epmet.screen.dto.form.SubAgencyIndexRankFormDTO; -import com.epmet.screen.dto.form.YearAverageIndexFormDTO; -import com.epmet.screen.dto.result.MonthBarchartResultDTO; -import com.epmet.screen.dto.result.MonthPieChartResultDTO; -import com.epmet.screen.dto.result.SubAgencyIndexRankResultDTO; -import com.epmet.screen.dto.result.YearAverageIndexResultDTO; +import com.epmet.datareport.service.evaluationindex.screen.IndexService; +import com.epmet.evaluationindex.screen.dto.form.MonthBarchartFormDTO; +import com.epmet.evaluationindex.screen.dto.form.MonthPieChartFormDTO; +import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.YearAverageIndexFormDTO; +import com.epmet.evaluationindex.screen.dto.result.MonthBarchartResultDTO; +import com.epmet.evaluationindex.screen.dto.result.MonthPieChartResultDTO; +import com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.YearAverageIndexResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java index 0f3fe32130..d3f4242013 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java @@ -2,9 +2,9 @@ package com.epmet.datareport.controller.screen; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.datareport.service.screen.PartyMemberLeadService; -import com.epmet.screen.dto.form.*; -import com.epmet.screen.dto.result.*; +import com.epmet.datareport.service.evaluationindex.screen.PartyMemberLeadService; +import com.epmet.evaluationindex.screen.dto.form.*; +import com.epmet.evaluationindex.screen.dto.result.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java index 79d61f5f75..dc80b5178e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java @@ -2,9 +2,9 @@ package com.epmet.datareport.controller.screen; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.datareport.service.screen.ScreenProjectService; -import com.epmet.screen.dto.form.ProjectDetailFormDTO; -import com.epmet.screen.dto.result.ProjectDetailResultDTO; +import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService; +import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO; +import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCpcBaseDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java similarity index 89% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCpcBaseDataDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java index 87f26f3b01..e752fe40dd 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCpcBaseDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java @@ -15,9 +15,9 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.result.PartymemberAgeDistributionResultDTO; +import com.epmet.evaluationindex.screen.dto.result.PartymemberAgeDistributionResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java similarity index 95% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerAgencyDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index c97ac8b8e0..17c48ae989 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -15,9 +15,9 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.result.*; +import com.epmet.evaluationindex.screen.dto.result.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerDeptDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerDeptDao.java similarity index 94% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerDeptDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerDeptDao.java index e6ae450514..15ed670395 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerDeptDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerDeptDao.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; import org.apache.ibatis.annotations.Mapper; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerGridDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java similarity index 95% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerGridDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java index ec6a2e7ee1..b6196411f8 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerGridDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java @@ -15,9 +15,9 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.result.*; +import com.epmet.evaluationindex.screen.dto.result.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenDifficultyDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenDifficultyDataDao.java similarity index 90% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenDifficultyDataDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenDifficultyDataDao.java index 17d2e7a420..8697ba9adf 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenDifficultyDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenDifficultyDataDao.java @@ -15,9 +15,9 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.result.DifficultProjectResultDTO; +import com.epmet.evaluationindex.screen.dto.result.DifficultProjectResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenEventDataDao.java similarity index 87% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventDataDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenEventDataDao.java index 24604bf1de..16e023adff 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenEventDataDao.java @@ -15,10 +15,10 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.result.ProjectDetailResultDTO; -import com.epmet.screen.dto.result.ProjectResultDTO; +import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; +import com.epmet.evaluationindex.screen.dto.result.ProjectResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventImgDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenEventImgDataDao.java similarity index 95% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventImgDataDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenEventImgDataDao.java index 8090ce00c7..f0da56ccd9 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventImgDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenEventImgDataDao.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenGovernRankDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenGovernRankDataDao.java similarity index 90% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenGovernRankDataDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenGovernRankDataDao.java index 3cf167fc5e..e973aa85f3 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenGovernRankDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenGovernRankDataDao.java @@ -15,9 +15,9 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.result.GovernCapacityResultDTO; +import com.epmet.evaluationindex.screen.dto.result.GovernCapacityResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java similarity index 83% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataMonthlyDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java index 57f0398615..372dacf9dd 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataMonthlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java @@ -15,13 +15,12 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.form.SubAgencyIndexRankFormDTO; -import com.epmet.screen.dto.result.MonthBarchartResult; -import com.epmet.screen.dto.result.MonthBarchartResultDTO; -import com.epmet.screen.dto.result.MonthPieChartResultDTO; -import com.epmet.screen.dto.result.SubAgencyIndexRankResultDTO; +import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankFormDTO; +import com.epmet.evaluationindex.screen.dto.result.MonthBarchartResult; +import com.epmet.evaluationindex.screen.dto.result.MonthPieChartResultDTO; +import com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataYearlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java similarity index 89% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataYearlyDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java index 304351b3b7..c63c17fa57 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataYearlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java @@ -15,9 +15,9 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.result.YearAverageIndexResultDTO; +import com.epmet.evaluationindex.screen.dto.result.YearAverageIndexResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenOrgRankDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenOrgRankDataDao.java similarity index 90% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenOrgRankDataDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenOrgRankDataDao.java index fbee5cd15c..2b9bdba497 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenOrgRankDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenOrgRankDataDao.java @@ -15,9 +15,9 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.result.OrgRankDataResultDTO; +import com.epmet.evaluationindex.screen.dto.result.OrgRankDataResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyBranchDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java similarity index 90% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyBranchDataDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java index f28a23354b..fa2836e4fb 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyBranchDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java @@ -15,11 +15,11 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.result.BranchBuildOrderByCountResultDTO; -import com.epmet.screen.dto.result.BranchIssueDataResultDTO; -import com.epmet.screen.dto.result.VolunteerServiceResult; +import com.epmet.evaluationindex.screen.dto.result.BranchBuildOrderByCountResultDTO; +import com.epmet.evaluationindex.screen.dto.result.BranchIssueDataResultDTO; +import com.epmet.evaluationindex.screen.dto.result.VolunteerServiceResult; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyLinkMassesDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java similarity index 90% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyLinkMassesDataDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java index dfa5c1f6d2..1ca974982f 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyLinkMassesDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java @@ -15,9 +15,9 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.result.ContactMassLineChartResult; +import com.epmet.evaluationindex.screen.dto.result.ContactMassLineChartResult; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyUserRankDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java similarity index 88% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyUserRankDataDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java index 946ac2a096..2c4358ce15 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyUserRankDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java @@ -15,10 +15,10 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.result.PartyUserPointResultDTO; -import com.epmet.screen.dto.result.UserPointResultDTO; +import com.epmet.evaluationindex.screen.dto.result.PartyUserPointResultDTO; +import com.epmet.evaluationindex.screen.dto.result.UserPointResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPioneerDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPioneerDataDao.java similarity index 90% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPioneerDataDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPioneerDataDao.java index 4b477689c3..92177ec52c 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPioneerDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPioneerDataDao.java @@ -15,9 +15,9 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.result.FineExampleResultDTO; +import com.epmet.evaluationindex.screen.dto.result.FineExampleResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPublicPartiTotalDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java similarity index 89% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPublicPartiTotalDataDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java index 02d7e0c722..88c2aa0e77 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPublicPartiTotalDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java @@ -15,10 +15,9 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.screen.dto.result.PublicPartiRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.PublicPartiRankResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserJoinDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserJoinDao.java similarity index 87% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserJoinDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserJoinDao.java index 0edee635d4..962691f625 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserJoinDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserJoinDao.java @@ -15,10 +15,10 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.result.UserJoinIndicatorGrowthRateResultDTO; -import com.epmet.screen.dto.result.UserJoinMonthlyResultDTO; +import com.epmet.evaluationindex.screen.dto.result.UserJoinIndicatorGrowthRateResultDTO; +import com.epmet.evaluationindex.screen.dto.result.UserJoinMonthlyResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserTotalDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserTotalDataDao.java similarity index 89% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserTotalDataDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserTotalDataDao.java index 2230e636b9..653cf3f606 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserTotalDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserTotalDataDao.java @@ -15,15 +15,13 @@ * along with this program. If not, see . */ -package com.epmet.datareport.dao.screen; +package com.epmet.datareport.dao.evaluationindex.screen; -import com.epmet.screen.dto.result.PartymemberPercentResultDTO; -import com.epmet.screen.dto.result.TopProfileResultDTO; +import com.epmet.evaluationindex.screen.dto.result.PartymemberPercentResultDTO; +import com.epmet.evaluationindex.screen.dto.result.TopProfileResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; -import java.util.List; - /** * 中央区-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数 * diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/AgencyService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java similarity index 68% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/AgencyService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java index d3eee4f133..d633b94ea2 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/AgencyService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java @@ -1,12 +1,9 @@ -package com.epmet.datareport.service.screen; +package com.epmet.datareport.service.evaluationindex.screen; import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; -import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.screen.dto.form.CompartmentFormDTO; -import com.epmet.screen.dto.result.CompartmentResultDTO; -import com.epmet.screen.dto.result.TreeResultDTO; - -import java.util.List; +import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; +import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; +import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; /** * 组织相关api diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/DistributionService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/DistributionService.java similarity index 87% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/DistributionService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/DistributionService.java index 62a0d0d7bf..a73d1ccfcd 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/DistributionService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/DistributionService.java @@ -1,7 +1,7 @@ -package com.epmet.datareport.service.screen; +package com.epmet.datareport.service.evaluationindex.screen; -import com.epmet.screen.dto.form.*; -import com.epmet.screen.dto.result.*; +import com.epmet.evaluationindex.screen.dto.form.*; +import com.epmet.evaluationindex.screen.dto.result.*; import java.util.List; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/GrassRootsGovernService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassRootsGovernService.java similarity index 86% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/GrassRootsGovernService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassRootsGovernService.java index 12315295b5..fecde12a9f 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/GrassRootsGovernService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassRootsGovernService.java @@ -1,9 +1,9 @@ -package com.epmet.datareport.service.screen; +package com.epmet.datareport.service.evaluationindex.screen; -import com.epmet.screen.dto.form.AgencyAndNumFormDTO; -import com.epmet.screen.dto.form.AgencyFormDTO; -import com.epmet.screen.dto.form.AgencyNumTypeParamFormDTO; -import com.epmet.screen.dto.result.*; +import com.epmet.evaluationindex.screen.dto.form.AgencyAndNumFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AgencyFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AgencyNumTypeParamFormDTO; +import com.epmet.evaluationindex.screen.dto.result.*; import java.util.List; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/GrassrootsPartyDevService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassrootsPartyDevService.java similarity index 71% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/GrassrootsPartyDevService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassrootsPartyDevService.java index a870d21585..41c8fafc28 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/GrassrootsPartyDevService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassrootsPartyDevService.java @@ -1,12 +1,12 @@ -package com.epmet.datareport.service.screen; +package com.epmet.datareport.service.evaluationindex.screen; -import com.epmet.screen.dto.form.BranchBuildRankFormDTO; -import com.epmet.screen.dto.form.BranchBuildTrendFormDTO; -import com.epmet.screen.dto.form.ParymemberFormDTO; -import com.epmet.screen.dto.result.BranchBuildRankResultDTO; -import com.epmet.screen.dto.result.BranchBuildTrendResultDTO; -import com.epmet.screen.dto.result.PartymemberAgeDistributionResultDTO; -import com.epmet.screen.dto.result.PartymemberPercentResultDTO; +import com.epmet.evaluationindex.screen.dto.form.BranchBuildRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.BranchBuildTrendFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ParymemberFormDTO; +import com.epmet.evaluationindex.screen.dto.result.BranchBuildRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.BranchBuildTrendResultDTO; +import com.epmet.evaluationindex.screen.dto.result.PartymemberAgeDistributionResultDTO; +import com.epmet.evaluationindex.screen.dto.result.PartymemberPercentResultDTO; /** * 基层党建相关各指标查询 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/IndexService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java similarity index 64% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/IndexService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java index 5f840c2369..266898530d 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/IndexService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java @@ -1,13 +1,13 @@ -package com.epmet.datareport.service.screen; - -import com.epmet.screen.dto.form.MonthBarchartFormDTO; -import com.epmet.screen.dto.form.MonthPieChartFormDTO; -import com.epmet.screen.dto.form.SubAgencyIndexRankFormDTO; -import com.epmet.screen.dto.form.YearAverageIndexFormDTO; -import com.epmet.screen.dto.result.MonthBarchartResultDTO; -import com.epmet.screen.dto.result.MonthPieChartResultDTO; -import com.epmet.screen.dto.result.SubAgencyIndexRankResultDTO; -import com.epmet.screen.dto.result.YearAverageIndexResultDTO; +package com.epmet.datareport.service.evaluationindex.screen; + +import com.epmet.evaluationindex.screen.dto.form.MonthBarchartFormDTO; +import com.epmet.evaluationindex.screen.dto.form.MonthPieChartFormDTO; +import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.YearAverageIndexFormDTO; +import com.epmet.evaluationindex.screen.dto.result.MonthBarchartResultDTO; +import com.epmet.evaluationindex.screen.dto.result.MonthPieChartResultDTO; +import com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.YearAverageIndexResultDTO; import java.util.List; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/PartyMemberLeadService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/PartyMemberLeadService.java similarity index 79% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/PartyMemberLeadService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/PartyMemberLeadService.java index 5f781b2622..5e75a3946c 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/PartyMemberLeadService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/PartyMemberLeadService.java @@ -1,10 +1,10 @@ -package com.epmet.datareport.service.screen; +package com.epmet.datareport.service.evaluationindex.screen; -import com.epmet.screen.dto.form.AgencyAndNumFormDTO; -import com.epmet.screen.dto.form.ContactMassLineChartFormDTO; -import com.epmet.screen.dto.form.FineExampleFormDTO; -import com.epmet.screen.dto.form.VolunteerServiceFormDTO; -import com.epmet.screen.dto.result.*; +import com.epmet.evaluationindex.screen.dto.form.AgencyAndNumFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ContactMassLineChartFormDTO; +import com.epmet.evaluationindex.screen.dto.form.FineExampleFormDTO; +import com.epmet.evaluationindex.screen.dto.form.VolunteerServiceFormDTO; +import com.epmet.evaluationindex.screen.dto.result.*; import java.util.List; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/ScreenProjectService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java similarity index 63% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/ScreenProjectService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java index 78543bc52f..aea908ff15 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/ScreenProjectService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java @@ -1,7 +1,7 @@ -package com.epmet.datareport.service.screen; +package com.epmet.datareport.service.evaluationindex.screen; -import com.epmet.screen.dto.form.ProjectDetailFormDTO; -import com.epmet.screen.dto.result.ProjectDetailResultDTO; +import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO; +import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; /** * 项目 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java similarity index 85% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java index 0727ebfbde..6eef8b2387 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java @@ -1,17 +1,17 @@ -package com.epmet.datareport.service.screen.impl; +package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; -import com.epmet.datareport.dao.screen.ScreenCustomerAgencyDao; -import com.epmet.datareport.dao.screen.ScreenCustomerGridDao; -import com.epmet.screen.dto.form.CompartmentFormDTO; -import com.epmet.screen.dto.result.AgencyDistributionResultDTO; -import com.epmet.screen.constant.*; -import com.epmet.screen.dto.result.CompartmentResultDTO; -import com.epmet.screen.dto.result.TreeResultDTO; -import com.epmet.datareport.service.screen.AgencyService; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerGridDao; +import com.epmet.datareport.service.evaluationindex.screen.AgencyService; +import com.epmet.evaluationindex.screen.constant.ScreenConstant; +import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; +import com.epmet.evaluationindex.screen.dto.result.AgencyDistributionResultDTO; +import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; +import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -25,6 +25,7 @@ import java.util.List; * @date 2020/8/18 10:18 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class AgencyServiceImpl implements AgencyService { @Autowired @@ -38,7 +39,7 @@ public class AgencyServiceImpl implements AgencyService { * @author zxc * @date 2020/8/18 2:04 下午 */ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public TreeResultDTO tree(ExternalAppRequestParam externalAppRequestParam) { // 1. 查询客户根组织ID @@ -118,7 +119,7 @@ public class AgencyServiceImpl implements AgencyService { * @author zxc * @date 2020/8/18 2:33 下午 */ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public CompartmentResultDTO compartment(CompartmentFormDTO compartmentFormDTO) { CompartmentResultDTO agencyAreaInfo = screenCustomerAgencyDao.getAgencyAreaInfo(compartmentFormDTO.getAgencyId()); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/DistributionServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java similarity index 79% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/DistributionServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java index 97a627fb23..b65c0fe059 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/DistributionServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java @@ -1,16 +1,16 @@ -package com.epmet.datareport.service.screen.impl; +package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; -import com.epmet.datareport.dao.screen.ScreenCustomerAgencyDao; -import com.epmet.datareport.dao.screen.ScreenCustomerGridDao; -import com.epmet.datareport.dao.screen.ScreenEventDataDao; -import com.epmet.datareport.dao.screen.ScreenUserTotalDataDao; -import com.epmet.screen.dto.form.*; -import com.epmet.screen.dto.result.*; -import com.epmet.screen.constant.*; -import com.epmet.datareport.service.screen.DistributionService; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerGridDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventDataDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenUserTotalDataDao; +import com.epmet.datareport.service.evaluationindex.screen.DistributionService; +import com.epmet.evaluationindex.screen.constant.ScreenConstant; +import com.epmet.evaluationindex.screen.dto.form.*; +import com.epmet.evaluationindex.screen.dto.result.*; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -25,6 +25,7 @@ import java.util.List; * @date 2020/8/18 10:19 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class DistributionServiceImpl implements DistributionService { @Autowired @@ -42,7 +43,7 @@ public class DistributionServiceImpl implements DistributionService { * @author zxc * @date 2020/8/18 10:59 上午 */ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List branch(BranchFormDTO formDTO) { List branchResultDTOS = screenCustomerGridDao.selectBranch(formDTO.getAgencyId()); @@ -55,7 +56,7 @@ public class DistributionServiceImpl implements DistributionService { * @author zxc * @date 2020/8/18 11:10 上午 */ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public UserResultDTO user(UserFormDTO userFormDTO) { UserResultDTO userResult = new UserResultDTO(); @@ -80,7 +81,7 @@ public class DistributionServiceImpl implements DistributionService { * @author zxc * @date 2020/8/18 11:20 上午 */ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public ParymemberResultDTO parymember(ParymemberFormDTO parymemberFormDTO) { ParymemberResultDTO parymemberResult = new ParymemberResultDTO(); @@ -105,7 +106,7 @@ public class DistributionServiceImpl implements DistributionService { * @author zxc * @date 2020/8/19 1:29 下午 */ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List project(ProjectFormDTO projectFormDTO) { List projectResultDTOS = screenEventDataDao.selectEvent(projectFormDTO.getAgencyId()); @@ -121,7 +122,7 @@ public class DistributionServiceImpl implements DistributionService { * @author zxc * @date 2020/8/19 1:52 下午 */ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public TopProfileResultDTO topProfile(TopProfileFormDTO topProfileFormDTO) { TopProfileResultDTO topProfileResultDTO = screenUserTotalDataDao.selectTopProfile(topProfileFormDTO.getAgencyId()); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassRootsGovernServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java similarity index 91% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassRootsGovernServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java index c1ad6a3eca..bf8fe359d2 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassRootsGovernServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java @@ -1,17 +1,17 @@ -package com.epmet.datareport.service.screen.impl; +package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.DataSourceConstant; -import com.epmet.datareport.dao.screen.*; -import com.epmet.datareport.service.screen.GrassRootsGovernService; +import com.epmet.datareport.dao.evaluationindex.screen.*; +import com.epmet.datareport.service.evaluationindex.screen.GrassRootsGovernService; import com.epmet.datareport.utils.DateUtils; import com.epmet.datareport.utils.ModuleConstant; -import com.epmet.screen.dto.form.AgencyAndNumFormDTO; -import com.epmet.screen.dto.form.AgencyFormDTO; -import com.epmet.screen.dto.form.AgencyNumTypeParamFormDTO; -import com.epmet.screen.dto.result.*; +import com.epmet.evaluationindex.screen.dto.form.AgencyAndNumFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AgencyFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AgencyNumTypeParamFormDTO; +import com.epmet.evaluationindex.screen.dto.result.*; import com.github.pagehelper.PageHelper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -31,6 +31,7 @@ import java.util.stream.Collectors; * @date 2020/8/18 10:20 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { @Autowired @@ -54,7 +55,7 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { * @author wangc * @date 2020.08.20 11:16 **/ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public UserPointRankResultDTO userPointRank(AgencyAndNumFormDTO param) { //默认5 @@ -78,7 +79,7 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { * @author wangc * @date 2020.08.20 13:55 **/ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List difficultProject(AgencyNumTypeParamFormDTO param) { if(null == param.getTopNum()){ @@ -99,7 +100,7 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { * @author wangc * @date 2020.08.20 14:37 **/ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public PublicPartiProfileResultDTO publicPartiProfile(AgencyFormDTO param) { @@ -130,7 +131,7 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { * @author wangc * @date 2020.08.20 15:32 **/ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List publicPartiRank(AgencyAndNumFormDTO param) { if(null == param.getTopNum()){ @@ -155,7 +156,7 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { * @author wangc * @date 2020.08.20 17:46 **/ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List governCapacityRank(AgencyAndNumFormDTO param) { if(null == param.getTopNum()) param.setTopNum(NumConstant.FIVE); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java similarity index 90% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java index a4cbbc87da..a336d356cc 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java @@ -1,20 +1,19 @@ -package com.epmet.datareport.service.screen.impl; +package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; -import com.epmet.datareport.dao.screen.ScreenCpcBaseDataDao; -import com.epmet.datareport.dao.screen.ScreenPartyBranchDataDao; -import com.epmet.datareport.dao.screen.ScreenUserTotalDataDao; -import com.epmet.datareport.service.screen.GrassrootsPartyDevService; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenCpcBaseDataDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenPartyBranchDataDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenUserTotalDataDao; +import com.epmet.datareport.service.evaluationindex.screen.GrassrootsPartyDevService; import com.epmet.datareport.utils.DateUtils; import com.epmet.datareport.utils.ModuleConstant; -import com.epmet.screen.dto.form.BranchBuildRankFormDTO; -import com.epmet.screen.dto.form.BranchBuildTrendFormDTO; -import com.epmet.screen.dto.form.ParymemberFormDTO; -import com.epmet.screen.dto.result.*; +import com.epmet.evaluationindex.screen.dto.form.BranchBuildRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.BranchBuildTrendFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ParymemberFormDTO; +import com.epmet.evaluationindex.screen.dto.result.*; import com.github.pagehelper.PageHelper; -import com.google.common.collect.Maps; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -23,7 +22,6 @@ import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.math.BigDecimal; -import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -34,6 +32,7 @@ import java.util.stream.Collectors; * @date 2020/8/18 10:21 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService { private static final Logger logger = LoggerFactory.getLogger(GrassrootsPartyDevServiceImpl.class); @@ -55,7 +54,7 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService * @author wangc * @date 2020.08.18 14:58 **/ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public PartymemberPercentResultDTO partymemberBaseInfo(ParymemberFormDTO param) { @@ -84,7 +83,7 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService * @author wangc * @date 2020.08.18 17:54 **/ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public PartymemberAgeDistributionResultDTO partymemberAgeDistribution(ParymemberFormDTO param) { return screenCpcBaseDataDao.selectPartymemberAgeDistribution(param.getAgencyId()); @@ -98,7 +97,7 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService * @author wangc * @date 2020.08.19 11:02 **/ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public BranchBuildTrendResultDTO branchBuildTrend(BranchBuildTrendFormDTO param) { if(StringUtils.equals(ModuleConstant.PARAM_BRANCH_CATEGORY_UNION,param.getCategory())){ @@ -183,7 +182,7 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService * @author wangc * @date 2020.08.19 15:25 **/ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public BranchBuildRankResultDTO branchBuildRank(BranchBuildRankFormDTO param) { if(StringUtils.equals(ModuleConstant.PARAM_BRANCH_CATEGORY_UNION,param.getCategory())){ diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java similarity index 88% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java index fa1e261128..22f6aa376b 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java @@ -1,18 +1,17 @@ -package com.epmet.datareport.service.screen.impl; +package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; -import com.epmet.datareport.dao.screen.ScreenIndexDataMonthlyDao; -import com.epmet.datareport.dao.screen.ScreenIndexDataYearlyDao; -import com.epmet.datareport.service.screen.IndexService; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataMonthlyDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataYearlyDao; +import com.epmet.datareport.service.evaluationindex.screen.IndexService; import com.epmet.datareport.utils.DateUtils; -import com.epmet.screen.dto.form.MonthBarchartFormDTO; -import com.epmet.screen.dto.form.MonthPieChartFormDTO; -import com.epmet.screen.dto.form.SubAgencyIndexRankFormDTO; -import com.epmet.screen.dto.form.YearAverageIndexFormDTO; -import com.epmet.screen.dto.result.*; +import com.epmet.evaluationindex.screen.dto.form.MonthBarchartFormDTO; +import com.epmet.evaluationindex.screen.dto.form.MonthPieChartFormDTO; +import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.YearAverageIndexFormDTO; +import com.epmet.evaluationindex.screen.dto.result.*; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -31,6 +30,7 @@ import java.util.stream.Collectors; * @date 2020/8/18 10:21 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class IndexServiceImpl implements IndexService { @Autowired @@ -48,7 +48,7 @@ public class IndexServiceImpl implements IndexService { * @author zxc * @date 2020/8/19 2:53 下午 */ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public YearAverageIndexResultDTO yearAverageIndex(YearAverageIndexFormDTO yearAverageIndexFormDTO) { YearAverageIndexResultDTO yearAverageIndexResultDTO = screenIndexDataYearlyDao.selectYearAverageIndex(yearAverageIndexFormDTO.getAgencyId()); @@ -64,7 +64,7 @@ public class IndexServiceImpl implements IndexService { * @author zxc * @date 2020/8/19 3:17 下午 */ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public MonthPieChartResultDTO monthPieChart(MonthPieChartFormDTO monthPieChartFormDTO) { @@ -89,7 +89,7 @@ public class IndexServiceImpl implements IndexService { * @author zxc * @date 2020/8/19 5:27 下午 */ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public MonthBarchartResultDTO monthBarchart(MonthBarchartFormDTO monthBarchartFormDTO) { MonthBarchartResultDTO result = new MonthBarchartResultDTO(); @@ -170,7 +170,7 @@ public class IndexServiceImpl implements IndexService { * @author zxc * @date 2020/8/20 10:04 上午 */ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List subAgencyIndexRank(SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO) { LocalDate now = LocalDate.now().minusMonths(NumConstant.ONE); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java similarity index 90% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java index 8d85e51d8f..61fe56778d 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java @@ -1,23 +1,19 @@ -package com.epmet.datareport.service.screen.impl; +package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.DataSourceConstant; -import com.epmet.datareport.dao.screen.ScreenOrgRankDataDao; -import com.epmet.datareport.dao.screen.ScreenPartyBranchDataDao; -import com.epmet.datareport.dao.screen.ScreenPartyLinkMassesDataDao; -import com.epmet.datareport.dao.screen.ScreenPioneerDataDao; -import com.epmet.datareport.dao.screen.ScreenPartyUserRankDataDao; -import com.epmet.datareport.service.screen.PartyMemberLeadService; +import com.epmet.datareport.dao.evaluationindex.screen.*; +import com.epmet.datareport.service.evaluationindex.screen.PartyMemberLeadService; import com.epmet.datareport.utils.DateUtils; import com.epmet.datareport.utils.ModuleConstant; -import com.epmet.screen.dto.form.AgencyAndNumFormDTO; -import com.epmet.screen.dto.form.ContactMassLineChartFormDTO; -import com.epmet.screen.dto.form.FineExampleFormDTO; -import com.epmet.screen.dto.form.VolunteerServiceFormDTO; -import com.epmet.screen.dto.result.*; -import com.epmet.screen.constant.*; +import com.epmet.evaluationindex.screen.constant.ScreenConstant; +import com.epmet.evaluationindex.screen.dto.form.AgencyAndNumFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ContactMassLineChartFormDTO; +import com.epmet.evaluationindex.screen.dto.form.FineExampleFormDTO; +import com.epmet.evaluationindex.screen.dto.form.VolunteerServiceFormDTO; +import com.epmet.evaluationindex.screen.dto.result.*; import com.github.pagehelper.PageHelper; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -27,7 +23,6 @@ import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.time.LocalDate; import java.util.*; -import java.util.stream.Collectors; /** * 党建引领相关各指标查询 @@ -36,6 +31,7 @@ import java.util.stream.Collectors; * @date 2020/8/18 10:22 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { @Autowired @@ -57,7 +53,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { * @author zxc * @date 2020/8/20 1:56 下午 */ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public FineExampleResultDTO fineExample(FineExampleFormDTO fineExampleFormDTO) { FineExampleResultDTO fineExampleResultDTO = screenPioneerDataDao.selectFineExample(fineExampleFormDTO.getAgencyId()); @@ -89,7 +85,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { * @author zxc * @date 2020/8/20 2:35 下午 */ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public ContactMassLineChartResultDTO contactMassLineChart(ContactMassLineChartFormDTO contactMassLineChartFormDTO) { ContactMassLineChartResultDTO result = new ContactMassLineChartResultDTO(); @@ -122,7 +118,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { * @author zxc * @date 2020/8/20 3:19 下午 */ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public VolunteerServiceResultDTO volunteerService(VolunteerServiceFormDTO volunteerServiceFormDTO) { VolunteerServiceResultDTO result = new VolunteerServiceResultDTO(); @@ -207,7 +203,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { * @author wangc * @date 2020.08.21 11:05 **/ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List advancedBranchRank(AgencyAndNumFormDTO param) { if(null == param.getTopNum()){ @@ -245,7 +241,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { * @author wangc * @date 2020.08.21 14:22 **/ - @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List advancedPartymemberRank(AgencyAndNumFormDTO param) { if(null == param.getTopNum()) param.setTopNum(NumConstant.TEN); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/ScreenProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java similarity index 68% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/ScreenProjectServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java index e617449458..2cf288cae9 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/ScreenProjectServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java @@ -1,12 +1,12 @@ -package com.epmet.datareport.service.screen.impl; +package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.constant.DataSourceConstant; -import com.epmet.datareport.dao.screen.ScreenEventDataDao; -import com.epmet.datareport.dao.screen.ScreenEventImgDataDao; -import com.epmet.datareport.service.screen.ScreenProjectService; -import com.epmet.screen.dto.form.ProjectDetailFormDTO; -import com.epmet.screen.dto.result.ProjectDetailResultDTO; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventDataDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventImgDataDao; +import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService; +import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO; +import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -19,6 +19,7 @@ import java.util.List; * @date 2020/8/18 10:23 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class ScreenProjectServiceImpl implements ScreenProjectService { @Autowired @@ -32,7 +33,7 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { * @author zxc * @date 2020/8/19 4:36 下午 */ - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override public ProjectDetailResultDTO projectDetail(ProjectDetailFormDTO projectDetailFormDTO) { ProjectDetailResultDTO projectDetailResultDTO = screenEventDataDao.selectEventDetail(projectDetailFormDTO.getProjectId(),projectDetailFormDTO.getAgencyId()); diff --git a/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml b/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml index 44b522b30b..5899ead6dd 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml @@ -104,6 +104,11 @@ dynamic: url: @datasource.druid.statsdisplay.url@ username: @datasource.druid.statsdisplay.username@ password: @datasource.druid.statsdisplay.password@ + evaluationIndex: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.evaluationIndex.url@ + username: @datasource.druid.evaluationIndex.username@ + password: @datasource.druid.evaluationIndex.password@ feign: hystrix: diff --git a/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml b/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml index ea81aca726..793be083a1 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml @@ -149,7 +149,7 @@ - + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml index ef851d6a08..fa89221e37 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml @@ -1,10 +1,10 @@ - + - SELECT SUM( AGE_LEVEL_1 ) + SUM( AGE_LEVEL_2 ) AS under30Count, SUM( AGE_LEVEL_3 ) + SUM( AGE_LEVEL_4 ) AS between31And50Count, diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml index f66aef3609..22a62be6d0 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml @@ -1,10 +1,10 @@ - + - SELECT agency_name AS label, agency_id AS value, @@ -20,7 +20,7 @@ - SELECT agency_id AS value, agency_name AS label, @@ -37,7 +37,7 @@ - SELECT agency_id AS agencyId, agency_name AS name, @@ -51,7 +51,7 @@ - SELECT agency_id AS subId, agency_name AS subName, @@ -66,7 +66,7 @@ - SELECT sutd.org_id AS subId, sca.center_mark AS centerMark, @@ -84,7 +84,7 @@ - SELECT sutd.org_id AS subId, sca.center_mark AS centerMark, diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerDeptDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerDeptDao.xml index 58e2171c3d..cf939d024a 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerDeptDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerDeptDao.xml @@ -1,7 +1,7 @@ - + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml index 01d3f4da7d..6cafd96036 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml @@ -1,10 +1,10 @@ - + - SELECT grid_id AS subId, grid_name AS subName, @@ -19,7 +19,7 @@ - SELECT grid_id AS gridId, grid_name AS gridName, @@ -32,7 +32,7 @@ - SELECT sutd.org_id AS subId, scg.center_mark AS centerMark, @@ -50,7 +50,7 @@ - SELECT sutd.org_id AS subId, scg.center_mark AS centerMark, @@ -68,7 +68,7 @@ - SELECT grid_id AS value, grid_name AS label, diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml index 630befedcd..0bb479ed65 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml @@ -1,10 +1,10 @@ - + - SELECT diff.EVENT_ID AS projectId, diff.EVENT_CONTENT AS title, diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml index 750439bb3e..b877ad611d 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml @@ -1,10 +1,10 @@ - + - SELECT IFNULL(event_title,'') AS projectTitle, event_level AS color, @@ -20,7 +20,7 @@ - SELECT event_content AS projectContent, event_status_desc AS STATUS, diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventImgDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventImgDataDao.xml index e5e3e636af..ef20677ece 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventImgDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventImgDataDao.xml @@ -1,7 +1,7 @@ - + + + - SELECT month_id AS monthId, service_ablity AS serviceAbility, @@ -44,7 +44,7 @@ - SELECT org_name AS NAME, index_total AS totalIndex, diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml index 3d9329846d..d224b92d4e 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml @@ -1,10 +1,10 @@ - + - SELECT index_total AS yearAverageIndex, service_ablity AS serviceAbility, diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml index 97292b4797..310320029e 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml @@ -1,10 +1,10 @@ - + - SELECT ORG_NAME AS NAME, PARTY_TOTAL AS partyMemberNum, diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml index 2b20c44880..0ee2a6a315 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml @@ -1,7 +1,7 @@ - + - SELECT MONTH_ID, MEET_CATEGORY_NAME AS issue, @@ -38,7 +38,7 @@ - SELECT ORG_NAME, SUM( ORGANIZE_COUNT ) AS organizeData , @@ -69,7 +69,7 @@ - SELECT month_id AS monthId, SUM(organize_count) AS organizeData, diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml index 5643b1e31b..2bbdece16c 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml @@ -1,10 +1,10 @@ - + - SELECT org_name AS orgName, create_group_total AS groupTotal, diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml index 80aee4ece5..8d865b6341 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml @@ -1,10 +1,10 @@ - + - SELECT concat( surname, CASE char_length( NAME ) WHEN 1 THEN '*' WHEN 2 THEN '**' ELSE '***' END ) AS name, point_total AS point @@ -21,7 +21,7 @@ - SELECT USER_ID, concat( surname, CASE char_length( NAME ) WHEN 1 THEN '*' WHEN 2 THEN '**' ELSE '***' END ) AS name, diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml index 5e509c8329..992c347f9b 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml @@ -1,10 +1,10 @@ - + - SELECT issue_total AS issueTotal, issue_ratio AS issueRatioA, diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml index ff931885f6..1a94210725 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml @@ -1,10 +1,10 @@ - + - SELECT ORG_NAME AS NAME, REG_USER_TOTAL AS regNum, diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml index 2fe2eb4337..cbbc5fe211 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml @@ -1,10 +1,10 @@ - + - SELECT JOIN_TOTAL AS total, AVG_JOIN AS averageJoin, @@ -25,7 +25,7 @@ - /* SELECT MONTH_ID, diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml index 84e00a0f5d..57b2959430 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml @@ -1,10 +1,10 @@ - + - SELECT SUM( PARTY_TOTAL ) AS partyMemberTotal, SUM( USER_TOTAL ) AS platFormTotal @@ -16,7 +16,7 @@ - SELECT user_total AS userNum, party_total AS partyMemberNum, @@ -46,7 +46,7 @@ - SELECT ORG_NAME AS NAME, REG_USER_TOTAL AS regNum, From 5159201f09770fffe5128376bbf64fa2353266eb Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 2 Sep 2020 18:04:37 +0800 Subject: [PATCH 162/226] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E8=84=9A=E6=9C=AC=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migration/2020-09-02_add_screen_table.sql | 514 ++++++++++++++++++ 1 file changed, 514 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/2020-09-02_add_screen_table.sql diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/2020-09-02_add_screen_table.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/2020-09-02_add_screen_table.sql new file mode 100644 index 0000000000..4374c4cd09 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/2020-09-02_add_screen_table.sql @@ -0,0 +1,514 @@ +/* + Navicat Premium Data Transfer + + Source Server : 测试 + Source Server Type : MySQL + Source Server Version : 50726 + Source Host : rm-m5ef9t617j6o5eup7.mysql.rds.aliyuncs.com:3306 + Source Schema : epmet_evaluation_index + + Target Server Type : MySQL + Target Server Version : 50726 + File Encoding : 65001 + + Date: 02/09/2020 17:57:39 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for screen_cpc_base_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_cpc_base_data`; +CREATE TABLE `screen_cpc_base_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `ORG_TYPE` varchar(32) NOT NULL COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + `REGISTER_USER_COUNT` int(11) DEFAULT '0' COMMENT '注册用户数', + `RESI_TOTAL` int(11) DEFAULT '0' COMMENT '群众用户数', + `PARTY_MEMBER_COUNT` int(11) DEFAULT '0' COMMENT '注册党员数', + `AGE_LEVEL_1` int(11) DEFAULT '0' COMMENT '小于20岁的党员总人数', + `AGE_LEVEL_2` int(11) DEFAULT '0' COMMENT '20-30岁的党员总人数', + `AGE_LEVEL_3` int(11) DEFAULT '0' COMMENT '31-40岁的党员总人数', + `AGE_LEVEL_4` int(11) DEFAULT '0' COMMENT '41-50岁的党员总人数', + `AGE_LEVEL_5` int(11) DEFAULT '0' COMMENT '51-60岁的党员总人数', + `AGE_LEVEL_6` int(11) DEFAULT '0' COMMENT '60+岁的党员总人数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基层党建-党员基本情况'; + +-- ---------------------------- +-- Table structure for screen_customer_agency +-- ---------------------------- +DROP TABLE IF EXISTS `screen_customer_agency`; +CREATE TABLE `screen_customer_agency` ( + `ID` varchar(64) NOT NULL COMMENT '主键ID 主键ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '组织id', + `AGENCY_NAME` varchar(255) NOT NULL COMMENT '组织名称', + `PID` varchar(64) NOT NULL COMMENT '父级id ,顶级,此列为0', + `PIDS` varchar(512) DEFAULT NULL COMMENT '所有上级ID,用逗号(英文)分开', + `ALL_PARENT_NAMES` varchar(512) DEFAULT NULL COMMENT '所有组织名称以-链接', + `AREA_MARKS` text COMMENT '坐标区域', + `CENTER_MARK` varchar(255) DEFAULT NULL COMMENT '中心点位', + `PARTY_MARK` varchar(255) DEFAULT NULL COMMENT '党工委或者党委的位置,目前此阶段为预留字段', + `LEVEL` varchar(32) NOT NULL COMMENT '机关级别(社区级:community,\r\n乡(镇、街道)级:street,\r\n区县级: district,\r\n市级: city\r\n省级:province)', + `AREA_CODE` varchar(30) DEFAULT NULL COMMENT '行政地区编码', + `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='组织机构信息'; + +-- ---------------------------- +-- Table structure for screen_customer_dept +-- ---------------------------- +DROP TABLE IF EXISTS `screen_customer_dept`; +CREATE TABLE `screen_customer_dept` ( + `ID` varchar(64) NOT NULL COMMENT '主键ID 主键ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `DEPT_ID` varchar(64) NOT NULL COMMENT '部门id', + `DEPT_NAME` varchar(255) NOT NULL COMMENT '部门名称', + `PARENT_AGENCY_ID` varchar(64) NOT NULL COMMENT '部门所属组织id', + `AREA_MARKS` text COMMENT '坐标区域', + `CENTER_MARK` varchar(255) DEFAULT NULL COMMENT '中心点位', + `DEPT_MARK` varchar(255) DEFAULT NULL COMMENT '部门所在位置(目前预留此字段)', + `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='部门信息'; + +-- ---------------------------- +-- Table structure for screen_customer_grid +-- ---------------------------- +DROP TABLE IF EXISTS `screen_customer_grid`; +CREATE TABLE `screen_customer_grid` ( + `ID` varchar(64) NOT NULL COMMENT '主键ID 主键ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `GRID_ID` varchar(64) NOT NULL COMMENT '网格id', + `GRID_NAME` varchar(255) NOT NULL COMMENT '组织名称', + `PARENT_AGENCY_ID` varchar(64) NOT NULL COMMENT '网格所属组织id', + `AREA_MARKS` text COMMENT '坐标区域', + `CENTER_MARK` varchar(255) DEFAULT NULL COMMENT '中心点位', + `PARTY_MARK` varchar(255) DEFAULT NULL COMMENT '党支部(=网格)的位置', + `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + `ALL_PARENT_IDS` varchar(512) DEFAULT NULL COMMENT '所有上级ID,用英文逗号分开', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='网格(党支部)信息'; + +-- ---------------------------- +-- Table structure for screen_difficulty_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_difficulty_data`; +CREATE TABLE `screen_difficulty_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `EVENT_ID` varchar(64) NOT NULL COMMENT '事件原Id', + `EVENT_IMG_URL` varchar(512) DEFAULT NULL COMMENT '事件图片', + `EVENT_SOURCE` varchar(64) DEFAULT NULL COMMENT '事件来源 XX街道-社区-网格', + `EVENT_CONTENT` varchar(512) DEFAULT NULL COMMENT '事件内容', + `EVENT_COST_TIME` int(11) DEFAULT '0' COMMENT '事件耗时 单位:分钟', + `EVENT_RE_ORG` int(11) DEFAULT '0' COMMENT '事件涉及部门数', + `EVENT_HANDLED_COUNT` int(11) NOT NULL COMMENT '事件被处理次数(08-21新增)', + `EVENT_CATEGORY_CODE` varchar(32) DEFAULT NULL COMMENT '事件类别编码', + `EVENT_CATEGORY_NAME` varchar(128) DEFAULT NULL COMMENT '事件类别名称', + `EVENT_STATUS_CODE` varchar(32) DEFAULT NULL COMMENT '事件状态key', + `EVENT_STATUS_DESC` varchar(64) DEFAULT NULL COMMENT '事件状态描述', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `LATEST_OPERATE_DESC` varchar(64) NOT NULL COMMENT '最近一次操作说明', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + `ALL_PARENT_IDS` varchar(512) DEFAULT NULL COMMENT '所有上级ID,用英文逗号分开', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基层治理-难点堵点(耗时最长|设计部门最多|处理次数)'; + +-- ---------------------------- +-- Table structure for screen_event_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_event_data`; +CREATE TABLE `screen_event_data` ( + `ID` varchar(256) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `EVENT_ID` varchar(64) NOT NULL COMMENT '原始事件Id', + `EVENT_TITLE` varchar(256) DEFAULT '0' COMMENT '事件名称', + `EVENT_CREATE_TIME` datetime DEFAULT NULL COMMENT '事件时间', + `LINK_MOBILE` varchar(32) DEFAULT NULL COMMENT '联系人 联系人', + `EVENT_CONTENT` varchar(1024) DEFAULT '0' COMMENT '事件描述', + `EVENT_IMG_URL` varchar(512) DEFAULT NULL COMMENT '事件图片', + `EVENT_LEVEL` varchar(32) DEFAULT '0' COMMENT '事件待处理级别 red:红;yellow:黄;绿色:green', + `EVENT_ADDRESS` varchar(512) DEFAULT NULL COMMENT '事件地址', + `LONGITUDE` decimal(32,8) DEFAULT '0.00000000' COMMENT '事件所在经度', + `LATITUDE` decimal(32,8) DEFAULT '0.00000000' COMMENT '事件所在维度', + `LAST_PROCESS_DEPT` varchar(128) DEFAULT '0' COMMENT '最后处理组织', + `LAST_PROCESS_DATE` datetime DEFAULT '0000-00-00 00:00:00' COMMENT '最后处理时间', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `EVENT_STATUS_CODE` varchar(32) DEFAULT NULL COMMENT '事件状态key', + `EVENT_STATUS_DESC` varchar(64) DEFAULT NULL COMMENT '事件状态描述', + `LATEST_OPERATE_DESC` varchar(64) DEFAULT NULL COMMENT '最近一次操作说明', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyMM|yyyyMMdd', + `ALL_PARENT_IDS` varchar(512) DEFAULT NULL COMMENT '所有上级ID,用英文逗号分开', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='中央区-事件数据'; + +-- ---------------------------- +-- Table structure for screen_event_img_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_event_img_data`; +CREATE TABLE `screen_event_img_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `EVENT_ID` varchar(64) NOT NULL COMMENT '原始事件Id', + `EVENT_IMG_URL` varchar(512) NOT NULL COMMENT '图片图片地址', + `SORT` int(11) NOT NULL COMMENT '排序', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='中央区-事件数据图片数据'; + +-- ---------------------------- +-- Table structure for screen_govern_rank_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_govern_rank_data`; +CREATE TABLE `screen_govern_rank_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年Id', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月份Id', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(32) NOT NULL COMMENT '组织名称', + `RESPONSE_RATIO` decimal(10,6) DEFAULT NULL COMMENT '响应率', + `RESOLVED_RATIO` decimal(10,6) DEFAULT NULL COMMENT '解决率', + `GOVERN_RATIO` decimal(10,6) DEFAULT NULL COMMENT '自治率', + `SATISFACTION_RATIO` decimal(10,6) DEFAULT NULL COMMENT '满意率', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基层治理-治理能力排行数据(按月统计)'; + +-- ---------------------------- +-- Table structure for screen_index_data_monthly +-- ---------------------------- +DROP TABLE IF EXISTS `screen_index_data_monthly`; +CREATE TABLE `screen_index_data_monthly` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年Id: yyyy', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月份Id yyyyMM', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `INDEX_TOTAL` decimal(10,6) DEFAULT NULL COMMENT '总指数', + `PARTY_DEV_ABLITY` decimal(10,6) DEFAULT NULL COMMENT '党建能力指数', + `SERVICE_ABLITY` decimal(10,6) DEFAULT NULL COMMENT '服务能力指数', + `GOVERN_ABLITY` decimal(10,6) DEFAULT NULL COMMENT '治理能力指数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='指数-指数数据(每月数值)'; + +-- ---------------------------- +-- Table structure for screen_index_data_yearly +-- ---------------------------- +DROP TABLE IF EXISTS `screen_index_data_yearly`; +CREATE TABLE `screen_index_data_yearly` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年Id: yyyy', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `INDEX_TOTAL` decimal(10,6) NOT NULL COMMENT '总指数', + `PARTY_DEV_ABLITY` decimal(10,6) NOT NULL COMMENT '党建能力指数', + `SERVICE_ABLITY` decimal(10,6) NOT NULL COMMENT '服务能力指数', + `GOVERN_ABLITY` decimal(10,6) NOT NULL COMMENT '治理能力指数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='指数-指数数据(按年统计)'; + +-- ---------------------------- +-- Table structure for screen_org_rank_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_org_rank_data`; +CREATE TABLE `screen_org_rank_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年Id', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月份Id', + `ORG_TYPE` varchar(32) NOT NULL COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `PARTY_TOTAL` int(11) DEFAULT '0' COMMENT '党员总数', + `GROUP_TOTAL` int(11) DEFAULT '0' COMMENT '小组(支部建设)总数', + `TOPIC_TOTAL` int(11) DEFAULT '0' COMMENT '话题总数', + `ISSUE_TOTAL` int(11) DEFAULT '0' COMMENT '议题总数', + `PROJECT_TOTAL` int(11) DEFAULT '0' COMMENT '项目总数', + `CLOSE_PROJECT_RATIO` decimal(10,6) DEFAULT NULL COMMENT '结案率', + `SATISFACTION_RATIO` decimal(10,6) DEFAULT NULL COMMENT '满意率', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `ALL_PARENT_IDS` varchar(512) DEFAULT NULL COMMENT '所有上级ID,用英文逗号分开', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='党建引领-组织先进排行榜'; + +-- ---------------------------- +-- Table structure for screen_party_branch_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_party_branch_data`; +CREATE TABLE `screen_party_branch_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年Id', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月份Id', + `TYPE` varchar(32) NOT NULL DEFAULT 'party' COMMENT '数据类别 :party:支部建设; union:联合建设;党员志愿服务:voluntaryservice', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `MEET_CATEGORY_ID` varchar(32) DEFAULT '0' COMMENT '会议分类Id', + `MEET_CATEGORY_NAME` varchar(64) DEFAULT '0' COMMENT '会议分类名称(三会党课、主题党日.....等等)', + `ORGANIZE_COUNT` int(11) DEFAULT '0' COMMENT '组织次数', + `JOIN_USER_COUNT` int(11) DEFAULT '0' COMMENT '参加人数', + `AVERAGE_JOIN_USER_COUNT` int(11) DEFAULT NULL COMMENT '平均参加人数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基层党建-建设情况数据(支部,联建,志愿服务)按月'; + +-- ---------------------------- +-- Table structure for screen_party_link_masses_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_party_link_masses_data`; +CREATE TABLE `screen_party_link_masses_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `CREATE_GROUP_TOTAL` int(11) DEFAULT '0' COMMENT '党员建群总数', + `GROUP_USER_TOTAL` int(11) DEFAULT '0' COMMENT '群成员总数', + `DEL_FLAG` char(1) NOT NULL COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='党建引领-党员联系群众数据'; + +-- ---------------------------- +-- Table structure for screen_party_user_rank_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_party_user_rank_data`; +CREATE TABLE `screen_party_user_rank_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `GRID_ID` varchar(64) NOT NULL COMMENT '用户所属网格id', + `GRID_NAME` varchar(128) NOT NULL COMMENT '用户所属网格名称', + `ORG_ID` varchar(64) NOT NULL COMMENT '网格所属的组织id', + `ORG_NAME` varchar(255) NOT NULL COMMENT '网格所属的组织名称', + `PARTY_FLAG` tinyint(1) NOT NULL COMMENT '是否是党员标志:1是。0不是党员', + `USER_ID` varchar(64) NOT NULL COMMENT '用户Id', + `SURNAME` varchar(32) DEFAULT NULL COMMENT '姓', + `NAME` varchar(32) DEFAULT NULL COMMENT '名', + `USER_NAME` varchar(32) NOT NULL COMMENT '姓名', + `POINT_TOTAL` int(11) DEFAULT '0' COMMENT '用户积分', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + `ALL_PARENT_IDS` varchar(512) DEFAULT NULL COMMENT '所有上级ID,用英文逗号分开', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='党建引领|基层治理-市民(党员)积分排行榜'; + +-- ---------------------------- +-- Table structure for screen_pioneer_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_pioneer_data`; +CREATE TABLE `screen_pioneer_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `ISSUE_TOTAL` int(11) DEFAULT '0' COMMENT '党员参与议事', + `ISSUE_RATIO` decimal(10,6) DEFAULT NULL COMMENT '党员参与议事占比', + `TOPIC_TOTAL` int(11) DEFAULT '0' COMMENT '党员发布话题', + `TOPIC_RATIO` decimal(10,6) DEFAULT NULL COMMENT '党员发布话题占比', + `PUBLISH_ISSUE_TOTAL` int(11) DEFAULT '0' COMMENT '党员发布议题', + `PUBLISH_ISSUE_RATIO` decimal(10,6) DEFAULT NULL COMMENT '党员发布议题占比', + `SHIFT_PROJECT_TOTAL` int(11) DEFAULT '0' COMMENT '议题转项目数', + `SHIFT_PROJECT_RATIO` decimal(10,6) DEFAULT NULL COMMENT '议题转项目占比', + `RESOLVED_PROJECT_TOTAL` int(11) DEFAULT '0' COMMENT '解决项目总数', + `RESOLVED_PROJECT_RATIO` decimal(10,6) DEFAULT NULL COMMENT '解决项目总数占比', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='党建引领-先锋模范数据'; + +-- ---------------------------- +-- Table structure for screen_public_parti_total_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_public_parti_total_data`; +CREATE TABLE `screen_public_parti_total_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;网格:grid;部门:department;', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id,如果是网格,传入网格所属组织id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称,也可能是网格名称', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + `TOPIC_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '话题总数', + `ISSUE_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '议题总数', + `PROJECT_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '项目总数', + `REG_USER_TOTAL` int(11) NOT NULL COMMENT '注册人数', + `JOIN_USER_TOTAL` int(11) NOT NULL COMMENT '参与人数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公众参与-各类(话题|议题|项目|注册人数|参与人数)总数'; + +-- ---------------------------- +-- Table structure for screen_user_join +-- ---------------------------- +DROP TABLE IF EXISTS `screen_user_join`; +CREATE TABLE `screen_user_join` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `ORG_TYPE` varchar(32) NOT NULL COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `YEAR_ID` varchar(32) NOT NULL COMMENT '数据更新至 年Id: yyyy', + `MONTH_ID` varchar(32) NOT NULL COMMENT '数据更新至 :月份Id :yyyyMM', + `JOIN_TOTAL` int(11) DEFAULT '0' COMMENT '总的参与次数', + `JOIN_TOTAL_UP_RATE` decimal(30,6) DEFAULT NULL COMMENT '总的参与次数较上月增长率(采集的时候后台自己计算)', + `JOIN_TOTAL_UP_FLAG` varchar(10) DEFAULT NULL COMMENT '增长:incr;下降:decr; 相等 :eq;默认:空', + `AVG_ISSUE` int(11) DEFAULT '0' COMMENT '人均议题', + `AVG_ISSUE_UP_RATE` decimal(30,6) DEFAULT NULL COMMENT '人均议题较上月增长率(采集的时候后台自己计算)', + `AVG_ISSUE_UP_FLAG` varchar(10) DEFAULT NULL COMMENT '增长:incr;下降:decr; 相等 :eq;默认:空', + `AVG_JOIN` int(11) DEFAULT '0' COMMENT '平均参与度', + `AGVG_JOIN_UP_RATE` decimal(30,6) DEFAULT NULL COMMENT '平均参与度较上月增长率(采集的时候后台自己计算)', + `AGVG_JOIN_UP_FLAG` varchar(10) DEFAULT NULL COMMENT '增长:incr;下降:decr; 相等 :eq;默认:空', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基层治理-公众参与'; + +-- ---------------------------- +-- Table structure for screen_user_total_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_user_total_data`; +CREATE TABLE `screen_user_total_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;网格:grid;部门:department;', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称,也可能是网格名称', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + `USER_TOTAL` int(11) DEFAULT '0' COMMENT '用户总数', + `PARTY_TOTAL` int(11) DEFAULT '0' COMMENT '注册党总数', + `GROUP_TOTAL` int(11) DEFAULT '0' COMMENT '小组(党群)总数', + `TOPIC_TOTAL` int(11) DEFAULT '0' COMMENT '话题总数', + `ISSUE_TOTAL` int(11) DEFAULT '0' COMMENT '议题总数', + `PROJECT_TOTAL` int(11) DEFAULT '0' COMMENT '项目总数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='中央区-各类(用户|党员|党群|话题|议题|项目)总数'; + +SET FOREIGN_KEY_CHECKS = 1; From 7456f6a22312130fde45f86840f8f91e0134b528 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 3 Sep 2020 10:18:22 +0800 Subject: [PATCH 163/226] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E5=8F=8A=E7=94=9F=E4=BA=A7=E6=95=B0=E6=8D=AE=E5=BA=93=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-report/data-report-server/pom.xml | 25 +++++++++++++++++++ .../data-statistical-server/pom.xml | 24 ++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 6e97f8c65d..497f38df57 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -168,6 +168,19 @@ epmet elink@833066 + + + + epmet + elink@833066 + + + + + epmet + elink@833066 + + 0 r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com @@ -207,6 +220,18 @@ epmet_data_statistical EpmEt-db-UsEr + + + + epmet_data_stats_display_user + EpmEt-db-UsEr + + + + + epmet_evaluation_index_user + EpmEt-db-UsEr + 0 r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 70552ac026..8a76d00116 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -281,6 +281,18 @@ epmet elink@833066 + + + + epmet + elink@833066 + + + + + epmet + elink@833066 + 0 r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com @@ -363,6 +375,18 @@ epmet_user_user EpmEt-db-UsEr + + + + epmet_data_stats_display_user + EpmEt-db-UsEr + + + + + epmet_evaluation_index_user + EpmEt-db-UsEr + 0 r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com From b62b1aefb33555d8142dc9c9c3aaecca9310974b Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 3 Sep 2020 10:29:27 +0800 Subject: [PATCH 164/226] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=88=86=E9=A1=B5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/impl/GrassRootsGovernServiceImpl.java | 7 ++----- .../screen/impl/GrassrootsPartyDevServiceImpl.java | 1 + .../screen/impl/PartyMemberLeadServiceImpl.java | 1 + 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java index bf8fe359d2..d750c1ee03 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java @@ -169,6 +169,7 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { while(CollectionUtils.isEmpty(orderList) && time > NumConstant.ONE){ time--; monthId = dateUtils.getPreviousMonthIdByDest(null ,monthId); + PageHelper.startPage(NumConstant.ONE,param.getTopNum()); orderList = screenGovernRankDataDao.selectGovernCapacityRatio(monthId,param.getAgencyId()); } @@ -238,11 +239,7 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { return result; } - private String convertPercentStr(BigDecimal percent){ - if(null == percent || BigDecimal.ZERO == percent) return "0.00%"; - String percentStr = percent.setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString(); - return percentStr.concat(ModuleConstant.SYMBOL_PERCENT); - } + private String convertPercentStr(BigDecimal percent,Integer digits){ if(null == percent) percent = BigDecimal.ZERO; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java index a336d356cc..619eba4625 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java @@ -207,6 +207,7 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService while(CollectionUtils.isEmpty(orderList) && time > NumConstant.ONE){ time --; param.setMonthId(dateUtils.getPreviousMonthIdByDest(null,param.getMonthId())); + PageHelper.startPage(NumConstant.ONE,param.getTopNum()); orderList = screenPartyBranchDataDao.selectBranchDataByTypeOrder(param.getAgencyId(),param.getCategory(),param.getMonthId(),param.getBottomMonthId()); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java index 61fe56778d..203b5cb456 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java @@ -219,6 +219,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { while(CollectionUtils.isEmpty(gridData) && time > NumConstant.ONE){ time--; monthId = dateUtils.getPreviousMonthIdByDest(null,monthId); + PageHelper.startPage(NumConstant.ONE,param.getTopNum()); gridData = screenOrgRankDataDao.selectGridDataMonthly(param.getAgencyId(),monthId); } List result = new LinkedList<>(); From d31e78978c5f50a98fe4318e3949846446442338 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 3 Sep 2020 11:00:29 +0800 Subject: [PATCH 165/226] =?UTF-8?q?sql=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/migration/V0.0.1__demo.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/migration/V0.0.1__demo.sql diff --git a/epmet-module/data-report/data-report-server/src/main/resources/migration/V0.0.1__demo.sql b/epmet-module/data-report/data-report-server/src/main/resources/migration/V0.0.1__demo.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/migration/V0.0.1__demo.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file From 87f7b11197ec68c5039e8b82f7b0a29550776035 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 3 Sep 2020 13:41:22 +0800 Subject: [PATCH 166/226] =?UTF-8?q?=E6=B7=BB=E5=8A=A0flyway=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/{ => db}/migration/V0.0.1__demo.sql | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename epmet-module/data-report/data-report-server/src/main/resources/{ => db}/migration/V0.0.1__demo.sql (100%) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/migration/V0.0.1__demo.sql b/epmet-module/data-report/data-report-server/src/main/resources/db/migration/V0.0.1__demo.sql similarity index 100% rename from epmet-module/data-report/data-report-server/src/main/resources/migration/V0.0.1__demo.sql rename to epmet-module/data-report/data-report-server/src/main/resources/db/migration/V0.0.1__demo.sql From 2888963bb0025776576a4f81ffe591684102a289 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 3 Sep 2020 15:02:05 +0800 Subject: [PATCH 167/226] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/FactIndexCollectServiceImpl.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 0e4136eccb..e8ec5f9342 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 @@ -37,7 +37,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { @Autowired private FactIndexGovrnAblityDeptMonthlyDao factIndexGovrnAblityDeptMonthlyDao; - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertGridPartyMemberData(List formDTO, String customerId) { @@ -51,7 +51,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertGridPartyAbility(List formDTO, String customerId) { @@ -65,7 +65,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertOrgPartyAbility(List formDTO, String customerId) { @@ -83,7 +83,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertGridServiceAbility(List formDTO, String customerId) { @@ -97,7 +97,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertOrgServiceAbility(List formDTO, String customerId) { @@ -115,7 +115,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertGridGovrnAbility(List formDTO, String customerId) { @@ -129,7 +129,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertOrgGovrnAbility(List formDTO, String customerId) { @@ -147,7 +147,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertDeptGovrnAbility(List formDTO, String customerId) { From 65995689cf93176aeae5fe0c34bba7d7a32fc321 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 3 Sep 2020 15:02:26 +0800 Subject: [PATCH 168/226] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/DataStatsApplication.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java index b11253b6e4..eee1f3bca7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java @@ -17,6 +17,6 @@ public class DataStatsApplication { public static void main(String[] args) { SpringApplication.run(DataStatsApplication.class ,args); -// HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() +" DataStatsApplication started!"); + HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() +" DataStatsApplication started!"); } } From 3266e3d7d38595c65ccc6e1c54ecc30880a030bd Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 3 Sep 2020 15:16:49 +0800 Subject: [PATCH 169/226] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/impl/ScreenCollServiceImpl.java | 34 +++++++++---------- .../stats/impl/DimAgencyServiceImpl.java | 4 +-- 2 files changed, 19 insertions(+), 19 deletions(-) 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 8a40a66ed5..0b205efb5a 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 @@ -83,7 +83,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { @Autowired private ScreenPublicPartiTotalDataDao screenPublicPartiTotalDataDao; - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertPartyUserRankData(List formDTO,String customerId) { @@ -98,7 +98,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertPartyLinkMassesData(List formDTO, String customerId) { @@ -113,7 +113,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertPartyBranchData(List formDTO, String customerId) { @@ -131,7 +131,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertOrgRankData(List formDTO, String customerId) { @@ -149,7 +149,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertGovernRankData(List formDTO, String customerId) { @@ -167,7 +167,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertEventData(List formDTO, String customerId) { @@ -195,7 +195,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertDifficultyData(List formDTO, String customerId) { @@ -208,7 +208,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertCpcbaseData(List formDTO, String customerId) { @@ -223,7 +223,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertIndexDataMonthly(List formDTO, String customerId) { @@ -241,7 +241,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertIndexDataYearly(List formDTO, String customerId) { @@ -258,7 +258,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertCustomerDept(List formDTO, String customerId) { @@ -273,7 +273,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertCustomerGrid(List formDTO, String customerId) { @@ -288,7 +288,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertCustomerAgency(List formDTO, String customerId) { @@ -303,7 +303,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertUserTotalData(List formDTO, String customerId) { @@ -318,7 +318,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertUserJoin(List formDTO, String customerId) { @@ -437,7 +437,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertPioneerData(List formDTO, String customerId) { @@ -452,7 +452,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } - @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertPublicPartiTotalData(List formDTO, String customerId) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java index 10d4ba7a44..7f21b81ee0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java @@ -21,11 +21,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.DimAgencyConstant; import com.epmet.constant.RobotConstant; @@ -210,7 +210,7 @@ public class DimAgencyServiceImpl extends BaseServiceImpl getAgencyListByCustomerId(String customerId) { if (StringUtils.isBlank(customerId)){ From 6a37525f24f5e83faa9c4af438c3e10befc9115f Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 3 Sep 2020 15:27:25 +0800 Subject: [PATCH 170/226] =?UTF-8?q?=E8=A1=97=E9=81=93=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/IndexCalConstant.java | 4 + .../SubCommunityGovernAvgResultDTO.java | 46 ++ .../SubCommunityServiceAvgResultDTO.java | 51 +++ .../com/epmet/controller/DemoController.java | 10 + .../indexcal/AgencyScoreDao.java | 9 + .../screen/FactIndexCommunityScoreDao.java | 34 ++ .../screen/FactIndexGridScoreDao.java | 4 +- .../java/com/epmet/eum/IndexCodeEnum.java | 3 + .../IndexCalculateCommunityServiceImpl.java | 55 ++- .../impl/IndexCalculateStreetServiceImpl.java | 424 +++++++++++++++++- .../indexcal/AgencyScoreDao.xml | 22 + .../screen/FactIndexCommunityScoreDao.xml | 64 ++- .../screen/FactIndexGridScoreDao.xml | 31 +- 13 files changed, 722 insertions(+), 35 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityGovernAvgResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityServiceAvgResultDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java index defe8225fd..a2064455a4 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java @@ -14,6 +14,10 @@ public interface IndexCalConstant { String AGENCY_ID="AGENCY_ID"; + String PARENT_AGENCY_ID = "parentAgencyId"; + + String PARENT_ID = "PARENT_ID"; + String CUSTOMER_ID="CUSTOMER_ID"; String MONTH_ID="MONTH_ID"; diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityGovernAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityGovernAvgResultDTO.java new file mode 100644 index 0000000000..013d8c02dc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityGovernAvgResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/9/2 5:54 下午 + */ +@Data +public class SubCommunityGovernAvgResultDTO implements Serializable { + + private static final long serialVersionUID = 4591964909777753497L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 分数 + */ + private BigDecimal score; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityServiceAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityServiceAvgResultDTO.java new file mode 100644 index 0000000000..d860696dd1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityServiceAvgResultDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/9/2 6:01 下午 + */ +@Data +public class SubCommunityServiceAvgResultDTO implements Serializable { + + private static final long serialVersionUID = 7681907923515081626L; + + /** + * + */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 分数 + */ + private BigDecimal score; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index e92d93a3b6..58d08b8120 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -19,6 +19,7 @@ import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.service.StatsDemoService; import com.epmet.service.evaluationindex.indexcal.GridCorreLationService; import com.epmet.service.evaluationindex.indexcal.IndexCalculateCommunityService; +import com.epmet.service.evaluationindex.indexcal.IndexCalculateStreetService; import com.epmet.service.stats.DimAgencyService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -50,6 +51,8 @@ public class DemoController { private IndexCalculateCommunityService indexCalculateCommunityService; @Autowired private GridCorreLationService gridCorreLationService; + @Autowired + private IndexCalculateStreetService indexCalculateStreetService; @GetMapping("testAlarm") public void testAlarm() { @@ -442,4 +445,11 @@ public class DemoController { entity.setUpdatedBy(IndexCalConstant.insertUser); return entity; } + + @PostMapping("streetZxc") + public void getStreet(){ + String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + String monthId = "202008"; + indexCalculateStreetService.calStreetAll(customerId,monthId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java index 71f4f09bca..5c6a90ad02 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java @@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.indexcal; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcal.AgencyScoreDTO; +import com.epmet.dto.screen.FactIndexCommunityScoreDTO; import com.epmet.entity.evaluationindex.indexcal.AgencyScoreEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -52,5 +53,13 @@ public interface AgencyScoreDao extends BaseDao { */ void deleteOldRecord(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("dataType")String dataType); + /** + * @Description 查询街道相关信息 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/1 9:41 上午 + */ + List selectStreetInfo(@Param("customerId") String customerId, @Param("monthId")String monthId,@Param("dataType")String dataType); } \ No newline at end of file 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/screen/FactIndexCommunityScoreDao.java index 189afc8e84..96963e7cc9 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/screen/FactIndexCommunityScoreDao.java @@ -18,7 +18,13 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.SubCommunityGovernAvgResultDTO; +import com.epmet.dto.indexcal.SubCommunityPartyAvgResultDTO; +import com.epmet.dto.indexcal.SubCommunityServiceAvgResultDTO; import com.epmet.dto.screen.FactIndexCommunityScoreDTO; +import com.epmet.dto.screen.result.SubGridGovernAvgResultDTO; +import com.epmet.dto.screen.result.SubGridPartyAvgResultDTO; +import com.epmet.dto.screen.result.SubGridServiceAvgResultDTO; import com.epmet.entity.evaluationindex.screen.FactIndexCommunityScoreEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -61,4 +67,32 @@ public interface FactIndexCommunityScoreDao extends BaseDao selectCommunityInfo(@Param("customerId") String customerId,@Param("monthId")String monthId); + + /** + * @Description 下属所有社区的党建能力平均值 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/28 3:20 下午 + */ + List selectSubCommPartyAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * @Description 街道下属所有社区治理能力汇总平均值 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/31 9:19 上午 + */ + List selectSubCommGovernAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * @Description 街道下级所有社区服务能力得分平均值 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/31 1:51 下午 + */ + List selectSubCommServiceAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("indexCode")String indexCode); + } \ 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 index 96ba8f3c9f..ea12caa2ec 100644 --- 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 @@ -37,13 +37,13 @@ import java.util.List; public interface FactIndexGridScoreDao extends BaseDao { /** - * @Description 下属所有网格的党建能力平均值 + * @Description 下属所有网格的平均值 * @param customerId * @param monthId * @author zxc * @date 2020/8/28 3:20 下午 */ - List selectSubGridPartyAvgScore(@Param("customerId")String customerId,@Param("monthId")String monthId); + List selectSubGridAvgScore(@Param("customerId")String customerId,@Param("monthId")String monthId,@Param("indexCode")String indexCode); /** * @Description 社区下属所有网格治理能力汇总平均值 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java index 88e759af17..5ebaab6f74 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java @@ -28,6 +28,9 @@ public enum IndexCodeEnum { XIA_SHU_SUO_YOU_WGDDJNLPJZ("xiashusuoyouwgddjnlpjz","下属所有网格的党建能力(平均值)",5), SHE_QU_XIA_SHU_SYWGZLNLHZPJZ("shequxiashusywgzlnlhzpjz","社区下属所有网格治理能力汇总(平均值)",5), SHE_QU_XIA_JI_SYWGFWNLDFPJZ("shequxiajisywgfwnldfpjz","社区下级所有网格服务能力得分(平均值) ",5), + JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ("jiedaoxiashusysqdjnlhzpjz","街道下属所有社区党建能力汇总(平均值)",5), + JIE_DAO_XIA_SHU_SYSQZLNLHZ("jiedaoxiashusysqzlnlhz","街道下属所有社区治理能力汇总 (平均值) ",5), + JIE_DAO_XIA_SHU_SQFWNLDFPYZ("jiedaoxiashusqfwnldfpjz","街道下属社区服务能力得分 (平均值) ",5), ; private String code; 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 229c3059de..5ff0a15ba9 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 @@ -80,15 +80,17 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return false; } List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); //下属所有网格的党建能力平均值 detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.XIA_SHU_SUO_YOU_WGDDJNLPJZ.getCode().equals(detail.getIndexCode())) { - List subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridPartyAvgScore(customerId, monthId); + List subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { log.error("查询下属所有网格的党建能力平均值集合为空"); return; }else if (subGridPartyAvgScore.size() == NumConstant.ONE){ - sizeOne(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + pid.put(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),subGridPartyAvgScore.get(NumConstant.ZERO).getParentId()); + sizeOne(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); return; }else if (subGridPartyAvgScore.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -97,6 +99,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni partition.forEach(publish -> { List index1SampleValues = new ArrayList<>(); publish.forEach(c -> { + pid.put(c.getAgencyId(),c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -117,7 +120,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni log.error("指标Code未查询出对应字段 【" + detail.getIndexCode() + "】"); return; }else if (mapList.size() == NumConstant.ONE){ - sizeOne(mapList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + pid.put(mapList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),mapList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); + sizeOne(mapList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); return; }else if (mapList.size() > NumConstant.ONE) { List decimalList = mapList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); @@ -127,6 +131,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); List index1SampleValues = new ArrayList<>(); publish.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); index1SampleValues.add(s); }); @@ -138,7 +143,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); return true; } @@ -158,18 +163,21 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return false; } List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode().equals(detail.getIndexCode())) { - List subGridGovernAvg = factIndexGridScoreDao.selectSubGridGovernAvgScore(customerId, monthId); + List subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); if (subGridGovernAvg.size() == NumConstant.ONE) { - sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + pid.put(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),subGridGovernAvg.get(NumConstant.ZERO).getParentId()); + sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); return; } else if (subGridGovernAvg.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); - List> governAvg = ListUtils.partition(subGridGovernAvg, 10); + List> governAvg = ListUtils.partition(subGridGovernAvg, 10); governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { + pid.put(c.getAgencyId(),c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -185,7 +193,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni log.error("查询治理能力的六个五级指标集合为空"); return; }else if (communityGovernAbility.size() == NumConstant.ONE) { - sizeOne(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + pid.put(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); + sizeOne(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); return; } else if (communityGovernAbility.size() > NumConstant.ONE) { String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); @@ -200,6 +209,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); List index1SampleValues = new ArrayList<>(); governAbility.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); index1SampleValues.add(s); }); @@ -211,7 +221,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); return true; } @@ -231,20 +241,23 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return false; } List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.SHE_QU_XIA_JI_SYWGFWNLDFPJZ.getCode().equals(indexCode)) { - List subGridServiceAvg = factIndexGridScoreDao.selectSubGridServiceAvgScore(customerId, monthId); + List subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); if (subGridServiceAvg.size() == NumConstant.ONE) { - sizeOne(subGridServiceAvg.get(NumConstant.ZERO).getAgencyId().toString(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); + pid.put(subGridServiceAvg.get(NumConstant.ZERO).getAgencyId(),subGridServiceAvg.get(NumConstant.ZERO).getParentId()); + sizeOne(subGridServiceAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); return; } else if (subGridServiceAvg.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); - List> serviceAvgList = ListUtils.partition(subGridServiceAvg, 10); + List> serviceAvgList = ListUtils.partition(subGridServiceAvg, 10); serviceAvgList.forEach(serviceAvg -> { BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); List index1SampleValues = new ArrayList<>(); serviceAvg.forEach(c -> { + pid.put(c.getAgencyId(),c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -258,7 +271,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni log.error("查询社区活动组织次数集合为空"); return; }else if (communityActivityCountList.size() == NumConstant.ONE) { - sizeOne(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); + pid.put(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); + sizeOne(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); return; } else if (communityActivityCountList.size() > NumConstant.ONE) { String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); @@ -273,6 +287,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); List index1SampleValues = new ArrayList<>(); communityActivity.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); index1SampleValues.add(s); }); @@ -284,7 +299,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode()); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); return true; } @@ -319,6 +334,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni score.setIndexCode(IndexCalConstant.COMMUNITY_RELATE); value.forEach(community -> { score.setScore(score.getScore().add(community.getScore())); + score.setParentAgencyId(community.getParentAgencyId()); }); result.add(score); }); @@ -394,7 +410,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni * @author zxc * @date 2020/9/2 2:37 下午 */ - public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode) { + public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode,Map pid) { List result = new ArrayList<>(); scoreCountOfSampleId.forEach((k, v) -> { FactIndexCommunityScoreDTO score = new FactIndexCommunityScoreDTO(); @@ -406,6 +422,11 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni score.setIsTotal(isTotal); score.setIndexCode(indexCode); score.setScore(v); + pid.forEach((agency,parentAgency) -> { + if (k.equals(agency)){ + score.setParentAgencyId(parentAgency); + } + }); result.add(score); }); return result; @@ -419,10 +440,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni * @author zxc * @date 2020/9/2 2:40 下午 */ - public void sizeOne(String agencyId,String customerId,String monthId,String indexCode){ + public void sizeOne(String agencyId,String customerId,String monthId,String indexCode,Map pid){ HashMap scoreCountOfSampleId = new HashMap<>(); scoreCountOfSampleId.put(agencyId,new BigDecimal(NumConstant.FIFTY)); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, indexCode); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, indexCode,pid); deleteAndInsert(customerId, monthId, indexCode, result); } } 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 1b1b095fd5..6d7b90ffd0 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 @@ -1,10 +1,42 @@ package com.epmet.service.evaluationindex.indexcal.impl; +import com.alibaba.druid.util.StringUtils; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +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.AgencyScoreDao; +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.dto.indexcal.AgencyScoreDTO; +import com.epmet.dto.indexcal.SubCommunityServiceAvgResultDTO; +import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; +import com.epmet.eum.IndexCodeEnum; import com.epmet.service.evaluationindex.indexcal.IndexCalculateStreetService; +import com.epmet.service.evaluationindex.indexcal.IndexCodeFieldReService; +import com.epmet.service.evaluationindex.screen.IndexGroupDetailService; +import com.epmet.support.normalizing.BigDecimalScoreCalculator; +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.IndexInputVO; +import com.epmet.support.normalizing.batch.SampleValue; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; /** * @Author zxc @@ -15,6 +47,21 @@ import org.springframework.stereotype.Service; @DataSource(DataSourceConstant.EVALUATION_INDEX) public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetService { + @Autowired + private FactIndexPartyAblityOrgMonthlyDao factIndexPartyAblityOrgMonthlyDao; + @Autowired + private FactIndexGovrnAblityOrgMonthlyDao factIndexGovrnAblityOrgMonthlyDao; + @Autowired + private FactIndexServiceAblityOrgMonthlyDao factIndexServiceAblityOrgMonthlyDao; + @Autowired + private IndexGroupDetailService indexGroupDetailService; + @Autowired + private IndexCodeFieldReService indexCodeFieldReService; + @Autowired + private FactIndexCommunityScoreDao communityScoreDao; + @Autowired + private AgencyScoreDao agencyScoreDao; + /** * @Description 计算街道相关总分 * @param customerId @@ -24,6 +71,381 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ */ @Override public Boolean calStreetAll(String customerId, String monthId) { - return null; + Boolean aBoolean = streetPartyCalculate(customerId, monthId);//党建能力 + if (!aBoolean.equals(true)) { + throw new RenException("calculate street-party-ability failure ......"); + } + Boolean bBoolean = streetGovernAbilityCalculate(customerId, monthId);// 治理能力 + if (!bBoolean.equals(true)) { + throw new RenException("calculate street-govern-ability failure ......"); + } + Boolean cBoolean = streetServiceAbilityCalculate(customerId, monthId);// 服务能力 + if (!cBoolean.equals(true)) { + throw new RenException("calculate street-service-ability failure ......"); + } + Boolean dBoolean = streetRelate(customerId, monthId); + if (!dBoolean.equals(true)) { + throw new RenException("calculate street-all insert failure ......"); + } + return true; + } + + /** + * @param customerId + * @Description 社区名义发文数量计算【党建能力】 + * @author zxc + * @date 2020/8/26 10:46 上午 + */ + @Transactional(rollbackFor = Exception.class) + public Boolean streetPartyCalculate(String customerId, String monthId) { + // 党建能力 + // 根据all_parent_index_code 获取指标明细 + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error("指标明细查询集合为空"); + return false; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + //下属所有社区的党建能力平均值 + detailListByParentCode.forEach(detail -> { + if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { + List subCommPartyAvgScore = communityScoreDao.selectSubCommServiceAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(subCommPartyAvgScore)) { + log.error("查询下属所有社区的党建能力平均值集合为空"); + return; + }else if (subCommPartyAvgScore.size() == NumConstant.ONE){ + pid.put(subCommPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),subCommPartyAvgScore.get(NumConstant.ZERO).getParentId()); + sizeOne(subCommPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); + return; + }else if (subCommPartyAvgScore.size() > NumConstant.ONE) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); + Integer indexEnd = NumConstant.TEN; + List> partition = ListUtils.partition(subCommPartyAvgScore, indexEnd); + partition.forEach(publish -> { + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + pid.put(c.getAgencyId(),c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + 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); + indexInputVOS.add(index1VO); + }); + } + } else { + // 街道名义发文数量 + List> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId, IndexCalConstant.STREET_LEVEL); + if (CollectionUtils.isEmpty(mapList)) { + log.error("查询街道名义发文数量集合为空"); + return; + } + String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldName)) { + log.error("指标Code未查询出对应字段 【" + detail.getIndexCode() + "】"); + return; + }else if (mapList.size() == NumConstant.ONE){ + pid.put(mapList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),mapList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); + sizeOne(mapList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); + return; + }else if (mapList.size() > NumConstant.ONE) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(mapList.stream().map(m -> new BigDecimal(m.get(fieldName).toString())).collect(Collectors.toList())); + List>> publishArticleList = ListUtils.partition(mapList, 10); + publishArticleList.forEach(publish -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); + 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); + indexInputVOS.add(index1VO); + }); + } + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); + deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); + return true; + } + + /** + * @Description 街道治理能力 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/26 1:40 下午 + */ + @Transactional(rollbackFor = Exception.class) + public Boolean streetGovernAbilityCalculate(String customerId, String monthId) { + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error("指标明细查询集合为空"); + return false; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + detailListByParentCode.forEach(detail -> { + if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) { + List subGridGovernAvg = communityScoreDao.selectSubCommServiceAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + if (subGridGovernAvg.size() == NumConstant.ONE) { + pid.put(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),subGridGovernAvg.get(NumConstant.ZERO).getParentId()); + sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); + return; + } else if (subGridGovernAvg.size() > NumConstant.ONE) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> governAvg = ListUtils.partition(subGridGovernAvg, 10); + governAvg.forEach(avg -> { + List index1SampleValues = new ArrayList<>(); + avg.forEach(c -> { + pid.put(c.getAgencyId(),c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + 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); + indexInputVOS.add(index1VO); + }); + } + } else { + // 治理能力的六个五级指标 + List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(customerId, monthId,IndexCalConstant.STREET_LEVEL); + if (CollectionUtils.isEmpty(communityGovernAbility)){ + log.error("查询治理能力的六个五级指标集合为空"); + return; + }else if (communityGovernAbility.size() == NumConstant.ONE) { + pid.put(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); + sizeOne(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); + return; + } else if (communityGovernAbility.size() > NumConstant.ONE) { + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + System.err.println(fieldNameByIndexCode); + System.err.println(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error("指标Code未查询出对应字段 【" + detail.getIndexCode() + "】"); + return; + } + List decimalList = communityGovernAbility.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> governAbilityList = ListUtils.partition(communityGovernAbility, 10); + governAbilityList.forEach(governAbility -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + List index1SampleValues = new ArrayList<>(); + governAbility.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); + 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); + indexInputVOS.add(index1VO); + }); + } + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); + deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); + return true; + } + + /** + * @Description 街道服务能力 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/31 1:38 下午 + */ + @Transactional(rollbackFor = Exception.class) + public Boolean streetServiceAbilityCalculate(String customerId, String monthId) { + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error("指标明细查询集合为空"); + return false; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + detailListByParentCode.forEach(detail -> { + String indexCode = detail.getIndexCode(); + if (IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode().equals(indexCode)) { + List subCommServiceAvg = communityScoreDao.selectSubCommServiceAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); + if (subCommServiceAvg.size() == NumConstant.ONE) { + pid.put(subCommServiceAvg.get(NumConstant.ZERO).getAgencyId(),subCommServiceAvg.get(NumConstant.ZERO).getParentId()); + sizeOne(subCommServiceAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); + return; + } else if (subCommServiceAvg.size() > NumConstant.ONE) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> serviceAvgList = ListUtils.partition(subCommServiceAvg, 10); + serviceAvgList.forEach(serviceAvg -> { + BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + List index1SampleValues = new ArrayList<>(); + serviceAvg.forEach(c -> { + pid.put(c.getAgencyId(),c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + indexInputVOS.add(index1VO); + }); + } + } else { + List> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMap(customerId, monthId,IndexCalConstant.STREET_LEVEL); + if (CollectionUtils.isEmpty(communityActivityCountList)) { + log.error("查询街道活动组织次数集合为空"); + return; + }else if (communityActivityCountList.size() == NumConstant.ONE) { + pid.put(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); + sizeOne(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); + return; + } else if (communityActivityCountList.size() > NumConstant.ONE) { + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error("指标Code未查询出对应字段 【" + detail.getIndexCode() + "】"); + return; + } + List decimalList = communityActivityCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> communityActivityList = ListUtils.partition(communityActivityCountList, 10); + communityActivityList.forEach(communityActivity -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + List index1SampleValues = new ArrayList<>(); + communityActivity.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); + 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); + indexInputVOS.add(index1VO); + }); + } + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid + ); + deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); + return true; + } + + /** + * @Description 街道相关计算 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/3 9:21 上午 + */ + public Boolean streetRelate(String customerId, String monthId) { + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); + List agencyScoreList = agencyScoreDao.selectStreetInfo(customerId, monthId, IndexCalConstant.STREET_LEVEL); + detailListByParentCode.forEach(detail -> { + agencyScoreList.forEach(community -> { + if (detail.getIndexCode().equals(community.getIndexCode())) { + community.setScore(community.getScore().multiply(detail.getWeight())); + } + }); + }); + Map> collect = agencyScoreList.stream().collect(Collectors.groupingBy(AgencyScoreDTO::getAgencyId)); + List result = new ArrayList<>(); + collect.forEach((key, value) -> { + AgencyScoreDTO score = new AgencyScoreDTO(); + score.setIsTotal(NumConstant.ONE_STR); + score.setCustomerId(customerId); + score.setAgencyId(key); + score.setMonthId(monthId); + score.setYearId(DateUtils.getYearId(monthId)); + score.setQuarterId(DateUtils.getQuarterId(monthId)); + score.setIndexCode(IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode()); + score.setDataType(IndexCalConstant.STREET_LEVEL); + value.forEach(street -> { + score.setScore(score.getScore().add(street.getScore())); + score.setParentAgencyId(street.getParentAgencyId()); + }); + result.add(score); + }); + deleteAndInsert(customerId, monthId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), result); + return true; + } + + /** + * @param list + * @Description BigDecimal类型获取最大数和最小数 + * @author zxc + * @date 2020/8/27 1:30 下午 + */ + public MaxAndMinBigDecimalResultDTO getMaxAndMinBigDecimal(List list) { + BigDecimal max = Collections.max(list); + BigDecimal min = Collections.min(list); + MaxAndMinBigDecimalResultDTO result = new MaxAndMinBigDecimalResultDTO(); + result.setMax(max); + result.setMin(min); + return result; + } + + /** + * @param customerId + * @param monthId + * @param indexCode + * @param subAllCommunityList + * @Description 先删除记录,在插入 + * @author zxc + * @date 2020/9/1 4:24 下午 + */ + public void deleteAndInsert(String customerId, String monthId, String indexCode, List subAllCommunityList) { + if (!CollectionUtils.isEmpty(subAllCommunityList)) { + agencyScoreDao.deleteOldRecord(customerId, monthId, indexCode,IndexCalConstant.STREET_LEVEL); + agencyScoreDao.insertStreetRecord(subAllCommunityList); + } + } + + /** + * @Description + * @param scoreCountOfSampleId 指标计算结果 + * @param customerId 客户ID + * @param monthId 月份ID + * @param isTotal 是否 总分【党建+治理+服务】 + * @param indexCode 党建能力:dangjiannengli,治理能力:zhilinengli,服务能力:fuwunengli,xx相关:xx相关 + * @author zxc + * @date 2020/9/2 2:37 下午 + */ + public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode,Map pid) { + List result = new ArrayList<>(); + scoreCountOfSampleId.forEach((k, v) -> { + AgencyScoreDTO score = new AgencyScoreDTO(); + score.setCustomerId(customerId); + score.setAgencyId(k); + score.setMonthId(monthId); + score.setQuarterId(DateUtils.getQuarterId(monthId)); + score.setYearId(DateUtils.getYearId(monthId)); + score.setIsTotal(isTotal); + score.setIndexCode(indexCode); + score.setScore(v); + pid.forEach((agency,parentAgency) -> { + if (k.equals(agency)){ + score.setParentAgencyId(parentAgency); + } + }); + result.add(score); + }); + return result; + } + + /** + * @Description 当查询结果为一条时,调用此方法 + * @param agencyId + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/2 2:40 下午 + */ + public void sizeOne(String agencyId,String customerId,String monthId,String indexCode,Map pid){ + HashMap scoreCountOfSample = new HashMap<>(); + scoreCountOfSample.put(agencyId,new BigDecimal(NumConstant.FIFTY)); + List result = getResult(scoreCountOfSample, customerId, monthId, NumConstant.ZERO_STR, indexCode,pid); + deleteAndInsert(customerId, monthId, indexCode, result); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml index dd6a3a9892..cd0c93b654 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml @@ -42,4 +42,26 @@ AND index_code = #{indexCode} AND data_type = #{dataType} + + + \ No newline at end of file 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/screen/FactIndexCommunityScoreDao.xml index 10a4b32c3e..c2ad038a93 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/screen/FactIndexCommunityScoreDao.xml @@ -50,14 +50,76 @@ QUARTER_ID, YEAR_ID, SCORE, - INDEX_CODE + INDEX_CODE, + PARENT_AGENCY_ID FROM fact_index_community_score WHERE del_flag = 0 AND CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + AND IS_TOTAL = "0" AND INDEX_CODE != "shequxiangguan" + + + + + + + + + \ 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 index 5e88cb424a..f8d540688d 100644 --- 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 @@ -3,23 +3,26 @@ - - SELECT - agency_id, - month_id, - quarter_id, - year_id, - AVG( score ) AS score, - customer_id + figc.agency_id AS agencyId, + figc.month_id as monthId, + figc.quarter_id as quarterId, + figc.year_id as yearId, + AVG( figc.score ) AS score, + figc.customer_id as customerId, + sca.pid AS parentId FROM - fact_index_grid_score + fact_index_grid_score figc + LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = figc.AGENCY_ID WHERE - del_flag = '0' - AND customer_id = #{customerId} - AND month_id = #{monthId} - AND index_code = 'dangjiannengli' - GROUP BY agency_id + figc.del_flag = '0' + AND sca.DEL_FLAG = 0 + AND figc.customer_id = #{customerId} + AND figc.month_id = #{monthId} + AND figc.index_code = #{indexCode} + GROUP BY figc.agency_id From b2249ac8fd67b960492badfd0b904356e66a080e Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 3 Sep 2020 15:42:31 +0800 Subject: [PATCH 171/226] =?UTF-8?q?=E8=A1=97=E9=81=93=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...DTO.java => SubCommunityAvgResultDTO.java} | 2 +- ...esultDTO.java => SubGridAvgResultDTO.java} | 2 +- .../screen/FactIndexCommunityScoreDao.java | 28 ++----------- .../screen/FactIndexGridScoreDao.java | 23 +---------- .../IndexCalculateCommunityServiceImpl.java | 38 +++++++++--------- .../impl/IndexCalculateStreetServiceImpl.java | 14 +++---- .../screen/FactIndexCommunityScoreDao.xml | 40 +------------------ .../screen/FactIndexGridScoreDao.xml | 40 +------------------ 8 files changed, 34 insertions(+), 153 deletions(-) rename epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/{SubCommunityServiceAvgResultDTO.java => SubCommunityAvgResultDTO.java} (90%) rename epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/{SubGridPartyAvgResultDTO.java => SubGridAvgResultDTO.java} (91%) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityServiceAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityAvgResultDTO.java similarity index 90% rename from epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityServiceAvgResultDTO.java rename to epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityAvgResultDTO.java index d860696dd1..06b06109f1 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityServiceAvgResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityAvgResultDTO.java @@ -10,7 +10,7 @@ import java.math.BigDecimal; * @DateTime 2020/9/2 6:01 下午 */ @Data -public class SubCommunityServiceAvgResultDTO implements Serializable { +public class SubCommunityAvgResultDTO implements Serializable { private static final long serialVersionUID = 7681907923515081626L; diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridPartyAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridAvgResultDTO.java similarity index 91% rename from epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridPartyAvgResultDTO.java rename to epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridAvgResultDTO.java index 48b4501606..460eb12640 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridPartyAvgResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridAvgResultDTO.java @@ -10,7 +10,7 @@ import java.math.BigDecimal; * @DateTime 2020/8/28 3:15 下午 */ @Data -public class SubGridPartyAvgResultDTO implements Serializable { +public class SubGridAvgResultDTO implements Serializable { private static final long serialVersionUID = 1592381327492545907L; 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/screen/FactIndexCommunityScoreDao.java index 96963e7cc9..1df4f962b5 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/screen/FactIndexCommunityScoreDao.java @@ -20,11 +20,8 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcal.SubCommunityGovernAvgResultDTO; import com.epmet.dto.indexcal.SubCommunityPartyAvgResultDTO; -import com.epmet.dto.indexcal.SubCommunityServiceAvgResultDTO; +import com.epmet.dto.indexcal.SubCommunityAvgResultDTO; import com.epmet.dto.screen.FactIndexCommunityScoreDTO; -import com.epmet.dto.screen.result.SubGridGovernAvgResultDTO; -import com.epmet.dto.screen.result.SubGridPartyAvgResultDTO; -import com.epmet.dto.screen.result.SubGridServiceAvgResultDTO; import com.epmet.entity.evaluationindex.screen.FactIndexCommunityScoreEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -67,32 +64,13 @@ public interface FactIndexCommunityScoreDao extends BaseDao selectCommunityInfo(@Param("customerId") String customerId,@Param("monthId")String monthId); - - /** - * @Description 下属所有社区的党建能力平均值 - * @param customerId - * @param monthId - * @author zxc - * @date 2020/8/28 3:20 下午 - */ - List selectSubCommPartyAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId); - - /** - * @Description 街道下属所有社区治理能力汇总平均值 - * @param customerId - * @param monthId - * @author zxc - * @date 2020/8/31 9:19 上午 - */ - List selectSubCommGovernAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId); - /** - * @Description 街道下级所有社区服务能力得分平均值 + * @Description 街道下级所有社区得分平均值 * @param customerId * @param monthId * @author zxc * @date 2020/8/31 1:51 下午 */ - List selectSubCommServiceAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("indexCode")String indexCode); + List selectSubCommAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); } \ 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 index ea12caa2ec..b1271f13f1 100644 --- 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 @@ -19,7 +19,7 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.screen.result.SubGridGovernAvgResultDTO; -import com.epmet.dto.screen.result.SubGridPartyAvgResultDTO; +import com.epmet.dto.screen.result.SubGridAvgResultDTO; import com.epmet.dto.screen.result.SubGridServiceAvgResultDTO; import com.epmet.entity.evaluationindex.screen.FactIndexGridScoreEntity; import org.apache.ibatis.annotations.Mapper; @@ -43,24 +43,5 @@ public interface FactIndexGridScoreDao extends BaseDao * @author zxc * @date 2020/8/28 3:20 下午 */ - List selectSubGridAvgScore(@Param("customerId")String customerId,@Param("monthId")String monthId,@Param("indexCode")String indexCode); - - /** - * @Description 社区下属所有网格治理能力汇总平均值 - * @param customerId - * @param monthId - * @author zxc - * @date 2020/8/31 9:19 上午 - */ - List selectSubGridGovernAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId); - - /** - * @Description 社区下级所有网格服务能力得分平均值 - * @param customerId - * @param monthId - * @author zxc - * @date 2020/8/31 1:51 下午 - */ - List selectSubGridServiceAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId); - + List selectSubGridAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); } \ No newline at end of file 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 5ff0a15ba9..574073e3c4 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 @@ -14,9 +14,7 @@ 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.SubGridGovernAvgResultDTO; -import com.epmet.dto.screen.result.SubGridPartyAvgResultDTO; -import com.epmet.dto.screen.result.SubGridServiceAvgResultDTO; +import com.epmet.dto.screen.result.SubGridAvgResultDTO; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; import com.epmet.eum.IndexCodeEnum; import com.epmet.service.evaluationindex.indexcal.IndexCalculateCommunityService; @@ -84,7 +82,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni //下属所有网格的党建能力平均值 detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.XIA_SHU_SUO_YOU_WGDDJNLPJZ.getCode().equals(detail.getIndexCode())) { - List subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + List subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { log.error("查询下属所有网格的党建能力平均值集合为空"); return; @@ -95,10 +93,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni }else if (subGridPartyAvgScore.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); Integer indexEnd = NumConstant.TEN; - List> partition = ListUtils.partition(subGridPartyAvgScore, indexEnd); - partition.forEach(publish -> { + List> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, indexEnd); + subPartyAvgList.forEach( party -> { List index1SampleValues = new ArrayList<>(); - publish.forEach(c -> { + party.forEach(c -> { pid.put(c.getAgencyId(),c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); @@ -110,8 +108,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni } } else { // 社区名义发文数量 - List> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); - if (CollectionUtils.isEmpty(mapList)) { + List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); + if (CollectionUtils.isEmpty(publishArticleCountList)) { log.error("查询社区名义发文数量集合为空"); return; } @@ -119,15 +117,15 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni if (StringUtils.isEmpty(fieldNameByIndexCode)) { log.error("指标Code未查询出对应字段 【" + detail.getIndexCode() + "】"); return; - }else if (mapList.size() == NumConstant.ONE){ - pid.put(mapList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),mapList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); - sizeOne(mapList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); + }else if (publishArticleCountList.size() == NumConstant.ONE){ + pid.put(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); + sizeOne(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); return; - }else if (mapList.size() > NumConstant.ONE) { - List decimalList = mapList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + }else if (publishArticleCountList.size() > NumConstant.ONE) { + List decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); - List>> publishArticleList = ListUtils.partition(mapList, 10); - publishArticleList.forEach(publish -> { + List>> publishArticleList = ListUtils.partition(publishArticleCountList, 10); + publishArticleList.forEach( publish -> { ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); List index1SampleValues = new ArrayList<>(); publish.forEach(c -> { @@ -166,14 +164,14 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode().equals(detail.getIndexCode())) { - List subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + List subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); if (subGridGovernAvg.size() == NumConstant.ONE) { pid.put(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),subGridGovernAvg.get(NumConstant.ZERO).getParentId()); sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); return; } else if (subGridGovernAvg.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); - List> governAvg = ListUtils.partition(subGridGovernAvg, 10); + List> governAvg = ListUtils.partition(subGridGovernAvg, 10); governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { @@ -245,14 +243,14 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.SHE_QU_XIA_JI_SYWGFWNLDFPJZ.getCode().equals(indexCode)) { - List subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); + List subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); if (subGridServiceAvg.size() == NumConstant.ONE) { pid.put(subGridServiceAvg.get(NumConstant.ZERO).getAgencyId(),subGridServiceAvg.get(NumConstant.ZERO).getParentId()); sizeOne(subGridServiceAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); return; } else if (subGridServiceAvg.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); - List> serviceAvgList = ListUtils.partition(subGridServiceAvg, 10); + List> serviceAvgList = ListUtils.partition(subGridServiceAvg, 10); serviceAvgList.forEach(serviceAvg -> { BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); List index1SampleValues = new ArrayList<>(); 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 6d7b90ffd0..cc49f16f6a 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 @@ -13,7 +13,7 @@ import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityOrgMonthlyDao; import com.epmet.dao.evaluationindex.screen.FactIndexCommunityScoreDao; import com.epmet.dto.indexcal.AgencyScoreDTO; -import com.epmet.dto.indexcal.SubCommunityServiceAvgResultDTO; +import com.epmet.dto.indexcal.SubCommunityAvgResultDTO; import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; import com.epmet.eum.IndexCodeEnum; @@ -110,7 +110,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ //下属所有社区的党建能力平均值 detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { - List subCommPartyAvgScore = communityScoreDao.selectSubCommServiceAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + List subCommPartyAvgScore = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); if (CollectionUtils.isEmpty(subCommPartyAvgScore)) { log.error("查询下属所有社区的党建能力平均值集合为空"); return; @@ -121,7 +121,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ }else if (subCommPartyAvgScore.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); Integer indexEnd = NumConstant.TEN; - List> partition = ListUtils.partition(subCommPartyAvgScore, indexEnd); + List> partition = ListUtils.partition(subCommPartyAvgScore, indexEnd); partition.forEach(publish -> { List index1SampleValues = new ArrayList<>(); publish.forEach(c -> { @@ -191,14 +191,14 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) { - List subGridGovernAvg = communityScoreDao.selectSubCommServiceAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + List subGridGovernAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); if (subGridGovernAvg.size() == NumConstant.ONE) { pid.put(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),subGridGovernAvg.get(NumConstant.ZERO).getParentId()); sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); return; } else if (subGridGovernAvg.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); - List> governAvg = ListUtils.partition(subGridGovernAvg, 10); + List> governAvg = ListUtils.partition(subGridGovernAvg, 10); governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { @@ -272,14 +272,14 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode().equals(indexCode)) { - List subCommServiceAvg = communityScoreDao.selectSubCommServiceAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); + List subCommServiceAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); if (subCommServiceAvg.size() == NumConstant.ONE) { pid.put(subCommServiceAvg.get(NumConstant.ZERO).getAgencyId(),subCommServiceAvg.get(NumConstant.ZERO).getParentId()); sizeOne(subCommServiceAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); return; } else if (subCommServiceAvg.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); - List> serviceAvgList = ListUtils.partition(subCommServiceAvg, 10); + List> serviceAvgList = ListUtils.partition(subCommServiceAvg, 10); serviceAvgList.forEach(serviceAvg -> { BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); List index1SampleValues = new ArrayList<>(); 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/screen/FactIndexCommunityScoreDao.xml index c2ad038a93..c3da270827 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/screen/FactIndexCommunityScoreDao.xml @@ -62,46 +62,8 @@ AND INDEX_CODE != "shequxiangguan" - - - - - - - SELECT fics.agency_id, fics.month_id, 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 index f8d540688d..9d2176f678 100644 --- 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 @@ -4,7 +4,7 @@ - SELECT figc.agency_id AS agencyId, figc.month_id as monthId, @@ -24,42 +24,4 @@ AND figc.index_code = #{indexCode} GROUP BY figc.agency_id - - - - - - \ No newline at end of file From e9896edd90f73d86a0ee024743e45fb2aff4c1ba Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 3 Sep 2020 15:55:59 +0800 Subject: [PATCH 172/226] =?UTF-8?q?=E8=A1=97=E9=81=93=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E4=BC=98=E5=8C=96=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java | 2 +- .../indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java index 47ae64dd69..2b7277f7d2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java @@ -64,7 +64,7 @@ public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao list, @Param("customerId")String customerId); /** - * @Description 社区治理能力各个参数查询【被吹哨次数、办结项目数、项目响应度、超期项目率、办结项目率、办结项目满意度】 + * @Description 社区治理能力各个参数查询【被吹哨次数、办结项目数、项目响应度、超期项目率、【街道办结项目的处理效率,level为street时存在】、办结项目率、办结项目满意度】 * @param customerId * @param monthId * @author zxc diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml index f47ef128f6..5d49deaddb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml @@ -99,7 +99,8 @@ RESP_PROJECT_RATIO, OVERDUE_PROJECT_RATIO, CLOSED_PROJECT_RATIO, - SATISFACTION_RATIO + SATISFACTION_RATIO, + HANDLE_PROJECT_RATIO FROM fact_index_govrn_ablity_org_monthly WHERE From 2a3bcfde29b80d37196643aa26aa714c72ba2314 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 3 Sep 2020 15:57:56 +0800 Subject: [PATCH 173/226] =?UTF-8?q?/data/stats/indexcollect/orggovrnabilit?= =?UTF-8?q?y=E6=96=B0=E5=A2=9EhandleProjectRatio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/indexcollect/form/OrgGovrnAbilityFormDTO.java | 8 +++++++- .../indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java | 6 +++++- .../indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml | 3 +++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityFormDTO.java index 1534955c75..c2eadf4dc7 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityFormDTO.java @@ -71,7 +71,13 @@ public class OrgGovrnAbilityFormDTO implements Serializable { private BigDecimal satisfactionRatio; /** - * 超期项目率 + * 社区超期项目率,dataTyp=commnuity有值 */ private BigDecimal overdueProjectRatio; + + + /** + * 街道办结项目的处理效率, data_type=street时有值 + */ + private BigDecimal handleProjectRatio; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java index a104561749..e23472c6a4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java @@ -98,8 +98,12 @@ public class FactIndexGovrnAblityOrgMonthlyEntity extends BaseEpmetEntity { private BigDecimal satisfactionRatio; /** - * 超期项目率 + * 社区超期项目率,dataTyp=commnuity有值 */ private BigDecimal overdueProjectRatio; + /** + * 街道办结项目的处理效率, data_type=street时有值 + */ + private BigDecimal handleProjectRatio; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml index f47ef128f6..d91da41fea 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml @@ -18,6 +18,7 @@ + @@ -53,6 +54,7 @@ CLOSED_PROJECT_RATIO, SATISFACTION_RATIO, OVERDUE_PROJECT_RATIO, + HANDLE_PROJECT_RATIO, DEL_FLAG, REVISION, CREATED_BY, @@ -76,6 +78,7 @@ #{item.closedProjectRatio}, #{item.satisfactionRatio}, #{item.overdueProjectRatio}, + #{item.handleProjectRatio}, 0, 0, 'APP_USER', From 6b2730e4aa5fda6edfb5ada0289c1effc241e7e1 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 3 Sep 2020 16:00:47 +0800 Subject: [PATCH 174/226] =?UTF-8?q?=E5=8C=BA=E7=9B=B4=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/IndexCalConstant.java | 2 + .../com/epmet/controller/DemoController.java | 4 + .../FactIndexGovrnAblityDeptMonthlyDao.java | 35 +++++ .../indexcal/impl/DeptScoreServiceImpl.java | 146 +++++++++++++++++- .../FactIndexGovrnAblityDeptMonthlyDao.xml | 61 ++++++++ 5 files changed, 244 insertions(+), 4 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java index a2064455a4..b232ea7635 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java @@ -12,6 +12,8 @@ public interface IndexCalConstant { String GRID_ID="GRID_ID"; + String DEPT_ID="DEPT_ID"; + String AGENCY_ID="AGENCY_ID"; String PARENT_AGENCY_ID = "parentAgencyId"; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 58d08b8120..380b2f3b86 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -17,6 +17,7 @@ import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMont import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.service.StatsDemoService; +import com.epmet.service.evaluationindex.indexcal.DeptScoreService; import com.epmet.service.evaluationindex.indexcal.GridCorreLationService; import com.epmet.service.evaluationindex.indexcal.IndexCalculateCommunityService; import com.epmet.service.evaluationindex.indexcal.IndexCalculateStreetService; @@ -53,6 +54,8 @@ public class DemoController { private GridCorreLationService gridCorreLationService; @Autowired private IndexCalculateStreetService indexCalculateStreetService; + @Autowired + private DeptScoreService deptScoreService; @GetMapping("testAlarm") public void testAlarm() { @@ -162,6 +165,7 @@ public class DemoController { // List gridScoreDTOList=gridScoreDao.selectList(formDTO); // return new Result>().ok(gridScoreDTOList); gridCorreLationService.calculateGridCorreLation(formDTO); +// deptScoreService.calculateDeptCorreLation(formDTO); return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java index 5db8adb014..20abf945b7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java @@ -17,12 +17,14 @@ package com.epmet.dao.evaluationindex.indexcoll; /** import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcollect.form.DeptGovrnAbilityFormDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 治理能力-部门相关数据 @@ -63,4 +65,37 @@ public interface FactIndexGovrnAblityDeptMonthlyDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * @return java.lang.Integer + * @param calculateCommonFormDTO + * @author yinzuomei + * @description 查询(fact_index_govrn_ablity_dept_monthly治理能力-区直部门相关数据 )当前月共上传了多少条记录 + * @Date 2020/9/3 9:31 + **/ + Integer selectCount(CalculateCommonFormDTO calculateCommonFormDTO); + + /** + * @return java.util.Map + * @param calculateCommonFormDTO + * @author yinzuomei + * @description 计算最大最小值 + * @Date 2020/9/3 9:36 + **/ + Map selectExtremeValue(CalculateCommonFormDTO calculateCommonFormDTO); + + /** + * @return java.util.List> + * @param customerId 客户id + * @param monthId yyyyMM + * @param offset + * @param pageSize + * @author yinzuomei + * @description + * @Date 2020/9/3 11:00 + **/ + List> selectListByMonthId(@Param("customerId") String customerId, + @Param("monthId") String monthId, + @Param("offset") Integer offset, + @Param("pageSize") Integer pageSize); } 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 d999757956..20360baa29 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 @@ -19,7 +19,10 @@ package com.epmet.service.evaluationindex.indexcal.impl; import com.alibaba.fastjson.JSON; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.IndexCalConstant; import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; @@ -27,13 +30,26 @@ import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; import com.epmet.eum.IndexCodeEnum; import com.epmet.service.evaluationindex.indexcal.DeptScoreService; +import com.epmet.service.evaluationindex.indexcal.IndexCodeFieldReService; import com.epmet.service.evaluationindex.screen.IndexGroupDetailService; +import com.epmet.support.normalizing.BigDecimalScoreCalculator; +import com.epmet.support.normalizing.Correlation; +import com.epmet.support.normalizing.ScoreCalculator; +import com.epmet.support.normalizing.ScoreConstants; +import com.epmet.support.normalizing.batch.IndexInputVO; +import com.epmet.support.normalizing.batch.SampleValue; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; /** @@ -49,6 +65,8 @@ public class DeptScoreServiceImpl extends BaseServiceImpl parentIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), + List indexGroupDetailEntityList = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.QU_ZHI_BU_MEN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); - if (CollectionUtils.isEmpty(parentIndexDetails)) { + if (CollectionUtils.isEmpty(indexGroupDetailEntityList)) { log.warn("calculateDeptCorreLation customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); throw new RenException("客户【区直部门:治理能力】指标权重信息不存在"); } - log.info(JSON.toJSONString(parentIndexDetails)); - return null; + log.info(JSON.toJSONString(indexGroupDetailEntityList)); + + //1、查询总记录数 + int total = factIndexGovrnAblityDeptMonthlyDao.selectCount(formDTO); + if (NumConstant.ZERO == total) { + log.warn(String.format("customerId=%s,monthId=%s,fact_index_govrn_ablity_dept_monthly have not any fact record", formDTO.getCustomerId(), formDTO.getMonthId())); + return Boolean.FALSE; + } else if (NumConstant.ONE == total) { + //只有一个网格时 + log.warn(String.format("customerId:%s,monthId:%s,only one fact_index_party_ablity_grid_monthly record", formDTO.getCustomerId(), formDTO.getMonthId())); + this.handleOneGridScene(formDTO); + return Boolean.TRUE; + } + + //2、计算最大最小值 + Map minAndMaxMap = factIndexGovrnAblityDeptMonthlyDao.selectExtremeValue(formDTO); + if (CollectionUtils.isEmpty(minAndMaxMap)) { + log.warn("calculateDeptCorreLation getExtremeValue customerId:{} fact_index_govrn_ablity_dept_monthly have not any fact record", formDTO.getCustomerId()); + throw new RenException("【区直部门:治理能力】指标原始数据记录不存在"); + } + //3、构造入参 指标集合 + Map> indexMap = buildDeptCorrelationIndexInputVO(indexGroupDetailEntityList, minAndMaxMap); + //4、分批计算 + int pageNo = NumConstant.ONE; + int pageSize = IndexCalConstant.PAGE_SIZE; + //分页查询 要计算的原始数据 + List> list = null; + do { + list = factIndexGovrnAblityDeptMonthlyDao.selectListByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize); + if (!CollectionUtils.isEmpty(list)) { + //遍历指标分组 计算分数 + List> crrentFactRecordList = list; + calculateScore(formDTO,indexMap,crrentFactRecordList); + } + } while (!CollectionUtils.isEmpty(list) && pageNo++ > 0); + return true; + } + + /** + * @return void + * @param formDTO + * @param indexMap + * @author yinzuomei + * @description 计算分值并保存结果 + * @Date 2020/9/3 11:14 + **/ + private void calculateScore(CalculateCommonFormDTO formDTO, Map> indexMap,List> recordList) { + //遍历每一个网格的记录 + recordList.forEach(recordMap -> { + //遍历所有的指标 + indexMap.forEach((key, indexInputVO) -> { + if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { + //对应的数值 + String sampleValueStr = (String) recordMap.get(indexCodeFieldReService.getFieldNameByIndexCode(key)); + //构造样本值对象 + SampleValue currentGridIndexValue = new SampleValue((String) recordMap.get(IndexCalConstant.DEPT_ID), new BigDecimal(sampleValueStr)); + indexInputVO.getIndexValueVOs().add(currentGridIndexValue); + + } + }); + + + }); + //保存中间表记录 TODO + + } + + /** + * @param formDTO + * @return void + * @author yinzuomei + * @description TODO + * @Date 2020/9/3 9:35 + **/ + private void handleOneGridScene(CalculateCommonFormDTO formDTO) { + + } + + /** + * @param indexList + * @param minAndMaxMap + * @return java.util.Map> + * @author yinzuomei + * @description + * @Date 2020/9/3 9:31 + **/ + private Map> buildDeptCorrelationIndexInputVO(List indexList, + Map minAndMaxMap) { + Map> map = new HashMap<>(); + for (IndexGroupDetailEntity index : indexList) { + //获取指标对应的列名 + String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(index.getIndexCode()); + if (StringUtils.isBlank(fieldName)) { + log.error("index_code:{} not find field_name", index.getIndexCode()); + continue; + } + String minValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MIN); + String maxValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MAX); + BigDecimal minValue = new BigDecimal(String.valueOf(minAndMaxMap.get(minValueKey))); + BigDecimal maxValue = new BigDecimal(String.valueOf(minAndMaxMap.get(maxValueKey))); + //有阈值,且最大值>阈值,则最大值赋值为阈值 + if (new BigDecimal(NumConstant.ONE_NEG_STR).compareTo(index.getThreshold()) != NumConstant.ZERO + && maxValue.compareTo(index.getThreshold()) == NumConstant.ONE) { + maxValue = index.getThreshold(); + } + //分值计算器 + ScoreCalculator scoreCalculator = new BigDecimalScoreCalculator(minValue, + maxValue, + ScoreConstants.MIN_SCORE, + ScoreConstants.MAX_SCORE, + Correlation.getCorrelation(index.getCorrelation()) + ); + List> sampleValueList = new ArrayList<>(); + IndexInputVO indexInputVO1 = new IndexInputVO(index.getIndexCode(), + sampleValueList, + index.getThreshold(), +// new BigDecimal("-1"), //FOR TEST + index.getWeight(), + scoreCalculator); + map.put(index.getIndexCode(), indexInputVO1); + } + return map; } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml index acacf4211e..bf9647c67f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml @@ -79,4 +79,65 @@ + + + + + + + + From 1f27decf191bffd2ef2ea271a3baa0d1a0838e0c Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 3 Sep 2020 16:06:05 +0800 Subject: [PATCH 175/226] =?UTF-8?q?=E8=A1=97=E9=81=93=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E4=BC=98=E5=8C=96=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcal/impl/IndexCalculateCommunityServiceImpl.java | 4 +--- .../indexcal/impl/IndexCalculateStreetServiceImpl.java | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) 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 574073e3c4..f7a56d2dbe 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 @@ -68,7 +68,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni * @author zxc * @date 2020/8/26 10:46 上午 */ - @Transactional(rollbackFor = Exception.class) public Boolean communityPartyCalculate(String customerId, String monthId) { // 党建能力 // 根据all_parent_index_code 获取指标明细 @@ -153,7 +152,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni * @author zxc * @date 2020/8/26 1:40 下午 */ - @Transactional(rollbackFor = Exception.class) public Boolean communityGovernAbilityCalculate(String customerId, String monthId) { List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); if (CollectionUtils.isEmpty(detailListByParentCode)) { @@ -231,7 +229,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni * @author zxc * @date 2020/8/31 1:38 下午 */ - @Transactional(rollbackFor = Exception.class) public Boolean communityServiceAbilityCalculate(String customerId, String monthId) { List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); if (CollectionUtils.isEmpty(detailListByParentCode)) { @@ -391,6 +388,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni * @author zxc * @date 2020/9/1 4:24 下午 */ + @Transactional(rollbackFor = Exception.class) public void deleteAndInsert(String customerId, String monthId, String indexCode, List subAllGridList) { if (!CollectionUtils.isEmpty(subAllGridList)) { factIndexCommunityScoreDao.deleteOldRecord(customerId, monthId, indexCode); 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 cc49f16f6a..eb966945c6 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 @@ -96,7 +96,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ * @author zxc * @date 2020/8/26 10:46 上午 */ - @Transactional(rollbackFor = Exception.class) public Boolean streetPartyCalculate(String customerId, String monthId) { // 党建能力 // 根据all_parent_index_code 获取指标明细 @@ -180,7 +179,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ * @author zxc * @date 2020/8/26 1:40 下午 */ - @Transactional(rollbackFor = Exception.class) public Boolean streetGovernAbilityCalculate(String customerId, String monthId) { List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); if (CollectionUtils.isEmpty(detailListByParentCode)) { @@ -260,7 +258,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ * @author zxc * @date 2020/8/31 1:38 下午 */ - @Transactional(rollbackFor = Exception.class) public Boolean streetServiceAbilityCalculate(String customerId, String monthId) { List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); if (CollectionUtils.isEmpty(detailListByParentCode)) { @@ -395,6 +392,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ * @author zxc * @date 2020/9/1 4:24 下午 */ + @Transactional(rollbackFor = Exception.class) public void deleteAndInsert(String customerId, String monthId, String indexCode, List subAllCommunityList) { if (!CollectionUtils.isEmpty(subAllCommunityList)) { agencyScoreDao.deleteOldRecord(customerId, monthId, indexCode,IndexCalConstant.STREET_LEVEL); From a203a8626dadc7a72c1d765eeb5164f492367e23 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 3 Sep 2020 16:31:00 +0800 Subject: [PATCH 176/226] =?UTF-8?q?=E8=A1=97=E9=81=93=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E4=BC=98=E5=8C=96=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/IndexCalConstant.java | 11 +++++++ .../IndexCalculateCommunityServiceImpl.java | 30 +++++++++---------- .../impl/IndexCalculateStreetServiceImpl.java | 30 +++++++++---------- 3 files changed, 41 insertions(+), 30 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java index b232ea7635..bc7295ccda 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java @@ -51,4 +51,15 @@ public interface IndexCalConstant { String monthId="202008"; String insertUser="yinzuomei"; + + String INDEX_DETAIL_LIST_NULL = "指标明细查询集合为空"; + String COMMUNITY_PARTY_AVG_NULL = "查询下属所有【社区】的党建能力平均值集合为空"; + String GRID_PARTY_AVG_NULL = "查询下属所有【网格】的党建能力平均值集合为空"; + String STREET_PUBLISH_ARTICLE_LIST_NULL = "查询【街道】名义发文数量集合为空"; + String COMMUNITY_PUBLISH_ARTICLE_LIST_NULL = "查询【社区】名义发文数量集合为空"; + String INDEX_CODE_NULL = "指标Code未查询出对应字段 【 %s 】"; + String STREET_GOVERN_ABILITY_NULL = "查询【街道】治理能力的六个五级指标集合为空"; + String COMMUNITY_GOVERN_ABILITY_NULL = "查询【社区】治理能力的六个五级指标集合为空"; + String STREET_SERVICE_ABILITY_NULL = "查询街道活动组织次数集合为空"; + String COMMUNITY_SERVICE_ABILITY_NULL = "查询社区活动组织次数集合为空"; } 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 f7a56d2dbe..1d7b37a78d 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 @@ -73,7 +73,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni // 根据all_parent_index_code 获取指标明细 List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); if (CollectionUtils.isEmpty(detailListByParentCode)) { - log.error("指标明细查询集合为空"); + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return false; } List indexInputVOS = new ArrayList<>(); @@ -83,7 +83,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni if (IndexCodeEnum.XIA_SHU_SUO_YOU_WGDDJNLPJZ.getCode().equals(detail.getIndexCode())) { List subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { - log.error("查询下属所有网格的党建能力平均值集合为空"); + log.error(IndexCalConstant.GRID_PARTY_AVG_NULL); return; }else if (subGridPartyAvgScore.size() == NumConstant.ONE){ pid.put(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),subGridPartyAvgScore.get(NumConstant.ZERO).getParentId()); @@ -109,12 +109,12 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni // 社区名义发文数量 List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); if (CollectionUtils.isEmpty(publishArticleCountList)) { - log.error("查询社区名义发文数量集合为空"); + log.error(IndexCalConstant.COMMUNITY_PUBLISH_ARTICLE_LIST_NULL); return; } String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { - log.error("指标Code未查询出对应字段 【" + detail.getIndexCode() + "】"); + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); return; }else if (publishArticleCountList.size() == NumConstant.ONE){ pid.put(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); @@ -123,7 +123,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni }else if (publishArticleCountList.size() > NumConstant.ONE) { List decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); - List>> publishArticleList = ListUtils.partition(publishArticleCountList, 10); + List>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE); publishArticleList.forEach( publish -> { ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); List index1SampleValues = new ArrayList<>(); @@ -155,7 +155,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni public Boolean communityGovernAbilityCalculate(String customerId, String monthId) { List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); if (CollectionUtils.isEmpty(detailListByParentCode)) { - log.error("指标明细查询集合为空"); + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return false; } List indexInputVOS = new ArrayList<>(); @@ -169,7 +169,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return; } else if (subGridGovernAvg.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); - List> governAvg = ListUtils.partition(subGridGovernAvg, 10); + List> governAvg = ListUtils.partition(subGridGovernAvg, IndexCalConstant.PAGE_SIZE); governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { @@ -186,7 +186,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni // 治理能力的六个五级指标 List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); if (CollectionUtils.isEmpty(communityGovernAbility)){ - log.error("查询治理能力的六个五级指标集合为空"); + log.error(IndexCalConstant.COMMUNITY_GOVERN_ABILITY_NULL); return; }else if (communityGovernAbility.size() == NumConstant.ONE) { pid.put(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); @@ -195,12 +195,12 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni } else if (communityGovernAbility.size() > NumConstant.ONE) { String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { - log.error("指标Code未查询出对应字段 【" + detail.getIndexCode() + "】"); + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); return; } List decimalList = communityGovernAbility.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); - List>> governAbilityList = ListUtils.partition(communityGovernAbility, 10); + List>> governAbilityList = ListUtils.partition(communityGovernAbility, IndexCalConstant.PAGE_SIZE); governAbilityList.forEach(governAbility -> { ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); List index1SampleValues = new ArrayList<>(); @@ -232,7 +232,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni public Boolean communityServiceAbilityCalculate(String customerId, String monthId) { List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); if (CollectionUtils.isEmpty(detailListByParentCode)) { - log.error("指标明细查询集合为空"); + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return false; } List indexInputVOS = new ArrayList<>(); @@ -247,7 +247,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return; } else if (subGridServiceAvg.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); - List> serviceAvgList = ListUtils.partition(subGridServiceAvg, 10); + List> serviceAvgList = ListUtils.partition(subGridServiceAvg, IndexCalConstant.PAGE_SIZE); serviceAvgList.forEach(serviceAvg -> { BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); List index1SampleValues = new ArrayList<>(); @@ -263,7 +263,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni } else { List> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMap(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); if (CollectionUtils.isEmpty(communityActivityCountList)) { - log.error("查询社区活动组织次数集合为空"); + log.error(IndexCalConstant.COMMUNITY_SERVICE_ABILITY_NULL); return; }else if (communityActivityCountList.size() == NumConstant.ONE) { pid.put(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); @@ -272,12 +272,12 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni } else if (communityActivityCountList.size() > NumConstant.ONE) { String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { - log.error("指标Code未查询出对应字段 【" + detail.getIndexCode() + "】"); + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); return; } List decimalList = communityActivityCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); - List>> communityActivityList = ListUtils.partition(communityActivityCountList, 10); + List>> communityActivityList = ListUtils.partition(communityActivityCountList, IndexCalConstant.PAGE_SIZE); communityActivityList.forEach(communityActivity -> { ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); List index1SampleValues = new ArrayList<>(); 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 eb966945c6..e3890fa9b2 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 @@ -101,7 +101,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ // 根据all_parent_index_code 获取指标明细 List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); if (CollectionUtils.isEmpty(detailListByParentCode)) { - log.error("指标明细查询集合为空"); + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return false; } List indexInputVOS = new ArrayList<>(); @@ -111,7 +111,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { List subCommPartyAvgScore = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); if (CollectionUtils.isEmpty(subCommPartyAvgScore)) { - log.error("查询下属所有社区的党建能力平均值集合为空"); + log.error(IndexCalConstant.COMMUNITY_PARTY_AVG_NULL); return; }else if (subCommPartyAvgScore.size() == NumConstant.ONE){ pid.put(subCommPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),subCommPartyAvgScore.get(NumConstant.ZERO).getParentId()); @@ -137,12 +137,12 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ // 街道名义发文数量 List> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId, IndexCalConstant.STREET_LEVEL); if (CollectionUtils.isEmpty(mapList)) { - log.error("查询街道名义发文数量集合为空"); + log.error(IndexCalConstant.STREET_PUBLISH_ARTICLE_LIST_NULL); return; } String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldName)) { - log.error("指标Code未查询出对应字段 【" + detail.getIndexCode() + "】"); + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); return; }else if (mapList.size() == NumConstant.ONE){ pid.put(mapList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),mapList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); @@ -150,7 +150,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ return; }else if (mapList.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(mapList.stream().map(m -> new BigDecimal(m.get(fieldName).toString())).collect(Collectors.toList())); - List>> publishArticleList = ListUtils.partition(mapList, 10); + List>> publishArticleList = ListUtils.partition(mapList, IndexCalConstant.PAGE_SIZE); publishArticleList.forEach(publish -> { ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); List index1SampleValues = new ArrayList<>(); @@ -182,7 +182,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ public Boolean streetGovernAbilityCalculate(String customerId, String monthId) { List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); if (CollectionUtils.isEmpty(detailListByParentCode)) { - log.error("指标明细查询集合为空"); + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return false; } List indexInputVOS = new ArrayList<>(); @@ -196,7 +196,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ return; } else if (subGridGovernAvg.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); - List> governAvg = ListUtils.partition(subGridGovernAvg, 10); + List> governAvg = ListUtils.partition(subGridGovernAvg, IndexCalConstant.PAGE_SIZE); governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { @@ -213,7 +213,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ // 治理能力的六个五级指标 List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(customerId, monthId,IndexCalConstant.STREET_LEVEL); if (CollectionUtils.isEmpty(communityGovernAbility)){ - log.error("查询治理能力的六个五级指标集合为空"); + log.error(IndexCalConstant.STREET_GOVERN_ABILITY_NULL); return; }else if (communityGovernAbility.size() == NumConstant.ONE) { pid.put(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); @@ -224,12 +224,12 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ System.err.println(fieldNameByIndexCode); System.err.println(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { - log.error("指标Code未查询出对应字段 【" + detail.getIndexCode() + "】"); + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); return; } List decimalList = communityGovernAbility.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); - List>> governAbilityList = ListUtils.partition(communityGovernAbility, 10); + List>> governAbilityList = ListUtils.partition(communityGovernAbility, IndexCalConstant.PAGE_SIZE); governAbilityList.forEach(governAbility -> { ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); List index1SampleValues = new ArrayList<>(); @@ -261,7 +261,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ public Boolean streetServiceAbilityCalculate(String customerId, String monthId) { List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); if (CollectionUtils.isEmpty(detailListByParentCode)) { - log.error("指标明细查询集合为空"); + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); return false; } List indexInputVOS = new ArrayList<>(); @@ -276,7 +276,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ return; } else if (subCommServiceAvg.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); - List> serviceAvgList = ListUtils.partition(subCommServiceAvg, 10); + List> serviceAvgList = ListUtils.partition(subCommServiceAvg, IndexCalConstant.PAGE_SIZE); serviceAvgList.forEach(serviceAvg -> { BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); List index1SampleValues = new ArrayList<>(); @@ -292,7 +292,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ } else { List> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMap(customerId, monthId,IndexCalConstant.STREET_LEVEL); if (CollectionUtils.isEmpty(communityActivityCountList)) { - log.error("查询街道活动组织次数集合为空"); + log.error(IndexCalConstant.STREET_SERVICE_ABILITY_NULL); return; }else if (communityActivityCountList.size() == NumConstant.ONE) { pid.put(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); @@ -301,12 +301,12 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ } else if (communityActivityCountList.size() > NumConstant.ONE) { String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { - log.error("指标Code未查询出对应字段 【" + detail.getIndexCode() + "】"); + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); return; } List decimalList = communityActivityCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); - List>> communityActivityList = ListUtils.partition(communityActivityCountList, 10); + List>> communityActivityList = ListUtils.partition(communityActivityCountList, IndexCalConstant.PAGE_SIZE); communityActivityList.forEach(communityActivity -> { ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); List index1SampleValues = new ArrayList<>(); From a3b2dfdd32790698d278ef87919eefc96fd35692 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 3 Sep 2020 16:49:54 +0800 Subject: [PATCH 177/226] =?UTF-8?q?third=E6=9C=8D=E5=8A=A1=E5=8D=87?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-third-server/deploy/docker-compose-prod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml index eede66ca29..1028ad0be9 100644 --- a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-third-server: container_name: epmet-third-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-third-server:0.0.136 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-third-server:0.0.138 ports: - "8110:8110" network_mode: host # 使用现有网络 From 1427c2cbbc9f827625e8cc7263affb23577d3df8 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 3 Sep 2020 16:55:17 +0800 Subject: [PATCH 178/226] =?UTF-8?q?=E5=8C=BA=E7=9B=B4=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E6=9A=82=E5=AD=98v1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FactIndexGovrnAblityDeptMonthlyDao.java | 10 ++++ .../screen/ScreenCustomerDeptDao.java | 11 ++++ .../indexcal/DeptScoreEntity.java | 8 +-- .../indexcal/GridCorreLationService.java | 12 ++++ .../indexcal/impl/DeptScoreServiceImpl.java | 58 +++++++++++++++++-- .../impl/GridCorreLationServiceImpl.java | 3 +- .../FactIndexGovrnAblityDeptMonthlyDao.xml | 12 ++++ .../screen/ScreenCustomerDeptDao.xml | 12 ++++ 8 files changed, 115 insertions(+), 11 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java index 20abf945b7..abdabd7465 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java @@ -98,4 +98,14 @@ public interface FactIndexGovrnAblityDeptMonthlyDao extends BaseDao * @Date 10:52 2020-08-18 **/ void batchInsertCustomerDept(@Param("list") List list, @Param("customerId")String customerId); + + /** + * @param customerId + * @param deptId + * @return com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity + * @author yinzuomei + * @description 查询部门所属组织id + * @Date 2020/9/3 16:32 + **/ + ScreenCustomerDeptEntity selectParentAgencyId(@Param("customerId") String customerId, @Param("deptId") String deptId); } 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 8517c59ff1..29857fdc2c 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 @@ -47,10 +47,10 @@ public class DeptScoreEntity extends BaseEpmetEntity { */ private String deptId; - /** - * 所有上级ID,用英文逗号分开 - */ - private String allParentIds; + /** + * 部门所属的组织id + */ + private String agencyId; /** * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/GridCorreLationService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/GridCorreLationService.java index 14d2ac604c..a93697ce12 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/GridCorreLationService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/GridCorreLationService.java @@ -3,7 +3,10 @@ package com.epmet.service.evaluationindex.indexcal; import com.epmet.dto.ScreenCustomerGridDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.PageQueryGridFormDTO; +import com.epmet.support.normalizing.batch.IndexInputVO; +import java.math.BigDecimal; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -41,4 +44,13 @@ public interface GridCorreLationService { * @Date 2020/8/27 14:48 **/ List pageGridList(PageQueryGridFormDTO formDTO); + + /** + * @return java.util.HashMap + * @param indexMap + * @author yinzuomei + * @description 通用计算方法 + * @Date 2020/9/3 16:07 + **/ + HashMap calculate(Map> indexMap); } 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 20360baa29..59b6127b77 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 @@ -22,14 +22,19 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; 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.utils.DateUtils; import com.epmet.constant.IndexCalConstant; import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyDao; +import com.epmet.dao.evaluationindex.screen.ScreenCustomerDeptDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; +import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity; import com.epmet.eum.IndexCodeEnum; import com.epmet.service.evaluationindex.indexcal.DeptScoreService; +import com.epmet.service.evaluationindex.indexcal.GridCorreLationService; import com.epmet.service.evaluationindex.indexcal.IndexCodeFieldReService; import com.epmet.service.evaluationindex.screen.IndexGroupDetailService; import com.epmet.support.normalizing.BigDecimalScoreCalculator; @@ -42,6 +47,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.math.BigDecimal; @@ -49,7 +55,6 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; /** @@ -67,6 +72,12 @@ public class DeptScoreServiceImpl extends BaseServiceImpl resultMap = gridCorreLationService.calculate(indexMap); + //保存中间表记录 + this.saveDeptScoreEntity(formDTO,resultMap); + } + /** + * @return void + * @param formDTO + * @param resultMap + * @author yinzuomei + * @description fact_index_dept_score + * @Date 2020/9/3 16:11 + **/ + @Transactional(rollbackFor = Exception.class) + public void saveDeptScoreEntity(CalculateCommonFormDTO formDTO, HashMap resultMap) { + String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); + String yearId = DateUtils.getYearId(formDTO.getMonthId()); + resultMap.forEach((deptId, governAblityScore) -> { + DeptScoreEntity deptScoreEntity = new DeptScoreEntity(); + deptScoreEntity.setCustomerId(formDTO.getCustomerId()); + deptScoreEntity.setDeptId(deptId); + deptScoreEntity.setIsTotal(NumConstant.ZERO_STR); + deptScoreEntity.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + ScreenCustomerDeptEntity deptEntity = screenCustomerDeptDao.selectParentAgencyId(formDTO.getCustomerId(), deptId); + if (null != deptEntity) { + if(StringUtils.isNotBlank(deptEntity.getParentAgencyId())){ + deptScoreEntity.setAgencyId(deptEntity.getParentAgencyId()); + } + } + deptScoreEntity.setQuarterId(quarterId); + deptScoreEntity.setYearId(yearId); + deptScoreEntity.setMonthId(formDTO.getMonthId()); + deptScoreEntity.setScore(governAblityScore); + deptScoreDao.insert(deptScoreEntity); + }); } /** * @param formDTO * @return void * @author yinzuomei - * @description TODO + * @description * @Date 2020/9/3 9:35 **/ private void handleOneGridScene(CalculateCommonFormDTO formDTO) { - + FactIndexGovrnAblityDeptMonthlyEntity entity = factIndexGovrnAblityDeptMonthlyDao.selectOneRecord(formDTO.getCustomerId(), formDTO.getMonthId()); + HashMap resultMap = new HashMap<>(); + resultMap.put(entity.getDeptId(), new BigDecimal(NumConstant.FIFTY_STR)); + this.saveDeptScoreEntity(formDTO, resultMap); } /** 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 306c3c7713..abbe326a81 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 @@ -370,7 +370,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { * @description 调用计算器计算每个指标下,各个网格的总分 * @Date 2020/8/30 21:40 **/ - private HashMap calculate(Map> indexMap) { + @Override + public HashMap calculate(Map> indexMap) { //构造入参 List indexInputVOS = this.getIndexInputVOList(indexMap); log.info("计算的参数"+JSON.toJSONString(indexInputVOS)); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml index bf9647c67f..3039ac9eed 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml @@ -140,4 +140,16 @@ m.DEPT_ID ASC LIMIT #{offset},#{pageSize} + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml index 8f1ef7eaf4..d014071995 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml @@ -52,4 +52,16 @@ + + + From 9fbb8136e44552e5ce2205757cce444036f5f13d Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 3 Sep 2020 22:15:20 +0800 Subject: [PATCH 179/226] =?UTF-8?q?=E5=85=9A=E5=91=98=E7=9B=B8=E5=85=B3=20?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E5=8F=AA=E6=9C=89=E4=B8=80=E6=9D=A1=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E5=88=99=E7=BB=9950=E5=88=86=EF=BC=9B=E5=A4=84?= =?UTF-8?q?=E7=90=86=E5=AF=BC=E5=85=A5=E6=8C=87=E6=A0=87=E7=9A=84=E6=AD=A3?= =?UTF-8?q?=E8=B4=9F=E7=9B=B8=E5=85=B3=E5=8F=8A=E9=98=88=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/model/IndexExcelDataListener.java | 28 +++++-- .../main/java/com/epmet/model/IndexModel.java | 1 + .../impl/CpcIndexCalculateServiceImpl.java | 77 +++++++++++++++---- .../evaluationindex/indexcal/CpcScoreDao.xml | 18 +++-- 4 files changed, 91 insertions(+), 33 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 eef2856684..3fec1a9132 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 @@ -11,6 +11,7 @@ import com.epmet.entity.evaluationindex.screen.IndexGroupTemplateEntity; import com.epmet.service.evaluationindex.screen.IndexDictService; import com.epmet.service.evaluationindex.screen.IndexGroupDetailTemplateService; import com.epmet.service.evaluationindex.screen.IndexGroupTemplateService; +import com.epmet.support.normalizing.Correlation; import com.epmet.util.Pinyin4jUtil; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -29,7 +30,6 @@ import java.util.stream.Collectors; */ public class IndexExcelDataListener extends AnalysisEventListener { private static final Logger LOGGER = LoggerFactory.getLogger(IndexExcelDataListener.class); - private String POSITIVE = "positive"; /** * 每隔5条存储数据库,实际使用中可以3000条,然后清理list ,方便内存回收 */ @@ -86,8 +86,23 @@ public class IndexExcelDataListener extends AnalysisEventListener { data.setWeight(preWheight); } LOGGER.info("解析到一条数据:{}", JSON.toJSONString(data)); - //TODO 默认正相关 - data.setCorrelation(POSITIVE); + if (StringUtils.isNotBlank(data.getThreshold())) { + String threshold = data.getThreshold(); + if ("无".equals(data.getThreshold())) { + threshold = "-1"; + } else if (data.getThreshold().contains("%")) { + String thresholdStr = data.getThreshold().replace("%", ""); + threshold = new BigDecimal(thresholdStr).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP).toString(); + } + data.setThreshold(threshold); + } + if (StringUtils.isNotBlank(data.getCorrelation())) { + if (Correlation.NEGATIVE.getDesc().equals(data.getCorrelation())) { + data.setCorrelation(Correlation.NEGATIVE.getCode()); + } else { + data.setCorrelation(Correlation.POSITIVE.getCode()); + } + } IndexDictEntity entity = new IndexDictEntity(); IndexDictEntity entity2 = new IndexDictEntity(); @@ -240,11 +255,8 @@ public class IndexExcelDataListener extends AnalysisEventListener { templateEntity.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(), false, 4)); templateEntity.setWeight(new BigDecimal(index.getWeight()).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP)); } - - if (StringUtils.isNotBlank(index.getThreshold())) { - String thresholdStr = index.getThreshold().replace("%", ""); - templateEntity.setThreshold(new BigDecimal(thresholdStr).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP)); - } + templateEntity.setThreshold(new BigDecimal(index.getThreshold())); + templateEntity.setCorrelation(index.getCorrelation()); } private void buildIndexDicEntity(IndexModel data, IndexDictEntity entity, IndexDictEntity entity2, IndexDictEntity entity3, IndexDictEntity entity4, IndexDictEntity entity5) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java index 5ff0b19267..77a0fd3138 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java @@ -21,6 +21,7 @@ public class IndexModel { private String weight; @ExcelProperty(value = "五级权重") private String level5Weight; + //没有阈值:无,有就是百分数 @ExcelProperty(value = "阈值") private String threshold; /** 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 7876c2158e..52cb4e3fc6 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 @@ -10,9 +10,9 @@ import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; import com.epmet.dao.evaluationindex.indexcal.CpcScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyDao; -import com.epmet.dao.evaluationindex.screen.IndexCodeFieldReDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.entity.evaluationindex.indexcal.CpcScoreEntity; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; import com.epmet.eum.IndexCodeEnum; import com.epmet.service.evaluationindex.indexcal.CpcIndexCalculateService; @@ -43,8 +43,6 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { @Autowired private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; @Autowired - private IndexCodeFieldReDao indexCodeFieldReDao; - @Autowired private IndexGroupDetailService getDetailListByParentCode; @Autowired private IndexCodeFieldReService indexCodeFieldReService; @@ -97,11 +95,43 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { totalEntity.setScore(totalEntity.getScore().add(total)); } }); - deleteAndInsertBatch(formDTO.getCustomerId(),formDTO.getMonthId(),IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(),cpcScoreTotalMap.values().stream().collect(Collectors.toList())); + deleteAndInsertBatch(formDTO, cpcScoreTotalMap.values().stream().collect(Collectors.toList()), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); + } + + /** + * @param formDTO + * @param indexCode + * @param stringObjectMap + * @return void + * @author yinzuomei + * @description 只有一条事实记录时,分值默认赋50 + * @Date 2020/9/2 14:35 + **/ + private CpcScoreEntity handleOneGridScene(CalculateCommonFormDTO formDTO, String indexCode, Map stringObjectMap) { + FactIndexPartyAblityCpcMonthlyEntity factCpc = JSON.parseObject(JSON.toJSONString(stringObjectMap), FactIndexPartyAblityCpcMonthlyEntity.class); + // 保存中间表 + CpcScoreEntity cpcScoreEntity = new CpcScoreEntity(); + cpcScoreEntity.setCustomerId(factCpc.getCustomerId()); + cpcScoreEntity.setAgencyId(factCpc.getAgencyId()); + cpcScoreEntity.setGridId(factCpc.getGridId()); + cpcScoreEntity.setYearId(factCpc.getYearId()); + cpcScoreEntity.setMonthId(factCpc.getMonthId()); + cpcScoreEntity.setUserId(factCpc.getUserId()); + cpcScoreEntity.setScore(new BigDecimal(NumConstant.FIFTY_STR)); + cpcScoreEntity.setIndexCode(indexCode); + cpcScoreEntity.setIsTotal(NumConstant.ZERO_STR); + return cpcScoreEntity; } - private void deleteAndInsertBatch(String customerId, String monthId, String indexCode, Collection values) { - cpcScoreDao.deleteByMonthId(customerId, monthId, indexCode); + /** + * desc:根据客户id和月份Id 指标code 非必填 删除数据 + * + * @param formDTO + * @param indexCode 指标code 非必填 + * @param values + */ + private void deleteAndInsertBatch(CalculateCommonFormDTO formDTO, Collection values, String indexCode) { + cpcScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode); cpcScoreDao.insertBatch(values); } @@ -119,20 +149,33 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { return; } - int pageNo = 1; - int pageSize = 10; + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_THOUSAND; //分页查询 要计算的原始数据 List> list = null; do { list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize); if (!CollectionUtils.isEmpty(list)) { - //遍历指标分组 计算分数 - List> finalList = list; - groupIndexDetailsMap.forEach((parentIndexCode, details) -> { - calculateScore(formDTO, details, finalList, minAndMaxMap, parentIndexCode); - }); + //如果是第一页且仅有一条数据 则直接给50分 + if (pageNo == NumConstant.ONE && list.size() == NumConstant.ONE) { + List insertList = new ArrayList<>(); + for (String parentIndexCode : groupIndexDetailsMap.keySet()) { + insertList.add(handleOneGridScene(formDTO, parentIndexCode, list.get(0))); + } + if (CollectionUtils.isEmpty(insertList)) { + deleteAndInsertBatch(formDTO, insertList, null); + } + } else { + //遍历指标分组 计算分数 + for (Map.Entry> entry : groupIndexDetailsMap.entrySet()) { + String parentIndexCode = entry.getKey(); + List details = entry.getValue(); + calculateScore(formDTO, details, list, minAndMaxMap, parentIndexCode); + } + } } - } while (!CollectionUtils.isEmpty(list) && pageNo++ > 0); + pageNo++; + } while (!CollectionUtils.isEmpty(list) && list.size() == pageSize); } /** @@ -185,7 +228,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { log.info("计算的结果:{}", result); //处理结果 - if (CollectionUtils.isEmpty(result)){ + if (CollectionUtils.isEmpty(result)) { log.error("calculateScore calculateScore return empty"); return; } @@ -209,7 +252,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { cpcScoreEntity.setScore(score); list.add(cpcScoreEntity); }); - this.deleteAndInsertBatch(formDTO.getCustomerId(),formDTO.getMonthId(),parentIndexCode,list); + this.deleteAndInsertBatch(formDTO, list, parentIndexCode); } @@ -242,7 +285,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { minValue = new BigDecimal(String.valueOf(minAndMaxMap.get(minValueKey))); //如果最大值超过阈值 则最大值为阈值 if (new BigDecimal(NumConstant.ONE_NEG).compareTo(index.getThreshold()) != NumConstant.ZERO - && maxValue.compareTo(new BigDecimal(NumConstant.ONE_NEG)) == NumConstant.ONE){ + && maxValue.compareTo(new BigDecimal(NumConstant.ONE_NEG)) == NumConstant.ONE) { maxValue = index.getThreshold(); } //分值计算器 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml index 3f38b0dbbc..3c6fb2ea55 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml @@ -3,6 +3,16 @@ + + delete from fact_index_cpc_score + where + CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} + and MONTH_ID = #{monthId,jdbcType=VARCHAR} + + and INDEX_CODE = #{indexCode,jdbcType=VARCHAR} + + + @@ -18,14 +28,6 @@ - - delete from fact_index_cpc_score - where - CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} - and MONTH_ID = #{monthId,jdbcType=VARCHAR} - and INDEX_CODE = #{indexCode,jdbcType=VARCHAR} - - + SELECT + CUSTOMER_ID customerId, + AGENCY_ID agencyId, + PARENT_AGENCY_ID parentAgencyId, + YEAR_ID yearId, + MONTH_ID monthId, + IS_TOTAL isTotal, + SCORE score, + INDEX_CODE indexCode + FROM + fact_index_agency_score + WHERE + DEL_FLAG = '0' + AND CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + ORDER BY AGENCY_ID + + - \ No newline at end of file + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml index a5a7972279..a528c94f95 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml @@ -3,4 +3,22 @@ - \ No newline at end of file + + + 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/screen/FactIndexCommunityScoreDao.xml index c3da270827..07e3b05b94 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/screen/FactIndexCommunityScoreDao.xml @@ -84,4 +84,22 @@ GROUP BY fics.agency_id - \ 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 index 9d2176f678..b6eed400a2 100644 --- 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 @@ -24,4 +24,23 @@ AND figc.index_code = #{indexCode} GROUP BY figc.agency_id - \ No newline at end of file + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml index 4d16660ed3..dda779d7b9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml @@ -60,4 +60,14 @@ + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml index d014071995..8937212e71 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml @@ -64,4 +64,15 @@ AND m.CUSTOMER_ID =#{customerId} AND m.DEPT_ID =#{deptId} + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml index fdb4f2407c..7a8c216fea 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml @@ -105,4 +105,16 @@ AND m.CUSTOMER_ID =#{customerId} AND m.GRID_ID = #{gridId} + + From 6847c957e2a403525c39c8dac0791092494f75e7 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Fri, 4 Sep 2020 09:46:54 +0800 Subject: [PATCH 183/226] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=81=A2=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-gateway/pom.xml | 4 ++-- epmet-module/data-statistical/data-statistical-server/pom.xml | 2 +- .../dao/evaluationindex/screen/FactIndexGridScoreDao.java | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index 796a1e9880..97fd3b3851 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -181,8 +181,8 @@ lb://data-report-server - - http://localhost:8108 + lb://data-statistical-server + lb://epmet-openapi-scan diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 3746a65446..8a32ee8d75 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -201,7 +201,7 @@ 6379 123456 - false + true 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 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 index 1736cb88fe..8a8a1f8a38 100644 --- 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 @@ -45,7 +45,6 @@ public interface FactIndexGridScoreDao extends BaseDao * @date 2020/8/28 3:20 下午 */ List selectSubGridAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); - List selectSubGridPartyAvgScore(@Param("customerId")String customerId,@Param("monthId")String monthId); /** * @Description 社区下属所有网格治理能力汇总平均值 From f7282c4f00af6686f55cf8f4e0d61bb1089ce831 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Fri, 4 Sep 2020 09:49:57 +0800 Subject: [PATCH 184/226] =?UTF-8?q?control=E4=BB=A3=E7=A0=81=E6=81=A2?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/FactIndexCollectController.java | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java index 21a81701ac..82966dbe82 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java @@ -151,22 +151,4 @@ public class FactIndexCollectController { factIndexCollectService.insertDeptGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } - - public static void main(String[] args) { - String a = "202009"; - System.out.println(a.substring(0,4)); - System.out.println(a.substring(4,6)); - - int[] aa = new int[2]; - System.out.println(aa[0]); - System.out.println(aa == null); - IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); - System.out.println(monthlyFormDTO.getIndexTotal()); - } - - @GetMapping("hahaha") - public Result hahaha(String monthId, String customerId) { - factIndexCollectService.insertScreenIndexDataMonthlyAndYearly(monthId, customerId); - return new Result(); - } } From d2f08bb779509ece3fe10be2884d8d06867dcd14 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 4 Sep 2020 10:39:53 +0800 Subject: [PATCH 185/226] =?UTF-8?q?=E5=8A=A0=E6=80=A5=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/CodeAuditResultDTO.java | 5 +++++ .../epmet/dto/form/SubmitAuditFormDTO.java | 5 +++++ .../dto/result/CodeVersionInfoResultDTO.java | 4 ++++ .../epmet/entity/CodeAuditResultEntity.java | 5 +++++ .../epmet/service/impl/CodeServiceImpl.java | 19 +++++++++++++++---- .../db/migration/V0.0.9__thirdUpdate.sql | 1 + 6 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.9__thirdUpdate.sql diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeAuditResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeAuditResultDTO.java index 910ded04de..afcedffee0 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeAuditResultDTO.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeAuditResultDTO.java @@ -58,6 +58,11 @@ public class CodeAuditResultDTO implements Serializable { */ private String result; + /** + * 是否加急 + */ + private Boolean isSpeed; + /** * 原因 */ diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/SubmitAuditFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/SubmitAuditFormDTO.java index 9c2f1c506f..a16d0c8d6c 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/SubmitAuditFormDTO.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/SubmitAuditFormDTO.java @@ -25,6 +25,11 @@ public class SubmitAuditFormDTO implements Serializable { */ private Boolean isSpeed; + /** + * isSpeed=true时,是否是审核失败后的反馈提审 + */ + private Boolean isRepeat; + /** * 小程序版本说明和功能解释 */ diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CodeVersionInfoResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CodeVersionInfoResultDTO.java index b1b367c457..74b1bb54d4 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CodeVersionInfoResultDTO.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CodeVersionInfoResultDTO.java @@ -71,6 +71,10 @@ public class CodeVersionInfoResultDTO implements Serializable { * */ private String status; + /** + * + */ + private Boolean isSpeed; } @Data diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeAuditResultEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeAuditResultEntity.java index 164b8a97bb..488fa876a0 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeAuditResultEntity.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeAuditResultEntity.java @@ -58,6 +58,11 @@ public class CodeAuditResultEntity extends BaseEpmetEntity { */ private String result; + /** + * 是否加急 + */ + private Boolean isSpeed; + /** * 原因 */ diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java index 611c1a05b4..09f5f5a276 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java @@ -183,6 +183,7 @@ public class CodeServiceImpl implements CodeService { //审核版本 CodeCustomerDTO audit = codeCustomerService.getAuditInfo(formDTO.getCustomerId(), formDTO.getClientType()); if(null != audit) { + CodeAuditResultDTO auditResult = codeAuditResultService.getAuditResultByCodeId(audit.getId()); CodeVersionInfoResultDTO.AuditBean auditBean = new CodeVersionInfoResultDTO.AuditBean(); auditBean.setCodeId(audit.getId()); auditBean.setVersion(audit.getUserVersion()); @@ -191,7 +192,6 @@ public class CodeServiceImpl implements CodeService { //获取小程序调用令牌 AuthorizationInfoDTO authInfo = authorizationInfoDao.getAuthInfoByCustomer(formDTO.getCustomerId(), formDTO.getClientType()); //获取审核结果信息 - CodeAuditResultDTO auditResult = codeAuditResultService.getAuditResultByCodeId(audit.getId()); //调用微信API获取最新审核状态 WxMaCodeAuditStatusReq request = new WxMaCodeAuditStatusReq(); request.setAuditId(auditResult.getAuditId()); @@ -222,6 +222,7 @@ public class CodeServiceImpl implements CodeService { } } auditBean.setStatus(audit.getStatus()); + auditBean.setIsSpeed(auditResult.getIsSpeed()); auditBean.setCommitTime(DateUtils.format(audit.getCommitTime(), DateUtils.DATE_TIME_PATTERN)); auditBean.setAuditTime(DateUtils.format(audit.getAuditTime(), DateUtils.DATE_TIME_PATTERN)); resultDTO.setAudit(auditBean); @@ -283,6 +284,7 @@ public class CodeServiceImpl implements CodeService { codeCustomerDTO.getUserVersion(), CodeConstant.OPER_SUBMIT, wxResult.getErrorMsg()); throw new RenException(wxResult.getErrorCode(), wxResult.getErrorMsg()); } + boolean speedSuccess = false; if(formDTO.getIsSpeed()) { //调用微信API 加急审核 WxMaSpeedUpAuditReq speedRequest = new WxMaSpeedUpAuditReq(); @@ -291,8 +293,9 @@ public class CodeServiceImpl implements CodeService { if (!wxSpeedResult.success()) { saveOperation(codeCustomerDTO.getCustomerId(), codeCustomerDTO.getClientType(), codeCustomerDTO.getId(), codeCustomerDTO.getUserVersion(), CodeConstant.OPER_SUBMIT, wxSpeedResult.getErrorMsg()); - throw new RenException(wxSpeedResult.getErrorCode(), wxSpeedResult.getErrorMsg()); + log.error(wxSpeedResult.getErrorMsg()); } + speedSuccess = wxSpeedResult.success(); } //获取审核结果信息 CodeAuditResultDTO codeAuditResultDTO = codeAuditResultService.getAuditResultByCodeId(formDTO.getCodeId()); @@ -302,18 +305,24 @@ public class CodeServiceImpl implements CodeService { codeAuditResultDTO.setCustomerId(codeCustomerDTO.getCustomerId()); codeAuditResultDTO.setCodeId(codeCustomerDTO.getId()); codeAuditResultDTO.setAuditId(wxResult.getData()); + codeAuditResultDTO.setIsSpeed(speedSuccess); codeAuditResultDTO.setResult(CodeConstant.AUDITING); codeAuditResultService.save(codeAuditResultDTO); } else { - codeAuditResultDTO.setFeedbackInfo(formDTO.getFeedbackInfo()); - codeAuditResultDTO.setFeedbackStuff(formDTO.getFeedbackStuff()); codeAuditResultService.update(codeAuditResultDTO); codeAuditResultService.deleteById(codeAuditResultDTO.getId()); codeAuditResultDTO = new CodeAuditResultDTO(); + codeAuditResultDTO.setFeedbackInfo(formDTO.getFeedbackInfo()); + codeAuditResultDTO.setFeedbackStuff(formDTO.getFeedbackStuff()); codeAuditResultDTO.setCustomerId(codeCustomerDTO.getCustomerId()); codeAuditResultDTO.setCodeId(codeCustomerDTO.getId()); codeAuditResultDTO.setAuditId(wxResult.getData()); codeAuditResultDTO.setResult(CodeConstant.AUDITING); + if (formDTO.getIsRepeat()) { + codeAuditResultDTO.setIsSpeed(true); + } else { + codeAuditResultDTO.setIsSpeed(speedSuccess); + } codeAuditResultService.save(codeAuditResultDTO); } //更新代码表状态 @@ -656,6 +665,8 @@ public class CodeServiceImpl implements CodeService { codeCustomerDTO.getUserVersion(), CodeConstant.OPER_SUBMIT, wxSpeedResult.getErrorMsg()); throw new RenException(wxSpeedResult.getErrorCode(), wxSpeedResult.getErrorMsg()); } + codeAuditResultDTO.setIsSpeed(true); + codeAuditResultService.update(codeAuditResultDTO); } @Override diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.9__thirdUpdate.sql b/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.9__thirdUpdate.sql new file mode 100644 index 0000000000..9e7d638917 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.9__thirdUpdate.sql @@ -0,0 +1 @@ +ALTER TABLE code_audit_result ADD COLUMN IS_SPEED tinyint NULL DEFAULT 0 COMMENT '是否加急' AFTER RESULT; \ No newline at end of file From 8d0e923f77f9cf02a6c4db1dc58c68d9c594f4b7 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 4 Sep 2020 10:41:38 +0800 Subject: [PATCH 186/226] =?UTF-8?q?getAgencyListByCustomerId=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E6=95=B0=E6=8D=AE=E6=BA=90=E6=94=B9=E5=9B=9E=E5=8E=9F?= =?UTF-8?q?=E6=9D=A5=E7=9A=84=20STATS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java index 7f21b81ee0..d24fec3ee8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java @@ -210,7 +210,7 @@ public class DimAgencyServiceImpl extends BaseServiceImpl getAgencyListByCustomerId(String customerId) { if (StringUtils.isBlank(customerId)){ From 44c7aa5168c0eeecb82ebf67dc29235f2d0d74fc Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 4 Sep 2020 10:46:26 +0800 Subject: [PATCH 187/226] =?UTF-8?q?third=E6=9C=8D=E5=8A=A1=E5=8D=87?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-third-server/deploy/docker-compose-prod.yml | 2 +- epmet-module/epmet-third/epmet-third-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml index 1028ad0be9..a94c11da8f 100644 --- a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-third-server: container_name: epmet-third-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-third-server:0.0.138 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-third-server:0.0.139 ports: - "8110:8110" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-third/epmet-third-server/pom.xml b/epmet-module/epmet-third/epmet-third-server/pom.xml index 6eadb9e5f2..ef24994f99 100644 --- a/epmet-module/epmet-third/epmet-third-server/pom.xml +++ b/epmet-module/epmet-third/epmet-third-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.0.138 + 0.0.139 com.epmet From bef22d71024d3fce22f427b7d6f1276cbe7ea998 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 4 Sep 2020 10:54:45 +0800 Subject: [PATCH 188/226] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=8D=87=E7=BA=A7-?= =?UTF-8?q?=E9=81=97=E6=BC=8F=E4=B8=8A=E7=94=9F=E4=BA=A7=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resi-mine/resi-mine-server/deploy/docker-compose-prod.yml | 2 +- epmet-module/resi-mine/resi-mine-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-prod.yml b/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-prod.yml index a2a9ae18df..e59f895806 100644 --- a/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-prod.yml +++ b/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-mine-server: container_name: resi-mine-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/resi-mine-server:0.3.38 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/resi-mine-server:0.3.39 ports: - "8094:8094" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-mine/resi-mine-server/pom.xml b/epmet-module/resi-mine/resi-mine-server/pom.xml index 35d2c0edda..31ec3b085d 100644 --- a/epmet-module/resi-mine/resi-mine-server/pom.xml +++ b/epmet-module/resi-mine/resi-mine-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.38 + 0.3.39 com.epmet resi-mine From b0261bca0ade2beda9dac799d7e269bc18e29cd0 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 4 Sep 2020 13:55:04 +0800 Subject: [PATCH 189/226] =?UTF-8?q?=E6=89=AB=E7=A0=81=E6=8E=88=E6=9D=83=20?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=20=E6=8C=89=E9=92=AE=E6=8E=88=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java index 08f17ae49a..1cb126fe62 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java @@ -43,8 +43,8 @@ public interface WxMaCodeConstant { * 上面url为扫码形式 * 下面注释url为按钮形式 */ - String API_AUTH_REGISTER_URL = "https://mp.weixin.qq.com/cgi-bin/componentloginpage?component_appid=%s&pre_auth_code=%s&redirect_uri=%s"; -// String API_AUTH_REGISTER_URL = "https://mp.weixin.qq.com/safe/bindcomponent?action=bindcomponent&auth_type=3&no_scan=1&component_appid=%s&pre_auth_code=%s&redirect_uri=%s#wechat_redirect"; +// String API_AUTH_REGISTER_URL = "https://mp.weixin.qq.com/cgi-bin/componentloginpage?component_appid=%s&pre_auth_code=%s&redirect_uri=%s"; + String API_AUTH_REGISTER_URL = "https://mp.weixin.qq.com/safe/bindcomponent?action=bindcomponent&auth_type=3&no_scan=1&component_appid=%s&pre_auth_code=%s&redirect_uri=%s#wechat_redirect"; /** * 创建开放平台帐号并绑定公众号/小程序 From ff8cff2a057c567f4f117d01f11001a1d64e05f6 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 4 Sep 2020 13:58:57 +0800 Subject: [PATCH 190/226] =?UTF-8?q?third=E6=9C=8D=E5=8A=A1=E5=8D=87?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-third-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/epmet-third/epmet-third-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml index d4706c5733..60b8743393 100644 --- a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-third-server: container_name: epmet-third-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.134 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.140 ports: - "8110:8110" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-third/epmet-third-server/pom.xml b/epmet-module/epmet-third/epmet-third-server/pom.xml index ef24994f99..493388ea59 100644 --- a/epmet-module/epmet-third/epmet-third-server/pom.xml +++ b/epmet-module/epmet-third/epmet-third-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.0.139 + 0.0.140 com.epmet From 43f07858994d39847ab31e8c86b93f29c29c78f8 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 4 Sep 2020 14:00:08 +0800 Subject: [PATCH 191/226] =?UTF-8?q?third=E6=9C=8D=E5=8A=A1=E5=8D=87?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-third-server/deploy/docker-compose-prod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml index a94c11da8f..332cf74116 100644 --- a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-third-server: container_name: epmet-third-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-third-server:0.0.139 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-third-server:0.0.140 ports: - "8110:8110" network_mode: host # 使用现有网络 From b02d471c1ac311e737f69d00610e722c02aec2a9 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 4 Sep 2020 14:17:57 +0800 Subject: [PATCH 192/226] =?UTF-8?q?=E6=89=AB=E7=A0=81=E6=8E=88=E6=9D=83=20?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=20=E6=8C=89=E9=92=AE=E6=8E=88=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java index 1cb126fe62..4d62fcc95d 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java @@ -44,7 +44,7 @@ public interface WxMaCodeConstant { * 下面注释url为按钮形式 */ // String API_AUTH_REGISTER_URL = "https://mp.weixin.qq.com/cgi-bin/componentloginpage?component_appid=%s&pre_auth_code=%s&redirect_uri=%s"; - String API_AUTH_REGISTER_URL = "https://mp.weixin.qq.com/safe/bindcomponent?action=bindcomponent&auth_type=3&no_scan=1&component_appid=%s&pre_auth_code=%s&redirect_uri=%s#wechat_redirect"; + String API_AUTH_REGISTER_URL = "https://mp.weixin.qq.com/safe/bindcomponent?action=bindcomponent&auth_type=3&no_scan=1&component_appid=%s&pre_auth_code=%s&redirect_uri=%s&auth_type=3#wechat_redirect"; /** * 创建开放平台帐号并绑定公众号/小程序 From 281b69b4f29096b364d35ecd2da7218bea1bf35f Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 4 Sep 2020 15:10:58 +0800 Subject: [PATCH 193/226] =?UTF-8?q?=E5=85=A8=E5=8C=BA=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/IndexCalConstant.java | 4 + .../indexcal/SubAgencyScoreAvgResultDTO.java | 51 +++ .../com/epmet/controller/DemoController.java | 14 +- .../indexcal/AgencyScoreDao.java | 16 +- .../indexcal/DeptScoreDao.java | 12 + .../FactIndexGovrnAblityDeptMonthlyDao.java | 1 + .../java/com/epmet/eum/IndexCodeEnum.java | 4 + .../IndexCalculateDistrictService.java | 18 + .../IndexCalculateDistrictServiceImpl.java | 406 ++++++++++++++++++ .../impl/IndexCalculateStreetServiceImpl.java | 2 +- .../indexcal/AgencyScoreDao.xml | 21 +- .../evaluationindex/indexcal/DeptScoreDao.xml | 22 + 12 files changed, 562 insertions(+), 9 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubAgencyScoreAvgResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateDistrictService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java index bc7295ccda..f02185071f 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java @@ -31,6 +31,8 @@ public interface IndexCalConstant { String STREET_LEVEL = "street"; + String DISTRICT_LEVEL = "district"; + String COMMUNITY_RELATE = "shequxiangguan"; @@ -55,7 +57,9 @@ public interface IndexCalConstant { String INDEX_DETAIL_LIST_NULL = "指标明细查询集合为空"; String COMMUNITY_PARTY_AVG_NULL = "查询下属所有【社区】的党建能力平均值集合为空"; String GRID_PARTY_AVG_NULL = "查询下属所有【网格】的党建能力平均值集合为空"; + String DISTRICT_PARTY_AVG_NULL = "查询【区县】的党建能力平均值集合为空"; String STREET_PUBLISH_ARTICLE_LIST_NULL = "查询【街道】名义发文数量集合为空"; + String DISTRICT_PUBLISH_ARTICLE_LIST_NULL = "查询【区/县】名义发文数量集合为空"; String COMMUNITY_PUBLISH_ARTICLE_LIST_NULL = "查询【社区】名义发文数量集合为空"; String INDEX_CODE_NULL = "指标Code未查询出对应字段 【 %s 】"; String STREET_GOVERN_ABILITY_NULL = "查询【街道】治理能力的六个五级指标集合为空"; diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubAgencyScoreAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubAgencyScoreAvgResultDTO.java new file mode 100644 index 0000000000..f88e035b7b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubAgencyScoreAvgResultDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/9/4 9:32 上午 + */ +@Data +public class SubAgencyScoreAvgResultDTO implements Serializable { + + private static final long serialVersionUID = 6913351504675726385L; + + /** + * + */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 分数 + */ + private BigDecimal score; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 380b2f3b86..397d99df7a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -17,10 +17,7 @@ import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMont import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.service.StatsDemoService; -import com.epmet.service.evaluationindex.indexcal.DeptScoreService; -import com.epmet.service.evaluationindex.indexcal.GridCorreLationService; -import com.epmet.service.evaluationindex.indexcal.IndexCalculateCommunityService; -import com.epmet.service.evaluationindex.indexcal.IndexCalculateStreetService; +import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.stats.DimAgencyService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -56,6 +53,8 @@ public class DemoController { private IndexCalculateStreetService indexCalculateStreetService; @Autowired private DeptScoreService deptScoreService; + @Autowired + private IndexCalculateDistrictService indexCalculateDistrictService; @GetMapping("testAlarm") public void testAlarm() { @@ -456,4 +455,11 @@ public class DemoController { String monthId = "202008"; indexCalculateStreetService.calStreetAll(customerId,monthId); } + + @PostMapping("districtZxc") + public void getDistrict(){ + String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + String monthId = "202008"; + indexCalculateDistrictService.calDistrictAll(customerId,monthId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java index 219d617a0d..b30d2751d1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java @@ -19,7 +19,7 @@ package com.epmet.dao.evaluationindex.indexcal; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcal.AgencyScoreDTO; -import com.epmet.dto.screen.FactIndexCommunityScoreDTO; +import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; import com.epmet.entity.evaluationindex.indexcal.AgencyScoreEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -54,13 +54,23 @@ public interface AgencyScoreDao extends BaseDao { void deleteOldRecord(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("dataType")String dataType); /** - * @Description 查询街道相关信息 + * @Description 查询【fact_index_agency_score】相关信息 * @param customerId * @param monthId * @author zxc * @date 2020/9/1 9:41 上午 */ - List selectStreetInfo(@Param("customerId") String customerId, @Param("monthId")String monthId,@Param("dataType")String dataType); + List selectAgencyScoreInfo(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("dataType")String dataType); + + /** + * @Description 区下级街道得分平均值 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/31 1:51 下午 + */ + List selectAgencyScoreAvg(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + /** * 根据入参查询 区/街道相关分数表 记录 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java index 0718e44771..b77849a5d5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java @@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.indexcal; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcal.DeptScoreDTO; +import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -44,4 +45,15 @@ public interface DeptScoreDao extends BaseDao { **/ List selectListDeptScore(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * @Description 所有直属部门治理能力平均值 + * @param customerId + * @param monthId + * @param indexCode + * @author zxc + * @date 2020/9/4 10:53 上午 + */ + List selectGovernDeptScoreAvg(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java index abdabd7465..5a9350a63e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.evaluationindex.indexcoll; /** import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; import com.epmet.dto.indexcollect.form.DeptGovrnAbilityFormDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity; import org.apache.ibatis.annotations.Mapper; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java index 5ebaab6f74..cc29f12a95 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java @@ -31,6 +31,10 @@ public enum IndexCodeEnum { JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ("jiedaoxiashusysqdjnlhzpjz","街道下属所有社区党建能力汇总(平均值)",5), JIE_DAO_XIA_SHU_SYSQZLNLHZ("jiedaoxiashusysqzlnlhz","街道下属所有社区治理能力汇总 (平均值) ",5), JIE_DAO_XIA_SHU_SQFWNLDFPYZ("jiedaoxiashusqfwnldfpjz","街道下属社区服务能力得分 (平均值) ",5), + QU_XIA_SHU_JIE_DFWNLHZPJZ("quxiashujiedfwnlhzpjz","区下属街道服务能力汇总(平均值)",5), + QU_XIA_JI_JIE_DDJNLHZPJZ("quxiajijieddjnlhzpjz","区下级街道党建能力汇总(平均值)",5), + SUO_YOU_JIE_DAO_ZLNLPJZ("suoyoujiedaozlnlpjz","所有街道治理能力(平均值)",5), + SUO_YOU_ZHI_SHU_BMZLNLPJZ("suoyouzhishubmzlnlpjz","所有直属部门治理能力(平均值)",5), ; private String code; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateDistrictService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateDistrictService.java new file mode 100644 index 0000000000..0e8ce09ccf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateDistrictService.java @@ -0,0 +1,18 @@ +package com.epmet.service.evaluationindex.indexcal; + +/** + * @Author zxc + * @DateTime 2020/9/4 9:03 上午 + */ +public interface IndexCalculateDistrictService { + + /** + * @Description 计算全区相关总分 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/2 3:12 下午 + */ + Boolean calDistrictAll(String customerId, String monthId); + +} 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 new file mode 100644 index 0000000000..4fd50137bd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java @@ -0,0 +1,406 @@ +package com.epmet.service.evaluationindex.indexcal.impl; + +import com.alibaba.druid.util.StringUtils; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +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.AgencyScoreDao; +import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyDao; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao; +import com.epmet.dto.indexcal.AgencyScoreDTO; +import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; +import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; +import com.epmet.eum.IndexCodeEnum; +import com.epmet.service.evaluationindex.indexcal.IndexCalculateDistrictService; +import com.epmet.service.evaluationindex.indexcal.IndexCodeFieldReService; +import com.epmet.service.evaluationindex.screen.IndexGroupDetailService; +import com.epmet.support.normalizing.BigDecimalScoreCalculator; +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.IndexInputVO; +import com.epmet.support.normalizing.batch.SampleValue; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Author zxc + * @DateTime 2020/9/4 9:03 上午 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrictService { + + @Autowired + private FactIndexPartyAblityOrgMonthlyDao factIndexPartyAblityOrgMonthlyDao; + @Autowired + private IndexCodeFieldReService indexCodeFieldReService; + @Autowired + private IndexGroupDetailService indexGroupDetailService; + @Autowired + private AgencyScoreDao agencyScoreDao; + @Autowired + private DeptScoreDao deptScoreDao; + + /** + * @Description 计算全区相关总分 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/2 3:12 下午 + */ + @Override + public Boolean calDistrictAll(String customerId, String monthId) { + Boolean aBoolean = districtPartyCalculate(customerId, monthId);//党建能力 + if (!aBoolean.equals(true)) { + throw new RenException("calculate district-party-ability failure ......"); + } + Boolean bBoolean = districtGovernAbilityCalculate(customerId, monthId);// 治理能力 + if (!bBoolean.equals(true)) { + throw new RenException("calculate district-govern-ability failure ......"); + } + Boolean cBoolean = districtServiceAbilityCalculate(customerId, monthId);// 服务能力 + if (!cBoolean.equals(true)) { + throw new RenException("calculate district-service-ability failure ......"); + } + Boolean dBoolean = districtRelate(customerId, monthId); + if (!dBoolean.equals(true)) { + throw new RenException("calculate district-all insert failure ......"); + } + return true; + } + + /** + * @param customerId + * @Description 全区名义发文数量计算【党建能力】 + * @author zxc + * @date 2020/8/26 10:46 上午 + */ + public Boolean districtPartyCalculate(String customerId, String monthId) { + // 党建能力 + // 根据all_parent_index_code 获取指标明细 + List indexDetailList = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(indexDetailList)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return false; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + //党建能力平均值 + indexDetailList.forEach(detail -> { + if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { + List subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { + log.error(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); + return; + }else if (subGridPartyAvgScore.size() == NumConstant.ONE){ + pid.put(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),subGridPartyAvgScore.get(NumConstant.ZERO).getParentId()); + sizeOne(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); + return; + }else if (subGridPartyAvgScore.size() > NumConstant.ONE) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, IndexCalConstant.PAGE_SIZE); + subPartyAvgList.forEach( party -> { + List index1SampleValues = new ArrayList<>(); + party.forEach(c -> { + pid.put(c.getAgencyId(),c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + 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); + indexInputVOS.add(index1VO); + }); + } + } else { + // 区名义发文数量 + List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.DISTRICT_LEVEL); + if (CollectionUtils.isEmpty(publishArticleCountList)) { + log.error(IndexCalConstant.DISTRICT_PUBLISH_ARTICLE_LIST_NULL); + return; + } + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); + return; + }else if (publishArticleCountList.size() == NumConstant.ONE){ + pid.put(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); + sizeOne(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); + return; + }else if (publishArticleCountList.size() > NumConstant.ONE) { + List decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE); + publishArticleList.forEach( publish -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); + 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); + indexInputVOS.add(index1VO); + }); + } + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), pid); + deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); + return true; + } + + /** + * @param customerId + * @param monthId + * @Description 全区治理能力 + * @author zxc + * @date 2020/8/26 1:40 下午 + */ + public Boolean districtGovernAbilityCalculate(String customerId, String monthId) { + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return false; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + detailListByParentCode.forEach(detail -> { + if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { + List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + if (districtGovernAvgList.size() == NumConstant.ONE) { + pid.put(districtGovernAvgList.get(NumConstant.ZERO).getAgencyId(),districtGovernAvgList.get(NumConstant.ZERO).getParentId()); + sizeOne(districtGovernAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); + return; + } else if (districtGovernAvgList.size() > NumConstant.ONE) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(districtGovernAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> governAvg = ListUtils.partition(districtGovernAvgList, IndexCalConstant.PAGE_SIZE); + governAvg.forEach(avg -> { + List index1SampleValues = new ArrayList<>(); + avg.forEach(c -> { + pid.put(c.getAgencyId(),c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + 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); + indexInputVOS.add(index1VO); + }); + } + } else if (IndexCodeEnum.SUO_YOU_ZHI_SHU_BMZLNLPJZ.getCode().equals(detail.getIndexCode())){ + List deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + if (deptScoreAvgList.size() == NumConstant.ONE) { + pid.put(deptScoreAvgList.get(NumConstant.ZERO).getAgencyId(),deptScoreAvgList.get(NumConstant.ZERO).getParentId()); + sizeOne(deptScoreAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); + return; + } else if (deptScoreAvgList.size() > NumConstant.ONE) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(deptScoreAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> governAvg = ListUtils.partition(deptScoreAvgList, IndexCalConstant.PAGE_SIZE); + governAvg.forEach(avg -> { + List index1SampleValues = new ArrayList<>(); + avg.forEach(c -> { + pid.put(c.getAgencyId(),c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + 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); + indexInputVOS.add(index1VO); + }); + } + }else{ + // TODO 治理能力暂无自身级别 + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), pid); + deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); + return true; + } + + /** + * @param customerId + * @param monthId + * @Description 全区服务能力 + * @author zxc + * @date 2020/8/31 1:38 下午 + */ + public Boolean districtServiceAbilityCalculate(String customerId, String monthId) { + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return false; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + detailListByParentCode.forEach(detail -> { + String indexCode = detail.getIndexCode(); + if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { + List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); + if (subStreetAvgList.size() == NumConstant.ONE) { + pid.put(subStreetAvgList.get(NumConstant.ZERO).getAgencyId(),subStreetAvgList.get(NumConstant.ZERO).getParentId()); + sizeOne(subStreetAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); + return; + } else if (subStreetAvgList.size() > NumConstant.ONE) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subStreetAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> serviceAvgList = ListUtils.partition(subStreetAvgList, IndexCalConstant.PAGE_SIZE); + serviceAvgList.forEach(serviceAvg -> { + BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + List index1SampleValues = new ArrayList<>(); + serviceAvg.forEach(c -> { + pid.put(c.getAgencyId(),c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + indexInputVOS.add(index1VO); + }); + } + } else { + // todo 暂时没有自身级别 + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); + deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); + return true; + } + + /** + * @param customerId + * @param monthId + * @Description 区相关计算 + * @author zxc + * @date 2020/9/1 9:21 上午 + */ + public Boolean districtRelate(String customerId, String monthId) { + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); + List agencyScoreList = agencyScoreDao.selectAgencyScoreInfo(customerId, monthId, IndexCalConstant.DISTRICT_LEVEL); + detailListByParentCode.forEach(detail -> { + agencyScoreList.forEach(community -> { + if (detail.getIndexCode().equals(community.getIndexCode())) { + community.setScore(community.getScore().multiply(detail.getWeight())); + } + }); + }); + Map> collect = agencyScoreList.stream().collect(Collectors.groupingBy(AgencyScoreDTO::getAgencyId)); + List result = new ArrayList<>(); + collect.forEach((key, value) -> { + AgencyScoreDTO score = new AgencyScoreDTO(); + score.setIsTotal(NumConstant.ONE_STR); + score.setCustomerId(customerId); + score.setAgencyId(key); + score.setMonthId(monthId); + score.setYearId(DateUtils.getYearId(monthId)); + score.setQuarterId(DateUtils.getQuarterId(monthId)); + score.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode()); + value.forEach(community -> { + score.setScore(score.getScore().add(community.getScore())); + score.setParentAgencyId(community.getParentAgencyId()); + }); + result.add(score); + }); + deleteAndInsert(customerId, monthId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), result); + return true; + } + + /** + * @param list + * @Description BigDecimal类型获取最大数和最小数 + * @author zxc + * @date 2020/8/27 1:30 下午 + */ + public MaxAndMinBigDecimalResultDTO getMaxAndMinBigDecimal(List list) { + BigDecimal max = Collections.max(list); + BigDecimal min = Collections.min(list); + MaxAndMinBigDecimalResultDTO result = new MaxAndMinBigDecimalResultDTO(); + result.setMax(max); + result.setMin(min); + return result; + } + + /** + * @param customerId + * @param monthId + * @param indexCode + * @param subAllDistrict + * @Description 先删除记录,在插入 + * @author zxc + * @date 2020/9/1 4:24 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void deleteAndInsert(String customerId, String monthId, String indexCode, List subAllDistrict) { + if (!CollectionUtils.isEmpty(subAllDistrict)) { + agencyScoreDao.deleteOldRecord(customerId, monthId, indexCode,IndexCalConstant.DISTRICT_LEVEL); + System.err.println(subAllDistrict.size()); + agencyScoreDao.insertStreetRecord(subAllDistrict); + } + } + + /** + * @Description + * @param scoreCountOfSampleId 指标计算结果 + * @param customerId 客户ID + * @param monthId 月份ID + * @param isTotal 是否 总分【党建+治理+服务】 + * @param indexCode 党建能力:dangjiannengli,治理能力:zhilinengli,服务能力:fuwunengli,xx相关:xx相关 + * @author zxc + * @date 2020/9/2 2:37 下午 + */ + public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode,Map pid) { + List result = new ArrayList<>(); + scoreCountOfSampleId.forEach((k, v) -> { + AgencyScoreDTO score = new AgencyScoreDTO(); + score.setCustomerId(customerId); + score.setAgencyId(k); + score.setMonthId(monthId); + score.setQuarterId(DateUtils.getQuarterId(monthId)); + score.setYearId(DateUtils.getYearId(monthId)); + score.setIsTotal(isTotal); + score.setIndexCode(indexCode); + score.setScore(v); + score.setDataType(IndexCalConstant.DISTRICT_LEVEL); + pid.forEach((agency,parentAgency) -> { + if (k.equals(agency)){ + score.setParentAgencyId(parentAgency); + } + }); + result.add(score); + }); + return result; + } + + /** + * @Description 当查询结果为一条时,调用此方法 + * @param agencyId + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/2 2:40 下午 + */ + public void sizeOne(String agencyId,String customerId,String monthId,String indexCode,Map pid){ + HashMap scoreCountOfSampleId = new HashMap<>(); + scoreCountOfSampleId.put(agencyId,new BigDecimal(NumConstant.FIFTY)); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, indexCode,pid); + deleteAndInsert(customerId, monthId, indexCode, result); + } +} 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 e3890fa9b2..473b7c7ccb 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 @@ -338,7 +338,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ */ public Boolean streetRelate(String customerId, String monthId) { List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); - List agencyScoreList = agencyScoreDao.selectStreetInfo(customerId, monthId, IndexCalConstant.STREET_LEVEL); + List agencyScoreList = agencyScoreDao.selectAgencyScoreInfo(customerId, monthId, IndexCalConstant.STREET_LEVEL); detailListByParentCode.forEach(detail -> { agencyScoreList.forEach(community -> { if (detail.getIndexCode().equals(community.getIndexCode())) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml index b472801ad9..179fd5c9eb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml @@ -63,7 +63,7 @@ - SELECT CUSTOMER_ID, AGENCY_ID, @@ -83,4 +83,23 @@ AND INDEX_CODE != "jiedaoxiangguan" AND data_type = #{dataType} + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml index a528c94f95..8e01fb1e52 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml @@ -21,4 +21,26 @@ ORDER BY DEPT_ID + + + From a48974578407c130a4f448219dc43d4c0ad07e13 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 4 Sep 2020 15:18:25 +0800 Subject: [PATCH 194/226] =?UTF-8?q?=E5=8C=BA=E7=9B=B4=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/indexcal/impl/DeptScoreServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) 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 59b6127b77..52ea21e80a 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 @@ -18,11 +18,13 @@ package com.epmet.service.evaluationindex.indexcal.impl; import com.alibaba.fastjson.JSON; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; 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.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyDao; @@ -63,6 +65,7 @@ import java.util.Map; * @author generator generator@elink-cn.com * @since v1.0.0 2020-09-02 */ +@DataSource(DataSourceConstant.EVALUATION_INDEX) @Slf4j @Service public class DeptScoreServiceImpl extends BaseServiceImpl implements DeptScoreService { From dabb4e18d06173f9394e16004f44363ed98a05a2 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 4 Sep 2020 15:22:12 +0800 Subject: [PATCH 195/226] =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=8E=88=E6=9D=83=20?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=20=E6=89=AB=E7=A0=81=E6=8E=88=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java index 4d62fcc95d..c0d11dca5b 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java @@ -43,8 +43,8 @@ public interface WxMaCodeConstant { * 上面url为扫码形式 * 下面注释url为按钮形式 */ -// String API_AUTH_REGISTER_URL = "https://mp.weixin.qq.com/cgi-bin/componentloginpage?component_appid=%s&pre_auth_code=%s&redirect_uri=%s"; - String API_AUTH_REGISTER_URL = "https://mp.weixin.qq.com/safe/bindcomponent?action=bindcomponent&auth_type=3&no_scan=1&component_appid=%s&pre_auth_code=%s&redirect_uri=%s&auth_type=3#wechat_redirect"; + String API_AUTH_REGISTER_URL = "https://mp.weixin.qq.com/cgi-bin/componentloginpage?component_appid=%s&pre_auth_code=%s&redirect_uri=%s"; +// String API_AUTH_REGISTER_URL = "https://mp.weixin.qq.com/safe/bindcomponent?action=bindcomponent&auth_type=3&no_scan=1&component_appid=%s&pre_auth_code=%s&redirect_uri=%s&auth_type=3#wechat_redirect"; /** * 创建开放平台帐号并绑定公众号/小程序 From 6f2cb95f273e52f9af1e7b1cf0ea1d16d439a99a Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 4 Sep 2020 15:23:04 +0800 Subject: [PATCH 196/226] =?UTF-8?q?third=E6=9C=8D=E5=8A=A1=E5=8D=87?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-third-server/deploy/docker-compose-dev.yml | 2 +- .../epmet-third-server/deploy/docker-compose-prod.yml | 2 +- epmet-module/epmet-third/epmet-third-server/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml index 60b8743393..d9ab7469c0 100644 --- a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-third-server: container_name: epmet-third-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.140 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.141 ports: - "8110:8110" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml index 332cf74116..7d3cbbf9c4 100644 --- a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-third-server: container_name: epmet-third-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-third-server:0.0.140 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-third-server:0.0.141 ports: - "8110:8110" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-third/epmet-third-server/pom.xml b/epmet-module/epmet-third/epmet-third-server/pom.xml index 493388ea59..e6fa7ad473 100644 --- a/epmet-module/epmet-third/epmet-third-server/pom.xml +++ b/epmet-module/epmet-third/epmet-third-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.0.140 + 0.0.141 com.epmet From bf1870f388b0ad5441c88a14d0f2bf16c5429603 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 4 Sep 2020 15:27:34 +0800 Subject: [PATCH 197/226] =?UTF-8?q?=E4=BA=BA=E5=91=98=E8=B0=83=E5=8A=A8?= =?UTF-8?q?=E5=AF=B9=E8=87=AA=E5=B7=B1=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/commons/tools/exception/EpmetErrorCode.java | 1 + .../src/main/java/com/epmet/service/impl/StaffServiceImpl.java | 3 +++ 2 files changed, 4 insertions(+) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index d6ca03a428..41cd185cc7 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -79,6 +79,7 @@ public enum EpmetErrorCode { GRID_COUNT_UP(8407,"您的创建网格数量已到达上限,请联系管理员设置"), EXIT_PEND_PROJECT(8408,"该工作人员有项目尚在处理,处理完毕方可操作"), EXIT_PUBLISHED_ACTIVITY(8409,"该工作人员有活动尚在进行,等活动完成方可操作"), + CAN_NOT_SELF(8410,"无法对自己进行操作"), ALREADY_EVALUATE(8501,"您已评价"), ALREADY_VOTE(8502,"您已表态"), diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java index 9cae28ab76..c51ef0b513 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java @@ -194,6 +194,9 @@ public class StaffServiceImpl implements StaffService { @Override @Transactional(rollbackFor = Exception.class) public void staffTransfer(TokenDto tokenDto, StaffTransferFormDTO fromDTO) { + if (tokenDto.getUserId().equals(fromDTO.getStaffId())) { + throw new RenException(EpmetErrorCode.CAN_NOT_SELF.getCode()); + } //1.获取工作人员与机关关系 CustomerStaffAgencyDTO staffAgencyDTO = customerStaffAgencyService.getInfoByUserId(fromDTO.getStaffId()); String oldAgency = staffAgencyDTO.getAgencyId(); From b9ece9bf470e5116f0c90e9feca1759fe5d5942d Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 4 Sep 2020 16:11:25 +0800 Subject: [PATCH 198/226] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcal/impl/IndexCalculateCommunityServiceImpl.java | 7 +++++++ 1 file changed, 7 insertions(+) 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 1d7b37a78d..349167c112 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 @@ -1,6 +1,7 @@ package com.epmet.service.evaluationindex.indexcal.impl; import com.alibaba.druid.util.StringUtils; +import com.alibaba.fastjson.JSON; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.RenException; @@ -139,7 +140,9 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni } }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + log.info("communityPartyCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + log.info("communityPartyCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreCountOfSampleId)); List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); return true; @@ -216,7 +219,9 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni } }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + log.info("communityGovernAbilityCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + log.info("communityGovernAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreCountOfSampleId)); List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); return true; @@ -293,7 +298,9 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni } }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + log.info("communityServiceAbilityCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + log.info("communityServiceAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreCountOfSampleId)); List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); return true; From 8269770456ae2a77b099dbd416d222d080a3cb9e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 4 Sep 2020 16:51:52 +0800 Subject: [PATCH 199/226] =?UTF-8?q?=E9=9A=BE=E7=82=B9=E5=A0=B5=E7=82=B9?= =?UTF-8?q?=E3=80=81=E5=85=9A=E5=BB=BA=E8=83=BD=E5=8A=9B=E3=80=81=E5=85=9A?= =?UTF-8?q?=E5=91=98=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GridPartyMemberDataDetailFormDTO.java | 96 ++++++++++++++++ .../form/GridPartyMemberDataFormDTO.java | 77 +------------ .../form/DifficultyDataDetailFormDTO.java | 105 ++++++++++++++++++ .../form/DifficultyDataFormDTO.java | 90 +-------------- .../FactIndexCollectController.java | 7 +- .../controller/ScreenCollController.java | 4 +- .../FactIndexPartyAblityCpcMonthlyDao.java | 17 +-- .../screen/ScreenDifficultyDataDao.java | 9 +- .../indexcoll/FactIndexCollectService.java | 2 +- .../impl/FactIndexCollectServiceImpl.java | 19 ++-- .../screen/ScreenCollService.java | 2 +- .../screen/impl/ScreenCollServiceImpl.java | 15 +-- .../FactIndexPartyAblityCpcMonthlyDao.xml | 7 +- .../screen/ScreenDifficultyDataDao.xml | 2 +- 14 files changed, 251 insertions(+), 201 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataDetailFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataDetailFormDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataDetailFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataDetailFormDTO.java new file mode 100644 index 0000000000..364b19c34f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataDetailFormDTO.java @@ -0,0 +1,96 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 1、党建能力-党员相关指标上报(按照月份) 入参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/4 16:04 + */ +@Data +public class GridPartyMemberDataDetailFormDTO implements Serializable { + private static final long serialVersionUID = 2923515319015973995L; + /** + * 机关id:网格所属的组织id + */ + private String agencyId; + + /** + * 网格id + */ + private String gridId; + + /** + * yyyyMM + */ + private String monthId; + + /** + * yyyyQ1, yyyyQ2, yyyyQ3, yyyyQ4 + */ + private String quarterId; + + /** + * yyyy + */ + private String yearId; + + /** + * 党员提出的话题数 + */ + private Integer createTopicCount; + + /** + * 党员参与话题数(支持,反对,评论,浏览) + */ + private Integer joinTopicCount; + + /** + * 话题转议题数 + */ + private Integer shiftIssueCount; + + /** + * 议题转项目数 + */ + private Integer shiftProjectCount; + + /** + * 参加三会一课次数 + */ + private Integer joinThreeMeetsCount; + + /** + * 自建群群众人数 + */ + private Integer groupUserCount; + + /** + * 自建群活跃度-话题数 + */ + private Integer groupTopicCount; + + /** + * 议题转项目率 + */ + private BigDecimal topicToIssueRatio; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 党员自建群活跃群众人数(08-24) + */ + private Integer groupActiveUserCount; + + /** + * 用户id + */ + private String userId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java index 3c7c7a5141..5a0a9fb3c8 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java @@ -3,8 +3,11 @@ package com.epmet.dto.indexcollect.form; import lombok.Data; import org.apache.poi.hpsf.Decimal; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; import java.math.BigDecimal; +import java.util.List; /** * 1、党建能力-党员相关指标上报(按照月份) 入参 @@ -17,82 +20,14 @@ public class GridPartyMemberDataFormDTO implements Serializable { private static final long serialVersionUID = 1L; /** - * 机关id:网格所属的组织id + * 当为true时后台将删除本月数据 */ - private String agencyId; - - /** - * 网格id - */ - private String gridId; + private Boolean isFirst; /** * yyyyMM */ private String monthId; - /** - * yyyyQ1, yyyyQ2, yyyyQ3, yyyyQ4 - */ - private String quarterId; - - /** - * yyyy - */ - private String yearId; - - /** - * 党员提出的话题数 - */ - private Integer createTopicCount; - - /** - * 党员参与话题数(支持,反对,评论,浏览) - */ - private Integer joinTopicCount; - - /** - * 话题转议题数 - */ - private Integer shiftIssueCount; - - /** - * 议题转项目数 - */ - private Integer shiftProjectCount; - - /** - * 参加三会一课次数 - */ - private Integer joinThreeMeetsCount; - - /** - * 自建群群众人数 - */ - private Integer groupUserCount; - - /** - * 自建群活跃度-话题数 - */ - private Integer groupTopicCount; - - /** - * 议题转项目率 - */ - private BigDecimal topicToIssueRatio; - - /** - * 上级组织Id - */ - private String parentId; - - /** - * 党员自建群活跃群众人数(08-24) - */ - private Integer groupActiveUserCount; - - /** - * 用户id - */ - private String userId; + private List partyMemberDataList; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataDetailFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataDetailFormDTO.java new file mode 100644 index 0000000000..ab77a2363c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataDetailFormDTO.java @@ -0,0 +1,105 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/4 15:43 + */ +@Data +public class DifficultyDataDetailFormDTO implements Serializable { + private static final long serialVersionUID = 4893795146396420078L; + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 事件原Id + */ + private String eventId; + + /** + * 事件图片 URL + */ + private String eventImgUrl; + + /** + * 事件来源 eg: XXX街道-xx社区-网格 + */ + private String eventSource; + + /** + * 事件内容 + */ + private String eventContent; + + /** + * 事件耗时单位:分钟 + */ + private Integer eventCostTime; + + /** + * 事件设计部门数 + */ + private Integer eventReOrg; + + /** + * 事件类别编码 + */ + private String eventCategoryCode; + + /** + * 事件状态编码 + */ + private String eventStatusCode; + + /** + * 事件类别名称 + */ + private String eventCategoryName; + + /** + * 事件状态描述 + */ + private String eventStatusDesc; + + /** + * 最近一次操作说明 eg: 转项目,结案,流转 + */ + private String latestOperateDesc; + + /** + * 事件被处理次数(08-21新增) + */ + private Integer eventHandledCount; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java index e446e073a3..a0de181acb 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.screencoll.form; import lombok.Data; import java.io.Serializable; +import java.util.List; /** * 3、难点赌点 入参 @@ -11,96 +12,15 @@ import java.io.Serializable; */ @Data public class DifficultyDataFormDTO implements Serializable { - private static final long serialVersionUID = 1L; - /** - * 组织类别 agency:组织;部门:department;网格:grid + * 当为true时后台将删除本月数据 */ - private String orgType; + private Boolean isFirst; /** - * 组织Id 可以为网格,机关id + * 难点堵点数据 */ - private String orgId; + private List diffcultyDataList; - /** - * 上级组织Id - */ - private String parentId; - - /** - * 组织名称 - */ - private String orgName; - - /** - * 事件原Id - */ - private String eventId; - - /** - * 事件图片 URL - */ - private String eventImgUrl; - - /** - * 事件来源 eg: XXX街道-xx社区-网格 - */ - private String eventSource; - - /** - * 事件内容 - */ - private String eventContent; - - /** - * 事件耗时单位:分钟 - */ - private Integer eventCostTime; - - /** - * 事件设计部门数 - */ - private Integer eventReOrg; - - /** - * 事件类别编码 - */ - private String eventCategoryCode; - - /** - * 事件状态编码 - */ - private String eventStatusCode; - - /** - * 事件类别名称 - */ - private String eventCategoryName; - - /** - * 事件状态描述 - */ - private String eventStatusDesc; - - /** - * 最近一次操作说明 eg: 转项目,结案,流转 - */ - private String latestOperateDesc; - - /** - * 事件被处理次数(08-21新增) - */ - private Integer eventHandledCount; - - /** - * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) - */ - private String dataEndTime; - - /** - * 所有上级ID,用英文逗号分开(8.26新增) - */ - private String allParentIds; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java index 82966dbe82..9dbe0a82fb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java @@ -33,10 +33,11 @@ public class FactIndexCollectController { * @Author zhangyong * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth +// @ExternalAppRequestAuth @PostMapping("gridpartymemberdata") - public Result gridPartyMemberData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - factIndexCollectService.insertGridPartyMemberData(formDTO, externalAppRequestParam.getCustomerId()); + public Result gridPartyMemberData(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridPartyMemberDataFormDTO formDTO) { + + factIndexCollectService.insertGridPartyMemberData(formDTO,"b09527201c4409e19d1dbc5e3c3429a1" );//externalAppRequestParam.getCustomerId() return new Result(); } 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/ScreenCollController.java index 99ba483433..b3b482269d 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/ScreenCollController.java @@ -133,8 +133,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("difficultydata") - public Result difficultyData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertDifficultyData(formDTO, externalAppRequestParam.getCustomerId()); + public Result difficultyData(ExternalAppRequestParam externalAppRequestParam, @RequestBody DifficultyDataFormDTO formDTO) { + screenCollService.insertDifficultyData(formDTO, "b09527201c4409e19d1dbc5e3c3429a1");//externalAppRequestParam.getCustomerId() return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java index c23bf91b4c..ffdc533581 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.evaluationindex.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.GridPartyMemberDataDetailFormDTO; import com.epmet.dto.indexcollect.form.GridPartyMemberDataFormDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; import org.apache.ibatis.annotations.Mapper; @@ -40,22 +41,12 @@ public interface FactIndexPartyAblityCpcMonthlyDao extends BaseDao list, + int batchInsertFactIndexPartyAblityCpcMonthly(@Param("list") List list, @Param("customerId") String customerId); List> getCountByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("offset") Integer offset, @Param("pageSize") Integer pageSize); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java index 21eaa80280..412ab70225 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.DifficultyDataDetailFormDTO; import com.epmet.dto.screencoll.form.DifficultyDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import org.apache.ibatis.annotations.Mapper; @@ -38,14 +39,10 @@ public interface ScreenDifficultyDataDao extends BaseDao list, @Param("customerId")String customerId); + void batchInsertDifficultyData(@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/indexcoll/FactIndexCollectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexCollectService.java index 8f6197ffcd..e88e5d55a3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexCollectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexCollectService.java @@ -22,7 +22,7 @@ public interface FactIndexCollectService { * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void insertGridPartyMemberData(List formDTO, String customerId); + void insertGridPartyMemberData(GridPartyMemberDataFormDTO formDTO, String customerId); /** * 2、党建能力-网格相关指标上报(按照月份) 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 26c725cf4d..49415544b0 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 @@ -22,6 +22,7 @@ import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.util.ArrayList; @@ -75,14 +76,16 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertGridPartyMemberData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - factIndexPartyAblityCpcMonthlyDao.deleteFactIndexPartyAblityCpcMonthly(customerId, - formDTO.get(i).getAgencyId(), formDTO.get(i).getGridId(), formDTO.get(i).getUserId(), - formDTO.get(i).getYearId(), formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); - } - factIndexPartyAblityCpcMonthlyDao.batchInsertFactIndexPartyAblityCpcMonthly(formDTO, customerId); + public void insertGridPartyMemberData(GridPartyMemberDataFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + //删除这个客户这个月的数据 + int deleteNum; + do { + deleteNum = factIndexPartyAblityCpcMonthlyDao.deleteFactIndexPartyAblityCpcMonthly(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (null != formDTO && !CollectionUtils.isEmpty(formDTO.getPartyMemberDataList())) { + factIndexPartyAblityCpcMonthlyDao.batchInsertFactIndexPartyAblityCpcMonthly(formDTO.getPartyMemberDataList(), customerId); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCollService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCollService.java index d499b86c08..1e6dca0080 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCollService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCollService.java @@ -100,7 +100,7 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertDifficultyData(List formDTO, String customerId); + void insertDifficultyData(DifficultyDataFormDTO formDTO, String customerId); /** * 2、党员基本情况 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 0b205efb5a..6018622deb 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 @@ -30,6 +30,7 @@ import com.epmet.service.evaluationindex.screen.ScreenCollService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.util.ArrayList; @@ -198,13 +199,13 @@ public class ScreenCollServiceImpl implements ScreenCollService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertDifficultyData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - screenDifficultyDataDao.deleteDifficultyData(customerId, formDTO.get(i).getEventId(), formDTO.get(i).getOrgId()); - } - - screenDifficultyDataDao.batchInsertDifficultyData(formDTO, customerId); + public void insertDifficultyData(DifficultyDataFormDTO formDTO, String customerId) { + if(formDTO.getIsFirst()){ + //直接删除当前客户下所有的数据 + screenDifficultyDataDao.deleteDifficultyData(customerId); + } + if (null != formDTO && !CollectionUtils.isEmpty(formDTO.getDiffcultyDataList())){ + screenDifficultyDataDao.batchInsertDifficultyData(formDTO.getDiffcultyDataList(), customerId); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml index 05d4b206a3..8336f33e9a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml @@ -3,10 +3,11 @@ - + delete from fact_index_party_ablity_cpc_monthly - where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} AND USER_ID = #{userId} - AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} + where CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + limit 1000 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml index cfeba4c7b7..051f14cbcf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml @@ -5,7 +5,7 @@ delete from screen_difficulty_data - where CUSTOMER_ID = #{customerId} AND EVENT_ID = #{eventId} AND ORG_ID = #{orgId} + where CUSTOMER_ID = #{customerId} From da10ffe6b6052e66c402e1867fe6fede67b9c917 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 4 Sep 2020 17:00:10 +0800 Subject: [PATCH 200/226] =?UTF-8?q?=E9=9A=BE=E7=82=B9=E5=A0=B5=E7=82=B9?= =?UTF-8?q?=E3=80=81=E5=85=9A=E5=BB=BA=E8=83=BD=E5=8A=9B=E3=80=81=E5=85=9A?= =?UTF-8?q?=E5=91=98=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= =?UTF-8?q?v2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/FactIndexCollectController.java | 5 ++--- .../main/java/com/epmet/controller/ScreenCollController.java | 2 +- .../indexcoll/impl/FactIndexCollectServiceImpl.java | 3 ++- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java index 9dbe0a82fb..138ab5cbb7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java @@ -33,11 +33,10 @@ public class FactIndexCollectController { * @Author zhangyong * @Date 10:52 2020-08-20 **/ -// @ExternalAppRequestAuth + @ExternalAppRequestAuth @PostMapping("gridpartymemberdata") public Result gridPartyMemberData(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridPartyMemberDataFormDTO formDTO) { - - factIndexCollectService.insertGridPartyMemberData(formDTO,"b09527201c4409e19d1dbc5e3c3429a1" );//externalAppRequestParam.getCustomerId() + factIndexCollectService.insertGridPartyMemberData(formDTO,externalAppRequestParam.getCustomerId() ); return new Result(); } 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/ScreenCollController.java index b3b482269d..d83f8df3c5 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/ScreenCollController.java @@ -134,7 +134,7 @@ public class ScreenCollController { @ExternalAppRequestAuth @PostMapping("difficultydata") public Result difficultyData(ExternalAppRequestParam externalAppRequestParam, @RequestBody DifficultyDataFormDTO formDTO) { - screenCollService.insertDifficultyData(formDTO, "b09527201c4409e19d1dbc5e3c3429a1");//externalAppRequestParam.getCustomerId() + screenCollService.insertDifficultyData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } 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 49415544b0..715bc56b0f 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 @@ -16,9 +16,9 @@ import com.epmet.dto.screen.FactIndexCommunityScoreDTO; import com.epmet.dto.screen.FactIndexGridScoreDTO; import com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity; -import com.epmet.entity.evaluationindex.screen.ScreenIndexDataMonthlyEntity; import com.epmet.eum.IndexCodeEnum; import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -34,6 +34,7 @@ import java.util.stream.Collectors; * @Auther: zhangyong * @Date: 2020-08-20 10:05 */ +@Slf4j @Service @DataSource(DataSourceConstant.EVALUATION_INDEX) public class FactIndexCollectServiceImpl implements FactIndexCollectService { From 70fcf916d328faed8084660a8881a55592c26b8a Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 4 Sep 2020 17:03:24 +0800 Subject: [PATCH 201/226] OPER_EXT_APP_SECRET_RESET_FAIL 8713 --- .../java/com/epmet/commons/tools/exception/EpmetErrorCode.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index f12983016b..7b198800c8 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -104,7 +104,7 @@ public enum EpmetErrorCode { OPER_EXTERNAL_APP_AUTH_ERROR(8709, "外部应用认证失败"), OPER_EXTERNAL_CUSTOMER_NOT_EXISTS(8710, "该客户不存在"), OPER_EXTERNAL_APP_EXISTS(8711, "应用已存在"), - OPER_EXT_APP_SECRET_RESET_FAIL(8712, "秘钥更新失败"), + OPER_EXT_APP_SECRET_RESET_FAIL(8713, "秘钥更新失败"), // 党建声音 前端提示 88段 DRAFT_CONTENT_IS_NULL(8801, "至少需要添加一个段落"), From 945ab756f0dfea4ca27777062864f9228f77b802 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 4 Sep 2020 17:19:47 +0800 Subject: [PATCH 202/226] =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/FactIndexGridScoreDao.java | 18 ------------------ .../IndexCalculateCommunityServiceImpl.java | 4 ++++ 2 files changed, 4 insertions(+), 18 deletions(-) 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 index 8a8a1f8a38..5f43635941 100644 --- 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 @@ -46,24 +46,6 @@ public interface FactIndexGridScoreDao extends BaseDao */ List selectSubGridAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); - /** - * @Description 社区下属所有网格治理能力汇总平均值 - * @param customerId - * @param monthId - * @author zxc - * @date 2020/8/31 9:19 上午 - */ - List selectSubGridGovernAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId); - - /** - * @Description 社区下级所有网格服务能力得分平均值 - * @param customerId - * @param monthId - * @author zxc - * @date 2020/8/31 1:51 下午 - */ - List selectSubGridServiceAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId); - /** * 根据入参查询 网格相关分值记录 * @param 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 349167c112..afde8592af 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 @@ -166,6 +166,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode().equals(detail.getIndexCode())) { List subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(subGridGovernAvg)){ + log.error("社区下级治理能力平均分集合为空"); + return; + } if (subGridGovernAvg.size() == NumConstant.ONE) { pid.put(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),subGridGovernAvg.get(NumConstant.ZERO).getParentId()); sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); From e5be626a933729aa660725f4bdb15665520ea439 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Fri, 4 Sep 2020 18:24:02 +0800 Subject: [PATCH 203/226] =?UTF-8?q?Merge=20branch=20'dev=5Fscreen=5Fdata'?= =?UTF-8?q?=20of=20C:\Users\Administrator\Desktop\=E5=85=9A=E7=BE=A4e?= =?UTF-8?q?=E4=BA=8B=E9=80=9A=E5=90=8E=E7=AB=AF=20with=20conflicts.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/screen/FactIndexGridScoreDTO.java | 10 + .../indexcal/AgencyScoreDao.java | 22 + .../indexcal/DeptScoreDao.java | 22 +- .../screen/FactIndexCommunityScoreDao.java | 22 +- .../screen/FactIndexGridScoreDao.java | 23 +- .../screen/ScreenCustomerAgencyDao.java | 10 + .../screen/ScreenCustomerDeptDao.java | 13 +- .../screen/ScreenCustomerGridDao.java | 12 + .../screen/ScreenIndexDataMonthlyDao.java | 12 + .../impl/FactIndexCollectServiceImpl.java | 477 ++++++++++++++++-- .../indexcal/AgencyScoreDao.xml | 61 ++- .../evaluationindex/indexcal/DeptScoreDao.xml | 55 ++ .../screen/FactIndexCommunityScoreDao.xml | 55 ++ .../screen/FactIndexGridScoreDao.xml | 57 +++ .../screen/ScreenCustomerAgencyDao.xml | 20 + .../screen/ScreenCustomerDeptDao.xml | 18 + .../screen/ScreenCustomerGridDao.xml | 19 + .../screen/ScreenIndexDataMonthlyDao.xml | 19 + 18 files changed, 891 insertions(+), 36 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java index 4d26f40f48..d5be2db6e9 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java @@ -54,6 +54,16 @@ public class FactIndexGridScoreDTO implements Serializable { */ private String gridId; + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + /** * 月维度Id: yyyyMM */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java index b30d2751d1..72c11ee8ac 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcal.AgencyScoreDTO; import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; import com.epmet.entity.evaluationindex.indexcal.AgencyScoreEntity; +import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -81,4 +82,25 @@ public interface AgencyScoreDao extends BaseDao { * @Date 10:43 2020-09-03 **/ List selectListAgencyScore(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * 批量插入区/街道相关分数表 + * + * @param list + * @param customerId + * @return void + * @Author zhangyong + * @Date 11:11 2020-09-04 + **/ + void batchInsertAgencyScoreData(@Param("list") List list, @Param("customerId")String customerId); + + /** + * 根据入参查询 区/街道相关分数表id + * @param customerId + * @param monthId + * @return java.util.List + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListAgencyId(@Param("customerId")String customerId, @Param("monthId")String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java index b77849a5d5..bd4a483062 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java @@ -19,7 +19,6 @@ package com.epmet.dao.evaluationindex.indexcal; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcal.DeptScoreDTO; -import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -45,6 +44,27 @@ public interface DeptScoreDao extends BaseDao { **/ List selectListDeptScore(@Param("customerId")String customerId, @Param("monthId")String monthId); + /** + * 批量插入 区直部门分值表 + * + * @param list + * @param customerId + * @return void + * @Author zhangyong + * @Date 11:11 2020-09-04 + **/ + void batchInsertDeptScoreData(@Param("list") List list, @Param("customerId")String customerId); + + /** + * 根据入参查询 区直部门分值表id + * @param customerId + * @param monthId + * @return java.lang.String + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListDeptId(@Param("customerId")String customerId, @Param("monthId")String monthId); + /** * @Description 所有直属部门治理能力平均值 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/screen/FactIndexCommunityScoreDao.java index a6060a2bf7..40fd49e6ab 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/screen/FactIndexCommunityScoreDao.java @@ -18,8 +18,6 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.indexcal.SubCommunityGovernAvgResultDTO; -import com.epmet.dto.indexcal.SubCommunityPartyAvgResultDTO; import com.epmet.dto.indexcal.SubCommunityAvgResultDTO; import com.epmet.dto.screen.FactIndexCommunityScoreDTO; import com.epmet.entity.evaluationindex.screen.FactIndexCommunityScoreEntity; @@ -82,4 +80,24 @@ public interface FactIndexCommunityScoreDao extends BaseDao selectSubCommAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + /** + * 批量插入 社区相关分数表 + * + * @param list + * @param customerId + * @return void + * @Author zhangyong + * @Date 11:11 2020-09-04 + **/ + void batchInsertCommunityScoreData(@Param("list") List list, @Param("customerId")String customerId); + + /** + * 根据入参查询 查询社区id + * @param customerId + * @param monthId + * @return java.util.List + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListCommunityId(@Param("customerId")String customerId, @Param("monthId")String monthId); } 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 index 5f43635941..77c3f85366 100644 --- 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 @@ -19,9 +19,7 @@ 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.SubGridGovernAvgResultDTO; import com.epmet.dto.screen.result.SubGridAvgResultDTO; -import com.epmet.dto.screen.result.SubGridServiceAvgResultDTO; import com.epmet.entity.evaluationindex.screen.FactIndexGridScoreEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -55,4 +53,25 @@ public interface FactIndexGridScoreDao extends BaseDao * @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/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index 20147e0f82..ea9e977207 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -66,4 +66,14 @@ public interface ScreenCustomerAgencyDao extends BaseDao + * @Author zhangyong + * @Date 14:38 2020-09-04 + **/ + List selectListMismatcAgencyInfo(@Param("customerId")String customerId, @Param("agencyIds") String[] agencyIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java index 7cfb17110c..a6f251251a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java @@ -22,7 +22,6 @@ import com.epmet.dto.screencoll.form.CustomerDeptFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; -import org.springframework.web.bind.annotation.PostMapping; import java.util.List; @@ -77,4 +76,16 @@ public interface ScreenCustomerDeptDao extends BaseDao * @Date 2020/9/3 16:32 **/ ScreenCustomerDeptEntity selectParentAgencyId(@Param("customerId") String customerId, @Param("deptId") String deptId); + + /** + * 返回当前客户下,未匹配到的区直部门信息 + * + * @param customerId + * @param deptIds + * @return java.util.List + * @Author zhangyong + * @Date 10:45 2020-09-04 + **/ + List selectListMismatchDeptInfo(@Param("customerId") String customerId, + @Param("deptIds") String[] deptIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java index 0d9a6420f9..d07d9aff46 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java @@ -104,4 +104,16 @@ public interface ScreenCustomerGridDao extends BaseDao * @Date 16:57 2020-09-03 **/ ScreenCustomerGridDTO selectParentGridInfo(@Param("customerId")String customerId, @Param("gridId")String gridId); + + /** + * 返回当前客户下,未匹配到的网格信息 + * + * @param customerId + * @param gridIds + * @return java.util.List + * @Author zhangyong + * @Date 10:45 2020-09-04 + **/ + List selectListMismatchGridInfo(@Param("customerId") String customerId, + @Param("gridIds") String[] gridIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java index a38ff1cbe6..55b4e3ac41 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java @@ -60,4 +60,16 @@ public interface ScreenIndexDataMonthlyDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * 获取今年的各月份的平均值 + * @param customerId + * @param yearId + * @param month + * @return java.util.List + * @Author zhangyong + * @Date 15:51 2020-09-04 + **/ + List selectListIndexDataMonthlyByYear(@Param("customerId") String customerId, + @Param("yearId") String yearId, @Param("month") String month); } 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 715bc56b0f..6f260e44c8 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 @@ -1,7 +1,10 @@ package com.epmet.service.evaluationindex.indexcoll.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.OrgTypeConstant; import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; @@ -15,6 +18,11 @@ import com.epmet.dto.indexcollect.form.*; import com.epmet.dto.screen.FactIndexCommunityScoreDTO; import com.epmet.dto.screen.FactIndexGridScoreDTO; import com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO; +import com.epmet.dto.screencoll.form.IndexDataYearlyFormDTO; +import com.epmet.entity.evaluationindex.indexcal.AgencyScoreEntity; +import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity; +import com.epmet.entity.evaluationindex.screen.FactIndexCommunityScoreEntity; +import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity; import com.epmet.eum.IndexCodeEnum; import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; @@ -207,34 +215,53 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { if (NumConstant.SIX != monthId.length()){ throw new RuntimeException("入参monthId格式不正确:monthId =" + monthId); } - String year = monthId.substring(NumConstant.ZERO, NumConstant.FOUR); - String month = monthId.substring(NumConstant.FOUR, NumConstant.SIX); + // 开始处理 网格相关分值表 + this.startHandleIndexGridScore(monthId, customerId); + // 开始处理 社区相关分值表 + this.startHandleIndexCommunityScore(monthId, customerId); + // 开始处理 区直部门分值表 + this.startHandleIndexDeptScore(monthId, customerId); + // 开始处理 区/街道相关分数表 + this.startHandleIndexAgencyScore(monthId, customerId); - // fact_index_grid_score 网格相关分值记录表 grid - List gridScoreDTOS = factIndexGridScoreDao.selectListGridScore(customerId, monthId); - if (null != gridScoreDTOS && gridScoreDTOS.size() > NumConstant.ZERO){ - this.insertIndexDataMonthlyByGridScore(month, year, customerId, gridScoreDTOS); - } - - // fact_index_community_score 社区相关分数表 agency - List communityScoreDTOS = factIndexCommunityScoreDao.selectListCommunityScore(customerId, monthId); - if (null != communityScoreDTOS && communityScoreDTOS.size() > NumConstant.ZERO){ - this.insertIndexDataMonthlyByCommunityScore(month, year, customerId, communityScoreDTOS); - } - - // fact_index_dept_score 区直部门分值表 department - List deptScoreDTOS = deptScoreDao.selectListDeptScore(customerId, monthId); - if (null != deptScoreDTOS && deptScoreDTOS.size() > NumConstant.ZERO){ - this.insertIndexDataMonthlyByDeptScore(month, year, customerId, deptScoreDTOS); - } + // 根据年,汇总今年各项得到,计算平均值后 插入年表 screen_index_data_yearly + this.insertIndexDataYear(this.getYearStr(monthId), this.getMonthStr(monthId), customerId); + } - // fact_index_agency_score 区/街道相关分数表 agency - List agencyScoreDTOS = agencyScoreDaol.selectListAgencyScore(customerId, monthId); - if (null != agencyScoreDTOS && agencyScoreDTOS.size() > NumConstant.ZERO) { - this.insertIndexDataMonthlyByAgencyScore(month, year, customerId, agencyScoreDTOS); + /** + * 目标:将网格的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) + * 如果网格相关分值表 中的网格数量不全,需要从 网格(党支部)信息表(一) 中,先查询到缺少的网格信息,赋上默认值后,插入网格相关分值表(四)。 + * + * @param monthId + * @param customerId + * @return void + * @Author zhangyong + * @Date 13:44 2020-09-04 + **/ + private void startHandleIndexGridScore(String monthId, String customerId){ + // 查询网格相关分值记录 表已经存在的网格id + List indexGridIds = factIndexGridScoreDao.selectListGridId(customerId, monthId); + if (indexGridIds.size() > NumConstant.ZERO){ + // 根据网格相关分值表 中查询到的网格id,去 网格(党支部)信息表 进行不匹配查询(即返回网格相关分值表 中不存在的网格信息)。 + String[] gridIds = new String[indexGridIds.size()]; + for (int i = NumConstant.ZERO; i < indexGridIds.size(); i++){ + gridIds[i] = indexGridIds.get(i); + } + List mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, gridIds); + // 将 网格相关分值表 中,本月份没有的网格信息,按照 4种类型,各新增一遍,赋默认值 0 + if (mismatchGridList.size() > NumConstant.ZERO){ + this.insertIndexGridScoreDefaultValueFor(monthId, customerId, mismatchGridList); + } + } else { + // 将所有的网格按照 4种类型,各赋一遍默认值 + List mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, null); + this.insertIndexGridScoreDefaultValueFor(monthId, customerId, mismatchGridList); } - - // 插入年表 screen_index_data_yearly + // 开始处理实际分数 + // fact_index_grid_score 网格相关分值记录表 grid + String[] dateArr = yearOrMonth(monthId); + List gridScoreDTOS = factIndexGridScoreDao.selectListGridScore(customerId, monthId); + this.insertIndexDataMonthlyByGridScore(dateArr[NumConstant.ONE], dateArr[NumConstant.ZERO], customerId, gridScoreDTOS); } /** @@ -283,8 +310,37 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { parentGridInfo.getParentAgencyId(), parentGridInfo.getGridName(), monthlyFormDTO); monthlyFormDTOList.add(monthlyFormDTO); } - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, year, month, orgIds); - screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); + if (monthlyFormDTOList.size() > NumConstant.ZERO){ + screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, year, month, orgIds); + screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); + } + } + + private void startHandleIndexCommunityScore(String monthId, String customerId){ + // 查询社区相关分值记录 + List indexCommunityIds = factIndexCommunityScoreDao.selectListCommunityId(customerId, monthId); + if (indexCommunityIds.size() > NumConstant.ZERO){ + // 根据网格相关分值表 中查询到的网格id,去 网格(党支部)信息表 进行不匹配查询(即返回网格相关分值表 中不存在的网格信息)。 + String[] communityIds = new String[indexCommunityIds.size()]; + for (int i = NumConstant.ZERO; i < indexCommunityIds.size(); i++){ + communityIds[i] = indexCommunityIds.get(i); + } + List mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, communityIds); + // 将 社区相关分数表 中,本月份没有的网格信息,按照 4种类型,各新增一遍,赋默认值 0 + if (mismatchAgencyList.size() > NumConstant.ZERO){ + this.insertIndexCommunityScoreDefaultValueFor(monthId, customerId, mismatchAgencyList); + } + } else { + // 将所有的社区按照 4种类型,各赋一遍默认值 + List mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, null); + this.insertIndexCommunityScoreDefaultValueFor(monthId, customerId, mismatchAgencyList); + } + // 开始处理实际分数 + // fact_index_community_score 社区相关分数表 agency + String[] dateArr = yearOrMonth(monthId); + // 查询社区相关分值记录 + List communityScoreDTOS = factIndexCommunityScoreDao.selectListCommunityScore(customerId, monthId); + this.insertIndexDataMonthlyByCommunityScore(dateArr[NumConstant.ONE], dateArr[NumConstant.ZERO], customerId, communityScoreDTOS); } /** @@ -337,8 +393,34 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 补充表中其他字段 monthlyFormDTOList.add(monthlyFormDTO); } - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, year, month, orgIds); - screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); + if (monthlyFormDTOList.size() > NumConstant.ZERO){ + screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, year, month, orgIds); + screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); + } + } + + private void startHandleIndexDeptScore(String monthId, String customerId){ + // 查询社 区直部门分值表 + List indexDeptIds = deptScoreDao.selectListDeptId(customerId, monthId); + if (indexDeptIds.size() > NumConstant.ZERO){ + String[] depeIds = new String[indexDeptIds.size()]; + for (int i = NumConstant.ZERO; i < indexDeptIds.size(); i++){ + depeIds[i] = indexDeptIds.get(i); + } + List mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, depeIds); + if (mismatchDeptList.size() > NumConstant.ZERO){ + this.insertIndexDeptScoreDefaultValueFor(monthId, customerId, mismatchDeptList); + } + } else { + List mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, null); + this.insertIndexDeptScoreDefaultValueFor(monthId, customerId, mismatchDeptList); + } + // 开始处理实际分数 + // fact_index_dept_score 区直部门分值表 department + String[] dateArr = yearOrMonth(monthId); + // 查询社 区直部门分值表 + List deptScoreDTOS = deptScoreDao.selectListDeptScore(customerId, monthId); + this.insertIndexDataMonthlyByDeptScore(dateArr[NumConstant.ONE], dateArr[NumConstant.ZERO], customerId, deptScoreDTOS); } /** @@ -388,6 +470,28 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); } + private void startHandleIndexAgencyScore(String monthId, String customerId){ + List indexAgencyIds = agencyScoreDaol.selectListAgencyId(customerId, monthId); + if (indexAgencyIds.size() > NumConstant.ZERO){ + String[] agencys = new String[indexAgencyIds.size()]; + for (int i = NumConstant.ZERO; i < indexAgencyIds.size(); i++){ + agencys[i] = indexAgencyIds.get(i); + } + List mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, agencys); + if (mismatchAgencyList.size() > NumConstant.ZERO){ + this.insertIndexAgencyScoreDefaultValueFor(monthId, customerId, mismatchAgencyList); + } + } else { + List mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, null); + this.insertIndexAgencyScoreDefaultValueFor(monthId, customerId, mismatchAgencyList); + } + // 开始处理实际分数 + // fact_index_agency_score 区/街道相关分数表 agency + String[] dateArr = yearOrMonth(monthId); + List agencyScoreDTOS = agencyScoreDaol.selectListAgencyScore(customerId, monthId); + this.insertIndexDataMonthlyByAgencyScore(dateArr[NumConstant.ONE], dateArr[NumConstant.ZERO], customerId, agencyScoreDTOS); + } + /** * 将区/街道相关分数表 数据 插入月表 screenIndexDataMonthlyDao * @@ -496,4 +600,319 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } return monthlyFormDTO; } + + /** + * 设置 指数-指数数据(月、年) 表 + * 总指数、党建能力指数、治理能力、服务能力 默认值 0 + * @param monthlyFormDTO + * @return com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO + * @Author zhangyong + * @Date 11:01 2020-09-04 + **/ + private IndexDataMonthlyFormDTO setIndexDefaultValueFor(IndexDataMonthlyFormDTO monthlyFormDTO){ + BigDecimal zero = new BigDecimal(NumConstant.ZERO); + monthlyFormDTO.setIndexTotal(zero); + monthlyFormDTO.setPartyDevAblity(zero); + monthlyFormDTO.setGovernAblity(zero); + return monthlyFormDTO; + } + + /** + * 新增 网格相关分值记录表 默认值,一条网格,按照组织类别的不同 需要插入4次 + * + * @param monthId + * @param customerId + * @param mismatchGridList + * @return void + * @Author zhangyong + * @Date 14:02 2020-09-04 + **/ + private void insertIndexGridScoreDefaultValueFor(String monthId, String customerId, List mismatchGridList){ + String[] dateArr = yearOrMonth(monthId); + List insertIndexGridScoreDTOS = new ArrayList<>(); + for (ScreenCustomerGridDTO gridDTO : mismatchGridList){ + FactIndexGridScoreDTO indexGridScoreDTO = new FactIndexGridScoreDTO(); + // 赋默认值 - 党建能力指数 + indexGridScoreDTO.setGridId(gridDTO.getGridId()); + indexGridScoreDTO.setAgencyId(gridDTO.getParentAgencyId()); + indexGridScoreDTO.setAllParentIds(gridDTO.getAllParentIds()); + //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + indexGridScoreDTO.setQuarterId(DateUtils.getQuarterId(monthId)); + indexGridScoreDTO.setYearId(dateArr[NumConstant.ZERO]); + indexGridScoreDTO.setMonthId(monthId); + indexGridScoreDTO.setIsTotal(NumConstant.ZERO_STR); // 0 or 1 + indexGridScoreDTO.setScore(new BigDecimal(NumConstant.ZERO)); + indexGridScoreDTO.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); // 4种类型 + indexGridScoreDTO.setDelFlag(NumConstant.ZERO_STR); + insertIndexGridScoreDTOS.add(indexGridScoreDTO); + + FactIndexGridScoreDTO indexGridScoreDTO1 = new FactIndexGridScoreDTO(); + // 赋默认值 - 治理能力 + indexGridScoreDTO1.setGridId(gridDTO.getGridId()); + indexGridScoreDTO1.setAgencyId(gridDTO.getParentAgencyId()); + indexGridScoreDTO1.setAllParentIds(gridDTO.getAllParentIds()); + indexGridScoreDTO1.setQuarterId(DateUtils.getQuarterId(monthId)); + indexGridScoreDTO1.setYearId(dateArr[NumConstant.ZERO]); + indexGridScoreDTO1.setMonthId(monthId); + indexGridScoreDTO1.setIsTotal(NumConstant.ZERO_STR); + indexGridScoreDTO1.setScore(new BigDecimal(NumConstant.ZERO)); + indexGridScoreDTO1.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + indexGridScoreDTO1.setDelFlag(NumConstant.ZERO_STR); + insertIndexGridScoreDTOS.add(indexGridScoreDTO1); + + FactIndexGridScoreDTO indexGridScoreDTO2 = new FactIndexGridScoreDTO(); + // 赋默认值 - 服务能力 + indexGridScoreDTO2.setGridId(gridDTO.getGridId()); + indexGridScoreDTO2.setAgencyId(gridDTO.getParentAgencyId()); + indexGridScoreDTO2.setAllParentIds(gridDTO.getAllParentIds()); + indexGridScoreDTO2.setQuarterId(DateUtils.getQuarterId(monthId)); + indexGridScoreDTO2.setYearId(dateArr[NumConstant.ZERO]); + indexGridScoreDTO2.setMonthId(monthId); + indexGridScoreDTO2.setIsTotal(NumConstant.ZERO_STR); + indexGridScoreDTO2.setScore(new BigDecimal(NumConstant.ZERO)); + indexGridScoreDTO2.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode()); + indexGridScoreDTO2.setDelFlag(NumConstant.ZERO_STR); + insertIndexGridScoreDTOS.add(indexGridScoreDTO2); + + FactIndexGridScoreDTO indexGridScoreDTO3 = new FactIndexGridScoreDTO(); + // 赋默认值 - 网格相关 + indexGridScoreDTO3.setGridId(gridDTO.getGridId()); + indexGridScoreDTO3.setAgencyId(gridDTO.getParentAgencyId()); + indexGridScoreDTO3.setAllParentIds(gridDTO.getAllParentIds()); + indexGridScoreDTO3.setQuarterId(DateUtils.getQuarterId(monthId)); + indexGridScoreDTO3.setYearId(dateArr[NumConstant.ZERO]); + indexGridScoreDTO3.setMonthId(monthId); + indexGridScoreDTO3.setIsTotal(NumConstant.ONE_STR); + indexGridScoreDTO3.setScore(new BigDecimal(NumConstant.ZERO)); + indexGridScoreDTO3.setIndexCode(IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); + indexGridScoreDTO3.setDelFlag(NumConstant.ZERO_STR); + insertIndexGridScoreDTOS.add(indexGridScoreDTO3); + } + factIndexGridScoreDao.batchInsertGridScoreData(insertIndexGridScoreDTOS, customerId); + } + + /** + * 新增 社区相关分数表 默认值,一条组织id,按照组织类别的不同 需要插入4次 + * + * @param monthId + * @param customerId + * @param mismatchAgencyList + * @return void + * @Author zhangyong + * @Date 14:02 2020-09-04 + **/ + private void insertIndexCommunityScoreDefaultValueFor(String monthId, String customerId, List mismatchAgencyList){ + String[] dateArr = yearOrMonth(monthId); + List insertIndexCommunityScore = new ArrayList<>(); + for (ScreenCustomerAgencyEntity agencyDTO : mismatchAgencyList){ + FactIndexCommunityScoreEntity communityScore1 = new FactIndexCommunityScoreEntity(); + // 赋默认值 - 党建能力指数 + communityScore1.setAgencyId(agencyDTO.getAgencyId()); + communityScore1.setParentAgencyId(agencyDTO.getPid()); + //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + communityScore1.setQuarterId(DateUtils.getQuarterId(monthId)); + communityScore1.setYearId(dateArr[NumConstant.ZERO]); + communityScore1.setMonthId(monthId); + communityScore1.setIsTotal(NumConstant.ZERO_STR); // 0 or 1 + communityScore1.setScore(new BigDecimal(NumConstant.ZERO)); + communityScore1.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); // 4种类型 + insertIndexCommunityScore.add(communityScore1); + + FactIndexCommunityScoreEntity communityScore2 = new FactIndexCommunityScoreEntity(); + // 赋默认值 - 治理能力 + communityScore2.setAgencyId(agencyDTO.getAgencyId()); + communityScore2.setParentAgencyId(agencyDTO.getPid()); + //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + communityScore2.setQuarterId(DateUtils.getQuarterId(monthId)); + communityScore2.setYearId(dateArr[NumConstant.ZERO]); + communityScore2.setMonthId(monthId); + communityScore2.setIsTotal(NumConstant.ZERO_STR); + communityScore2.setScore(new BigDecimal(NumConstant.ZERO)); + communityScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + insertIndexCommunityScore.add(communityScore2); + + FactIndexCommunityScoreEntity communityScore3 = new FactIndexCommunityScoreEntity(); + // 赋默认值 - 服务能力 + communityScore3.setAgencyId(agencyDTO.getAgencyId()); + communityScore3.setParentAgencyId(agencyDTO.getPid()); + //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + communityScore3.setQuarterId(DateUtils.getQuarterId(monthId)); + communityScore3.setYearId(dateArr[NumConstant.ZERO]); + communityScore3.setMonthId(monthId); + communityScore3.setIsTotal(NumConstant.ZERO_STR); + communityScore3.setScore(new BigDecimal(NumConstant.ZERO)); + communityScore3.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode()); + insertIndexCommunityScore.add(communityScore3); + + FactIndexCommunityScoreEntity communityScore4 = new FactIndexCommunityScoreEntity(); + // 赋默认值 - 社区相关 + communityScore4.setAgencyId(agencyDTO.getAgencyId()); + communityScore4.setParentAgencyId(agencyDTO.getPid()); + //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + communityScore4.setQuarterId(DateUtils.getQuarterId(monthId)); + communityScore4.setYearId(dateArr[NumConstant.ZERO]); + communityScore4.setMonthId(monthId); + communityScore4.setIsTotal(NumConstant.ONE_STR); + communityScore4.setScore(new BigDecimal(NumConstant.ZERO)); + communityScore4.setIndexCode(IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); + insertIndexCommunityScore.add(communityScore4); + } + factIndexCommunityScoreDao.batchInsertCommunityScoreData(insertIndexCommunityScore, customerId); + } + + private void insertIndexDeptScoreDefaultValueFor(String monthId, String customerId, List mismatchDeptList){ + String[] dateArr = yearOrMonth(monthId); + List insertIndexDeptScore = new ArrayList<>(); + for (ScreenCustomerDeptEntity deptDTO : mismatchDeptList){ + DeptScoreEntity deptScore2 = new DeptScoreEntity(); + // 赋默认值 - 治理能力 + deptScore2.setDeptId(deptDTO.getDeptId()); + deptScore2.setAgencyId(deptDTO.getParentAgencyId()); + //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + deptScore2.setQuarterId(DateUtils.getQuarterId(monthId)); + deptScore2.setYearId(dateArr[NumConstant.ZERO]); + deptScore2.setMonthId(monthId); + deptScore2.setIsTotal(NumConstant.ZERO_STR); + deptScore2.setScore(new BigDecimal(NumConstant.ZERO)); + deptScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + insertIndexDeptScore.add(deptScore2); + } + deptScoreDao.batchInsertDeptScoreData(insertIndexDeptScore, customerId); + } + + private void insertIndexAgencyScoreDefaultValueFor(String monthId, String customerId, List mismatchAgencyList){ + String[] dateArr = yearOrMonth(monthId); + List insertIndexAgencyScore = new ArrayList<>(); + for (ScreenCustomerAgencyEntity agencyDTO : mismatchAgencyList){ + AgencyScoreEntity agencyScore1 = new AgencyScoreEntity(); + // 赋默认值 - 党建能力指数 + agencyScore1.setAgencyId(agencyDTO.getAgencyId()); + agencyScore1.setParentAgencyId(agencyDTO.getPid()); + //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + agencyScore1.setQuarterId(DateUtils.getQuarterId(monthId)); + agencyScore1.setYearId(dateArr[NumConstant.ZERO]); + agencyScore1.setMonthId(monthId); + agencyScore1.setIsTotal(NumConstant.ZERO_STR); // 0 or 1 + agencyScore1.setScore(new BigDecimal(NumConstant.ZERO)); + agencyScore1.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); // 4种类型 + + AgencyScoreEntity agencyScore2 = new AgencyScoreEntity(); + // 赋默认值 - 治理能力 + agencyScore2.setAgencyId(agencyDTO.getAgencyId()); + agencyScore2.setParentAgencyId(agencyDTO.getPid()); + //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + agencyScore2.setQuarterId(DateUtils.getQuarterId(monthId)); + agencyScore2.setYearId(dateArr[NumConstant.ZERO]); + agencyScore2.setMonthId(monthId); + agencyScore2.setIsTotal(NumConstant.ZERO_STR); + agencyScore2.setScore(new BigDecimal(NumConstant.ZERO)); + agencyScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + + AgencyScoreEntity agencyScore3 = new AgencyScoreEntity(); + // 赋默认值 - 服务能力 + agencyScore3.setAgencyId(agencyDTO.getAgencyId()); + agencyScore3.setParentAgencyId(agencyDTO.getPid()); + //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + agencyScore3.setQuarterId(DateUtils.getQuarterId(monthId)); + agencyScore3.setYearId(dateArr[NumConstant.ZERO]); + agencyScore3.setMonthId(monthId); + agencyScore3.setIsTotal(NumConstant.ZERO_STR); + agencyScore3.setScore(new BigDecimal(NumConstant.ZERO)); + agencyScore3.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode()); + + if ("community".equals(agencyDTO.getLevel())){ + AgencyScoreEntity agencyScore4 = new AgencyScoreEntity(); + // 赋默认值 - 全区相关 + agencyScore4.setAgencyId(agencyDTO.getAgencyId()); + agencyScore4.setParentAgencyId(agencyDTO.getPid()); + //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + agencyScore4.setQuarterId(DateUtils.getQuarterId(monthId)); + agencyScore4.setYearId(dateArr[NumConstant.ZERO]); + agencyScore4.setMonthId(monthId); + agencyScore4.setIsTotal(NumConstant.ONE_STR); + agencyScore4.setScore(new BigDecimal(NumConstant.ZERO)); + agencyScore4.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode()); + + agencyScore4.setDataType("district"); + agencyScore1.setDataType("district"); + agencyScore2.setDataType("district"); + agencyScore3.setDataType("district"); + insertIndexAgencyScore.add(agencyScore4); + } else if ("street".equals(agencyDTO.getLevel())){ + AgencyScoreEntity agencyScore4 = new AgencyScoreEntity(); + // 赋默认值 - 街道相关 + agencyScore4.setAgencyId(agencyDTO.getAgencyId()); + agencyScore4.setParentAgencyId(agencyDTO.getPid()); + //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + agencyScore4.setQuarterId(DateUtils.getQuarterId(monthId)); + agencyScore4.setYearId(dateArr[NumConstant.ZERO]); + agencyScore4.setMonthId(monthId); + agencyScore4.setIsTotal(NumConstant.ONE_STR); + agencyScore4.setScore(new BigDecimal(NumConstant.ZERO)); + agencyScore4.setIndexCode(IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode()); + + agencyScore4.setDataType("street"); + agencyScore1.setDataType("street"); + agencyScore2.setDataType("street"); + agencyScore3.setDataType("street"); + insertIndexAgencyScore.add(agencyScore4); + } + insertIndexAgencyScore.add(agencyScore1); + insertIndexAgencyScore.add(agencyScore2); + insertIndexAgencyScore.add(agencyScore3); + } + agencyScoreDaol.batchInsertAgencyScoreData(insertIndexAgencyScore, customerId); + } + + private void insertIndexDataYear(String year, String month, String customerId){ + List monthlyFormList = screenIndexDataMonthlyDao.selectListIndexDataMonthlyByYear(customerId, year, month); + String[] orgIds = new String[monthlyFormList.size()]; + for (int i = NumConstant.ZERO; i < monthlyFormList.size(); i++){ + orgIds[i] = monthlyFormList.get(i).getOrgId(); + } + screenIndexDataYearlyDao.deleteIndexDataYearly(customerId, year, orgIds); + List entity = ConvertUtils.sourceToTarget(monthlyFormList, IndexDataYearlyFormDTO.class); + screenIndexDataYearlyDao.batchInsertIndexDataYearly(entity, customerId); + } + + /** + * 将月份id,拆分 dateArr[0] = 年份 dateArr[1] = 月份 + * + * @param monthId 202008 + * @return java.lang.String[] + * @Author zhangyong + * @Date 13:39 2020-09-04 + **/ + private String[] yearOrMonth(String monthId){ + String[] dateArr = new String[NumConstant.TWO]; + dateArr[NumConstant.ZERO] = monthId.substring(NumConstant.ZERO, NumConstant.FOUR); + dateArr[NumConstant.ONE] = monthId.substring(NumConstant.FOUR, NumConstant.SIX); + return dateArr; + } + + + /** + * 将月份id,拆分成 年份 + * + * @param monthId 202008 + * @return java.lang.String + * @Author zhangyong + * @Date 13:39 2020-09-04 + **/ + private String getYearStr(String monthId){ + return monthId.substring(NumConstant.ZERO, NumConstant.FOUR); + } + + + /** + * 将月份id,拆分成 月份 + * + * @param monthId 202008 + * @return java.lang.String + * @Author zhangyong + * @Date 13:39 2020-09-04 + **/ + private String getMonthStr(String monthId){ + return monthId.substring(NumConstant.FOUR, NumConstant.SIX); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml index 179fd5c9eb..1c6efa8f52 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml @@ -63,7 +63,7 @@ - SELECT CUSTOMER_ID, AGENCY_ID, @@ -102,4 +102,63 @@ AND fics.index_code = #{indexCode} GROUP BY fics.agency_id + + + insert into fact_index_agency_score + ( + ID, + CUSTOMER_ID, + + AGENCY_ID, + PARENT_AGENCY_ID, + YEAR_ID, + QUARTER_ID, + MONTH_ID, + DATA_TYPE, + IS_TOTAL, + SCORE, + INDEX_CODE, + + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.parentAgencyId}, + + #{item.yearId}, + #{item.quarterId}, + #{item.monthId}, + #{item.dataType}, + #{item.isTotal}, + #{item.score}, + #{item.indexCode}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml index 8e01fb1e52..b225821aec 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml @@ -43,4 +43,59 @@ GROUP BY fidc.agency_id + + insert into fact_index_dept_score + ( + ID, + CUSTOMER_ID, + DEPT_ID, + AGENCY_ID, + 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.deptId}, + #{item.agencyId}, + #{item.quarterId}, + #{item.yearId}, + + #{item.monthId}, + #{item.isTotal}, + #{item.score}, + #{item.indexCode}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + 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/screen/FactIndexCommunityScoreDao.xml index 07e3b05b94..7978db5eee 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/screen/FactIndexCommunityScoreDao.xml @@ -102,4 +102,59 @@ AND MONTH_ID = #{monthId} ORDER BY AGENCY_ID + + + insert into fact_index_community_score + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + PARENT_AGENCY_ID, + YEAR_ID, + QUARTER_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.agencyId}, + #{item.parentAgencyId}, + #{item.yearId}, + #{item.quarterId}, + + #{item.monthId}, + #{item.isTotal}, + #{item.score}, + #{item.indexCode}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + 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 index b6eed400a2..010ac06798 100644 --- 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 @@ -43,4 +43,61 @@ AND MONTH_ID = #{monthId} ORDER BY GRID_ID + + + 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() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml index dda779d7b9..c1479694d4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml @@ -70,4 +70,24 @@ AND CUSTOMER_ID =#{customerId} AND AGENCY_ID = #{agencyId} + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml index 8937212e71..47ab3d400d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml @@ -75,4 +75,22 @@ AND CUSTOMER_ID =#{customerId} AND DEPT_ID = #{deptId} + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml index 7a8c216fea..a86ec3bec2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml @@ -117,4 +117,23 @@ AND CUSTOMER_ID =#{customerId} AND GRID_ID = #{gridId} + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml index 616d567b8a..4c8369dd0a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml @@ -59,4 +59,23 @@ + + From d5e8e3f4191a8061a29e3b384d4811b74da76e71 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Fri, 4 Sep 2020 18:39:31 +0800 Subject: [PATCH 204/226] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=BF=98=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java | 1 + .../mapper/evaluationindex/indexcal/AgencyScoreDao.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java index bd4a483062..8a13b7a0ff 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.evaluationindex.indexcal; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; import com.epmet.dto.indexcal.DeptScoreDTO; import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity; import org.apache.ibatis.annotations.Mapper; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml index 1c6efa8f52..cdc7ea366a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml @@ -63,7 +63,7 @@ - SELECT CUSTOMER_ID, AGENCY_ID, From e704015459db97a740ac60d3f3b01317d659823d Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Fri, 4 Sep 2020 19:01:31 +0800 Subject: [PATCH 205/226] =?UTF-8?q?=E5=B9=B4=E8=A1=A8=E3=80=81=E6=9C=88?= =?UTF-8?q?=E8=A1=A8=E6=94=B6=E5=B0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/FactIndexCollectServiceImpl.java | 165 +++++++++--------- .../evaluationindex/indexcal/DeptScoreDao.xml | 2 +- 2 files changed, 84 insertions(+), 83 deletions(-) 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 6f260e44c8..51d7dbcd38 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 @@ -446,15 +446,12 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { orgIds[j] = deptScore.getKey(); j++; for ( int i = 0; i < deptScore.getValue().size(); i++){ - if (NumConstant.ONE_STR.equals(deptScore.getValue().get(i).getIsTotal())){ - // 是总分 总指数 = IS_TOTAL = 1 - monthlyFormDTO.setIndexTotal(deptScore.getValue().get(i).getScore()); - } else { - // 赋值 党建能力、治理能力、服务能力 - monthlyFormDTO = this.setValueAblityMonthlyFor(deptScore.getValue().get(i).getIndexCode(), - deptScore.getValue().get(i).getScore(), - monthlyFormDTO); - } + // 区直街道的总分 就是 治理能力 + monthlyFormDTO.setIndexTotal(deptScore.getValue().get(i).getScore()); + // 赋值 治理能力 + monthlyFormDTO = this.setValueAblityMonthlyFor(deptScore.getValue().get(i).getIndexCode(), + deptScore.getValue().get(i).getScore(), + monthlyFormDTO); } // 查询网格的 上级组织id 和 组织名称 ScreenCustomerDeptEntity parentDeptInfo = screenCustomerDeptDao.selectParentDeptInfo(customerId, deptScore.getKey()); @@ -775,6 +772,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { deptScore2.setIsTotal(NumConstant.ZERO_STR); deptScore2.setScore(new BigDecimal(NumConstant.ZERO)); deptScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + deptScore2.setDelFlag(NumConstant.ZERO_STR); insertIndexDeptScore.add(deptScore2); } deptScoreDao.batchInsertDeptScoreData(insertIndexDeptScore, customerId); @@ -784,82 +782,85 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { String[] dateArr = yearOrMonth(monthId); List insertIndexAgencyScore = new ArrayList<>(); for (ScreenCustomerAgencyEntity agencyDTO : mismatchAgencyList){ - AgencyScoreEntity agencyScore1 = new AgencyScoreEntity(); - // 赋默认值 - 党建能力指数 - agencyScore1.setAgencyId(agencyDTO.getAgencyId()); - agencyScore1.setParentAgencyId(agencyDTO.getPid()); - //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 - agencyScore1.setQuarterId(DateUtils.getQuarterId(monthId)); - agencyScore1.setYearId(dateArr[NumConstant.ZERO]); - agencyScore1.setMonthId(monthId); - agencyScore1.setIsTotal(NumConstant.ZERO_STR); // 0 or 1 - agencyScore1.setScore(new BigDecimal(NumConstant.ZERO)); - agencyScore1.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); // 4种类型 - - AgencyScoreEntity agencyScore2 = new AgencyScoreEntity(); - // 赋默认值 - 治理能力 - agencyScore2.setAgencyId(agencyDTO.getAgencyId()); - agencyScore2.setParentAgencyId(agencyDTO.getPid()); - //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 - agencyScore2.setQuarterId(DateUtils.getQuarterId(monthId)); - agencyScore2.setYearId(dateArr[NumConstant.ZERO]); - agencyScore2.setMonthId(monthId); - agencyScore2.setIsTotal(NumConstant.ZERO_STR); - agencyScore2.setScore(new BigDecimal(NumConstant.ZERO)); - agencyScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); - - AgencyScoreEntity agencyScore3 = new AgencyScoreEntity(); - // 赋默认值 - 服务能力 - agencyScore3.setAgencyId(agencyDTO.getAgencyId()); - agencyScore3.setParentAgencyId(agencyDTO.getPid()); - //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 - agencyScore3.setQuarterId(DateUtils.getQuarterId(monthId)); - agencyScore3.setYearId(dateArr[NumConstant.ZERO]); - agencyScore3.setMonthId(monthId); - agencyScore3.setIsTotal(NumConstant.ZERO_STR); - agencyScore3.setScore(new BigDecimal(NumConstant.ZERO)); - agencyScore3.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode()); - - if ("community".equals(agencyDTO.getLevel())){ - AgencyScoreEntity agencyScore4 = new AgencyScoreEntity(); - // 赋默认值 - 全区相关 - agencyScore4.setAgencyId(agencyDTO.getAgencyId()); - agencyScore4.setParentAgencyId(agencyDTO.getPid()); + if ("community".equals(agencyDTO.getLevel()) || "street".equals(agencyDTO.getLevel()) + || "district".equals(agencyDTO.getLevel())){ + AgencyScoreEntity agencyScore1 = new AgencyScoreEntity(); + // 赋默认值 - 党建能力指数 + agencyScore1.setAgencyId(agencyDTO.getAgencyId()); + agencyScore1.setParentAgencyId(agencyDTO.getPid()); + //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + agencyScore1.setQuarterId(DateUtils.getQuarterId(monthId)); + agencyScore1.setYearId(dateArr[NumConstant.ZERO]); + agencyScore1.setMonthId(monthId); + agencyScore1.setIsTotal(NumConstant.ZERO_STR); // 0 or 1 + agencyScore1.setScore(new BigDecimal(NumConstant.ZERO)); + agencyScore1.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); // 4种类型 + + AgencyScoreEntity agencyScore2 = new AgencyScoreEntity(); + // 赋默认值 - 治理能力 + agencyScore2.setAgencyId(agencyDTO.getAgencyId()); + agencyScore2.setParentAgencyId(agencyDTO.getPid()); //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 - agencyScore4.setQuarterId(DateUtils.getQuarterId(monthId)); - agencyScore4.setYearId(dateArr[NumConstant.ZERO]); - agencyScore4.setMonthId(monthId); - agencyScore4.setIsTotal(NumConstant.ONE_STR); - agencyScore4.setScore(new BigDecimal(NumConstant.ZERO)); - agencyScore4.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode()); - - agencyScore4.setDataType("district"); - agencyScore1.setDataType("district"); - agencyScore2.setDataType("district"); - agencyScore3.setDataType("district"); - insertIndexAgencyScore.add(agencyScore4); - } else if ("street".equals(agencyDTO.getLevel())){ - AgencyScoreEntity agencyScore4 = new AgencyScoreEntity(); - // 赋默认值 - 街道相关 - agencyScore4.setAgencyId(agencyDTO.getAgencyId()); - agencyScore4.setParentAgencyId(agencyDTO.getPid()); + agencyScore2.setQuarterId(DateUtils.getQuarterId(monthId)); + agencyScore2.setYearId(dateArr[NumConstant.ZERO]); + agencyScore2.setMonthId(monthId); + agencyScore2.setIsTotal(NumConstant.ZERO_STR); + agencyScore2.setScore(new BigDecimal(NumConstant.ZERO)); + agencyScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + + AgencyScoreEntity agencyScore3 = new AgencyScoreEntity(); + // 赋默认值 - 服务能力 + agencyScore3.setAgencyId(agencyDTO.getAgencyId()); + agencyScore3.setParentAgencyId(agencyDTO.getPid()); //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 - agencyScore4.setQuarterId(DateUtils.getQuarterId(monthId)); - agencyScore4.setYearId(dateArr[NumConstant.ZERO]); - agencyScore4.setMonthId(monthId); - agencyScore4.setIsTotal(NumConstant.ONE_STR); - agencyScore4.setScore(new BigDecimal(NumConstant.ZERO)); - agencyScore4.setIndexCode(IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode()); - - agencyScore4.setDataType("street"); - agencyScore1.setDataType("street"); - agencyScore2.setDataType("street"); - agencyScore3.setDataType("street"); - insertIndexAgencyScore.add(agencyScore4); + agencyScore3.setQuarterId(DateUtils.getQuarterId(monthId)); + agencyScore3.setYearId(dateArr[NumConstant.ZERO]); + agencyScore3.setMonthId(monthId); + agencyScore3.setIsTotal(NumConstant.ZERO_STR); + agencyScore3.setScore(new BigDecimal(NumConstant.ZERO)); + agencyScore3.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode()); + + if ("community".equals(agencyDTO.getLevel())){ + AgencyScoreEntity agencyScore4 = new AgencyScoreEntity(); + // 赋默认值 - 全区相关 + agencyScore4.setAgencyId(agencyDTO.getAgencyId()); + agencyScore4.setParentAgencyId(agencyDTO.getPid()); + //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + agencyScore4.setQuarterId(DateUtils.getQuarterId(monthId)); + agencyScore4.setYearId(dateArr[NumConstant.ZERO]); + agencyScore4.setMonthId(monthId); + agencyScore4.setIsTotal(NumConstant.ONE_STR); + agencyScore4.setScore(new BigDecimal(NumConstant.ZERO)); + agencyScore4.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode()); + + agencyScore4.setDataType("district"); + agencyScore1.setDataType("district"); + agencyScore2.setDataType("district"); + agencyScore3.setDataType("district"); + insertIndexAgencyScore.add(agencyScore4); + } else if ("street".equals(agencyDTO.getLevel()) || "district".equals(agencyDTO.getLevel())){ + AgencyScoreEntity agencyScore4 = new AgencyScoreEntity(); + // 赋默认值 - 街道相关 + agencyScore4.setAgencyId(agencyDTO.getAgencyId()); + agencyScore4.setParentAgencyId(agencyDTO.getPid()); + //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + agencyScore4.setQuarterId(DateUtils.getQuarterId(monthId)); + agencyScore4.setYearId(dateArr[NumConstant.ZERO]); + agencyScore4.setMonthId(monthId); + agencyScore4.setIsTotal(NumConstant.ONE_STR); + agencyScore4.setScore(new BigDecimal(NumConstant.ZERO)); + agencyScore4.setIndexCode(IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode()); + + agencyScore4.setDataType("street"); + agencyScore1.setDataType("street"); + agencyScore2.setDataType("street"); + agencyScore3.setDataType("street"); + insertIndexAgencyScore.add(agencyScore4); + } + insertIndexAgencyScore.add(agencyScore1); + insertIndexAgencyScore.add(agencyScore2); + insertIndexAgencyScore.add(agencyScore3); } - insertIndexAgencyScore.add(agencyScore1); - insertIndexAgencyScore.add(agencyScore2); - insertIndexAgencyScore.add(agencyScore3); } agencyScoreDaol.batchInsertAgencyScoreData(insertIndexAgencyScore, customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml index b225821aec..8ebc54bf91 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml @@ -77,7 +77,7 @@ #{item.isTotal}, #{item.score}, #{item.indexCode}, - 0, + #{item.delFlag}, 0, 'APP_USER', now(), From bcfb1adb926f600c92a0f08e24055f25d4ffaf0f Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Fri, 4 Sep 2020 22:12:46 +0800 Subject: [PATCH 206/226] =?UTF-8?q?=E5=B9=B4=E8=A1=A8=E3=80=81=E6=9C=88?= =?UTF-8?q?=E8=A1=A8=20--=20=E5=B1=95=E7=A4=BA=E6=8E=A5=E5=8F=A3=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/ScreenIndexDataMonthlyDao.java | 2 +- .../impl/FactIndexCollectServiceImpl.java | 328 ++++++++++-------- 2 files changed, 179 insertions(+), 151 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java index 55b4e3ac41..4ebfc825e4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java @@ -65,7 +65,7 @@ public interface ScreenIndexDataMonthlyDao extends BaseDao * @Author zhangyong * @Date 15:51 2020-09-04 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 51d7dbcd38..f1068d23b8 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 @@ -27,6 +27,8 @@ import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity; import com.epmet.eum.IndexCodeEnum; import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; import lombok.extern.slf4j.Slf4j; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -46,6 +48,7 @@ import java.util.stream.Collectors; @Service @DataSource(DataSourceConstant.EVALUATION_INDEX) public class FactIndexCollectServiceImpl implements FactIndexCollectService { + private static final Logger log = LoggerFactory.getLogger(FactIndexCollectServiceImpl.class); @Autowired private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; @@ -225,12 +228,12 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { this.startHandleIndexAgencyScore(monthId, customerId); // 根据年,汇总今年各项得到,计算平均值后 插入年表 screen_index_data_yearly - this.insertIndexDataYear(this.getYearStr(monthId), this.getMonthStr(monthId), customerId); + this.insertIndexDataYear(monthId, customerId); } /** * 目标:将网格的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) - * 如果网格相关分值表 中的网格数量不全,需要从 网格(党支部)信息表(一) 中,先查询到缺少的网格信息,赋上默认值后,插入网格相关分值表(四)。 + * 如果网格相关分值表 中的网格数量不全,需要从 网格(党支部)信息表 中,先查询到缺少的网格信息,赋上默认值后,在插入网格相关分值表。 一对四 * * @param monthId * @param customerId @@ -242,40 +245,39 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 查询网格相关分值记录 表已经存在的网格id List indexGridIds = factIndexGridScoreDao.selectListGridId(customerId, monthId); if (indexGridIds.size() > NumConstant.ZERO){ - // 根据网格相关分值表 中查询到的网格id,去 网格(党支部)信息表 进行不匹配查询(即返回网格相关分值表 中不存在的网格信息)。 + // 根据网格相关分值表 中查询到的网格id,去 网格(党支部)信息表 进行不匹配查询。 String[] gridIds = new String[indexGridIds.size()]; for (int i = NumConstant.ZERO; i < indexGridIds.size(); i++){ gridIds[i] = indexGridIds.get(i); } + // 进行不匹配查询(即返回网格相关分值表 中不存在的网格信息)。 List mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, gridIds); // 将 网格相关分值表 中,本月份没有的网格信息,按照 4种类型,各新增一遍,赋默认值 0 if (mismatchGridList.size() > NumConstant.ZERO){ - this.insertIndexGridScoreDefaultValueFor(monthId, customerId, mismatchGridList); + this.insertIndexGridScoreDefaultValue(monthId, customerId, mismatchGridList); } } else { // 将所有的网格按照 4种类型,各赋一遍默认值 List mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, null); - this.insertIndexGridScoreDefaultValueFor(monthId, customerId, mismatchGridList); + this.insertIndexGridScoreDefaultValue(monthId, customerId, mismatchGridList); } // 开始处理实际分数 // fact_index_grid_score 网格相关分值记录表 grid - String[] dateArr = yearOrMonth(monthId); List gridScoreDTOS = factIndexGridScoreDao.selectListGridScore(customerId, monthId); - this.insertIndexDataMonthlyByGridScore(dateArr[NumConstant.ONE], dateArr[NumConstant.ZERO], customerId, gridScoreDTOS); + this.insertIndexDataMonthlyByGridScore(monthId, customerId, gridScoreDTOS); } /** * 将网格相关分值记录表 数据 插入月表 screenIndexDataMonthlyDao * - * @param month 08 - * @param year 2020 + * @param monthId 202008 * @param customerId 客户id * @param gridScoreDTOS 网格相关分值记录表 当前客户所属月份数据集 * @return void * @Author zhangyong * @Date 14:17 2020-09-03 **/ - private void insertIndexDataMonthlyByGridScore(String month, String year, String customerId, List gridScoreDTOS){ + private void insertIndexDataMonthlyByGridScore(String monthId, String customerId, List gridScoreDTOS){ List monthlyFormDTOList = new ArrayList<>(); // 根据网格id进行分组,最后组装一条数据 一个网格 对应 4条数据 Map> collect = gridScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexGridScoreDTO::getGridId)); @@ -286,6 +288,8 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 网格id orgIds[j] = gridScore.getKey(); j++; + // 给4个指数 赋默认值 + monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO); for ( int i = 0; i < gridScore.getValue().size(); i++){ if (NumConstant.ONE_STR.equals(gridScore.getValue().get(i).getIsTotal())){ // 是总分 @@ -294,8 +298,8 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { monthlyFormDTO.setIndexTotal(gridScore.getValue().get(i).getScore()); } } else { - // 赋值 党建能力、治理能力、服务能力 - monthlyFormDTO = this.setValueAblityMonthlyFor(gridScore.getValue().get(i).getIndexCode(), + // 赋实际值 党建能力、治理能力、服务能力 + monthlyFormDTO = this.setValueAbilityMonthlyFor(gridScore.getValue().get(i).getIndexCode(), gridScore.getValue().get(i).getScore(), monthlyFormDTO); } @@ -306,55 +310,64 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { throw new RuntimeException("在screen_customer_grid表中未查询到该客户下的网格信息:customerId =" + customerId + ", gridId = " + gridScore.getKey()); } // 补充表中其他字段 - monthlyFormDTO = this.supplementIndexDataMonthlyTable(year, month, OrgTypeConstant.GRID, gridScore.getKey(), + monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.GRID, gridScore.getKey(), parentGridInfo.getParentAgencyId(), parentGridInfo.getGridName(), monthlyFormDTO); monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, year, month, orgIds); + screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds); screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); } } + /** + * 目标:将社区的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) + * 如果社区相关分值表 中的社区数量不全,需要从 组织机构信息 中,先查询到缺少的社区信息,赋上默认值后,在插入社区相关分值表。 一对四 + * + * @param monthId + * @param customerId + * @return void + * @Author zhangyong + * @Date 13:44 2020-09-04 + **/ private void startHandleIndexCommunityScore(String monthId, String customerId){ - // 查询社区相关分值记录 + // 查询社区相关分值记录id List indexCommunityIds = factIndexCommunityScoreDao.selectListCommunityId(customerId, monthId); if (indexCommunityIds.size() > NumConstant.ZERO){ - // 根据网格相关分值表 中查询到的网格id,去 网格(党支部)信息表 进行不匹配查询(即返回网格相关分值表 中不存在的网格信息)。 + // 根据社区相关分值表 中查询到的社区id,去 组织机构信息 进行不匹配查询。 String[] communityIds = new String[indexCommunityIds.size()]; for (int i = NumConstant.ZERO; i < indexCommunityIds.size(); i++){ communityIds[i] = indexCommunityIds.get(i); } + // 进行不匹配查询(即返回社区相关分值表 中不存在的社区信息)。 List mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, communityIds); - // 将 社区相关分数表 中,本月份没有的网格信息,按照 4种类型,各新增一遍,赋默认值 0 + // 将 社区相关分数表 中,本月份没有的社区信息,按照 4种类型,各新增一遍,赋默认值 0 if (mismatchAgencyList.size() > NumConstant.ZERO){ - this.insertIndexCommunityScoreDefaultValueFor(monthId, customerId, mismatchAgencyList); + this.insertIndexCommunityScoreDefaultValue(monthId, customerId, mismatchAgencyList); } } else { // 将所有的社区按照 4种类型,各赋一遍默认值 List mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, null); - this.insertIndexCommunityScoreDefaultValueFor(monthId, customerId, mismatchAgencyList); + this.insertIndexCommunityScoreDefaultValue(monthId, customerId, mismatchAgencyList); } // 开始处理实际分数 // fact_index_community_score 社区相关分数表 agency - String[] dateArr = yearOrMonth(monthId); // 查询社区相关分值记录 List communityScoreDTOS = factIndexCommunityScoreDao.selectListCommunityScore(customerId, monthId); - this.insertIndexDataMonthlyByCommunityScore(dateArr[NumConstant.ONE], dateArr[NumConstant.ZERO], customerId, communityScoreDTOS); + this.insertIndexDataMonthlyByCommunityScore(monthId, customerId, communityScoreDTOS); } /** * 社区相关分数表 数据 插入月表 screenIndexDataMonthlyDao * - * @param month 08 - * @param year 2020 + * @param monthId 202008 * @param customerId 客户id * @param communityScoreDTOS 社区相关分数表 当前客户所属月份数据集 * @return void * @Author zhangyong * @Date 14:17 2020-09-03 **/ - private void insertIndexDataMonthlyByCommunityScore(String month, String year, String customerId, List communityScoreDTOS){ + private void insertIndexDataMonthlyByCommunityScore(String monthId, String customerId, List communityScoreDTOS){ List monthlyFormDTOList = new ArrayList<>(); // 根据组织id 进行分组,最后组装一条数据 一个组织id 对应 4条数据 Map> collect = communityScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexCommunityScoreDTO::getAgencyId)); @@ -365,6 +378,8 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 组织id orgIds[j] = communityScore.getKey(); j++; + // 给4个指数 赋默认值 + monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO); for ( int i = 0; i < communityScore.getValue().size(); i++){ if (NumConstant.ONE_STR.equals(communityScore.getValue().get(i).getIsTotal())){ // 是总分 @@ -374,7 +389,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } else { // 赋值 党建能力、治理能力、服务能力 - monthlyFormDTO = this.setValueAblityMonthlyFor(communityScore.getValue().get(i).getIndexCode(), + monthlyFormDTO = this.setValueAbilityMonthlyFor(communityScore.getValue().get(i).getIndexCode(), communityScore.getValue().get(i).getScore(), monthlyFormDTO); } @@ -388,17 +403,27 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { throw new RuntimeException("在screen_customer_agency表中未查询到该客户下的组织名称:customerId =" + customerId + ", agencyId = " + communityScore.getKey()); } // 补充表中其他字段 - monthlyFormDTO = this.supplementIndexDataMonthlyTable(year, month, OrgTypeConstant.GRID, communityScore.getKey(), + monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.GRID, communityScore.getKey(), parentAgencyId, agencyName, monthlyFormDTO); // 补充表中其他字段 monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, year, month, orgIds); + screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds); screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); } } + /** + * 目标:将区直部门的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) + * 如果 区直部门分值表 中的部门数量不全,需要从 部门信息表 中,先查询到缺少的部门信息,赋上默认值后,在插入 区直部门分值表。 一对四 + * + * @param monthId + * @param customerId + * @return void + * @Author zhangyong + * @Date 13:44 2020-09-04 + **/ private void startHandleIndexDeptScore(String monthId, String customerId){ // 查询社 区直部门分值表 List indexDeptIds = deptScoreDao.selectListDeptId(customerId, monthId); @@ -417,24 +442,22 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } // 开始处理实际分数 // fact_index_dept_score 区直部门分值表 department - String[] dateArr = yearOrMonth(monthId); // 查询社 区直部门分值表 List deptScoreDTOS = deptScoreDao.selectListDeptScore(customerId, monthId); - this.insertIndexDataMonthlyByDeptScore(dateArr[NumConstant.ONE], dateArr[NumConstant.ZERO], customerId, deptScoreDTOS); + this.insertIndexDataMonthlyByDeptScore(monthId, customerId, deptScoreDTOS); } /** * 将区直部门分值表 数据 插入月表 screenIndexDataMonthlyDao * - * @param month 08 - * @param year 2020 + * @param monthId 202008 * @param customerId 客户id * @param deptScoreDTOS 区直部门分值表 当前客户所属月份数据集 * @return void * @Author zhangyong * @Date 14:17 2020-09-03 **/ - private void insertIndexDataMonthlyByDeptScore(String month, String year, String customerId, List deptScoreDTOS){ + private void insertIndexDataMonthlyByDeptScore(String monthId, String customerId, List deptScoreDTOS){ List monthlyFormDTOList = new ArrayList<>(); // 根据部门id 进行分组,最后组装一条数据 一个部门id 对应 4条数据 Map> collect = deptScoreDTOS.stream().collect(Collectors.groupingBy(DeptScoreDTO::getDeptId)); @@ -445,11 +468,13 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 部门id orgIds[j] = deptScore.getKey(); j++; + // 给4个指数 赋默认值 + monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO); for ( int i = 0; i < deptScore.getValue().size(); i++){ // 区直街道的总分 就是 治理能力 monthlyFormDTO.setIndexTotal(deptScore.getValue().get(i).getScore()); // 赋值 治理能力 - monthlyFormDTO = this.setValueAblityMonthlyFor(deptScore.getValue().get(i).getIndexCode(), + monthlyFormDTO = this.setValueAbilityMonthlyFor(deptScore.getValue().get(i).getIndexCode(), deptScore.getValue().get(i).getScore(), monthlyFormDTO); } @@ -459,22 +484,34 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { throw new RuntimeException("在screen_customer_dept表中未查询到该客户下的父级信息:customerId =" + customerId + ", deptId = " + deptScore.getKey()); } // 补充表中其他字段 - monthlyFormDTO = this.supplementIndexDataMonthlyTable(year, month, OrgTypeConstant.GRID, deptScore.getKey(), + monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.GRID, deptScore.getKey(), parentDeptInfo.getParentAgencyId(), parentDeptInfo.getDeptName(), monthlyFormDTO); monthlyFormDTOList.add(monthlyFormDTO); } - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, year, month, orgIds); - screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); + if (monthlyFormDTOList.size() > NumConstant.ZERO){ + screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds); + screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); + } } + /** + * 目标:将 区/街道的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) + * 如果 区/街道相关分数表 中的组织数量不全,需要从 组织机构信息 中,先查询到缺少的组织信息,赋上默认值后,在插入 区/街道相关分数表。 一对四 + * + * @param monthId + * @param customerId + * @return void + * @Author zhangyong + * @Date 13:44 2020-09-04 + **/ private void startHandleIndexAgencyScore(String monthId, String customerId){ List indexAgencyIds = agencyScoreDaol.selectListAgencyId(customerId, monthId); if (indexAgencyIds.size() > NumConstant.ZERO){ - String[] agencys = new String[indexAgencyIds.size()]; + String[] agencyIds = new String[indexAgencyIds.size()]; for (int i = NumConstant.ZERO; i < indexAgencyIds.size(); i++){ - agencys[i] = indexAgencyIds.get(i); + agencyIds[i] = indexAgencyIds.get(i); } - List mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, agencys); + List mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, agencyIds); if (mismatchAgencyList.size() > NumConstant.ZERO){ this.insertIndexAgencyScoreDefaultValueFor(monthId, customerId, mismatchAgencyList); } @@ -484,23 +521,21 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } // 开始处理实际分数 // fact_index_agency_score 区/街道相关分数表 agency - String[] dateArr = yearOrMonth(monthId); List agencyScoreDTOS = agencyScoreDaol.selectListAgencyScore(customerId, monthId); - this.insertIndexDataMonthlyByAgencyScore(dateArr[NumConstant.ONE], dateArr[NumConstant.ZERO], customerId, agencyScoreDTOS); + this.insertIndexDataMonthlyByAgencyScore(monthId, customerId, agencyScoreDTOS); } /** * 将区/街道相关分数表 数据 插入月表 screenIndexDataMonthlyDao * - * @param month 08 - * @param year 2020 + * @param monthId 202008 * @param customerId 客户id * @param agencyScoreDTOS 区/街道相关分数表 当前客户所属月份数据集 * @return void * @Author zhangyong * @Date 14:17 2020-09-03 **/ - private void insertIndexDataMonthlyByAgencyScore(String month, String year, String customerId, List agencyScoreDTOS){ + private void insertIndexDataMonthlyByAgencyScore(String monthId, String customerId, List agencyScoreDTOS){ List monthlyFormDTOList = new ArrayList<>(); // 根据组织id(eg:社区或者街道id) 进行分组,最后组装一条数据 一个组织id 对应 4条数据 Map> collect = agencyScoreDTOS.stream().collect(Collectors.groupingBy(AgencyScoreDTO::getAgencyId)); @@ -511,13 +546,15 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 组织id(eg:社区或者街道id) orgIds[j] = agencyScore.getKey(); j++; + // 给4个指数 赋默认值 + monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO); for ( int i = 0; i < agencyScore.getValue().size(); i++){ if (NumConstant.ONE_STR.equals(agencyScore.getValue().get(i).getIsTotal())){ // 是总分 总指数 = IS_TOTAL = 1 monthlyFormDTO.setIndexTotal(agencyScore.getValue().get(i).getScore()); } else { // 赋值 党建能力、治理能力、服务能力 - monthlyFormDTO = this.setValueAblityMonthlyFor(agencyScore.getValue().get(i).getIndexCode(), + monthlyFormDTO = this.setValueAbilityMonthlyFor(agencyScore.getValue().get(i).getIndexCode(), agencyScore.getValue().get(i).getScore(), monthlyFormDTO); } @@ -530,18 +567,19 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { throw new RuntimeException("在screen_customer_agency表中未查询到该客户下的组织名称:customerId =" + customerId + ", agencyId = " + agencyScore.getKey()); } // 补充表中其他字段 - monthlyFormDTO = this.supplementIndexDataMonthlyTable(year, month, OrgTypeConstant.GRID, agencyScore.getKey(), + monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.GRID, agencyScore.getKey(), parentAgencyId, agencyName, monthlyFormDTO); monthlyFormDTOList.add(monthlyFormDTO); } - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, year, month, orgIds); - screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); + if (monthlyFormDTOList.size() > NumConstant.ZERO){ + screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds); + screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); + } } /** * 指数-指数数据(每月数值) 表 字段补全,待新增 - * @param year 2020 - * @param month 08 + * @param monthId 202008 * @param orgType 组织类别 agency:组织;部门:department;网格:grid * @param orgId 组织Id 可以为网格,机关id * @param parentId 上级组织id @@ -551,10 +589,10 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @Author zhangyong * @Date 15:29 2020-09-03 **/ - private IndexDataMonthlyFormDTO supplementIndexDataMonthlyTable(String year, String month, String orgType, String orgId, String parentId, + private IndexDataMonthlyFormDTO supplementIndexDataMonthlyTable(String monthId, String orgType, String orgId, String parentId, String orgName, IndexDataMonthlyFormDTO monthlyFormDTO){ - monthlyFormDTO.setYearId(year); - monthlyFormDTO.setMonthId(year + month); + monthlyFormDTO.setYearId(getYearStr(monthId)); + monthlyFormDTO.setMonthId(monthId); monthlyFormDTO.setOrgType(orgType); monthlyFormDTO.setOrgId(orgId); // 根据网格id,查询其上级组织id、组织名称 @@ -564,8 +602,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } /** - * 赋值 党建能力、治理能力、服务能力 - * (总指数 赋默认值) + * 赋实际值 党建能力、治理能力、服务能力 * @param IndexCode 组织类别 * @param Score 分数 * @param monthlyFormDTO 待保存的数据 @@ -573,17 +610,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @Author zhangyong * @Date 09:26 2020-09-04 **/ - private IndexDataMonthlyFormDTO setValueAblityMonthlyFor(String IndexCode, BigDecimal Score, - IndexDataMonthlyFormDTO monthlyFormDTO){ - // 赋默认值 - if (null == monthlyFormDTO.getIndexTotal() && null == monthlyFormDTO.getPartyDevAblity() - && null == monthlyFormDTO.getGovernAblity() && null == monthlyFormDTO.getServiceAblity()){ - BigDecimal zero = new BigDecimal(NumConstant.ZERO); - monthlyFormDTO.setIndexTotal(zero); - monthlyFormDTO.setPartyDevAblity(zero); - monthlyFormDTO.setGovernAblity(zero); - monthlyFormDTO.setServiceAblity(zero); - } + private IndexDataMonthlyFormDTO setValueAbilityMonthlyFor(String IndexCode, BigDecimal Score, IndexDataMonthlyFormDTO monthlyFormDTO){ // 赋实际值 if (IndexCodeEnum.DANG_JIAN_NENG_LI.getCode().equals(IndexCode)){ // 党建能力 @@ -611,22 +638,23 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { monthlyFormDTO.setIndexTotal(zero); monthlyFormDTO.setPartyDevAblity(zero); monthlyFormDTO.setGovernAblity(zero); + monthlyFormDTO.setServiceAblity(zero); return monthlyFormDTO; } /** * 新增 网格相关分值记录表 默认值,一条网格,按照组织类别的不同 需要插入4次 * - * @param monthId + * @param monthId 例:202008 * @param customerId - * @param mismatchGridList + * @param mismatchGridList 网格相关分值记录表 中缺少的网格集合 * @return void * @Author zhangyong * @Date 14:02 2020-09-04 **/ - private void insertIndexGridScoreDefaultValueFor(String monthId, String customerId, List mismatchGridList){ - String[] dateArr = yearOrMonth(monthId); + private void insertIndexGridScoreDefaultValue(String monthId, String customerId, List mismatchGridList){ List insertIndexGridScoreDTOS = new ArrayList<>(); + BigDecimal zero = new BigDecimal(NumConstant.ZERO); for (ScreenCustomerGridDTO gridDTO : mismatchGridList){ FactIndexGridScoreDTO indexGridScoreDTO = new FactIndexGridScoreDTO(); // 赋默认值 - 党建能力指数 @@ -635,11 +663,12 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { indexGridScoreDTO.setAllParentIds(gridDTO.getAllParentIds()); //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 indexGridScoreDTO.setQuarterId(DateUtils.getQuarterId(monthId)); - indexGridScoreDTO.setYearId(dateArr[NumConstant.ZERO]); + indexGridScoreDTO.setYearId(getYearStr(monthId)); indexGridScoreDTO.setMonthId(monthId); - indexGridScoreDTO.setIsTotal(NumConstant.ZERO_STR); // 0 or 1 - indexGridScoreDTO.setScore(new BigDecimal(NumConstant.ZERO)); - indexGridScoreDTO.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); // 4种类型 + // 0 or 1 + indexGridScoreDTO.setIsTotal(NumConstant.ZERO_STR); + indexGridScoreDTO.setScore(zero); + indexGridScoreDTO.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); indexGridScoreDTO.setDelFlag(NumConstant.ZERO_STR); insertIndexGridScoreDTOS.add(indexGridScoreDTO); @@ -649,10 +678,10 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { indexGridScoreDTO1.setAgencyId(gridDTO.getParentAgencyId()); indexGridScoreDTO1.setAllParentIds(gridDTO.getAllParentIds()); indexGridScoreDTO1.setQuarterId(DateUtils.getQuarterId(monthId)); - indexGridScoreDTO1.setYearId(dateArr[NumConstant.ZERO]); + indexGridScoreDTO1.setYearId(getYearStr(monthId)); indexGridScoreDTO1.setMonthId(monthId); indexGridScoreDTO1.setIsTotal(NumConstant.ZERO_STR); - indexGridScoreDTO1.setScore(new BigDecimal(NumConstant.ZERO)); + indexGridScoreDTO1.setScore(zero); indexGridScoreDTO1.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); indexGridScoreDTO1.setDelFlag(NumConstant.ZERO_STR); insertIndexGridScoreDTOS.add(indexGridScoreDTO1); @@ -663,10 +692,10 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { indexGridScoreDTO2.setAgencyId(gridDTO.getParentAgencyId()); indexGridScoreDTO2.setAllParentIds(gridDTO.getAllParentIds()); indexGridScoreDTO2.setQuarterId(DateUtils.getQuarterId(monthId)); - indexGridScoreDTO2.setYearId(dateArr[NumConstant.ZERO]); + indexGridScoreDTO2.setYearId(getYearStr(monthId)); indexGridScoreDTO2.setMonthId(monthId); indexGridScoreDTO2.setIsTotal(NumConstant.ZERO_STR); - indexGridScoreDTO2.setScore(new BigDecimal(NumConstant.ZERO)); + indexGridScoreDTO2.setScore(zero); indexGridScoreDTO2.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode()); indexGridScoreDTO2.setDelFlag(NumConstant.ZERO_STR); insertIndexGridScoreDTOS.add(indexGridScoreDTO2); @@ -677,10 +706,10 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { indexGridScoreDTO3.setAgencyId(gridDTO.getParentAgencyId()); indexGridScoreDTO3.setAllParentIds(gridDTO.getAllParentIds()); indexGridScoreDTO3.setQuarterId(DateUtils.getQuarterId(monthId)); - indexGridScoreDTO3.setYearId(dateArr[NumConstant.ZERO]); + indexGridScoreDTO3.setYearId(getYearStr(monthId)); indexGridScoreDTO3.setMonthId(monthId); indexGridScoreDTO3.setIsTotal(NumConstant.ONE_STR); - indexGridScoreDTO3.setScore(new BigDecimal(NumConstant.ZERO)); + indexGridScoreDTO3.setScore(zero); indexGridScoreDTO3.setIndexCode(IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); indexGridScoreDTO3.setDelFlag(NumConstant.ZERO_STR); insertIndexGridScoreDTOS.add(indexGridScoreDTO3); @@ -698,9 +727,9 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @Author zhangyong * @Date 14:02 2020-09-04 **/ - private void insertIndexCommunityScoreDefaultValueFor(String monthId, String customerId, List mismatchAgencyList){ - String[] dateArr = yearOrMonth(monthId); + private void insertIndexCommunityScoreDefaultValue(String monthId, String customerId, List mismatchAgencyList){ List insertIndexCommunityScore = new ArrayList<>(); + BigDecimal zero = new BigDecimal(NumConstant.ZERO); for (ScreenCustomerAgencyEntity agencyDTO : mismatchAgencyList){ FactIndexCommunityScoreEntity communityScore1 = new FactIndexCommunityScoreEntity(); // 赋默认值 - 党建能力指数 @@ -708,23 +737,23 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { communityScore1.setParentAgencyId(agencyDTO.getPid()); //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 communityScore1.setQuarterId(DateUtils.getQuarterId(monthId)); - communityScore1.setYearId(dateArr[NumConstant.ZERO]); + communityScore1.setYearId(getYearStr(monthId)); communityScore1.setMonthId(monthId); - communityScore1.setIsTotal(NumConstant.ZERO_STR); // 0 or 1 - communityScore1.setScore(new BigDecimal(NumConstant.ZERO)); - communityScore1.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); // 4种类型 + // 0 or 1 + communityScore1.setIsTotal(NumConstant.ZERO_STR); + communityScore1.setScore(zero); + communityScore1.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); insertIndexCommunityScore.add(communityScore1); FactIndexCommunityScoreEntity communityScore2 = new FactIndexCommunityScoreEntity(); // 赋默认值 - 治理能力 communityScore2.setAgencyId(agencyDTO.getAgencyId()); communityScore2.setParentAgencyId(agencyDTO.getPid()); - //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 communityScore2.setQuarterId(DateUtils.getQuarterId(monthId)); - communityScore2.setYearId(dateArr[NumConstant.ZERO]); + communityScore2.setYearId(getYearStr(monthId)); communityScore2.setMonthId(monthId); communityScore2.setIsTotal(NumConstant.ZERO_STR); - communityScore2.setScore(new BigDecimal(NumConstant.ZERO)); + communityScore2.setScore(zero); communityScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); insertIndexCommunityScore.add(communityScore2); @@ -732,12 +761,11 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 赋默认值 - 服务能力 communityScore3.setAgencyId(agencyDTO.getAgencyId()); communityScore3.setParentAgencyId(agencyDTO.getPid()); - //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 communityScore3.setQuarterId(DateUtils.getQuarterId(monthId)); - communityScore3.setYearId(dateArr[NumConstant.ZERO]); + communityScore3.setYearId(getYearStr(monthId)); communityScore3.setMonthId(monthId); communityScore3.setIsTotal(NumConstant.ZERO_STR); - communityScore3.setScore(new BigDecimal(NumConstant.ZERO)); + communityScore3.setScore(zero); communityScore3.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode()); insertIndexCommunityScore.add(communityScore3); @@ -745,20 +773,28 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 赋默认值 - 社区相关 communityScore4.setAgencyId(agencyDTO.getAgencyId()); communityScore4.setParentAgencyId(agencyDTO.getPid()); - //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 communityScore4.setQuarterId(DateUtils.getQuarterId(monthId)); - communityScore4.setYearId(dateArr[NumConstant.ZERO]); + communityScore4.setYearId(getYearStr(monthId)); communityScore4.setMonthId(monthId); communityScore4.setIsTotal(NumConstant.ONE_STR); - communityScore4.setScore(new BigDecimal(NumConstant.ZERO)); + communityScore4.setScore(zero); communityScore4.setIndexCode(IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); insertIndexCommunityScore.add(communityScore4); } factIndexCommunityScoreDao.batchInsertCommunityScoreData(insertIndexCommunityScore, customerId); } + /** + * 新增 区直部门分值表 默认值,一条部门id,按照组织类别的不同 需要插入1次 + * + * @param monthId + * @param customerId + * @param mismatchDeptList + * @return void + * @Author zhangyong + * @Date 14:02 2020-09-04 + **/ private void insertIndexDeptScoreDefaultValueFor(String monthId, String customerId, List mismatchDeptList){ - String[] dateArr = yearOrMonth(monthId); List insertIndexDeptScore = new ArrayList<>(); for (ScreenCustomerDeptEntity deptDTO : mismatchDeptList){ DeptScoreEntity deptScore2 = new DeptScoreEntity(); @@ -767,7 +803,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { deptScore2.setAgencyId(deptDTO.getParentAgencyId()); //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 deptScore2.setQuarterId(DateUtils.getQuarterId(monthId)); - deptScore2.setYearId(dateArr[NumConstant.ZERO]); + deptScore2.setYearId(getYearStr(monthId)); deptScore2.setMonthId(monthId); deptScore2.setIsTotal(NumConstant.ZERO_STR); deptScore2.setScore(new BigDecimal(NumConstant.ZERO)); @@ -778,8 +814,18 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { deptScoreDao.batchInsertDeptScoreData(insertIndexDeptScore, customerId); } + /** + * 新增 区/街道相关分数表 默认值,一条组织id,按照组织类别的不同 需要插入4次 + * + * @param monthId + * @param customerId + * @param mismatchAgencyList + * @return void + * @Author zhangyong + * @Date 14:02 2020-09-04 + **/ private void insertIndexAgencyScoreDefaultValueFor(String monthId, String customerId, List mismatchAgencyList){ - String[] dateArr = yearOrMonth(monthId); + BigDecimal zero = new BigDecimal(NumConstant.ZERO); List insertIndexAgencyScore = new ArrayList<>(); for (ScreenCustomerAgencyEntity agencyDTO : mismatchAgencyList){ if ("community".equals(agencyDTO.getLevel()) || "street".equals(agencyDTO.getLevel()) @@ -790,11 +836,12 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { agencyScore1.setParentAgencyId(agencyDTO.getPid()); //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 agencyScore1.setQuarterId(DateUtils.getQuarterId(monthId)); - agencyScore1.setYearId(dateArr[NumConstant.ZERO]); + agencyScore1.setYearId(getYearStr(monthId)); agencyScore1.setMonthId(monthId); - agencyScore1.setIsTotal(NumConstant.ZERO_STR); // 0 or 1 - agencyScore1.setScore(new BigDecimal(NumConstant.ZERO)); - agencyScore1.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); // 4种类型 + // 0 or 1 + agencyScore1.setIsTotal(NumConstant.ZERO_STR); + agencyScore1.setScore(zero); + agencyScore1.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); AgencyScoreEntity agencyScore2 = new AgencyScoreEntity(); // 赋默认值 - 治理能力 @@ -802,96 +849,77 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { agencyScore2.setParentAgencyId(agencyDTO.getPid()); //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 agencyScore2.setQuarterId(DateUtils.getQuarterId(monthId)); - agencyScore2.setYearId(dateArr[NumConstant.ZERO]); + agencyScore2.setYearId(getYearStr(monthId)); agencyScore2.setMonthId(monthId); agencyScore2.setIsTotal(NumConstant.ZERO_STR); - agencyScore2.setScore(new BigDecimal(NumConstant.ZERO)); + agencyScore2.setScore(zero); agencyScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); AgencyScoreEntity agencyScore3 = new AgencyScoreEntity(); // 赋默认值 - 服务能力 agencyScore3.setAgencyId(agencyDTO.getAgencyId()); agencyScore3.setParentAgencyId(agencyDTO.getPid()); - //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 agencyScore3.setQuarterId(DateUtils.getQuarterId(monthId)); - agencyScore3.setYearId(dateArr[NumConstant.ZERO]); + agencyScore3.setYearId(getYearStr(monthId)); agencyScore3.setMonthId(monthId); agencyScore3.setIsTotal(NumConstant.ZERO_STR); - agencyScore3.setScore(new BigDecimal(NumConstant.ZERO)); + agencyScore3.setScore(zero); agencyScore3.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode()); + AgencyScoreEntity agencyScore4 = new AgencyScoreEntity(); + agencyScore4.setAgencyId(agencyDTO.getAgencyId()); + agencyScore4.setParentAgencyId(agencyDTO.getPid()); + agencyScore4.setQuarterId(DateUtils.getQuarterId(monthId)); + agencyScore4.setYearId(getYearStr(monthId)); + agencyScore4.setMonthId(monthId); + agencyScore4.setIsTotal(NumConstant.ONE_STR); + agencyScore4.setScore(zero); if ("community".equals(agencyDTO.getLevel())){ - AgencyScoreEntity agencyScore4 = new AgencyScoreEntity(); // 赋默认值 - 全区相关 - agencyScore4.setAgencyId(agencyDTO.getAgencyId()); - agencyScore4.setParentAgencyId(agencyDTO.getPid()); - //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 - agencyScore4.setQuarterId(DateUtils.getQuarterId(monthId)); - agencyScore4.setYearId(dateArr[NumConstant.ZERO]); - agencyScore4.setMonthId(monthId); - agencyScore4.setIsTotal(NumConstant.ONE_STR); - agencyScore4.setScore(new BigDecimal(NumConstant.ZERO)); agencyScore4.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode()); - agencyScore4.setDataType("district"); agencyScore1.setDataType("district"); agencyScore2.setDataType("district"); agencyScore3.setDataType("district"); - insertIndexAgencyScore.add(agencyScore4); } else if ("street".equals(agencyDTO.getLevel()) || "district".equals(agencyDTO.getLevel())){ - AgencyScoreEntity agencyScore4 = new AgencyScoreEntity(); // 赋默认值 - 街道相关 - agencyScore4.setAgencyId(agencyDTO.getAgencyId()); - agencyScore4.setParentAgencyId(agencyDTO.getPid()); - //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 - agencyScore4.setQuarterId(DateUtils.getQuarterId(monthId)); - agencyScore4.setYearId(dateArr[NumConstant.ZERO]); - agencyScore4.setMonthId(monthId); - agencyScore4.setIsTotal(NumConstant.ONE_STR); - agencyScore4.setScore(new BigDecimal(NumConstant.ZERO)); agencyScore4.setIndexCode(IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode()); - agencyScore4.setDataType("street"); agencyScore1.setDataType("street"); agencyScore2.setDataType("street"); agencyScore3.setDataType("street"); - insertIndexAgencyScore.add(agencyScore4); } insertIndexAgencyScore.add(agencyScore1); insertIndexAgencyScore.add(agencyScore2); insertIndexAgencyScore.add(agencyScore3); + insertIndexAgencyScore.add(agencyScore4); } } agencyScoreDaol.batchInsertAgencyScoreData(insertIndexAgencyScore, customerId); } - private void insertIndexDataYear(String year, String month, String customerId){ - List monthlyFormList = screenIndexDataMonthlyDao.selectListIndexDataMonthlyByYear(customerId, year, month); - String[] orgIds = new String[monthlyFormList.size()]; - for (int i = NumConstant.ZERO; i < monthlyFormList.size(); i++){ - orgIds[i] = monthlyFormList.get(i).getOrgId(); - } - screenIndexDataYearlyDao.deleteIndexDataYearly(customerId, year, orgIds); - List entity = ConvertUtils.sourceToTarget(monthlyFormList, IndexDataYearlyFormDTO.class); - screenIndexDataYearlyDao.batchInsertIndexDataYearly(entity, customerId); - } - /** - * 将月份id,拆分 dateArr[0] = 年份 dateArr[1] = 月份 + * 根据年,汇总今年各项得到,计算平均值后 插入年表 screen_index_data_yearly * - * @param monthId 202008 - * @return java.lang.String[] + * @param monthId + * @param customerId + * @return void * @Author zhangyong - * @Date 13:39 2020-09-04 + * @Date 22:06 2020-09-04 **/ - private String[] yearOrMonth(String monthId){ - String[] dateArr = new String[NumConstant.TWO]; - dateArr[NumConstant.ZERO] = monthId.substring(NumConstant.ZERO, NumConstant.FOUR); - dateArr[NumConstant.ONE] = monthId.substring(NumConstant.FOUR, NumConstant.SIX); - return dateArr; + private void insertIndexDataYear(String monthId, String customerId){ + List monthlyFormList = screenIndexDataMonthlyDao.selectListIndexDataMonthlyByYear(customerId, getYearStr(monthId), getMonthStr(monthId)); + String[] orgIds = new String[monthlyFormList.size()]; + for (int i = NumConstant.ZERO; i < monthlyFormList.size(); i++){ + orgIds[i] = monthlyFormList.get(i).getOrgId(); + } + if (monthlyFormList.size() > NumConstant.ZERO){ + screenIndexDataYearlyDao.deleteIndexDataYearly(customerId, getYearStr(monthId), orgIds); + List entity = ConvertUtils.sourceToTarget(monthlyFormList, IndexDataYearlyFormDTO.class); + screenIndexDataYearlyDao.batchInsertIndexDataYearly(entity, customerId); + } } - /** * 将月份id,拆分成 年份 * From 350333606c26553939c045f8dce53b0123a8868a Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 7 Sep 2020 09:34:19 +0800 Subject: [PATCH 207/226] =?UTF-8?q?=E5=85=A8=E5=8C=BA=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/evaluationindex/indexcal/AgencyScoreDao.java | 2 +- .../indexcal/impl/IndexCalculateDistrictServiceImpl.java | 8 ++++---- .../mapper/evaluationindex/indexcal/AgencyScoreDao.xml | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java index 72c11ee8ac..5cbcfb20e2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java @@ -70,7 +70,7 @@ public interface AgencyScoreDao extends BaseDao { * @author zxc * @date 2020/8/31 1:51 下午 */ - List selectAgencyScoreAvg(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + List selectAgencyScoreAvg(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("dataType")String dataType); /** 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 4fd50137bd..62a698c953 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 @@ -104,7 +104,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict //党建能力平均值 indexDetailList.forEach(detail -> { if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { - List subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + List subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { log.error(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); return; @@ -184,7 +184,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { - List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); if (districtGovernAvgList.size() == NumConstant.ONE) { pid.put(districtGovernAvgList.get(NumConstant.ZERO).getAgencyId(),districtGovernAvgList.get(NumConstant.ZERO).getParentId()); sizeOne(districtGovernAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); @@ -254,7 +254,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { - List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); + List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); if (subStreetAvgList.size() == NumConstant.ONE) { pid.put(subStreetAvgList.get(NumConstant.ZERO).getAgencyId(),subStreetAvgList.get(NumConstant.ZERO).getParentId()); sizeOne(subStreetAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); @@ -312,6 +312,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict score.setMonthId(monthId); score.setYearId(DateUtils.getYearId(monthId)); score.setQuarterId(DateUtils.getQuarterId(monthId)); + score.setDataType(IndexCalConstant.DISTRICT_LEVEL); score.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode()); value.forEach(community -> { score.setScore(score.getScore().add(community.getScore())); @@ -351,7 +352,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict public void deleteAndInsert(String customerId, String monthId, String indexCode, List subAllDistrict) { if (!CollectionUtils.isEmpty(subAllDistrict)) { agencyScoreDao.deleteOldRecord(customerId, monthId, indexCode,IndexCalConstant.DISTRICT_LEVEL); - System.err.println(subAllDistrict.size()); agencyScoreDao.insertStreetRecord(subAllDistrict); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml index cdc7ea366a..211e573c3c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml @@ -100,6 +100,7 @@ AND fics.customer_id = #{customerId} AND fics.month_id = #{monthId} AND fics.index_code = #{indexCode} + AND fics.DATA_TYPE = #{dataType} GROUP BY fics.agency_id From c83d5c7d0a53b715d2af85892576f2d36dc64cc2 Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 7 Sep 2020 09:44:53 +0800 Subject: [PATCH 208/226] =?UTF-8?q?=E5=AF=B9=E5=A4=96=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=EF=BC=8C=E6=9F=A5=E8=AF=A2=E6=9C=BA=E5=85=B3=E3=80=81=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E3=80=81=E7=BD=91=E6=A0=BC=E4=B8=8B=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E4=BA=BA=E5=91=98=EF=BC=8C=E8=8C=83=E5=9B=B4=E4=BB=8E=E2=80=9C?= =?UTF-8?q?=E4=B8=8D=E5=8C=85=E6=8B=AC=E6=9C=AA=E6=BF=80=E6=B4=BB=E5=92=8C?= =?UTF-8?q?=E8=A2=AB=E7=A6=81=E7=94=A8=E7=9A=84=E2=80=9D=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E6=88=90=E2=80=9C=E4=B8=8D=E5=8C=85=E6=8B=AC=E8=A2=AB=E7=A6=81?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/CustomerStaffDao.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml index 94aaebe1a6..48fd117891 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml @@ -228,7 +228,6 @@ LEFT JOIN user_wechat uw ON uw.user_id = cs.user_id AND uw.del_flag = 0 WHERE cs.del_flag = 0 - AND cs.active_flag = 'active' AND cs.enable_flag = 'enable' AND From 6ad06926ef0a48520aac48b949e23d8a9e365ff7 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Mon, 7 Sep 2020 09:51:30 +0800 Subject: [PATCH 209/226] =?UTF-8?q?=E5=B9=B4=E8=A1=A8-=E6=9C=88=E8=A1=A8?= =?UTF-8?q?=EF=BC=8C=E8=AE=BF=E9=97=AE=E6=95=B0=E6=8D=AE=E5=BA=93=E6=AC=A1?= =?UTF-8?q?=E6=95=B0=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/ScreenCustomerAgencyDao.java | 21 ++++---- .../screen/ScreenCustomerDeptDao.java | 19 ++++--- .../screen/ScreenCustomerGridDao.java | 19 ++++--- .../impl/FactIndexCollectServiceImpl.java | 54 ++++++++++++++----- .../screen/ScreenCustomerAgencyDao.xml | 22 ++++---- .../screen/ScreenCustomerDeptDao.xml | 23 ++++---- .../screen/ScreenCustomerGridDao.xml | 24 ++++----- 7 files changed, 105 insertions(+), 77 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index ea9e977207..4912171860 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -56,17 +56,6 @@ public interface ScreenCustomerAgencyDao extends BaseDao list, @Param("customerId")String customerId); - /** - * 根据客户id、组织id,查询区/街道 组织名称 - * - * @param customerId 客户id - * @param agencyId 组织id - * @return java.util.String - * @Author zhangyong - * @Date 16:57 2020-09-03 - **/ - String selectParentAgencyInfo(@Param("customerId")String customerId, @Param("agencyId")String agencyId); - /** * 返回当前客户下,未匹配到的组织信息 * @param customerId 客户id @@ -76,4 +65,14 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectListMismatcAgencyInfo(@Param("customerId")String customerId, @Param("agencyIds") String[] agencyIds); + + /** + * 根据客户id,查询区/街道 组织名称、id + * + * @param customerId 客户id + * @return java.util.List + * @Author zhangyong + * @Date 16:57 2020-09-03 + **/ + List selectListAgencyInfo(@Param("customerId")String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java index a6f251251a..53a5fcf042 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java @@ -57,16 +57,6 @@ public interface ScreenCustomerDeptDao extends BaseDao **/ void batchInsertCustomerDept(@Param("list") List list, @Param("customerId")String customerId); - /** - * 根据客户id、部门id,查询部门父级 信息 - * @param customerId 客户id - * @param deptId 部门id - * @return com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity - * @Author zhangyong - * @Date 16:57 2020-09-03 - **/ - ScreenCustomerDeptEntity selectParentDeptInfo(@Param("customerId")String customerId, @Param("deptId")String deptId); - /** * @param customerId * @param deptId @@ -88,4 +78,13 @@ public interface ScreenCustomerDeptDao extends BaseDao **/ List selectListMismatchDeptInfo(@Param("customerId") String customerId, @Param("deptIds") String[] deptIds); + + /** + * 根据客户id 查询部门 信息 + * @param customerId 客户id + * @return java.util.List + * @Author zhangyong + * @Date 16:57 2020-09-03 + **/ + List selectListDeptInfo(@Param("customerId")String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java index d07d9aff46..005f69289b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java @@ -95,16 +95,6 @@ public interface ScreenCustomerGridDao extends BaseDao **/ ScreenCustomerGridDTO selectParentAgencyId(@Param("customerId") String customerId, @Param("gridId") String gridId); - /** - * 根据客户id、网格id,查询网格(党支部)父级信息 - * @param customerId - * @param gridId - * @return com.epmet.dto.screen.FactIndexGridScoreDTO - * @Author zhangyong - * @Date 16:57 2020-09-03 - **/ - ScreenCustomerGridDTO selectParentGridInfo(@Param("customerId")String customerId, @Param("gridId")String gridId); - /** * 返回当前客户下,未匹配到的网格信息 * @@ -116,4 +106,13 @@ public interface ScreenCustomerGridDao extends BaseDao **/ List selectListMismatchGridInfo(@Param("customerId") String customerId, @Param("gridIds") String[] gridIds); + + /** + * 根据客户id 查询网格(党支部)详细信息 + * @param customerId + * @return java.util.List + * @Author zhangyong + * @Date 16:57 2020-09-03 + **/ + List selectListGridInfo(@Param("customerId")String customerId); } 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 f1068d23b8..e8d04fea45 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 @@ -281,6 +281,8 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { List monthlyFormDTOList = new ArrayList<>(); // 根据网格id进行分组,最后组装一条数据 一个网格 对应 4条数据 Map> collect = gridScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexGridScoreDTO::getGridId)); + // 查询网格的 上级组织id 和 组织名称 + List parentGridList = screenCustomerGridDao.selectListGridInfo(customerId); String[] orgIds = new String[collect.size()]; int j = 0; for(Map.Entry> gridScore : collect.entrySet()){ @@ -304,14 +306,21 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { monthlyFormDTO); } } - // 查询网格的 上级组织id 和 组织名称 - ScreenCustomerGridDTO parentGridInfo = screenCustomerGridDao.selectParentGridInfo(customerId, gridScore.getKey()); - if (null == parentGridInfo){ + // 匹配网格的 上级组织id 和 组织名称 + String parentAgencyId = ""; + String gridName = ""; + for (ScreenCustomerGridDTO gridDTO : parentGridList){ + if (gridScore.getKey().equals(gridDTO.getGridId())){ + parentAgencyId = gridDTO.getParentAgencyId(); + gridName = gridDTO.getGridName(); + } + } + if ("".equals(parentAgencyId)){ throw new RuntimeException("在screen_customer_grid表中未查询到该客户下的网格信息:customerId =" + customerId + ", gridId = " + gridScore.getKey()); } // 补充表中其他字段 monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.GRID, gridScore.getKey(), - parentGridInfo.getParentAgencyId(), parentGridInfo.getGridName(), monthlyFormDTO); + parentAgencyId, gridName, monthlyFormDTO); monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ @@ -371,6 +380,8 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { List monthlyFormDTOList = new ArrayList<>(); // 根据组织id 进行分组,最后组装一条数据 一个组织id 对应 4条数据 Map> collect = communityScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexCommunityScoreDTO::getAgencyId)); + // 根据客户id,查询区/街道 组织名称、id + List parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId); String[] orgIds = new String[collect.size()]; int j = 0; for(Map.Entry> communityScore : collect.entrySet()){ @@ -397,9 +408,14 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 当前组织 的上级组织id String parentAgencyId = communityScore.getValue().get(NumConstant.ZERO).getParentAgencyId(); - // 查询 组织名称 - String agencyName = screenCustomerAgencyDao.selectParentAgencyInfo(customerId, communityScore.getKey()); - if (null == agencyName){ + // 获取 组织名称 + String agencyName = ""; + for (ScreenCustomerAgencyEntity agencyScoreDTO : parentAgencyList) { + if (communityScore.getKey().equals(agencyScoreDTO.getAgencyId())) { + agencyName = agencyScoreDTO.getAgencyName(); + } + } + if ("".equals(agencyName)){ throw new RuntimeException("在screen_customer_agency表中未查询到该客户下的组织名称:customerId =" + customerId + ", agencyId = " + communityScore.getKey()); } // 补充表中其他字段 @@ -461,6 +477,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { List monthlyFormDTOList = new ArrayList<>(); // 根据部门id 进行分组,最后组装一条数据 一个部门id 对应 4条数据 Map> collect = deptScoreDTOS.stream().collect(Collectors.groupingBy(DeptScoreDTO::getDeptId)); + List parentDeptList = screenCustomerDeptDao.selectListDeptInfo(customerId); String[] orgIds = new String[collect.size()]; int j = 0; for(Map.Entry> deptScore : collect.entrySet()){ @@ -479,13 +496,20 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { monthlyFormDTO); } // 查询网格的 上级组织id 和 组织名称 - ScreenCustomerDeptEntity parentDeptInfo = screenCustomerDeptDao.selectParentDeptInfo(customerId, deptScore.getKey()); - if (null == parentDeptInfo){ + String parentAgencyId = ""; + String deptName = ""; + for (ScreenCustomerDeptEntity deptEntity : parentDeptList) { + if (deptScore.getKey().equals(deptEntity.getDeptId())) { + parentAgencyId = deptEntity.getParentAgencyId(); + deptName = deptEntity.getDeptName(); + } + } + if ("".equals(parentAgencyId)){ throw new RuntimeException("在screen_customer_dept表中未查询到该客户下的父级信息:customerId =" + customerId + ", deptId = " + deptScore.getKey()); } // 补充表中其他字段 monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.GRID, deptScore.getKey(), - parentDeptInfo.getParentAgencyId(), parentDeptInfo.getDeptName(), monthlyFormDTO); + parentAgencyId, deptName, monthlyFormDTO); monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ @@ -539,6 +563,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { List monthlyFormDTOList = new ArrayList<>(); // 根据组织id(eg:社区或者街道id) 进行分组,最后组装一条数据 一个组织id 对应 4条数据 Map> collect = agencyScoreDTOS.stream().collect(Collectors.groupingBy(AgencyScoreDTO::getAgencyId)); + List parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId); String[] orgIds = new String[collect.size()]; int j = 0; for(Map.Entry> agencyScore : collect.entrySet()){ @@ -562,8 +587,13 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 当前组织 的上级组织id String parentAgencyId = agencyScore.getValue().get(NumConstant.ZERO).getParentAgencyId(); // 查询 组织名称 - String agencyName = screenCustomerAgencyDao.selectParentAgencyInfo(customerId, agencyScore.getKey()); - if (null == agencyName){ + String agencyName = ""; + for (ScreenCustomerAgencyEntity agencyScoreDTO : parentAgencyList) { + if (agencyScore.getKey().equals(agencyScoreDTO.getAgencyId())) { + agencyName = agencyScoreDTO.getAgencyName(); + } + } + if ("".equals(agencyName)){ throw new RuntimeException("在screen_customer_agency表中未查询到该客户下的组织名称:customerId =" + customerId + ", agencyId = " + agencyScore.getKey()); } // 补充表中其他字段 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml index c1479694d4..36ac049262 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml @@ -60,17 +60,6 @@ - - + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml index 47ab3d400d..31717d6dd2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml @@ -64,17 +64,6 @@ AND m.CUSTOMER_ID =#{customerId} AND m.DEPT_ID =#{deptId} - + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml index a86ec3bec2..c85dc0af60 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml @@ -106,18 +106,6 @@ AND m.GRID_ID = #{gridId} - - + + From a5eb4ea7bf85e7b6248f7c8c12431d8505271f98 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 7 Sep 2020 10:15:36 +0800 Subject: [PATCH 210/226] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=98=8E=E7=BB=86=20?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=80=A7=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/util/Pinyin4jUtil.java | 3 ++- .../evaluationindex/screen/IndexGroupDetailTemplateDao.xml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java index b3a9ac1760..8d392a2c21 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java @@ -29,7 +29,8 @@ public class Pinyin4jUtil { duoyinMap.put('期',new String[]{"qi"}); duoyinMap.put('参',new String[]{"can"}); duoyinMap.put('均',new String[]{"jun"}); - duoyinMap.put('会',new String[]{"hui"}); + duoyinMap.put('会', new String[]{"hui"}); + duoyinMap.put('属', new String[]{"shu"}); } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailTemplateDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailTemplateDao.xml index df9ec89823..a8e5f55a2e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailTemplateDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailTemplateDao.xml @@ -7,7 +7,7 @@ delete from index_group_detail_template From 1ab0e0c32c36b73bd8da02c1e16f4d33c1668052 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 7 Sep 2020 10:16:36 +0800 Subject: [PATCH 211/226] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=98=8E=E7=BB=86=20?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=80=A7=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/evaluationindex/screen/IndexGroupDetailDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml index 143cdacec1..f099cf7d9a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml @@ -6,7 +6,7 @@ - - \ No newline at end of file From 9794b400ec5182b3386687a1860f0a26d61f1fcf Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Mon, 7 Sep 2020 11:13:05 +0800 Subject: [PATCH 214/226] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/OrgTypeConstant.java | 18 ++- .../impl/FactIndexCollectServiceImpl.java | 111 ++++-------------- 2 files changed, 39 insertions(+), 90 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/OrgTypeConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/OrgTypeConstant.java index 95919792d9..7c88be956c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/OrgTypeConstant.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/OrgTypeConstant.java @@ -9,7 +9,7 @@ package com.epmet.constant; /** - * 组织类别 常量 + * 组织类别/机关级别 常量 * * @author sun * @since 1.0.0 @@ -30,4 +30,20 @@ public interface OrgTypeConstant { * 组织 */ String AGENCY = "agency"; + + /** + * 乡(镇、街道)级 + */ + String STREET = "street"; + + /** + * 区县级 + */ + String DISTRICT = "district"; + + /** + * 社区级 + */ + String COMMUNITY = "community"; + } 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 e8d04fea45..6033f97b04 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 @@ -702,46 +702,20 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { indexGridScoreDTO.setDelFlag(NumConstant.ZERO_STR); insertIndexGridScoreDTOS.add(indexGridScoreDTO); - FactIndexGridScoreDTO indexGridScoreDTO1 = new FactIndexGridScoreDTO(); + FactIndexGridScoreDTO indexGridScoreDTO1 = ConvertUtils.sourceToTarget(indexGridScoreDTO, FactIndexGridScoreDTO.class); // 赋默认值 - 治理能力 - indexGridScoreDTO1.setGridId(gridDTO.getGridId()); - indexGridScoreDTO1.setAgencyId(gridDTO.getParentAgencyId()); - indexGridScoreDTO1.setAllParentIds(gridDTO.getAllParentIds()); - indexGridScoreDTO1.setQuarterId(DateUtils.getQuarterId(monthId)); - indexGridScoreDTO1.setYearId(getYearStr(monthId)); - indexGridScoreDTO1.setMonthId(monthId); - indexGridScoreDTO1.setIsTotal(NumConstant.ZERO_STR); - indexGridScoreDTO1.setScore(zero); indexGridScoreDTO1.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); - indexGridScoreDTO1.setDelFlag(NumConstant.ZERO_STR); insertIndexGridScoreDTOS.add(indexGridScoreDTO1); - FactIndexGridScoreDTO indexGridScoreDTO2 = new FactIndexGridScoreDTO(); + FactIndexGridScoreDTO indexGridScoreDTO2 = ConvertUtils.sourceToTarget(indexGridScoreDTO, FactIndexGridScoreDTO.class); // 赋默认值 - 服务能力 - indexGridScoreDTO2.setGridId(gridDTO.getGridId()); - indexGridScoreDTO2.setAgencyId(gridDTO.getParentAgencyId()); - indexGridScoreDTO2.setAllParentIds(gridDTO.getAllParentIds()); - indexGridScoreDTO2.setQuarterId(DateUtils.getQuarterId(monthId)); - indexGridScoreDTO2.setYearId(getYearStr(monthId)); - indexGridScoreDTO2.setMonthId(monthId); - indexGridScoreDTO2.setIsTotal(NumConstant.ZERO_STR); - indexGridScoreDTO2.setScore(zero); indexGridScoreDTO2.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode()); - indexGridScoreDTO2.setDelFlag(NumConstant.ZERO_STR); insertIndexGridScoreDTOS.add(indexGridScoreDTO2); - FactIndexGridScoreDTO indexGridScoreDTO3 = new FactIndexGridScoreDTO(); - // 赋默认值 - 网格相关 - indexGridScoreDTO3.setGridId(gridDTO.getGridId()); - indexGridScoreDTO3.setAgencyId(gridDTO.getParentAgencyId()); - indexGridScoreDTO3.setAllParentIds(gridDTO.getAllParentIds()); - indexGridScoreDTO3.setQuarterId(DateUtils.getQuarterId(monthId)); - indexGridScoreDTO3.setYearId(getYearStr(monthId)); - indexGridScoreDTO3.setMonthId(monthId); + FactIndexGridScoreDTO indexGridScoreDTO3 = ConvertUtils.sourceToTarget(indexGridScoreDTO, FactIndexGridScoreDTO.class); indexGridScoreDTO3.setIsTotal(NumConstant.ONE_STR); - indexGridScoreDTO3.setScore(zero); + // 赋默认值 - 网格相关 indexGridScoreDTO3.setIndexCode(IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); - indexGridScoreDTO3.setDelFlag(NumConstant.ZERO_STR); insertIndexGridScoreDTOS.add(indexGridScoreDTO3); } factIndexGridScoreDao.batchInsertGridScoreData(insertIndexGridScoreDTOS, customerId); @@ -775,39 +749,19 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { communityScore1.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); insertIndexCommunityScore.add(communityScore1); - FactIndexCommunityScoreEntity communityScore2 = new FactIndexCommunityScoreEntity(); // 赋默认值 - 治理能力 - communityScore2.setAgencyId(agencyDTO.getAgencyId()); - communityScore2.setParentAgencyId(agencyDTO.getPid()); - communityScore2.setQuarterId(DateUtils.getQuarterId(monthId)); - communityScore2.setYearId(getYearStr(monthId)); - communityScore2.setMonthId(monthId); - communityScore2.setIsTotal(NumConstant.ZERO_STR); - communityScore2.setScore(zero); + FactIndexCommunityScoreEntity communityScore2 = ConvertUtils.sourceToTarget(communityScore1, FactIndexCommunityScoreEntity.class); communityScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); insertIndexCommunityScore.add(communityScore2); - FactIndexCommunityScoreEntity communityScore3 = new FactIndexCommunityScoreEntity(); // 赋默认值 - 服务能力 - communityScore3.setAgencyId(agencyDTO.getAgencyId()); - communityScore3.setParentAgencyId(agencyDTO.getPid()); - communityScore3.setQuarterId(DateUtils.getQuarterId(monthId)); - communityScore3.setYearId(getYearStr(monthId)); - communityScore3.setMonthId(monthId); - communityScore3.setIsTotal(NumConstant.ZERO_STR); - communityScore3.setScore(zero); + FactIndexCommunityScoreEntity communityScore3 = ConvertUtils.sourceToTarget(communityScore1, FactIndexCommunityScoreEntity.class); communityScore3.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode()); insertIndexCommunityScore.add(communityScore3); - FactIndexCommunityScoreEntity communityScore4 = new FactIndexCommunityScoreEntity(); // 赋默认值 - 社区相关 - communityScore4.setAgencyId(agencyDTO.getAgencyId()); - communityScore4.setParentAgencyId(agencyDTO.getPid()); - communityScore4.setQuarterId(DateUtils.getQuarterId(monthId)); - communityScore4.setYearId(getYearStr(monthId)); - communityScore4.setMonthId(monthId); + FactIndexCommunityScoreEntity communityScore4 = ConvertUtils.sourceToTarget(communityScore1, FactIndexCommunityScoreEntity.class); communityScore4.setIsTotal(NumConstant.ONE_STR); - communityScore4.setScore(zero); communityScore4.setIndexCode(IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); insertIndexCommunityScore.add(communityScore4); } @@ -858,8 +812,8 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { BigDecimal zero = new BigDecimal(NumConstant.ZERO); List insertIndexAgencyScore = new ArrayList<>(); for (ScreenCustomerAgencyEntity agencyDTO : mismatchAgencyList){ - if ("community".equals(agencyDTO.getLevel()) || "street".equals(agencyDTO.getLevel()) - || "district".equals(agencyDTO.getLevel())){ + if (OrgTypeConstant.COMMUNITY.equals(agencyDTO.getLevel()) || OrgTypeConstant.STREET.equals(agencyDTO.getLevel()) + || OrgTypeConstant.DISTRICT.equals(agencyDTO.getLevel())){ AgencyScoreEntity agencyScore1 = new AgencyScoreEntity(); // 赋默认值 - 党建能力指数 agencyScore1.setAgencyId(agencyDTO.getAgencyId()); @@ -873,51 +827,30 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { agencyScore1.setScore(zero); agencyScore1.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); - AgencyScoreEntity agencyScore2 = new AgencyScoreEntity(); + AgencyScoreEntity agencyScore2 = ConvertUtils.sourceToTarget(agencyScore1, AgencyScoreEntity.class); // 赋默认值 - 治理能力 - agencyScore2.setAgencyId(agencyDTO.getAgencyId()); - agencyScore2.setParentAgencyId(agencyDTO.getPid()); - //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 - agencyScore2.setQuarterId(DateUtils.getQuarterId(monthId)); - agencyScore2.setYearId(getYearStr(monthId)); - agencyScore2.setMonthId(monthId); - agencyScore2.setIsTotal(NumConstant.ZERO_STR); - agencyScore2.setScore(zero); agencyScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); - AgencyScoreEntity agencyScore3 = new AgencyScoreEntity(); + AgencyScoreEntity agencyScore3 = ConvertUtils.sourceToTarget(agencyScore1, AgencyScoreEntity.class); // 赋默认值 - 服务能力 - agencyScore3.setAgencyId(agencyDTO.getAgencyId()); - agencyScore3.setParentAgencyId(agencyDTO.getPid()); - agencyScore3.setQuarterId(DateUtils.getQuarterId(monthId)); - agencyScore3.setYearId(getYearStr(monthId)); - agencyScore3.setMonthId(monthId); - agencyScore3.setIsTotal(NumConstant.ZERO_STR); - agencyScore3.setScore(zero); agencyScore3.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode()); - AgencyScoreEntity agencyScore4 = new AgencyScoreEntity(); - agencyScore4.setAgencyId(agencyDTO.getAgencyId()); - agencyScore4.setParentAgencyId(agencyDTO.getPid()); - agencyScore4.setQuarterId(DateUtils.getQuarterId(monthId)); - agencyScore4.setYearId(getYearStr(monthId)); - agencyScore4.setMonthId(monthId); + AgencyScoreEntity agencyScore4 = ConvertUtils.sourceToTarget(agencyScore1, AgencyScoreEntity.class); agencyScore4.setIsTotal(NumConstant.ONE_STR); - agencyScore4.setScore(zero); - if ("community".equals(agencyDTO.getLevel())){ + if (OrgTypeConstant.COMMUNITY.equals(agencyDTO.getLevel())){ // 赋默认值 - 全区相关 agencyScore4.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode()); - agencyScore4.setDataType("district"); - agencyScore1.setDataType("district"); - agencyScore2.setDataType("district"); - agencyScore3.setDataType("district"); - } else if ("street".equals(agencyDTO.getLevel()) || "district".equals(agencyDTO.getLevel())){ + agencyScore4.setDataType(OrgTypeConstant.DISTRICT); + agencyScore1.setDataType(OrgTypeConstant.DISTRICT); + agencyScore2.setDataType(OrgTypeConstant.DISTRICT); + agencyScore3.setDataType(OrgTypeConstant.DISTRICT); + } else if (OrgTypeConstant.STREET.equals(agencyDTO.getLevel()) || OrgTypeConstant.DISTRICT.equals(agencyDTO.getLevel())){ // 赋默认值 - 街道相关 agencyScore4.setIndexCode(IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode()); - agencyScore4.setDataType("street"); - agencyScore1.setDataType("street"); - agencyScore2.setDataType("street"); - agencyScore3.setDataType("street"); + agencyScore4.setDataType(OrgTypeConstant.STREET); + agencyScore1.setDataType(OrgTypeConstant.STREET); + agencyScore2.setDataType(OrgTypeConstant.STREET); + agencyScore3.setDataType(OrgTypeConstant.STREET); } insertIndexAgencyScore.add(agencyScore1); insertIndexAgencyScore.add(agencyScore2); From 37e731a9f6716592ec7380551ce36765ca789be7 Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 7 Sep 2020 13:25:29 +0800 Subject: [PATCH 215/226] =?UTF-8?q?user=20=20=20=20ext=20=20=20=20=20dev?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml | 2 +- epmet-module/epmet-ext/epmet-ext-server/pom.xml | 2 +- epmet-user/epmet-user-server/deploy/docker-compose-prod.yml | 2 +- epmet-user/epmet-user-server/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml index 5a11859c4a..709b384c7a 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-ext-server: container_name: epmet-ext-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-ext-server:0.0.6 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-ext-server:0.0.7 ports: - "8113:8113" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-ext/epmet-ext-server/pom.xml b/epmet-module/epmet-ext/epmet-ext-server/pom.xml index 771990a0f1..7fe0198686 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/pom.xml +++ b/epmet-module/epmet-ext/epmet-ext-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.0.6 + 0.0.7 com.epmet diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml b/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml index 0f080c990f..4f7e1eb69f 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-user-server:0.3.122 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-user-server:0.3.123 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index b7c301d01b..e9a5b6c5a7 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.122 + 0.3.123 com.epmet epmet-user From 0a9196025a3e7d09297c885a98bd3660895701d2 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Mon, 7 Sep 2020 13:57:09 +0800 Subject: [PATCH 216/226] =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcoll/impl/FactIndexCollectServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 6033f97b04..2d6a2c48ed 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 @@ -419,7 +419,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { throw new RuntimeException("在screen_customer_agency表中未查询到该客户下的组织名称:customerId =" + customerId + ", agencyId = " + communityScore.getKey()); } // 补充表中其他字段 - monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.GRID, communityScore.getKey(), + monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.AGENCY, communityScore.getKey(), parentAgencyId, agencyName, monthlyFormDTO); // 补充表中其他字段 monthlyFormDTOList.add(monthlyFormDTO); @@ -508,7 +508,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { throw new RuntimeException("在screen_customer_dept表中未查询到该客户下的父级信息:customerId =" + customerId + ", deptId = " + deptScore.getKey()); } // 补充表中其他字段 - monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.GRID, deptScore.getKey(), + monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.DEPARTMENT, deptScore.getKey(), parentAgencyId, deptName, monthlyFormDTO); monthlyFormDTOList.add(monthlyFormDTO); } @@ -597,7 +597,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { throw new RuntimeException("在screen_customer_agency表中未查询到该客户下的组织名称:customerId =" + customerId + ", agencyId = " + agencyScore.getKey()); } // 补充表中其他字段 - monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.GRID, agencyScore.getKey(), + monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.AGENCY, agencyScore.getKey(), parentAgencyId, agencyName, monthlyFormDTO); monthlyFormDTOList.add(monthlyFormDTO); } From de648c295f8cc16713ece69f834572f64df016d7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 7 Sep 2020 14:20:06 +0800 Subject: [PATCH 217/226] =?UTF-8?q?=E5=8C=BA=E7=9B=B4selectExtremeValue=20?= =?UTF-8?q?sql=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml index 3039ac9eed..67165f1bf7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml @@ -101,7 +101,7 @@ MAX(m.TRANSFERED_COUNT) as TRANSFERED_COUNT_MAX, MIN(m.CLOSED_PROJECT_COUNT) as CLOSED_PROJECT_COUNT_MIN, MAX(m.CLOSED_PROJECT_COUNT) as CLOSED_PROJECT_COUNT_MAX, - MIN(m.RESP_PROJECT_RATIO) as RESP_PROJECT_RATIO_MIN_MAX, + MIN(m.RESP_PROJECT_RATIO) as RESP_PROJECT_RATIO_MIN, MAX(m.RESP_PROJECT_RATIO) as RESP_PROJECT_RATIO_MAX, MIN(m.HANDLE_PROJECT_RATIO) as HANDLE_PROJECT_RATIO_MIN, MAX(m.HANDLE_PROJECT_RATIO) as HANDLE_PROJECT_RATIO_MAX, From a3022879d3ec24373b405f46c061f769b457e2a8 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 7 Sep 2020 14:34:47 +0800 Subject: [PATCH 218/226] =?UTF-8?q?=E5=8C=BA=E7=9B=B4selectExtremeValue=20?= =?UTF-8?q?sql=E4=BF=AE=E6=94=B9v2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/evaluationindex/indexcal/DeptScoreDao.java | 10 ++++++++++ .../indexcal/impl/DeptScoreServiceImpl.java | 3 ++- .../mapper/evaluationindex/indexcal/DeptScoreDao.xml | 6 ++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java index 8a13b7a0ff..4be461b59a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java @@ -77,4 +77,14 @@ public interface DeptScoreDao extends BaseDao { */ List selectGovernDeptScoreAvg(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + /** + * @return int + * @param customerId + * @param monthId + * @param deptId + * @author yinzuomei + * @description + * @Date 2020/9/7 14:30 + **/ + int deleteByDeptIdAndMonthId(@Param("customerId") String customerId, @Param("monthId")String monthId,@Param("deptId") String deptId); } 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 52ea21e80a..959f3caa64 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 @@ -152,7 +152,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl { if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { //对应的数值 - String sampleValueStr = (String) recordMap.get(indexCodeFieldReService.getFieldNameByIndexCode(key)); + String sampleValueStr =String.valueOf(recordMap.get(indexCodeFieldReService.getFieldNameByIndexCode(key))); //构造样本值对象 SampleValue currentGridIndexValue = new SampleValue((String) recordMap.get(IndexCalConstant.DEPT_ID), new BigDecimal(sampleValueStr)); indexInputVO.getIndexValueVOs().add(currentGridIndexValue); @@ -194,6 +194,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl + + + delete from fact_index_dept_score where CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + and DEPT_ID=#{deptId} + From ea046f3dd10f63b5218db0fc4d98a61ab0129334 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 7 Sep 2020 14:52:11 +0800 Subject: [PATCH 219/226] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=86=85=E5=85=9A?= =?UTF-8?q?=E5=91=98=E7=9A=84=E5=8F=82=E4=B8=8E=E8=AE=AE=E4=BA=8B=E8=83=BD?= =?UTF-8?q?=E5=8A=9B=E8=80=83=E8=AF=84=E5=88=86=EF=BC=88=E5=B9=B3=E5=9D=87?= =?UTF-8?q?=E5=80=BC=EF=BC=89index=5Fcode=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/eum/IndexCodeEnum.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java index cc29f12a95..a49d1a1e13 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java @@ -24,7 +24,7 @@ public enum IndexCodeEnum { DANG_WU_HUO_DONG("dangwuhuodong", "党务活动", 4), LIAN_XI_QUN_ZHONG("lianxiqunzhong", "联系群众", 4), ZUZHINEIDANGYDLXQZNLKPFPJZ("zuzhineidangydlxqznlkpfpjz","组织内党员的联系群众能力考评分(平均值)",5), - ZUZHINEIDANGYDSYYSNLKPFPJZ("zuzhineidangydsyysnlkpfpjz","组织内党员的参与议事能力考评分(平均值)",5), + ZUZHINEIDANGYDSYYSNLKPFPJZ("zuzhineidangydcyysnlkpfpjz","组织内党员的参与议事能力考评分(平均值)",5), XIA_SHU_SUO_YOU_WGDDJNLPJZ("xiashusuoyouwgddjnlpjz","下属所有网格的党建能力(平均值)",5), SHE_QU_XIA_SHU_SYWGZLNLHZPJZ("shequxiashusywgzlnlhzpjz","社区下属所有网格治理能力汇总(平均值)",5), SHE_QU_XIA_JI_SYWGFWNLDFPJZ("shequxiajisywgfwnldfpjz","社区下级所有网格服务能力得分(平均值) ",5), From fee35235828f032a99228218e5587650201a414b Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 7 Sep 2020 14:57:21 +0800 Subject: [PATCH 220/226] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resi-mine/resi-mine-server/deploy/docker-compose-prod.yml | 2 +- epmet-module/resi-mine/resi-mine-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-prod.yml b/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-prod.yml index e59f895806..3c154c7eec 100644 --- a/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-prod.yml +++ b/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-mine-server: container_name: resi-mine-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/resi-mine-server:0.3.39 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/resi-mine-server:0.3.40 ports: - "8094:8094" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-mine/resi-mine-server/pom.xml b/epmet-module/resi-mine/resi-mine-server/pom.xml index 31ec3b085d..a5087a808c 100644 --- a/epmet-module/resi-mine/resi-mine-server/pom.xml +++ b/epmet-module/resi-mine/resi-mine-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.39 + 0.3.40 com.epmet resi-mine From 3635f202625fd9c10303576a80f0197682916cfa Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 7 Sep 2020 16:16:16 +0800 Subject: [PATCH 221/226] =?UTF-8?q?=E6=8C=87=E6=A0=87=E6=B1=87=E6=80=BB?= =?UTF-8?q?=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/DemoController.java | 18 +++++++++ .../impl/IndexCalculateServiceImpl.java | 38 +++++++++++++++++-- 2 files changed, 52 insertions(+), 4 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 397d99df7a..ca5c66b5d6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -462,4 +462,22 @@ public class DemoController { String monthId = "202008"; indexCalculateDistrictService.calDistrictAll(customerId,monthId); } + @PostMapping("gridZxc") + public void getGrid(){ + String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + String monthId = "202008"; + CalculateCommonFormDTO c = new CalculateCommonFormDTO(); + c.setCustomerId(customerId); + c.setMonthId(monthId); + gridCorreLationService.calculateGridCorreLation(c); + } + @PostMapping("deptZxc") + public void getDept(){ + String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + String monthId = "202008"; + CalculateCommonFormDTO c = new CalculateCommonFormDTO(); + c.setCustomerId(customerId); + c.setMonthId(monthId); + deptScoreService.calculateDeptCorreLation(c); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java index f305df99e2..9385c1f121 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java @@ -9,10 +9,7 @@ import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.screen.form.IndexCalculateForm; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.redis.IndexCodeFieldReRedis; -import com.epmet.service.evaluationindex.indexcal.CpcIndexCalculateService; -import com.epmet.service.evaluationindex.indexcal.GridCorreLationService; -import com.epmet.service.evaluationindex.indexcal.IndexCalculateCommunityService; -import com.epmet.service.evaluationindex.indexcal.IndexCalculateService; +import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.util.DimIdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -41,6 +38,12 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { private IndexCodeFieldReRedis indexCodeFieldReRedis; @Autowired private IndexCalculateCommunityService indexCalculateCommunityService; + @Autowired + private IndexCalculateStreetService indexCalculateStreetService; + @Autowired + private IndexCalculateDistrictService indexCalculateDistrictService; + @Autowired + private DeptScoreService deptScoreService; @Override public Boolean indexCalculate(IndexCalculateForm formDTO) { @@ -87,6 +90,33 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { log.error("indexCalculate calAll exception", e); break; } + + //计算街道 + try { + indexCalculateStreetService.calStreetAll(customerId,formDTO.getMonthId()); + log.info("indexCalculate calAll return result:{}", flag); + } catch (Exception e) { + log.error("indexCalculate calAll exception", e); + break; + } + + //计算区直属 + try { + deptScoreService.calculateDeptCorreLation(calculateCommonFormDTO); + log.info("indexCalculate calAll return result:{}", flag); + } catch (Exception e) { + log.error("indexCalculate calAll exception", e); + break; + } + + //计算全区 + try { + indexCalculateDistrictService.calDistrictAll(customerId,formDTO.getMonthId()); + log.info("indexCalculate calAll return result:{}", flag); + } catch (Exception e) { + log.error("indexCalculate calAll exception", e); + break; + } } return flag; } catch (Exception e) { From 7d0166487ecc43c7645adca9c287019e62e83231 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 7 Sep 2020 16:37:55 +0800 Subject: [PATCH 222/226] test --- .../main/java/com/epmet/controller/DemoController.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 397d99df7a..5fe7a00dfa 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -1,8 +1,10 @@ package com.epmet.controller; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; import com.epmet.dao.evaluationindex.indexcal.GridScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao; @@ -167,7 +169,7 @@ public class DemoController { // deptScoreService.calculateDeptCorreLation(formDTO); return new Result(); } - + @DataSource(DataSourceConstant.EVALUATION_INDEX) @PostMapping("insertgridinfo") public Result insertScreenCustomerGrid(){ ScreenCustomerGridEntity entity1=new ScreenCustomerGridEntity(); @@ -205,6 +207,7 @@ public class DemoController { return new Result(); } + @DataSource(DataSourceConstant.EVALUATION_INDEX) @PostMapping("inserttestdata") public Result test(){ //网格相关-党建能力 @@ -253,7 +256,7 @@ public class DemoController { entity1.setPartyAvgShiftProjectCount(50); //网格党员人均提出的议题转项目数 entity1.setUserAvgShiftProjectCount(50); //网格群众人均提出的议题转项目数 entity1.setCreateGroupPartyCount(35); //建群党员数(累计值) 去重 - entity1.setPublishArticleCount(35); //网格发文数 + entity1.setPublishArticleCount(50); //网格发文数 entity1.setIssueToProjectRatio(new BigDecimal("50")); //网格议题转项目率 entity1.setCreateThreeMeetsCount(10); //组织三会一课次数 entity1.setJoinThreeMeetsCount(30); //党员参加三会一课人次 @@ -284,7 +287,7 @@ public class DemoController { entity2.setCreateGroupPartyCount(30); //建群党员数(累计值) 去重 entity2.setPublishArticleCount(30); //网格发文数 entity2.setIssueToProjectRatio(new BigDecimal("30")); //网格议题转项目率 - entity2.setCreateThreeMeetsCount(25); //组织三会一课次数 + entity2.setCreateThreeMeetsCount(35); //组织三会一课次数 entity2.setJoinThreeMeetsCount(20); //党员参加三会一课人次 entity2.setCreatedBy(IndexCalConstant.insertUser); From 7d1af6c75801ee8271006b3de0839f8ed09491cd Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 7 Sep 2020 18:17:53 +0800 Subject: [PATCH 223/226] =?UTF-8?q?=E9=83=A8=E7=BD=B2statis=20report=20use?= =?UTF-8?q?r=20ext?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-report-server/deploy/docker-compose-prod.yml | 2 +- .../data-report-server/deploy/docker-compose-test.yml | 2 +- .../data-statistical-server/deploy/docker-compose-prod.yml | 2 +- .../data-statistical-server/deploy/docker-compose-test.yml | 2 +- epmet-user/epmet-user-server/deploy/docker-compose-prod.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml index ad6ed50dc2..8fdb335fda 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-report-server: container_name: data-report-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-report-server:0.3.27 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-report-server:0.3.36 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-test.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-test.yml index 9a3f62f01c..78d38da205 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-test.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-report-server: container_name: data-report-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/data-report-server:0.3.27 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/data-report-server:0.3.36 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml index 029e37c343..1fe39907b7 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-statistical-server: container_name: data-statistical-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-statistical-server:0.3.42 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-statistical-server:0.3.47 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml index 2e5a7af0e8..075a43a0af 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-statistical-server: container_name: data-statistical-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/data-statistical-server:0.3.42 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/data-statistical-server:0.3.47 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml b/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml index 4f7e1eb69f..183968322f 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-user-server:0.3.123 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-user-server:0.3.124 ports: - "8087:8087" network_mode: host # 不会创建新的网络 From ed542f696fad7d5fd544b399d8b3dc4848409b70 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 7 Sep 2020 18:26:16 +0800 Subject: [PATCH 224/226] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/aspect/CustomerApplicationRunner.java | 1 + .../resources/db/migration/V0.0.2__dim_ag_add_col_type.sql | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/CustomerApplicationRunner.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/CustomerApplicationRunner.java index b1bfe5d08e..8e065c792a 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/CustomerApplicationRunner.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/CustomerApplicationRunner.java @@ -40,6 +40,7 @@ public class CustomerApplicationRunner implements ApplicationRunner { public void run(ApplicationArguments args) { //发送启动成功消息 EnvEnum currentEnv = EnvEnum.getCurrentEnv(); + logger.info(currentEnv); if (!EnvEnum.DEV.getCode().equals(currentEnv.getCode())) { InetUtils inetUtils = SpringContextUtils.getBean(InetUtils.class); String serverIp = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.2__dim_ag_add_col_type.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.2__dim_ag_add_col_type.sql index 9f1554015e..541d0d7307 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.2__dim_ag_add_col_type.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.2__dim_ag_add_col_type.sql @@ -1 +1,2 @@ -ALTER TABLE dim_agency ADD COLUMN AGENCY_DIM_TYPE VARCHAR(10) NOT NULL COMMENT '机关维度类型。self:机关本身自己,all:机关自己+下级+网格+部门等'; \ No newline at end of file +/*ALTER TABLE dim_agency ADD COLUMN AGENCY_DIM_TYPE VARCHAR(10) NOT NULL COMMENT '机关维度类型。self:机关本身自己,all:机关自己+下级+网格+部门等';*/ +select 1; \ No newline at end of file From 79691f6f442619e6faf3f580c731cc4bbbc22f77 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 7 Sep 2020 18:27:56 +0800 Subject: [PATCH 225/226] =?UTF-8?q?=E9=83=A8=E7=BD=B2reposrt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-statistical-server/deploy/docker-compose-dev.yml | 2 +- .../data-statistical-server/deploy/docker-compose-prod.yml | 2 +- epmet-module/data-statistical/data-statistical-server/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml index dd615ce5f1..36afabff51 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-statistical-server: container_name: data-statistical-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.47 + image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.48 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml index 1fe39907b7..b62847d615 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-statistical-server: container_name: data-statistical-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-statistical-server:0.3.47 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-statistical-server:0.3.48 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 8a32ee8d75..57200bf62b 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.47 + 0.3.48 data-statistical com.epmet From ab7314466f38503a842d701cf2956a6523fb3736 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 9 Sep 2020 14:44:30 +0800 Subject: [PATCH 226/226] =?UTF-8?q?pom=E6=96=87=E4=BB=B6=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?local=E9=85=8D=E7=BD=AE=EF=BC=8C=E7=94=A8=E4=BA=8E=E5=BC=80?= =?UTF-8?q?=E5=8F=91=E6=9C=BA=E5=99=A8=E8=B0=83=E8=AF=95=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-admin/epmet-admin-server/pom.xml | 36 +++++- epmet-auth/pom.xml | 43 ++++++- epmet-gateway/pom.xml | 119 +++++++++++++++++- .../data-report/data-report-server/pom.xml | 55 +++++++- .../data-statistical-server/pom.xml | 99 ++++++++++++++- .../epmet-activiti-server/pom.xml | 31 ++++- .../common-service-server/pom.xml | 42 ++++++- .../epmet-ext/epmet-ext-server/pom.xml | 33 ++++- .../epmet-heart/epmet-heart-server/pom.xml | 42 ++++++- .../epmet-job/epmet-job-server/pom.xml | 36 +++++- .../epmet-message-server/pom.xml | 33 ++++- .../epmet-oss/epmet-oss-server/pom.xml | 33 ++++- .../epmet-point/epmet-point-server/pom.xml | 36 +++++- .../epmet-third/epmet-third-server/pom.xml | 33 ++++- .../gov-access/gov-access-server/pom.xml | 34 ++++- epmet-module/gov-grid/gov-grid-server/pom.xml | 27 +++- .../gov-issue/gov-issue-server/pom.xml | 38 +++++- epmet-module/gov-mine/gov-mine-server/pom.xml | 25 +++- epmet-module/gov-org/gov-org-server/pom.xml | 33 ++++- .../gov-project/gov-project-server/pom.xml | 34 ++++- .../gov-voice/gov-voice-server/pom.xml | 34 ++++- .../oper-access/oper-access-server/pom.xml | 33 ++++- epmet-module/oper-crm/oper-crm-server/pom.xml | 33 ++++- .../oper-customize-server/pom.xml | 33 ++++- .../resi-group/resi-group-server/pom.xml | 34 ++++- .../resi-guide/resi-guide-server/pom.xml | 33 ++++- .../resi-hall/resi-hall-server/pom.xml | 27 +++- .../resi-home/resi-home-server/pom.xml | 25 +++- .../resi-mine/resi-mine-server/pom.xml | 24 +++- .../resi-partymember-server/pom.xml | 33 ++++- .../resi-voice/resi-voice-server/pom.xml | 25 +++- epmet-openapi/epmet-openapi-scan/pom.xml | 27 +++- epmet-user/epmet-user-server/pom.xml | 33 ++++- 33 files changed, 1179 insertions(+), 77 deletions(-) diff --git a/epmet-admin/epmet-admin-server/pom.xml b/epmet-admin/epmet-admin-server/pom.xml index 9058e3065d..df371df8a9 100644 --- a/epmet-admin/epmet-admin-server/pom.xml +++ b/epmet-admin/epmet-admin-server/pom.xml @@ -84,12 +84,41 @@ dev + + 8082 + dev + + + + + + epmet_admin_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8082 - dev + local @@ -103,7 +132,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 @@ -116,9 +145,6 @@ test - 8082 test diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index aaff93a013..7a7fcd5f9c 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -156,9 +156,6 @@ dev - - true - 8081 dev @@ -192,12 +189,46 @@ e5e72147737cfeb2b0f3a43624cadb3f--> + + local + + true + + + 8081 + local + + + 0 + 192.168.1.130 + 6379 + 123456 + + false + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + wxcb6ce2ed0c5ae54c + c7f74941ee97fa9b2e1065772d34c397 + 12345678Yzm + jiKrJoPQsUIP9ayAwmuJQeAVPBjFOh5D1JxFDd7ZSU3 + + wx07674c23af51b521 + a2fd0d29b007cbbcf8c8dda8c693d99b + + wx3d1372029eb816a3 + 651f02d71ed3f123dfb584b8bf0f4d8b + + + test - 8081 test diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index 66279bb8ad..e64e3f45c3 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -87,9 +87,6 @@ dev - - true - 8080 @@ -201,6 +198,122 @@ + + local + + true + + + 8080 + + + 0 + 192.168.1.130 + 6379 + 123456 + + false + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + + lb://epmet-auth-server + + lb://epmet-admin-server + + lb://epmet-oss-server + + lb://epmet-message-server + + lb://epmet-activiti-server + + lb://epmet-job-server + + + + lb://epmet-user-server + + lb://epmet-demo-server + + lb://oper-customize-server + + lb://oper-crm-server + + + lb://resi-guide-server + + + lb://gov-org-server + + + lb://oper-access-server + + + lb://resi-mine-server + + + lb://resi-group-server + + + lb://resi-partymember-server + + + lb://gov-grid-server + + + lb://gov-access-server + + + + lb://gov-mine-server + + lb://resi-hall-server + + + lb://gov-issue-server + + + lb://gov-project-server + + lb://common-service-server + + lb://resi-home-server + + + lb://gov-voice-server + + + lb://resi-voice-server + + + lb://data-report-server + + + lb://data-statistical-server + + + lb://epmet-openapi-scan + + + lb://epmet-third-server + + + + lb://epmet-heart-server + + + lb://epmet-point-server + + + lb://epmet-ext-server + + + test + + + + epmet_data_statistical_user + EpmEt-db-UsEr + + + + + + epmet_data_stats_display_user + EpmEt-db-UsEr + + + + + epmet_evaluation_index_user + EpmEt-db-UsEr + + + 0 + 192.168.1.130 + 6379 + 123456 + + + false + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + test + + + + epmet_data_statistical_user + EpmEt-db-UsEr + + + + + epmet_gov_org_user + EpmEt-db-UsEr + + + + + epmet_gov_issue_user + EpmEt-db-UsEr + + + + + epmet_gov_project_user + EpmEt-db-UsEr + + + + + epmet_gov_voice_user + EpmEt-db-UsEr + + + + + epmet_oper_crm_user + EpmEt-db-UsEr + + + + + epmet_resi_group_user + EpmEt-db-UsEr + + + + + epmet_user_user + EpmEt-db-UsEr + + + + + epmet_data_stats_display_user + EpmEt-db-UsEr + + + + + epmet_evaluation_index_user + EpmEt-db-UsEr + + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + false + + + 5 + 8 + 10 + 30 + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + + local true 8108 - dev + local @@ -201,7 +296,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/pom.xml b/epmet-module/epmet-activiti/epmet-activiti-server/pom.xml index 5a4cf59cab..06d167aab2 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/pom.xml +++ b/epmet-module/epmet-activiti/epmet-activiti-server/pom.xml @@ -158,12 +158,41 @@ dev + + 8086 + dev + + + + + + epmet_activiti_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + false + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8086 - dev + local diff --git a/epmet-module/epmet-common-service/common-service-server/pom.xml b/epmet-module/epmet-common-service/common-service-server/pom.xml index 169304d350..3988353e35 100644 --- a/epmet-module/epmet-common-service/common-service-server/pom.xml +++ b/epmet-module/epmet-common-service/common-service-server/pom.xml @@ -92,9 +92,6 @@ dev - - true - 8103 dev @@ -129,6 +126,45 @@ 52d9d9b0e7d0eb5b8b81c205b579e07c + + local + + true + + + 8103 + local + + + + + + + + epmet_common_service_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + false + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + https://epmet-dev.elinkservice.cn/estos/ + producerService/producer/sendMsg + 202007161443499985fa2d397436d10356542134c8f008c48 + 52d9d9b0e7d0eb5b8b81c205b579e07c + + test + + + + epmet_third_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8113 - dev + local @@ -191,7 +220,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/epmet-heart/epmet-heart-server/pom.xml b/epmet-module/epmet-heart/epmet-heart-server/pom.xml index 5b963aa293..202bc6a9d7 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/pom.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/pom.xml @@ -110,12 +110,50 @@ dev + + 8111 + dev + + + + + + epmet_heart_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + https://epmet-dev.elinkservice.cn/api/epmetscan/api + + https://epmet-dev.elinkservice.cn/estos/ + producerService/producer/sendMsg + 202007161443499985fa2d397436d10356542134c8f008c48 + 52d9d9b0e7d0eb5b8b81c205b579e07c + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + + local true 8111 - dev + local @@ -129,7 +167,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/epmet-job/epmet-job-server/pom.xml b/epmet-module/epmet-job/epmet-job-server/pom.xml index 3b0c5fcbf5..eddc655426 100644 --- a/epmet-module/epmet-job/epmet-job-server/pom.xml +++ b/epmet-module/epmet-job/epmet-job-server/pom.xml @@ -107,12 +107,44 @@ dev + + 8084 + dev + + + + + + epmet_job_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + + local true 8084 - dev + local @@ -126,7 +158,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/epmet-message/epmet-message-server/pom.xml b/epmet-module/epmet-message/epmet-message-server/pom.xml index deea95460a..1322ad2243 100644 --- a/epmet-module/epmet-message/epmet-message-server/pom.xml +++ b/epmet-module/epmet-message/epmet-message-server/pom.xml @@ -124,12 +124,41 @@ dev + + 8085 + dev + + + + + + epmet_message_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8085 - dev + local @@ -143,7 +172,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/epmet-oss/epmet-oss-server/pom.xml b/epmet-module/epmet-oss/epmet-oss-server/pom.xml index 8fc5bc1d67..b73264233b 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/pom.xml +++ b/epmet-module/epmet-oss/epmet-oss-server/pom.xml @@ -120,12 +120,41 @@ dev + + 8083 + dev + + + + + + epmet_oss_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8083 - dev + local @@ -139,7 +168,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/epmet-point/epmet-point-server/pom.xml b/epmet-module/epmet-point/epmet-point-server/pom.xml index c67cf5c997..f0add3faf1 100644 --- a/epmet-module/epmet-point/epmet-point-server/pom.xml +++ b/epmet-module/epmet-point/epmet-point-server/pom.xml @@ -115,12 +115,44 @@ dev + + 8112 + dev + + + + + + epmet_point_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + + local true 8112 - dev + local @@ -134,7 +166,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/epmet-third/epmet-third-server/pom.xml b/epmet-module/epmet-third/epmet-third-server/pom.xml index 6942418f11..f85185fb9b 100644 --- a/epmet-module/epmet-third/epmet-third-server/pom.xml +++ b/epmet-module/epmet-third/epmet-third-server/pom.xml @@ -183,12 +183,41 @@ dev + + 8110 + dev + + + + + + epmet_third_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8110 - dev + local @@ -202,7 +231,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/gov-access/gov-access-server/pom.xml b/epmet-module/gov-access/gov-access-server/pom.xml index 5d4189286a..9c0b30d5c1 100644 --- a/epmet-module/gov-access/gov-access-server/pom.xml +++ b/epmet-module/gov-access/gov-access-server/pom.xml @@ -101,12 +101,42 @@ dev + + 8099 + dev + + + + + + epmet_gov_access_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + false + + + + local true 8099 - dev + local @@ -120,7 +150,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/gov-grid/gov-grid-server/pom.xml b/epmet-module/gov-grid/gov-grid-server/pom.xml index c5bf66fd08..494a417395 100644 --- a/epmet-module/gov-grid/gov-grid-server/pom.xml +++ b/epmet-module/gov-grid/gov-grid-server/pom.xml @@ -93,12 +93,35 @@ dev + + 8097 + dev + + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8097 - dev + local 0 @@ -106,7 +129,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/gov-issue/gov-issue-server/pom.xml b/epmet-module/gov-issue/gov-issue-server/pom.xml index a90b43312d..93d9f0334c 100644 --- a/epmet-module/gov-issue/gov-issue-server/pom.xml +++ b/epmet-module/gov-issue/gov-issue-server/pom.xml @@ -119,12 +119,46 @@ dev + + 8101 + dev + + + + + + epmet_gov_issue_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + https://epmet-dev.elinkservice.cn/api/epmetscan/api + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + + local true 8101 - dev + local @@ -138,7 +172,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/gov-mine/gov-mine-server/pom.xml b/epmet-module/gov-mine/gov-mine-server/pom.xml index 073cf96190..54f3b8e225 100644 --- a/epmet-module/gov-mine/gov-mine-server/pom.xml +++ b/epmet-module/gov-mine/gov-mine-server/pom.xml @@ -119,12 +119,33 @@ dev + + 8098 + dev + + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + + local true 8098 - dev + local 0 @@ -132,7 +153,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index f7e38a8870..94f959ad2b 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -125,12 +125,41 @@ dev + + 8092 + dev + + + + + + epmet_gov_org_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8092 - dev + local @@ -144,7 +173,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/gov-project/gov-project-server/pom.xml b/epmet-module/gov-project/gov-project-server/pom.xml index 163ea7921d..2c45f4a53f 100644 --- a/epmet-module/gov-project/gov-project-server/pom.xml +++ b/epmet-module/gov-project/gov-project-server/pom.xml @@ -119,12 +119,42 @@ dev + + 8102 + dev + + + + + + epmet_gov_project_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + https://epmet-dev.elinkservice.cn/api/epmetscan/api + + + + local true 8102 - dev + local @@ -138,7 +168,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/gov-voice/gov-voice-server/pom.xml b/epmet-module/gov-voice/gov-voice-server/pom.xml index 17268c4fe4..1c80814b41 100644 --- a/epmet-module/gov-voice/gov-voice-server/pom.xml +++ b/epmet-module/gov-voice/gov-voice-server/pom.xml @@ -106,12 +106,42 @@ dev + + 8105 + dev + + + + + + epmet_gov_voice_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + https://epmet-dev.elinkservice.cn/api/epmetscan/api + + + + local true 8105 - dev + local @@ -125,7 +155,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/oper-access/oper-access-server/pom.xml b/epmet-module/oper-access/oper-access-server/pom.xml index e5c20ef1be..f78794d104 100644 --- a/epmet-module/oper-access/oper-access-server/pom.xml +++ b/epmet-module/oper-access/oper-access-server/pom.xml @@ -94,12 +94,41 @@ dev + + 8093 + dev + + + + + + epmet_oper_access_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8093 - dev + local @@ -113,7 +142,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/oper-crm/oper-crm-server/pom.xml b/epmet-module/oper-crm/oper-crm-server/pom.xml index b675bc8c4a..8535f16485 100644 --- a/epmet-module/oper-crm/oper-crm-server/pom.xml +++ b/epmet-module/oper-crm/oper-crm-server/pom.xml @@ -115,12 +115,41 @@ dev + + 8090 + dev + + + + + + epmet_oper_crm_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8090 - dev + local @@ -134,7 +163,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/oper-customize/oper-customize-server/pom.xml b/epmet-module/oper-customize/oper-customize-server/pom.xml index 1257fbf218..ff5abc3d03 100644 --- a/epmet-module/oper-customize/oper-customize-server/pom.xml +++ b/epmet-module/oper-customize/oper-customize-server/pom.xml @@ -92,12 +92,41 @@ dev + + 8089 + dev + + + + + + epmet_oper_customize_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8089 - dev + local @@ -111,7 +140,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/resi-group/resi-group-server/pom.xml b/epmet-module/resi-group/resi-group-server/pom.xml index c07b96ad77..9cf3e5ec43 100644 --- a/epmet-module/resi-group/resi-group-server/pom.xml +++ b/epmet-module/resi-group/resi-group-server/pom.xml @@ -122,12 +122,42 @@ dev + + 8095 + dev + + + + + + epmet_resi_group_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + https://epmet-dev.elinkservice.cn/api/epmetscan/api + + + + local true 8095 - dev + local @@ -141,7 +171,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/resi-guide/resi-guide-server/pom.xml b/epmet-module/resi-guide/resi-guide-server/pom.xml index 4aefd4cbe1..04ba4c1d3e 100644 --- a/epmet-module/resi-guide/resi-guide-server/pom.xml +++ b/epmet-module/resi-guide/resi-guide-server/pom.xml @@ -115,12 +115,41 @@ dev + + 8091 + dev + + + + + + epmet_resi_guide_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8091 - dev + local @@ -134,7 +163,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/resi-hall/resi-hall-server/pom.xml b/epmet-module/resi-hall/resi-hall-server/pom.xml index a81bf919dc..a44a834c35 100644 --- a/epmet-module/resi-hall/resi-hall-server/pom.xml +++ b/epmet-module/resi-hall/resi-hall-server/pom.xml @@ -79,12 +79,35 @@ dev + + 8100 + dev + + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8100 - dev + local 0 @@ -92,7 +115,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/resi-home/resi-home-server/pom.xml b/epmet-module/resi-home/resi-home-server/pom.xml index f6eebaaad7..d43f84aaa6 100644 --- a/epmet-module/resi-home/resi-home-server/pom.xml +++ b/epmet-module/resi-home/resi-home-server/pom.xml @@ -99,12 +99,33 @@ dev + + 8104 + dev + + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + + local true 8104 - dev + local 0 @@ -112,7 +133,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/resi-mine/resi-mine-server/pom.xml b/epmet-module/resi-mine/resi-mine-server/pom.xml index a5087a808c..1cf70149cc 100644 --- a/epmet-module/resi-mine/resi-mine-server/pom.xml +++ b/epmet-module/resi-mine/resi-mine-server/pom.xml @@ -124,19 +124,39 @@ dev + + 8094 + dev + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + + local true 8094 - dev + local 0 192.168.1.130 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/resi-partymember/resi-partymember-server/pom.xml b/epmet-module/resi-partymember/resi-partymember-server/pom.xml index 7ee6d3c54e..d35830cc69 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/pom.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/pom.xml @@ -121,12 +121,41 @@ dev + + 8096 + dev + + + + + + epmet_resi_partymember_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8096 - dev + local @@ -140,7 +169,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/resi-voice/resi-voice-server/pom.xml b/epmet-module/resi-voice/resi-voice-server/pom.xml index 5c087281de..9985f3c6a5 100644 --- a/epmet-module/resi-voice/resi-voice-server/pom.xml +++ b/epmet-module/resi-voice/resi-voice-server/pom.xml @@ -85,12 +85,33 @@ dev + + 8106 + dev + + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + + local true 8106 - dev + local 0 @@ -98,7 +119,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-openapi/epmet-openapi-scan/pom.xml b/epmet-openapi/epmet-openapi-scan/pom.xml index 46532a144e..c77bafe339 100644 --- a/epmet-openapi/epmet-openapi-scan/pom.xml +++ b/epmet-openapi/epmet-openapi-scan/pom.xml @@ -86,6 +86,28 @@ dev + + 8107 + dev + + + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + + local true @@ -100,7 +122,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 @@ -111,9 +133,6 @@ test - 8107 test diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index 761b8ea921..b6872595d0 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -130,12 +130,41 @@ dev + + 8087 + dev + + + + + + epmet_user_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8087 - dev + local @@ -149,7 +178,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988