From 798c4e95c96ef991dd7ed26e46a9a7fc1fcbe28c Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 14 Aug 2020 10:21:48 +0800 Subject: [PATCH 01/32] =?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 02/32] =?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 03/32] =?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 d10fc9bf0b8ba780638961857d75c7c0b2e26672 Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 24 Aug 2020 16:16:10 +0800 Subject: [PATCH 04/32] =?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 cd41458c40f882c5196fa37b624655a64f91c46f Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 26 Aug 2020 15:43:42 +0800 Subject: [PATCH 05/32] =?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 9d507ee0331fc04df60e696c01e37dfd668b68ad Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 31 Aug 2020 15:46:42 +0800 Subject: [PATCH 06/32] =?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 c1ea0143db61542b5712f32d3c84c15d1e5ca165 Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 31 Aug 2020 16:57:48 +0800 Subject: [PATCH 07/32] =?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 a3b2dfdd32790698d278ef87919eefc96fd35692 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 3 Sep 2020 16:49:54 +0800 Subject: [PATCH 08/32] =?UTF-8?q?third=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-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 945ab756f0dfea4ca27777062864f9228f77b802 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 4 Sep 2020 17:19:47 +0800 Subject: [PATCH 09/32] =?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 10/32] =?UTF-8?q?Merge=20branch=20'dev=5Fscreen=5Fdata'=20?= =?UTF-8?q?of=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 11/32] =?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 12/32] =?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 13/32] =?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 14/32] =?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 6ad06926ef0a48520aac48b949e23d8a9e365ff7 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Mon, 7 Sep 2020 09:51:30 +0800 Subject: [PATCH 15/32] =?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 16/32] =?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 17/32] =?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 20/32] =?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 21/32] =?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 22/32] =?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 23/32] =?UTF-8?q?=E5=8C=BA=E7=9B=B4selectExtremeValue=20sq?= =?UTF-8?q?l=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 24/32] =?UTF-8?q?=E5=8C=BA=E7=9B=B4selectExtremeValue=20sq?= =?UTF-8?q?l=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 25/32] =?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 26/32] =?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 27/32] =?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 28/32] 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 29/32] =?UTF-8?q?=E9=83=A8=E7=BD=B2statis=20report=20user?= =?UTF-8?q?=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 30/32] =?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 31/32] =?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 139f64cc7776a7b6dc47290df37317889d9e3cbd Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 8 Sep 2020 09:49:57 +0800 Subject: [PATCH 32/32] =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=AB=AF=E3=80=81?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E7=AB=AF=E8=8E=B7=E5=8F=96=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E5=AE=9A=E5=88=B6=E5=8A=9F=E8=83=BD=E5=88=97=E8=A1=A8=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/form/FunctionDetailFromDTO.java | 21 ++++ .../oper-customize-server/pom.xml | 6 + .../CustomerFunctionDetailController.java | 9 +- .../epmet/dao/CustomerFunctionRoleDao.java | 12 +- .../CustomerFunctionDetailService.java | 12 +- .../CustomerFunctionDetailServiceImpl.java | 113 +++++++++++++++--- .../impl/CustomerFunctionRoleServiceImpl.java | 4 +- .../mapper/CustomerFunctionRoleDao.xml | 15 +++ .../epmet/dto/form/GetRoleKeyListFormDTO.java | 28 +++++ .../epmet/feign/EpmetUserOpenFeignClient.java | 7 ++ .../EpmetUserOpenFeignClientFallback.java | 5 + .../com/epmet/controller/RoleController.java | 14 +++ .../main/java/com/epmet/dao/StaffRoleDao.java | 9 ++ .../main/java/com/epmet/dao/UserRoleDao.java | 9 ++ .../java/com/epmet/service/RoleService.java | 9 ++ .../epmet/service/impl/RoleServiceImpl.java | 26 ++++ .../main/resources/mapper/StaffRoleDao.xml | 12 ++ .../src/main/resources/mapper/UserRoleDao.xml | 12 ++ 18 files changed, 301 insertions(+), 22 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GetRoleKeyListFormDTO.java diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionDetailFromDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionDetailFromDTO.java index ee133cd136..d8a8641ddb 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionDetailFromDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionDetailFromDTO.java @@ -5,6 +5,7 @@ import lombok.Data; import javax.validation.constraints.NotBlank; import java.io.Serializable; +import java.util.List; /** * 查询客户定制功能列表-接口入参 @@ -25,6 +26,11 @@ public class FunctionDetailFromDTO implements Serializable { */ @NotBlank(message = "客户Id不能为空", groups = {AddUserShowGroup.class}) private String customerId; + /** + * 网格ID + */ + @NotBlank(message = "网格Id不能为空", groups = {AddUserShowGroup.class}) + private String gridId; /** * resi:居民端,work:工作端 @@ -32,4 +38,19 @@ public class FunctionDetailFromDTO implements Serializable { @NotBlank(message = "所属端不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class}) private String clientType; + /** + * token中userId + */ + private String userId; + + /** + * 所属端(居民端:resi 工作端:gov) + */ + private String fromApp; + + /** + * 用户角色key集合 + */ + private List roleKeyList; + } diff --git a/epmet-module/oper-customize/oper-customize-server/pom.xml b/epmet-module/oper-customize/oper-customize-server/pom.xml index 1257fbf218..335c55ad66 100644 --- a/epmet-module/oper-customize/oper-customize-server/pom.xml +++ b/epmet-module/oper-customize/oper-customize-server/pom.xml @@ -64,6 +64,12 @@ 2.0.0 compile + + com.epmet + epmet-user-client + 2.0.0 + compile + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java index 245d5018a2..76dff2a151 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java @@ -18,6 +18,7 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; @@ -105,7 +106,9 @@ public class CustomerFunctionDetailController { @PostMapping("resifunctiondetaillist") public Result> resiFunctionDetail(@LoginUser TokenDto tokenDto, @RequestBody FunctionDetailFromDTO formDTO) { ValidatorUtils.validateEntity(formDTO, FunctionDetailFromDTO.AddUserShowGroup.class); - return new Result>().ok(customerFunctionDetailService.resiAndWorkFunctionDetail(formDTO)); + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setFromApp(AppClientConstant.APP_RESI); + return new Result>().ok(customerFunctionDetailService.resiFunctionDetail(formDTO)); } /** @@ -118,7 +121,9 @@ public class CustomerFunctionDetailController { public Result> workFunctionDetail(@LoginUser TokenDto tokenDto, @RequestBody FunctionDetailFromDTO formDTO) { ValidatorUtils.validateEntity(formDTO, FunctionDetailFromDTO.AddUserInternalGroup.class); formDTO.setCustomerId(tokenDto.getCustomerId()); - return new Result>().ok(customerFunctionDetailService.resiAndWorkFunctionDetail(formDTO)); + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setFromApp(AppClientConstant.APP_GOV); + return new Result>().ok(customerFunctionDetailService.workFunctionDetail(formDTO)); } /** diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionRoleDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionRoleDao.java index 4a1eb94497..5a00d7e20a 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionRoleDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionRoleDao.java @@ -20,6 +20,8 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.CustomerFunctionRoleDTO; import com.epmet.dto.form.CustomerFunctionRoleListFormDTO; +import com.epmet.dto.form.FunctionDetailFromDTO; +import com.epmet.dto.form.SaveCustomerFunctionRoleFormDTO; import com.epmet.dto.result.CustomerFunctionRoleListResultDTO; import com.epmet.entity.CustomerFunctionRoleEntity; import org.apache.ibatis.annotations.Mapper; @@ -40,7 +42,7 @@ public interface CustomerFunctionRoleDao extends BaseDao selectCustomerFunctionRoleList(CustomerFunctionRoleListFormDTO formDTO); + + /** + * @param formDTO + * @return + * @author sun + * @Description 根据用户拥有的角色查询客户的定制功能 + */ + List selectFunctionList(FunctionDetailFromDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java index d0561093e3..7571294f23 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java @@ -102,9 +102,17 @@ public interface CustomerFunctionDetailService extends BaseService resiAndWorkFunctionDetail(FunctionDetailFromDTO formDTO); + List resiFunctionDetail(FunctionDetailFromDTO formDTO); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 工作端-根据所属端和客户Id查询客户定制功能列表 + **/ + List workFunctionDetail(FunctionDetailFromDTO formDTO); /** * 修改客户定制功能上下架 diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java index d57623db5d..895b1da73b 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java @@ -20,6 +20,7 @@ package com.epmet.service.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.constant.AppClientConstant; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; @@ -28,10 +29,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.dao.CustomerFunctionDao; -import com.epmet.dao.CustomerFunctionDetailDao; -import com.epmet.dao.FunctionCustomizedDao; -import com.epmet.dao.FunctionShoppingHistoryDao; +import com.epmet.dao.*; import com.epmet.dto.CustomerFunctionDetailDTO; import com.epmet.dto.FunctionCustomizedDTO; import com.epmet.dto.FunctionShoppingHistoryDTO; @@ -40,6 +38,7 @@ import com.epmet.dto.result.*; import com.epmet.entity.CustomerFunctionDetailEntity; import com.epmet.entity.CustomerFunctionEntity; import com.epmet.entity.FunctionShoppingHistoryEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.redis.CustomerFunctionDetailRedis; import com.epmet.service.CustomerFunctionDetailService; import com.epmet.service.FunctionShoppingHistoryService; @@ -49,6 +48,7 @@ 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 rx.internal.util.LinkedArrayList; import java.util.*; import java.util.stream.Collectors; @@ -73,6 +73,10 @@ public class CustomerFunctionDetailServiceImpl extends BaseServiceImpl page(Map params) { @@ -126,6 +130,58 @@ public class CustomerFunctionDetailServiceImpl extends BaseServiceImpl resiFunctionDetail(FunctionDetailFromDTO formDTO) { + List restltList = new LinkedList<>(); + //1.根据客户Id和所属端查询客户定制功能列表数据 + logger.info(String.format("根据客户Id和所属端查询客户定制功能列表,对应客户Id->%s,所属端->%s", formDTO.getCustomerId(), formDTO.getClientType())); + List list = baseDao.selectFunctionDetailList(formDTO); + if (null != list && list.size() > NumConstant.ZERO) { + //1-1.设置自定义json数据(暂时为空) + try { + String join = String.join(",", new ArrayList<>()); + String customerParameter = java.net.URLEncoder.encode(join, "utf-8"); + list.forEach(l -> { + l.setCustomerParameter(customerParameter); + }); + } catch (Exception e) { + logger.error("CustomerFunctionDetailServiceImpl.resiAndWorkFunctionDetail->集合参数URLEncode失败"); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage()); + } + + //2.调用user服务,获取用户角色信息 + GetRoleKeyListFormDTO dto = new GetRoleKeyListFormDTO(); + dto.setUserId(formDTO.getUserId()); + dto.setGridId(formDTO.getGridId()); + dto.setFromApp(AppClientConstant.APP_RESI); + Result> result = epmetUserOpenFeignClient.getUserRoleKeyList(dto); + if (!result.success()) { + throw new RenException(result.getCode()); + } + formDTO.setRoleKeyList(result.getData()); + + //3.根据用户拥有的角色查询客户的定制功能 + List listFunctionIds = customerFunctionRoleDao.selectFunctionList(formDTO); + + //4.封装结果数据 + listFunctionIds.forEach(id -> { + list.forEach(l -> { + if (id.equals(l.getFunctionId())) { + restltList.add(l); + } + }); + }); + } + + return restltList; + } + /** * @param formDTO * @return @@ -133,21 +189,48 @@ public class CustomerFunctionDetailServiceImpl extends BaseServiceImpl resiAndWorkFunctionDetail(FunctionDetailFromDTO formDTO) { - //根据客户Id和所属端查询客户定制功能列表数据 + public List workFunctionDetail(FunctionDetailFromDTO formDTO) { + List restltList = new LinkedList<>(); + //1.根据客户Id和所属端查询客户定制功能列表数据 logger.info(String.format("根据客户Id和所属端查询客户定制功能列表,对应客户Id->%s,所属端->%s", formDTO.getCustomerId(), formDTO.getClientType())); List list = baseDao.selectFunctionDetailList(formDTO); - try { - String join = String.join(",", new ArrayList<>()); - String customerParameter = java.net.URLEncoder.encode(join, "utf-8"); - list.forEach(l->{ - l.setCustomerParameter(customerParameter); + if (null != list && list.size() > NumConstant.ZERO) { + //1-1.设置自定义json数据(暂时为空) + try { + String join = String.join(",", new ArrayList<>()); + String customerParameter = java.net.URLEncoder.encode(join, "utf-8"); + list.forEach(l->{ + l.setCustomerParameter(customerParameter); + }); + } catch (Exception e) { + logger.error("CustomerFunctionDetailServiceImpl.resiAndWorkFunctionDetail->集合参数URLEncode失败"); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage()); + } + + //2.调用user服务,获取用户角色信息 + GetRoleKeyListFormDTO dto = new GetRoleKeyListFormDTO(); + dto.setUserId(formDTO.getUserId()); + dto.setFromApp(AppClientConstant.APP_GOV); + Result> result = epmetUserOpenFeignClient.getUserRoleKeyList(dto); + if (!result.success()) { + throw new RenException(result.getCode()); + } + formDTO.setRoleKeyList(result.getData()); + + //3.根据用户拥有的角色查询客户的定制功能 + List listFunctionIds = customerFunctionRoleDao.selectFunctionList(formDTO); + + //4.封装结果数据 + listFunctionIds.forEach(id -> { + list.forEach(l -> { + if (id.equals(l.getFunctionId())) { + restltList.add(l); + } + }); }); - } catch (Exception e) { - logger.error("CustomerFunctionDetailServiceImpl.resiAndWorkFunctionDetail->集合参数URLEncode失败"); - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage()); } - return list; + + return restltList; } @Override diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionRoleServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionRoleServiceImpl.java index 4ebfaa9f5f..f930ee6bdc 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionRoleServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionRoleServiceImpl.java @@ -129,8 +129,8 @@ public class CustomerFunctionRoleServiceImpl extends BaseServiceImpl + + DELETE FROM customer_function_role WHERE customer_id = #{customerId} + AND function_id = #{functionId} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GetRoleKeyListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GetRoleKeyListFormDTO.java new file mode 100644 index 0000000000..263b263a8f --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GetRoleKeyListFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 获取用户拥有的角色key集合-接口入参 + * @Author sun + */ +@Data +public class GetRoleKeyListFormDTO implements Serializable{ + private static final long serialVersionUID = -7994579456530273809L; + + /** + * 用户Id + * */ + private String userId; + /** + * 网格Id + * */ + private String gridId; + /** + * 所属端(居民端:resi 工作端:gov) + * */ + private String fromApp; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 4e3da40627..939bbd7b80 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -306,4 +306,11 @@ public interface EpmetUserOpenFeignClient { */ @PostMapping("epmetuser/staffrole/changeroleorg") Result changeRoleOrg(@RequestBody StaffRoleDTO formDTO); + + /** + * @Author sun + * @Description 居民端-查询用户角色key列表 + **/ + @PostMapping("epmetuser/role/getuserrolekeylist") + Result> getUserRoleKeyList(@RequestBody GetRoleKeyListFormDTO dto); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index a60c9611ae..2a6db644e7 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -205,4 +205,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result changeRoleOrg(StaffRoleDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "changeRoleOrg", formDTO); } + + @Override + public Result> getUserRoleKeyList(GetRoleKeyListFormDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getUserRoleKeyList", dto); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/RoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/RoleController.java index e7c82100a6..98ec4c998f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/RoleController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/RoleController.java @@ -17,7 +17,9 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -26,6 +28,7 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.RoleDTO; +import com.epmet.dto.form.GetRoleKeyListFormDTO; import com.epmet.excel.RoleExcel; import com.epmet.service.RoleService; import org.springframework.beans.factory.annotation.Autowired; @@ -91,4 +94,15 @@ public class RoleController { ExcelUtils.exportExcelToTarget(response, null, list, RoleExcel.class); } + /** + * @param formDTO + * @return + * @Author sun + * @Description 居民端-查询用户角色key列表 + **/ + @PostMapping("getuserrolekeylist") + public Result> getUserRoleKeyList(@RequestBody GetRoleKeyListFormDTO formDTO) { + return new Result>().ok(roleService.getUserRoleKeyList(formDTO)); + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java index dfc5407272..3124fc68c7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java @@ -23,6 +23,7 @@ import com.epmet.commons.mybatis.entity.DataScope; import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.form.CustomerStaffRoleListFormDTO; +import com.epmet.dto.form.GetRoleKeyListFormDTO; import com.epmet.dto.result.CustomerStaffRoleListResultDTO; import com.epmet.dto.result.CustomerStaffRoleResultDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; @@ -122,4 +123,12 @@ public interface StaffRoleDao extends BaseDao { * @return void */ void updateStaffRoleOrgId(StaffRoleDTO dto); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 工作端-查询用户角色key列表 + **/ + List selectStaffRoleKeyList(GetRoleKeyListFormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserRoleDao.java index e91e0c8d46..3801f0fcf4 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserRoleDao.java @@ -20,6 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.UserRoleDTO; +import com.epmet.dto.form.GetRoleKeyListFormDTO; import com.epmet.dto.form.UserRoleFormDTO; import com.epmet.dto.result.UserRoleResultDTO; import com.epmet.entity.UserRoleEntity; @@ -63,4 +64,12 @@ public interface UserRoleDao extends BaseDao { * @Date 14:24 2020-07-23 **/ List getUserRoleInfoByUserId(@Param("userId") String userId); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 居民端-查询用户角色key列表 + **/ + List selectUserRoleKeyList(GetRoleKeyListFormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RoleService.java index 72e055c4b1..21ac0465b0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RoleService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RoleService.java @@ -20,6 +20,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.RoleDTO; +import com.epmet.dto.form.GetRoleKeyListFormDTO; import com.epmet.entity.RoleEntity; import java.util.List; @@ -99,4 +100,12 @@ public interface RoleService extends BaseService { * @return RoleDTO */ RoleDTO getRoleByKey(RoleDTO role); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 居民端-查询用户角色key列表 + **/ + List getUserRoleKeyList(GetRoleKeyListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RoleServiceImpl.java index 8322ee7226..40b1e478ff 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RoleServiceImpl.java @@ -20,11 +20,15 @@ package com.epmet.service.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.constant.AppClientConstant; 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.RoleDao; +import com.epmet.dao.StaffRoleDao; +import com.epmet.dao.UserRoleDao; import com.epmet.dto.RoleDTO; +import com.epmet.dto.form.GetRoleKeyListFormDTO; import com.epmet.entity.RoleEntity; import com.epmet.redis.RoleRedis; import com.epmet.service.RoleService; @@ -33,6 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -48,6 +53,10 @@ public class RoleServiceImpl extends BaseServiceImpl implem @Autowired private RoleRedis roleRedis; + @Autowired + private UserRoleDao userRoleDao; + @Autowired + private StaffRoleDao staffRoleDao; @Override public PageData page(Map params) { @@ -106,4 +115,21 @@ public class RoleServiceImpl extends BaseServiceImpl implem RoleEntity entity = baseDao.selectRoleByKey(ConvertUtils.sourceToTarget(role, RoleEntity.class)); return ConvertUtils.sourceToTarget(entity, RoleDTO.class); } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 居民端-查询用户角色key列表 + **/ + @Override + public List getUserRoleKeyList(GetRoleKeyListFormDTO formDTO) { + List list = new ArrayList<>(); + if(AppClientConstant.APP_RESI.equals(formDTO.getFromApp())){ + list = userRoleDao.selectUserRoleKeyList(formDTO); + }else if(AppClientConstant.APP_GOV.equals(formDTO.getFromApp())){ + list = staffRoleDao.selectStaffRoleKeyList(formDTO); + } + return list; + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml index aabdfd6d71..0b39b350b7 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml @@ -181,4 +181,16 @@ and sr.ROLE_ID = #{roleId} and sr.DEL_FLAG='0' + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserRoleDao.xml index 803fa40621..d7726d3b7b 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserRoleDao.xml @@ -88,4 +88,16 @@ ur.USER_ID = #{userId} + +