From b5adf11f74ad60e8446c0db44202ba3918912d04 Mon Sep 17 00:00:00 2001
From: yinzuomei <576302893@qq.com>
Date: Thu, 27 Aug 2020 14:57:42 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9C=80=E5=A4=A7=E5=80=BC=E6=9C=80=E5=B0=8F?=
=?UTF-8?q?=E5=80=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../dto/indexcal/PageQueryGridFormDTO.java | 33 +++
.../FactIndexGovrnAblityGridMonthlyDTO.java | 142 ++++++++++++
.../FactIndexPartyAblityGridMonthlyDTO.java | 167 ++++++++++++++
.../FactIndexServiceAblityGridMonthlyDTO.java | 117 ++++++++++
.../data-statistical-server/pom.xml | 2 +-
.../FactIndexGovrnAblityGridMonthlyDao.java | 21 ++
.../FactIndexPartyAblityGridMonthlyDao.java | 22 ++
.../FactIndexServiceAblityGridMonthlyDao.java | 22 ++
.../dao/screen/ScreenCustomerGridDao.java | 10 +
.../indexcal/GridCorreLationService.java | 24 ++
.../impl/GridCorreLationServiceImpl.java | 210 +++++++++++++++++-
.../FactIndexGovrnAblityGridMonthlyDao.xml | 51 +++++
.../FactIndexPartyAblityGridMonthlyDao.xml | 68 ++++++
.../FactIndexServiceAblityGridMonthlyDao.xml | 37 +++
.../mapper/screen/ScreenCustomerGridDao.xml | 15 ++
15 files changed, 933 insertions(+), 8 deletions(-)
create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/PageQueryGridFormDTO.java
create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexGovrnAblityGridMonthlyDTO.java
create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexPartyAblityGridMonthlyDTO.java
create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexServiceAblityGridMonthlyDTO.java
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/PageQueryGridFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/PageQueryGridFormDTO.java
new file mode 100644
index 0000000000..51f5244294
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/PageQueryGridFormDTO.java
@@ -0,0 +1,33 @@
+package com.epmet.dto.indexcal;
+
+import lombok.Data;
+
+import javax.validation.constraints.Min;
+import java.io.Serializable;
+
+/**
+ * 分页查询网格列表
+ *
+ * @author yinzuomei@elink-cn.com
+ * @date 2020/8/27 14:37
+ */
+@Data
+public class PageQueryGridFormDTO implements Serializable {
+ /**
+ * 客户id
+ */
+ private String customerId;
+
+ /**
+ * 页码
+ * */
+ @Min(1)
+ private Integer pageNo;
+
+ /**
+ * 每页多少条
+ * */
+ private Integer pageSize = 10;
+
+ private Integer pageIndex;
+}
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexGovrnAblityGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexGovrnAblityGridMonthlyDTO.java
new file mode 100644
index 0000000000..80ec8c7100
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexGovrnAblityGridMonthlyDTO.java
@@ -0,0 +1,142 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto.indexcollect;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * 治理能力-网格相关事实表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-08-26
+ */
+@Data
+public class FactIndexGovrnAblityGridMonthlyDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * ID 主键
+ */
+ private String id;
+
+ /**
+ * 客户Id
+ */
+ private String customerId;
+
+ /**
+ * 网格所属机关Id
+ */
+ private String agencyId;
+
+ /**
+ * 网格Id
+ */
+ private String gridId;
+
+ /**
+ * 月维度Id:yyyyMM
+ */
+ private String monthId;
+
+ /**
+ * 季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4
+ */
+ private String quarterId;
+
+ /**
+ * 年Id:yyyy
+ */
+ private String yearId;
+
+ /**
+ * 网格总议题数
+ */
+ private Integer issueTotal;
+
+ /**
+ * 网格人均议题数目
+ */
+ private Integer avgIssueCount;
+
+ /**
+ * 网格议题转项目率
+ */
+ private BigDecimal avgShiftProjectRatio;
+
+ /**
+ * 网格总项目数
+ */
+ private Integer projectTotal;
+
+ /**
+ * 网格自治项目数 统计期网格自身内办结的项目数目
+ */
+ private Integer selfSolveProjectCount;
+
+ /**
+ * 网格办结项目数 统计期内办结的项目数目
+ */
+ private Integer resolveProjectCount;
+
+ /**
+ * 网格吹哨部门准确率
+ */
+ private BigDecimal transferRightRatio;
+
+ /**
+ * 网格内解决的项目的满意度
+ */
+ private BigDecimal satisfactionRatio;
+
+ /**
+ * 删除标识 0未删除;1已删除
+ */
+ private String delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+}
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexPartyAblityGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexPartyAblityGridMonthlyDTO.java
new file mode 100644
index 0000000000..901ff46b9e
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexPartyAblityGridMonthlyDTO.java
@@ -0,0 +1,167 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto.indexcollect;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * 党建能力-网格相关事实表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-08-26
+ */
+@Data
+public class FactIndexPartyAblityGridMonthlyDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * ID 主键
+ */
+ private String id;
+
+ /**
+ * 客户Id
+ */
+ private String customerId;
+
+ /**
+ * 机关Id
+ */
+ private String agencyId;
+
+ /**
+ * 网格Id
+ */
+ private String gridId;
+
+ /**
+ * 月维度Id:yyyyMM
+ */
+ private String monthId;
+
+ /**
+ * 季度Id yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4
+ */
+ private String quarterId;
+
+ /**
+ * 年Idyyyy
+ */
+ private String yearId;
+
+ /**
+ * 网格群众用户数
+ */
+ private Integer userCount;
+
+ /**
+ * 网格党员用户数
+ */
+ private Integer partyCount;
+
+ /**
+ * 网格活跃群众用户数
+ */
+ private Integer activeUserCount;
+
+ /**
+ * 网格活跃党员用户数
+ */
+ private Integer activePartyCount;
+
+ /**
+ * 网格党员人均提出话题数
+ */
+ private Integer partyAvgTopicCount;
+
+ /**
+ * 网格群众人均提出话题数
+ */
+ private Integer userAvgTopicCount;
+
+ /**
+ * 网格党员人均提出的议题转项目数
+ */
+ private Integer partyAvgShiftProjectCount;
+
+ /**
+ * 网格群众人均提出的议题转项目数
+ */
+ private Integer userAvgShiftProjectCount;
+
+ /**
+ * 建群党员数(累计值) 去重
+ */
+ private Integer createGroupPartyCount;
+
+ /**
+ * 网格发文数
+ */
+ private Integer publishArticleCount;
+
+ /**
+ * 网格议题转项目率
+ */
+ private BigDecimal issueToProjectRatio;
+
+ /**
+ * 组织三会一课次数
+ */
+ private Integer createThreeMeetsCount;
+
+ /**
+ * 党员参加三会一课人次
+ */
+ private Integer joinThreeMeetsCount;
+
+ /**
+ * 删除标识 0未删除;1已删除
+ */
+ private String delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+}
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexServiceAblityGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexServiceAblityGridMonthlyDTO.java
new file mode 100644
index 0000000000..decd896d03
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexServiceAblityGridMonthlyDTO.java
@@ -0,0 +1,117 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto.indexcollect;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * 服务能力-网格相关事实表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-08-26
+ */
+@Data
+public class FactIndexServiceAblityGridMonthlyDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * ID 主键
+ */
+ private String id;
+
+ /**
+ * 客户Id
+ */
+ private String customerId;
+
+ /**
+ * 网格所属组织Id
+ */
+ private String agencyId;
+
+ /**
+ * 网格Id
+ */
+ private String gridId;
+
+ /**
+ * 月维度Id:yyyyMM
+ */
+ private String monthId;
+
+ /**
+ * 季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4
+ */
+ private String quarterId;
+
+ /**
+ * 年Id: yyyy
+ */
+ private String yearId;
+
+ /**
+ * 网格活动组织次数 爱心活动
+ */
+ private Integer activityCount;
+
+ /**
+ * 网格志愿者占比
+ */
+ private BigDecimal volunteerRatio;
+
+ /**
+ * 网格党员志愿者率
+ */
+ private BigDecimal partyVolunteerRatio;
+
+ /**
+ * 删除标识 0未删除;1已删除
+ */
+ private String delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+}
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml
index 8d0e953c05..a805e4a53c 100644
--- a/epmet-module/data-statistical/data-statistical-server/pom.xml
+++ b/epmet-module/data-statistical/data-statistical-server/pom.xml
@@ -195,7 +195,7 @@
6379
123456
- true
+ false
192.168.1.130:8848
6ceab336-d004-4acf-89c6-e121d06f4988
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java
index e591ba928d..11cb3fbe03 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java
@@ -24,6 +24,7 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
+import java.util.Map;
/**
* 治理能力-网格相关事实表
@@ -64,4 +65,24 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao list, @Param("customerId")String customerId);
+
+ /**
+ * @param customerId 客户id
+ * @param monthId yyyyMM
+ * @return java.util.List
+ * @author yinzuomei
+ * @description 当前客户下,所有网格的治理能力相关五级指标
+ * @Date 2020/8/26 15:58
+ **/
+ List> selectListGovrnAblityGrid(@Param("customerId") String customerId, @Param("monthId") String monthId);
+
+ /**
+ * @return java.util.Map
+ * @param customerId
+ * @param monthId
+ * @author yinzuomei
+ * @description 查询治理能力,网格相关,各五级指标最大值,最小值
+ * @Date 2020/8/27 13:10
+ **/
+ Map selectGovrnAblityGridMinAndMax(@Param("customerId") String customerId, @Param("monthId") String monthId);
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityGridMonthlyDao.java
index b5cb8d2c5e..0aff70aece 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityGridMonthlyDao.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityGridMonthlyDao.java
@@ -18,12 +18,14 @@
package com.epmet.dao.indexcoll;
import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.indexcollect.FactIndexPartyAblityGridMonthlyDTO;
import com.epmet.dto.indexcollect.form.GridPartyAbilityFormDTO;
import com.epmet.entity.indexcoll.FactIndexPartyAblityGridMonthlyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
+import java.util.Map;
/**
* 党建能力-网格相关事实表
@@ -64,4 +66,24 @@ public interface FactIndexPartyAblityGridMonthlyDao extends BaseDao list, @Param("customerId")String customerId);
+
+ /**
+ * @param customerId 客户id
+ * @param monthId yyyyMM
+ * @return java.util.List
+ * @author yinzuomei
+ * @description 当前客户下,所有网格的党建能力相关五级指标
+ * @Date 2020/8/26 15:57
+ **/
+ List> selectListPartyAblityGrid(@Param("customerId") String customerId, @Param("monthId") String monthId);
+
+ /**
+ * @return java.util.Map
+ * @param customerId
+ * @param monthId
+ * @author yinzuomei
+ * @description 查询党建能力,网格相关,各五级指标最大值,最小值
+ * @Date 2020/8/27 12:51
+ **/
+ Map selectPartyAblityGridMinAndMax(@Param("customerId") String customerId, @Param("monthId") String monthId);
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.java
index 9eb7051762..a2b2eb78f8 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.java
@@ -18,12 +18,14 @@
package com.epmet.dao.indexcoll;
import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.indexcollect.FactIndexServiceAblityGridMonthlyDTO;
import com.epmet.dto.indexcollect.form.GridServiceAbilityFormDTO;
import com.epmet.entity.indexcoll.FactIndexServiceAblityGridMonthlyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
+import java.util.Map;
/**
* 服务能力-网格相关事实表
@@ -63,4 +65,24 @@ public interface FactIndexServiceAblityGridMonthlyDao extends BaseDao list, @Param("customerId")String customerId);
+
+ /**
+ * @return java.util.List
+ * @param customerId
+ * @param monthId
+ * @author yinzuomei
+ * @description 当前客户下,所有网格的治理能力相关五级指标
+ * @Date 2020/8/26 15:59
+ **/
+ List> selectListServiceAblityGrid(@Param("customerId") String customerId, @Param("monthId") String monthId);
+
+ /**
+ * @return java.util.Map
+ * @param customerId
+ * @param monthId
+ * @author yinzuomei
+ * @description 查询 服务能力,网格相关,各五级指标最大值,最小值
+ * @Date 2020/8/27 13:15
+ **/
+ Map selectServiceAblityGridMinAndMax(@Param("customerId") String customerId, @Param("monthId") String monthId);
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java
index 60f5a64ef4..dfb0d95a84 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java
@@ -19,6 +19,7 @@ package com.epmet.dao.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ScreenCustomerGridDTO;
+import com.epmet.dto.indexcal.PageQueryGridFormDTO;
import com.epmet.dto.screencoll.form.CustomerGridFormDTO;
import com.epmet.entity.screen.ScreenCustomerGridEntity;
import org.apache.ibatis.annotations.Mapper;
@@ -74,4 +75,13 @@ public interface ScreenCustomerGridDao extends BaseDao
* @Date 2020/8/26 15:33
**/
List selectListByCustomerId(@Param("customerId")String customerId);
+
+ /**
+ * @return java.util.List
+ * @param formDTO
+ * @author yinzuomei
+ * @description 分页查询网格列表
+ * @Date 2020/8/27 14:42
+ **/
+ List pageListByCustomerId(PageQueryGridFormDTO formDTO);
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/GridCorreLationService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/GridCorreLationService.java
index 7b7905a535..225ae2bb80 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/GridCorreLationService.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/GridCorreLationService.java
@@ -1,7 +1,12 @@
package com.epmet.service.indexcal;
import com.epmet.commons.tools.utils.Result;
+import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
+import com.epmet.dto.indexcal.PageQueryGridFormDTO;
+
+import java.util.List;
+import java.util.Map;
/**
* 网格相关指标计算
@@ -19,4 +24,23 @@ public interface GridCorreLationService {
* @Date 2020/8/26 10:51
**/
Boolean calculateGridCorreLation(CalculateCommonFormDTO formDTO);
+
+ /**
+ * @return java.util.List>
+ * @param customerId
+ * @param monthId
+ * @author yinzuomei
+ * @description 党建能力-网格相关事实表 当前客户下,所有网格的党建能力相关五级指标
+ * @Date 2020/8/27 14:48
+ **/
+ List> queryListPartyAblityGrid(String customerId, String monthId);
+
+ /**
+ * @return java.util.List
+ * @param formDTO
+ * @author yinzuomei
+ * @description 分页查询网格列表
+ * @Date 2020/8/27 14:48
+ **/
+ List pageGridList(PageQueryGridFormDTO formDTO);
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java
index a192fafc6a..96b82127c6 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java
@@ -1,6 +1,6 @@
package com.epmet.service.indexcal.impl;
-import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.dao.indexcoll.FactIndexGovrnAblityGridMonthlyDao;
import com.epmet.dao.indexcoll.FactIndexPartyAblityGridMonthlyDao;
import com.epmet.dao.indexcoll.FactIndexServiceAblityGridMonthlyDao;
@@ -8,12 +8,23 @@ import com.epmet.dao.screen.ScreenCustomerGridDao;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.indexcal.CustomerGridInfoDTO;
+import com.epmet.dto.indexcal.PageQueryGridFormDTO;
+import com.epmet.dto.indexcollect.FactIndexGovrnAblityGridMonthlyDTO;
+import com.epmet.dto.indexcollect.FactIndexPartyAblityGridMonthlyDTO;
+import com.epmet.dto.indexcollect.FactIndexServiceAblityGridMonthlyDTO;
+import com.epmet.entity.screen.IndexGroupDetailEntity;
+import com.epmet.eum.IndexCodeEnum;
import com.epmet.service.indexcal.GridCorreLationService;
-import io.swagger.annotations.Authorization;
+import com.epmet.service.screen.IndexGroupDetailService;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
/**
* 网格相关service
@@ -32,7 +43,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
private FactIndexServiceAblityGridMonthlyDao factIndexServiceAblityGridMonthlyDao;
@Autowired
private ScreenCustomerGridDao screenCustomerGridDao;
-
+ @Autowired
+ private IndexGroupDetailService indexGroupDetailService;
/**
* @param formDTO
@@ -43,22 +55,206 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
**/
@Override
public Boolean calculateGridCorreLation(CalculateCommonFormDTO formDTO) {
- return true;
+ boolean resultFlag = false;
+ List dangJianNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(),
+ IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(),
+ IndexCodeEnum.DANG_JIAN_NENG_LI.getCode());
+ if(!CollectionUtils.isEmpty(dangJianNengLiList)){
+ //1、计算网格相关-党建能力
+ calculateGridCorreLationDangJian(formDTO,dangJianNengLiList);
+ }
+ List zhiLiNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(),
+ IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(),
+ IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
+ if(!CollectionUtils.isEmpty(zhiLiNengLiList)){
+ //2、计算网格相关-治理能力
+ calculateGridCorreLationZhiLi(formDTO,zhiLiNengLiList);
+ }
+ List fuWuNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(),
+ IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(),
+ IndexCodeEnum.FU_WU_NENG_LI.getCode());
+ if(!CollectionUtils.isEmpty(fuWuNengLiList)){
+ //3、计算网格相关-服务能力
+ calculateGridCorreLationFuWu(formDTO,fuWuNengLiList);
+ }
+ //计算网格相关总分
+ List wgxgList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(),
+ IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode());
+ if(!CollectionUtils.isEmpty(wgxgList)){
+ calculateGridCorreLationTotal(formDTO,wgxgList);
+ }
+ resultFlag = true;
+ return resultFlag;
+ }
+
+ /**
+ * @return void
+ * @param formDTO
+ * @param indexList
+ * @author yinzuomei
+ * @description 计算网格相关-党建能力
+ * @Date 2020/8/26 16:47
+ **/
+ private void calculateGridCorreLationDangJian(CalculateCommonFormDTO formDTO,List indexList){
+ //分页查询网格列表
+ //查询五级指标
+
+ }
+
+ /**
+ * @return void
+ * @param formDTO
+ * @param indexList
+ * @author yinzuomei
+ * @description 计算网格相关-治理能力
+ * @Date 2020/8/26 16:47
+ **/
+ private void calculateGridCorreLationZhiLi(CalculateCommonFormDTO formDTO,List indexList){
+
+ }
+
+ /**
+ * @return void
+ * @param formDTO
+ * @param indexList
+ * @author yinzuomei
+ * @description 计算网格相关-服务能力
+ * @Date 2020/8/26 16:48
+ **/
+ private void calculateGridCorreLationFuWu(CalculateCommonFormDTO formDTO,List indexList){
+
+ }
+
+ /**
+ * @return void
+ * @param formDTO
+ * @param indexList
+ * @author yinzuomei
+ * @description 计算网格相关总分
+ * @Date 2020/8/26 16:50
+ **/
+ private void calculateGridCorreLationTotal(CalculateCommonFormDTO formDTO,List indexList){
+
}
/**
- * @return com.epmet.dto.indexcal.CustomerGridInfoDTO
* @param customerId
+ * @return com.epmet.dto.indexcal.CustomerGridInfoDTO
* @author yinzuomei
* @description 查询客户下网格信息
* @Date 2020/8/26 15:37
**/
- public CustomerGridInfoDTO queryCustomerGridInfo(String customerId){
- CustomerGridInfoDTO customerGridInfoDTO=new CustomerGridInfoDTO();
+ public CustomerGridInfoDTO queryCustomerGridInfo(String customerId) {
+ CustomerGridInfoDTO customerGridInfoDTO = new CustomerGridInfoDTO();
customerGridInfoDTO.setTotal(screenCustomerGridDao.selectCountByCustomerId(customerId));
customerGridInfoDTO.setGridList(screenCustomerGridDao.selectListByCustomerId(customerId));
return customerGridInfoDTO;
}
+
+ /**
+ * @return
+ * @param formDTO
+ * @author yinzuomei
+ * @description 分页查询网格列表
+ * @Date 2020/8/27 14:42
+ **/
+ public List pageGridList(PageQueryGridFormDTO formDTO){
+ int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize();
+ formDTO.setPageIndex(pageIndex);
+ return screenCustomerGridDao.pageListByCustomerId(formDTO);
+ }
+
+
+ /**
+ * @param customerId
+ * @param monthId
+ * @return java.util.List
+ * @author yinzuomei
+ * @description 党建能力-网格相关事实表 当前客户下,所有网格的党建能力相关五级指标
+ * @Date 2020/8/26 15:52
+ **/
+ @Override
+ public List> queryListPartyAblityGrid(String customerId, String monthId) {
+ return factIndexPartyAblityGridMonthlyDao.selectListPartyAblityGrid(customerId, monthId);
+ }
+
+ /*网格群众用户数
+ 网格党员用户数
+ 网格活跃群众用户数
+ 网格活跃党员用户数
+ 网格党员人均提出话题数
+ 网格群众人均提出话题数
+ 网格党员人均提出的议题转项目数
+ 网格群众人均提出的议题转项目数
+ 建群党员数
+ 组织内党员的联系群众能力考评分(平均值)
+ 网格的发文数量
+ 网格议题转项目率
+ 组织“三会一课”次数
+ 党员参加“三会一课”人次*/
+ /**
+ * @return java.util.Map
+ * @param customerId
+ * @param monthId
+ * @author yinzuomei
+ * @description 查询党建能力,网格相关,各五级指标最大值,最小值
+ * @Date 2020/8/27 12:47
+ **/
+ public Map queryPartyAblityGridMinAndMax(String customerId, String monthId){
+ return factIndexPartyAblityGridMonthlyDao.selectPartyAblityGridMinAndMax(customerId,monthId);
+ }
+
+
+ /**
+ * @param customerId
+ * @param monthId
+ * @return java.util.List
+ * @author yinzuomei
+ * @description 当前客户下,所有网格的治理能力相关五级指标
+ * @Date 2020/8/26 15:55
+ **/
+ public List> queryListGovrnAblityGrid(String customerId, String monthId) {
+ return factIndexGovrnAblityGridMonthlyDao.selectListGovrnAblityGrid(customerId, monthId);
+ }
+
+
+ /**
+ * @param customerId
+ * @param monthId
+ * @return java.util.Map
+ * @author yinzuomei
+ * @description 查询治理能力,网格相关,各五级指标最大值,最小值
+ * @Date 2020/8/27 12:48
+ **/
+ public Map queryGovrnAblityGridMinAndMax(String customerId, String monthId) {
+ return factIndexGovrnAblityGridMonthlyDao.selectGovrnAblityGridMinAndMax(customerId, monthId);
+ }
+
+ /**
+ * @param customerId
+ * @param monthId
+ * @return java.util.List
+ * @author yinzuomei
+ * @description 当前客户下,所有网格的服务能力相关五级指标
+ * @Date 2020/8/26 15:55
+ **/
+ public List> queryListServiceAblityGrid(String customerId, String monthId) {
+ return factIndexServiceAblityGridMonthlyDao.selectListServiceAblityGrid(customerId, monthId);
+ }
+
+ /**
+ * @return java.util.Map
+ * @param customerId
+ * @param monthId
+ * @author yinzuomei
+ * @description 查询 服务能力,网格相关,各五级指标最大值,最小值
+ * @Date 2020/8/27 12:50
+ **/
+ public Map queryServiceAblityGridMinAndMax(String customerId, String monthId) {
+ return factIndexServiceAblityGridMonthlyDao.selectServiceAblityGridMinAndMax(customerId, monthId);
+ }
+
+
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml
index ed0f65cc79..504ed412e1 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml
@@ -85,4 +85,55 @@
+
+
+ SELECT
+ m.CUSTOMER_ID,
+ m.GRID_ID,
+ m.MONTH_ID,
+ m.ISSUE_TOTAL,
+ m.AVG_ISSUE_COUNT,
+ m.AVG_SHIFT_PROJECT_RATIO,
+ m.PROJECT_TOTAL,
+ m.SELF_SOLVE_PROJECT_COUNT,
+ m.RESOLVE_PROJECT_COUNT,
+ m.TRANSFER_RIGHT_RATIO,
+ m.SATISFACTION_RATIO
+ FROM
+ fact_index_govrn_ablity_grid_monthly m
+ WHERE
+ m.DEL_FLAG = '0'
+ and m.CUSTOMER_ID=#{customerId}
+ and m.MONTH_ID=#{monthId}
+
+
+
+
+ SELECT
+ m.CUSTOMER_ID,
+ m.GRID_ID,
+ m.MONTH_ID,
+ MIN(m.ISSUE_TOTAL) AS ISSUE_TOTAL_MIN,
+ MAX(m.ISSUE_TOTAL) AS ISSUE_TOTAL_MAX,
+ MIN(m.AVG_ISSUE_COUNT) AS AVG_ISSUE_COUNT_MIN,
+ MAX(m.AVG_ISSUE_COUNT) AS AVG_ISSUE_COUNT_MAX,
+ MIN(m.AVG_SHIFT_PROJECT_RATIO) AS AVG_SHIFT_PROJECT_RATIO_MIN,
+ MAX(m.AVG_SHIFT_PROJECT_RATIO) AS AVG_SHIFT_PROJECT_RATIO_MAX,
+ MIN(m.PROJECT_TOTAL) AS PROJECT_TOTAL_MIN,
+ MAX(m.PROJECT_TOTAL) AS PROJECT_TOTAL_MAX,
+ MIN(m.SELF_SOLVE_PROJECT_COUNT) AS SELF_SOLVE_PROJECT_COUNT_MIN,
+ MAX(m.SELF_SOLVE_PROJECT_COUNT) AS SELF_SOLVE_PROJECT_COUNT_MAX,
+ MIN(m.RESOLVE_PROJECT_COUNT) AS RESOLVE_PROJECT_COUNT_MIN,
+ MAX(m.RESOLVE_PROJECT_COUNT) AS RESOLVE_PROJECT_COUNT_MAX,
+ MIN(m.TRANSFER_RIGHT_RATIO) AS TRANSFER_RIGHT_RATIO_MIN,
+ MAX(m.TRANSFER_RIGHT_RATIO) AS TRANSFER_RIGHT_RATIO_MAX,
+ MIN(m.SATISFACTION_RATIO) AS SATISFACTION_RATIO_MIN,
+ MAX(m.SATISFACTION_RATIO) AS SATISFACTION_RATIO_MAX
+ FROM
+ fact_index_govrn_ablity_grid_monthly m
+ WHERE
+ m.DEL_FLAG = '0'
+ and m.CUSTOMER_ID=#{customerId}
+ and m.MONTH_ID=#{monthId}
+
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml
index e51a7d4f7f..e0ca717e07 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml
@@ -99,4 +99,72 @@
)
+
+
+
+
+ SELECT
+ m.CUSTOMER_ID,
+ m.GRID_ID,
+ m.MONTH_ID,
+ m.USER_COUNT,
+ m.PARTY_COUNT,
+ m.ACTIVE_USER_COUNT,
+ m.ACTIVE_PARTY_COUNT,
+ m.PARTY_AVG_TOPIC_COUNT,
+ m.USER_AVG_TOPIC_COUNT,
+ m.PARTY_AVG_SHIFT_PROJECT_COUNT,
+ m.USER_AVG_SHIFT_PROJECT_COUNT,
+ m.CREATE_GROUP_PARTY_COUNT,
+ m.PUBLISH_ARTICLE_COUNT,
+ m.ISSUE_TO_PROJECT_RATIO,
+ m.CREATE_THREE_MEETS_COUNT,
+ m.JOIN_THREE_MEETS_COUNT
+ FROM
+ fact_index_party_ablity_grid_monthly m
+ WHERE
+ m.DEL_FLAG = '0'
+ AND m.CUSTOMER_ID =#{customerId}
+ AND m.MONTH_ID =#{monthId}
+
+
+
+
+ SELECT
+ m.CUSTOMER_ID,
+ m.GRID_ID,
+ m.MONTH_ID,
+ MIN(m.USER_COUNT) AS USER_COUNT_MIN,
+ MAX(m.USER_COUNT) AS USER_COUNT_MAX,
+ MIN(m.PARTY_COUNT) AS PARTY_COUNT_MIN,
+ MAX(m.PARTY_COUNT) AS PARTY_COUNT_MAX,
+ MIN(m.ACTIVE_USER_COUNT) AS ACTIVE_USER_COUNT_MIN,
+ MAX(m.ACTIVE_USER_COUNT) AS ACTIVE_USER_COUNT_MAX,
+ MIN(m.ACTIVE_PARTY_COUNT) AS ACTIVE_PARTY_COUNT_MIN,
+ MAX(m.ACTIVE_PARTY_COUNT) AS ACTIVE_PARTY_COUNT_MAX,
+ MIN(m.PARTY_AVG_TOPIC_COUNT) AS PARTY_AVG_TOPIC_COUNT_MIN,
+ MAX(m.PARTY_AVG_TOPIC_COUNT) AS PARTY_AVG_TOPIC_COUNT_MAX,
+ MIN(m.USER_AVG_TOPIC_COUNT) AS USER_AVG_TOPIC_COUNT_MIN,
+ MAX(m.USER_AVG_TOPIC_COUNT) AS USER_AVG_TOPIC_COUNT_MAX,
+ MIN(m.PARTY_AVG_SHIFT_PROJECT_COUNT) AS PARTY_AVG_SHIFT_PROJECT_COUNT_MIN,
+ MAX(m.PARTY_AVG_SHIFT_PROJECT_COUNT) AS PARTY_AVG_SHIFT_PROJECT_COUNT_MAX,
+ MIN(m.USER_AVG_SHIFT_PROJECT_COUNT) AS USER_AVG_SHIFT_PROJECT_COUNT_MIN,
+ MAX(m.USER_AVG_SHIFT_PROJECT_COUNT) AS USER_AVG_SHIFT_PROJECT_COUNT_MAX,
+ MIN(m.CREATE_GROUP_PARTY_COUNT) AS CREATE_GROUP_PARTY_COUNT_MIN,
+ MAX(m.CREATE_GROUP_PARTY_COUNT) AS CREATE_GROUP_PARTY_COUNT_MAX,
+ MIN(m.PUBLISH_ARTICLE_COUNT) AS PUBLISH_ARTICLE_COUNT_MIN,
+ MAX(m.PUBLISH_ARTICLE_COUNT) AS PUBLISH_ARTICLE_COUNT_MAX,
+ MIN(m.ISSUE_TO_PROJECT_RATIO) AS ISSUE_TO_PROJECT_RATIO_MIN,
+ MAX(m.ISSUE_TO_PROJECT_RATIO) AS ISSUE_TO_PROJECT_RATIO_MAX,
+ MIN(m.CREATE_THREE_MEETS_COUNT) AS CREATE_THREE_MEETS_COUNT_MIN,
+ MAX(m.CREATE_THREE_MEETS_COUNT) AS CREATE_THREE_MEETS_COUNT_MAX,
+ MIN(m.JOIN_THREE_MEETS_COUNT) AS JOIN_THREE_MEETS_COUNT_MIN,
+ MAX(m.JOIN_THREE_MEETS_COUNT) AS JOIN_THREE_MEETS_COUNT_MAX
+ FROM
+ fact_index_party_ablity_grid_monthly m
+ WHERE
+ m.DEL_FLAG = '0'
+ AND m.CUSTOMER_ID =#{customerId}
+ AND m.MONTH_ID =#{monthId}
+
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml
index bc4348ea56..fb3c488e9e 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml
@@ -69,4 +69,41 @@
)
+
+
+
+ SELECT
+ m.CUSTOMER_ID,
+ m.GRID_ID,
+ m.MONTH_ID,
+ m.ACTIVITY_COUNT,
+ m.VOLUNTEER_RATIO,
+ m.PARTY_VOLUNTEER_RATIO
+ FROM
+ fact_index_service_ablity_grid_monthly m
+ WHERE
+ m.DEL_FLAG = '0'
+ and m.CUSTOMER_ID=#{customerId}
+ and m.MONTH_ID=#{monthId}
+
+
+
+
+ SELECT
+ m.CUSTOMER_ID,
+ m.GRID_ID,
+ m.MONTH_ID,
+ MIN(m.ACTIVITY_COUNT) AS ACTIVITY_COUNT_MIN,
+ MAX(m.ACTIVITY_COUNT) AS ACTIVITY_COUNT_MAX,
+ MIN(m.VOLUNTEER_RATIO) AS VOLUNTEER_RATIO_MIN,
+ MAX(m.VOLUNTEER_RATIO) AS VOLUNTEER_RATIO_MAX,
+ MIN(m.PARTY_VOLUNTEER_RATIO) AS PARTY_VOLUNTEER_RATIO_MIN,
+ MAX(m.PARTY_VOLUNTEER_RATIO) AS PARTY_VOLUNTEER_RATIO_MAX
+ FROM
+ fact_index_service_ablity_grid_monthly m
+ WHERE
+ m.DEL_FLAG = '0'
+ and m.CUSTOMER_ID=#{customerId}
+ and m.MONTH_ID=#{monthId}
+
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml
index 1cf2922cd9..a5bee6054f 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml
@@ -77,4 +77,19 @@
m.DEL_FLAG = '0'
AND m.CUSTOMER_ID = #{customerId}
+
+
+
+ SELECT
+ m.GRID_ID,
+ m.CUSTOMER_ID,
+ m.GRID_NAME
+ FROM
+ screen_customer_grid m
+ WHERE
+ m.DEL_FLAG = '0'
+ AND m.CUSTOMER_ID = #{customerId}
+ order by m.GRID_ID asc
+ LIMIT #{pageIndex}, #{pageSize}
+