diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java
index 9ff138efe7..49681043e0 100644
--- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java
+++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java
@@ -136,4 +136,13 @@ public interface Constant {
String CREATED_TIME = "created_time";
String DEFAULT_CUSTOMER = "default";
+
+ /**
+ * 省级:province; 市级: city; 区县级: district ;乡(镇、街道)级:street ;社区级:community
+ */
+ String PROVINCE = "province";
+ String CITY = "city";
+ String DISTRICT = "district";
+ String STREET = "street";
+ String COMMUNITY = "community";
}
diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/OrgConstant.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/OrgConstant.java
index a7da3d564b..b3083d658e 100644
--- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/OrgConstant.java
+++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/OrgConstant.java
@@ -7,4 +7,8 @@ package com.epmet.dataaggre.constant;
public interface OrgConstant {
String AGENCY = "agency";
String GRID = "grid";
+ String PROVINCE = "province";
+ String CITY = "city";
+ String DISTRICT = "district";
+
}
diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgencyGovrnFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgencyGovrnFormDTO.java
index 82315c125f..14bfa2c51b 100644
--- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgencyGovrnFormDTO.java
+++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgencyGovrnFormDTO.java
@@ -33,6 +33,14 @@ public class AgencyGovrnFormDTO implements Serializable {
* 街道解决占比:street
*/
private String type;
+ /**
+ * 组织级别
+ */
+ private String level;
+ /**
+ * 组织地区码
+ */
+ private String areaCode;
public interface Agency extends CustomerClientShowGroup {}
}
diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GovrnRatioFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GovrnRatioFormDTO.java
index 7e5407a8ef..d760cd834f 100644
--- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GovrnRatioFormDTO.java
+++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GovrnRatioFormDTO.java
@@ -28,6 +28,8 @@ public class GovrnRatioFormDTO implements Serializable {
* 日维度Id[日期,不传值默认查前一天的【格式:20210101】]
*/
private String dateId;
+ private String areaCode;
+ private String level;
public interface AgencyGrid extends CustomerClientShowGroup {}
}
diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyGroupResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyGroupResultDTO.java
index 144368c26e..8b0f229204 100644
--- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyGroupResultDTO.java
+++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyGroupResultDTO.java
@@ -19,6 +19,10 @@ public class SubAgencyGroupResultDTO implements Serializable {
private String agencyId;
//组织名称
private String agencyName;
+ //机关级别[社区级:community;乡(镇、街道)级:street;区县级: district;市级: city;省级:province
+ private String level;
+ //行政地区编码
+ private String areaCode;
//党群小组总数
private Integer groupTotal = 0;
//楼院小组总数
diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyIssueResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyIssueResultDTO.java
index 5bece9dab4..a13f9d158b 100644
--- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyIssueResultDTO.java
+++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyIssueResultDTO.java
@@ -19,6 +19,10 @@ public class SubAgencyIssueResultDTO implements Serializable {
private String agencyId;
//组织名称
private String agencyName;
+ //机关级别[社区级:community;乡(镇、街道)级:street;区县级: district;市级: city;省级:province
+ private String level;
+ //行政地区编码
+ private String areaCode;
//议题总数
private Integer issueTotal = 0;
//表决中总数
diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyProjectResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyProjectResultDTO.java
index 33aa889ad4..63b0c512ca 100644
--- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyProjectResultDTO.java
+++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyProjectResultDTO.java
@@ -19,6 +19,10 @@ public class SubAgencyProjectResultDTO implements Serializable {
private String agencyId;
//组织名称
private String agencyName;
+ //机关级别[社区级:community;乡(镇、街道)级:street;区县级: district;市级: city;省级:province
+ private String level;
+ //行政地区编码
+ private String areaCode;
//项目总数
private Integer projectTotal = 0;
//处理中总数
diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyTopicResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyTopicResultDTO.java
index bad0896389..3712128526 100644
--- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyTopicResultDTO.java
+++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyTopicResultDTO.java
@@ -19,6 +19,10 @@ public class SubAgencyTopicResultDTO implements Serializable {
private String agencyId;
//组织名称
private String agencyName;
+ //机关级别[社区级:community;乡(镇、街道)级:street;区县级: district;市级: city;省级:province
+ private String level;
+ //行政地区编码
+ private String areaCode;
//话题总数
private Integer topicTotal = 0;
//热议中总数
diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyUserResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyUserResultDTO.java
index a60c3ad76b..d1cc92cd8f 100644
--- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyUserResultDTO.java
+++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyUserResultDTO.java
@@ -19,6 +19,10 @@ public class SubAgencyUserResultDTO implements Serializable {
private String agencyId;
//组织名称
private String agencyName;
+ //机关级别[社区级:community;乡(镇、街道)级:street;区县级: district;市级: city;省级:province
+ private String level;
+ //行政地区编码
+ private String areaCode;
//用户总数
private Integer userTotal = 0;
//党员总数
diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenCustomerAgencyDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenCustomerAgencyDTO.java
new file mode 100644
index 0000000000..3b2c818967
--- /dev/null
+++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenCustomerAgencyDTO.java
@@ -0,0 +1,49 @@
+package com.epmet.dataaggre.dto.evaluationindex;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 组织机构信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-08-21
+ */
+@Data
+public class ScreenCustomerAgencyDTO implements Serializable {
+ private static final long serialVersionUID = 6328123559936824470L;
+ /**
+ * 客户id
+ */
+ private String customerId;
+
+ /**
+ * 组织id
+ */
+ private String agencyId;
+
+ /**
+ * 组织名称
+ */
+ private String agencyName;
+
+ /**
+ * 机关级别(社区级:community,
+ 乡(镇、街道)级:street,
+ 区县级: district,
+ 市级: city
+ 省级:province)
+ */
+ private String level;
+
+ /**
+ * 行政地区编码
+ */
+ private String areaCode;
+
+ /**
+ * 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701
+ */
+ private String parentAreaCode;
+}
diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenCustomerGridDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenCustomerGridDTO.java
new file mode 100644
index 0000000000..e57fd42ac5
--- /dev/null
+++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenCustomerGridDTO.java
@@ -0,0 +1,119 @@
+/**
+ * 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.dataaggre.dto.evaluationindex;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * 网格(党支部)信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-08-26
+ */
+@Data
+public class ScreenCustomerGridDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 主键ID 主键ID
+ */
+ private String id;
+
+ /**
+ * 客户id
+ */
+ private String customerId;
+
+ /**
+ * 网格id
+ */
+ private String gridId;
+
+ /**
+ * 组织名称
+ */
+ private String gridName;
+
+ /**
+ * 网格所属组织id
+ */
+ private String parentAgencyId;
+
+ /**
+ * 坐标区域
+ */
+ private String areaMarks;
+
+ /**
+ * 中心点位
+ */
+ private String centerMark;
+
+ /**
+ * 党支部(=网格)的位置
+ */
+ private String partyMark;
+
+ /**
+ * 删除标识 0.未删除 1.已删除
+ */
+ private Integer delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+ /**
+ * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)
+ */
+ private String dataEndTime;
+
+ /**
+ * 所有上级ID,用英文逗号分开
+ */
+ private String allParentIds;
+ private String pid;
+ private String pids;
+
+}
\ No newline at end of file
diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenGovernRankDataDailyDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenGovernRankDataDailyDTO.java
new file mode 100644
index 0000000000..6542b8eb1c
--- /dev/null
+++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenGovernRankDataDailyDTO.java
@@ -0,0 +1,161 @@
+/**
+ * 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.dataaggre.dto.evaluationindex;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 基层治理-治理能力排行数据(按月统计)
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-05-24
+ */
+@Data
+public class ScreenGovernRankDataDailyDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * ID 主键
+ */
+ private String id;
+
+ /**
+ * 客户Id
+ */
+ private String customerId;
+
+ /**
+ * 年Id
+ */
+ private String yearId;
+
+ /**
+ * 月份Id
+ */
+ private String monthId;
+
+ /**
+ * 数据更新至:yyyyMMdd
+ */
+ private String dateId;
+
+ /**
+ * 组织类别 agency:组织;部门:department;网格:grid
+ */
+ private String orgType;
+
+ /**
+ * 组织Id 可以为网格,机关id
+ */
+ private String orgId;
+
+ /**
+ * 上级组织Id
+ */
+ private String parentId;
+
+ /**
+ * 组织名称
+ */
+ private String orgName;
+
+ /**
+ * 响应率
+ */
+ private BigDecimal responseRatio;
+
+ /**
+ * 解决率
+ */
+ private BigDecimal resolvedRatio;
+
+ /**
+ * 自治率
+ */
+ private BigDecimal governRatio;
+
+ /**
+ * 满意率
+ */
+ private BigDecimal satisfactionRatio;
+
+ /**
+ * 响应数
+ */
+ private Integer responseCount;
+ /**
+ * 项目转入次数
+ */
+ private Integer transferCount;
+ /**
+ * 解决项目数
+ */
+ private Integer resolvedCount;
+ /**
+ * 已关闭项目数
+ */
+ private Integer closedCount;
+ /**
+ * 自治项目数
+ */
+ private Integer governCount;
+ /**
+ * 满意项目数
+ */
+ private Integer satisfactionCount;
+ /**
+ * 已关闭项目(由议题转的项目)数
+ */
+ private Integer closedProjectCount;
+
+ /**
+ * 删除标识 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-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java
index b49b16fc0c..d157058b2e 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java
@@ -25,6 +25,7 @@ import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO;
import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO;
import com.epmet.dataaggre.entity.datastats.DimAgencyEntity;
import com.epmet.dataaggre.entity.datastats.DimGridEntity;
+import com.epmet.dataaggre.entity.datastats.FactAgencyGovernDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -41,43 +42,43 @@ public interface DataStatsDao {
* @Description 查询组织下注册用户最新日统计数据
* @author sun
*/
- AgencyBasicDataResultDTO getAgnecyRegUser(@Param("agencyId") String agencyId, @Param("dateId") String dateId);
+ List getAgnecyRegUser(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId);
/**
* @Description 查询组织下最新群组日统计数据
* @author sun
*/
- AgencyBasicDataResultDTO getAgnecyGroup(@Param("agencyId") String agencyId, @Param("dateId") String dateId);
+ List getAgnecyGroup(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId);
/**
* @Description 查询组织下最新状态话题-机关日统计数据表
* @author sun
*/
- List getAgencyTopic(@Param("agencyId") String agencyId, @Param("dateId") String dateId);
+ List getAgencyTopic(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId);
/**
* @Description 查询组织下最新转议题话题-机关日统计数据表
* @author sun
*/
- AgencyBasicDataResultDTO.Topic getAgencyTopicShiftIssue(@Param("agencyId") String agencyId, @Param("dateId") String dateId);
+ List getAgencyTopicShiftIssue(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId);
/**
* @Description 热议中话题-机关日统计数据
* @author sun
*/
- AgencyBasicDataResultDTO.Topic getAgencyTopicHotDiscuss(@Param("agencyId") String agencyId, @Param("dateId") String dateId);
+ List getAgencyTopicHotDiscuss(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId);
/**
* @Description 查询组织下最新议题日统计数据
* @author sun
*/
- AgencyBasicDataResultDTO getAgencyIssue(@Param("agencyId") String agencyId, @Param("dateId") String dateId);
+ List getAgencyIssue(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId);
/**
* @Description 查询组织下最新项目日统计数据
* @author sun
*/
- AgencyBasicDataResultDTO getAgencyProject(@Param("agencyId") String agencyId, @Param("dateId") String dateId);
+ List getAgencyProject(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId);
/**
* @Description 查询当前组织的直属下级组织信息
@@ -242,4 +243,14 @@ public interface DataStatsDao {
* @author sun
*/
List getGridGovern(@Param("gridIds") List gridIds, @Param("dateId") String dateId);
+
+ /**
+ * 根据组织Id查询事件治理指数
+ * @author zhaoqifeng
+ * @date 2021/6/25 15:08
+ * @param agencyIds
+ * @param dateId
+ * @return com.epmet.dataaggre.entity.datastats.FactAgencyGovernDailyEntity
+ */
+ List getAgencyGovernDaily(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId);
}
\ No newline at end of file
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java
index c9084a0b4b..197b4e05e6 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java
@@ -18,9 +18,14 @@
package com.epmet.dataaggre.dao.evaluationindex;
import com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO;
+import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO;
+import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO;
+import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
+import java.util.List;
+
/**
* @Author sun
* @Description 指标统计服务
@@ -34,4 +39,60 @@ public interface EvaluationIndexDao {
* @author sun
*/
GovrnRatioResultDTO getAgnecyOrGridGoverRatio(@Param("orgId") String orgId, @Param("orgType") String orgType, @Param("dateId") String dateId);
+
+ /**
+ * @Description 查询areaCode对应的直属下级且不是agencyId对应的客户id的客户组织列表
+ * @author sun
+ */
+ List getAgencyByAreaCodeAgencyId(@Param("agencyId") String agencyId, @Param("areaCode") String areaCode);
+
+ /**
+ * @Description 查询直属下级组织列表,有areaCode的按areaCode查,没有的按agencyId查
+ * @author sun
+ */
+ List getSubAgencyList(@Param("agencyId") String agencyId, @Param("areaCode") String areaCode);
+
+ /**
+ * @Description 查询指标库组织直属网格列表【这个客户组织网格数据包括小程序的和项目上报的】
+ * @author sun
+ */
+ List getSubGridList(@Param("agencyId") String agencyId);
+
+ /**
+ * 根据组织Id查询治理指数
+ * @author zhaoqifeng
+ * @date 2021/6/25 16:36
+ * @param agencyIds
+ * @param dateId
+ * @return java.util.List
+ */
+ ScreenGovernRankDataDailyDTO getGovernRankList(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId);
+
+ /**
+ * 获取组织信息
+ * @author zhaoqifeng
+ * @date 2021/6/29 13:58
+ * @param agencyId
+ * @return com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO
+ */
+ ScreenCustomerAgencyDTO getAgencyInfo(@Param("agencyId") String agencyId);
+
+ /**
+ * @Description 查询agencyId对应组织信息
+ * @author sun
+ */
+ ScreenCustomerAgencyDTO getByAgencyId(@Param("agencyId") String agencyId);
+
+ /**
+ * @Description 存在子客户的,查询当前组织的areaCode对应的直属下级且不是agencyId对应的客户id的但是存在父子客户关系的客户组织列表
+ * @author sun
+ */
+ List getAgencyIdsByAgencyId(@Param("agencyId") String agencyId, @Param("areaCode") String areaCode, @Param("list") List list);
+
+ /**
+ * @Description 查询直属下级组织列表,有areaCode的按areaCode查,没有的按agencyId查且是在当前客户和子客户范围内查询
+ * @author sun
+ */
+ List getSubAgencyListByAgency(@Param("agencyId") String agencyId, @Param("areaCode") String areaCode, @Param("list") List list);
+
}
\ No newline at end of file
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercrm/CustomerRelationDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercrm/CustomerRelationDao.java
index ed7aef852a..4cca334ea8 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercrm/CustomerRelationDao.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercrm/CustomerRelationDao.java
@@ -13,4 +13,13 @@ import java.util.List;
@Mapper
public interface CustomerRelationDao {
List selectUsedAreaCodeList(String areaCode);
+
+ /**
+ * 根据customerId查询其所有下级子客户id
+ * @author zhaoqifeng
+ * @date 2021/6/29 11:04
+ * @param customerId
+ * @return java.util.List
+ */
+ List selectAllSubCustomerIds(String customerId);
}
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/FactAgencyGovernDailyEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/FactAgencyGovernDailyEntity.java
new file mode 100644
index 0000000000..d709731f77
--- /dev/null
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/FactAgencyGovernDailyEntity.java
@@ -0,0 +1,174 @@
+/**
+ * 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.dataaggre.entity.datastats;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.math.BigDecimal;
+
+/**
+ * 组织的治理指数,按天统计
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-05-24
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("fact_agency_govern_daily")
+public class FactAgencyGovernDailyEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户id
+ */
+ private String customerId;
+
+ /**
+ * 数据更新至:yyyyMMdd;
+ */
+ private String dateId;
+
+ /**
+ * 组织id
+ */
+ private String agencyId;
+
+ /**
+ * agency_id所属的机关级别(社区级:community,
+乡(镇、街道)级:street,
+区县级: district,
+市级: city
+省级:province)
+ */
+ private String level;
+
+ /**
+ * 组织i所属的组织id
+ */
+ private String pid;
+
+ /**
+ * 组织i所有上级id
+ */
+ private String pids;
+
+ /**
+ * 界面展示:问题解决总数=1+2+3+4+5+6+7+8
+ */
+ private Integer problemResolvedCount;
+
+ /**
+ * 界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数
+ */
+ private BigDecimal groupSelfGovernRatio;
+
+ /**
+ * 界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数
+ */
+ private BigDecimal gridSelfGovernRatio;
+
+ /**
+ * 界面展示:社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数
+ */
+ private BigDecimal communityClosedRatio;
+
+ /**
+ * 界面展示:街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数
+ */
+ private BigDecimal streetClosedRatio;
+
+ /**
+ * 界面展示:区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数
+ */
+ private BigDecimal districtDeptClosedRatio;
+
+ /**
+ * 1、当前组织内,话题关闭已解决数
+ */
+ private Integer topicResolvedCount;
+
+ /**
+ * 2、当前组织内,话题关闭无需解决数
+ */
+ private Integer topicUnResolvedCount;
+
+ /**
+ * 3、当前组织内,议题关闭已解决数
+ */
+ private Integer issueResolvedCount;
+
+ /**
+ * 4、当前组织内,议题关闭无需解决数
+ */
+ private Integer issueUnResolvedCount;
+
+ /**
+ * 5、当前组织内:来源于议题的项目:结案已解决数
+ */
+ private Integer issueProjectResolvedCount;
+
+ /**
+ * 6、当前组织内:来源于议题的项目:结案无需解决数
+ */
+ private Integer issueProjectUnResolvedCount;
+
+ /**
+ * 7、当前组织内:项目立项,结案已解决数;默认为0,
+ */
+ private Integer approvalProjectResolvedCount;
+
+ /**
+ * 8、当前组织内:项目立项,结案无需解决数;默认为0,
+ */
+ private Integer approvalProjectUnResolvedCount;
+
+ /**
+ * 9、当前组织内,未出小组即未转议题的:话题关闭已解决数
+ */
+ private Integer inGroupTopicResolvedCount;
+
+ /**
+ * 10、当前组织内,未出小组即未转议题的:话题关闭无需解决数
+ */
+ private Integer inGroupTopicUnResolvedCount;
+
+ /**
+ * 未出当前网格的,结案项目数
+ */
+ private Integer gridSelfGovernProjectTotal;
+
+ /**
+ * 当前组织内结案的项目中:由社区结案的项目总数
+ */
+ private Integer communityClosedCount;
+
+ /**
+ * 当前组织内结案的项目中:由街道结案的项目总数
+ */
+ private Integer streetClosedCount;
+
+ /**
+ * 当前组织内结案的项目中:由区直部门结案的项目总数
+ */
+ private Integer districtDeptClosedCount;
+
+}
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
index e290386e71..bfa9a29710 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
@@ -12,14 +12,19 @@ import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO;
import com.epmet.dataaggre.dto.datastats.form.*;
import com.epmet.dataaggre.dto.datastats.result.*;
import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO;
+import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO;
+import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO;
+import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO;
import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO;
import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO;
import com.epmet.dataaggre.entity.datastats.DimAgencyEntity;
import com.epmet.dataaggre.entity.datastats.DimGridEntity;
import com.epmet.dataaggre.entity.datastats.FactGridMemberStatisticsDailyEntity;
+import com.epmet.dataaggre.entity.datastats.FactAgencyGovernDailyEntity;
import com.epmet.dataaggre.service.datastats.DataStatsService;
import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService;
import com.github.pagehelper.PageHelper;
+import com.epmet.dataaggre.service.opercrm.CustomerRelation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@@ -47,6 +52,8 @@ public class DataStatsServiceImpl implements DataStatsService {
private DataStatsDao dataStatsDao;
@Autowired
private EvaluationIndexService indexService;
+ @Autowired
+ private CustomerRelation customerRelation;
@Autowired
private FactGridMemberStatisticsDailyDao factGridMemberStatisticsDailyDao;
@@ -60,6 +67,7 @@ public class DataStatsServiceImpl implements DataStatsService {
@Override
public AgencyBasicDataResultDTO agencyBasicData(AgenctBasicDataFormDTO formDTO) {
AgencyBasicDataResultDTO resultDTO = new AgencyBasicDataResultDTO();
+ List agencyList = new ArrayList<>();
resultDTO.setAgencyId(formDTO.getAgencyId());
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.THREE);
@@ -71,78 +79,100 @@ public class DataStatsServiceImpl implements DataStatsService {
formDTO.setDateId(format.format(yesterday));
}
+ //0.根据组织Id查询是否存在子客户,存在的按areaCode查询当前客户之外的客户组织列表
+ agencyList = indexService.getAgencyIdsByAgencyId(formDTO.getAgencyId());
+ agencyList.add(formDTO.getAgencyId());
+
//1.查询组织下注册用户最新日统计数据【只查询注册用户的统计数据,不涉及参与用户的】
- AgencyBasicDataResultDTO user = dataStatsDao.getAgnecyRegUser(formDTO.getAgencyId(), formDTO.getDateId());
- if (null != user) {
- resultDTO.setUserTotal(user.getUserTotal());
- resultDTO.setResiTotal(user.getResiTotal());
- resultDTO.setResiRatio(user.getResiTotal() == 0 || user.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) user.getResiTotal() / (float) user.getUserTotal())));
- resultDTO.setPartyMemberTotal(user.getPartyMemberTotal());
- resultDTO.setPartyMemberRatio(user.getPartyMemberTotal() == 0 || user.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) user.getPartyMemberTotal() / (float) user.getUserTotal())));
- }
+ List userList = dataStatsDao.getAgnecyRegUser(agencyList, formDTO.getDateId());
+ int userTotal = 0;
+ int resiTotal = 0;
+ int partyMemberTotal = 0;
+ for (AgencyBasicDataResultDTO u : userList){
+ userTotal+=u.getUserTotal();
+ resiTotal+=u.getResiTotal();
+ partyMemberTotal+=u.getPartyMemberTotal();
+ }
+ resultDTO.setUserTotal(userTotal);
+ resultDTO.setResiTotal(resiTotal);
+ resultDTO.setResiRatio(resultDTO.getResiTotal() == 0 || resultDTO.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getResiTotal() / (float) resultDTO.getUserTotal())));
+ resultDTO.setPartyMemberTotal(partyMemberTotal);
+ resultDTO.setPartyMemberRatio(resultDTO.getPartyMemberTotal() == 0 || resultDTO.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getPartyMemberTotal() / (float) resultDTO.getUserTotal())));
//2.查询组织下最新群组日统计数据
- AgencyBasicDataResultDTO group = dataStatsDao.getAgnecyGroup(formDTO.getAgencyId(), formDTO.getDateId());
- if (null != group) {
- resultDTO.setGroupTotal(group.getGroupTotal());
- resultDTO.setOrdinaryTotal(group.getOrdinaryTotal());
- resultDTO.setOrdinaryRatio(group.getOrdinaryTotal() == 0 || group.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) group.getOrdinaryTotal() / (float) group.getGroupTotal())));
- resultDTO.setBranchTotal(group.getBranchTotal());
- resultDTO.setBranchRatio(group.getBranchTotal() == 0 || group.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) group.getBranchTotal() / (float) group.getGroupTotal())));
- }
+ List groupList = dataStatsDao.getAgnecyGroup(agencyList, formDTO.getDateId());
+ int groupTotal = 0;
+ int ordinaryTotal = 0;
+ int branchTotal = 0;
+ for (AgencyBasicDataResultDTO g : groupList){
+ groupTotal+=g.getGroupTotal();
+ ordinaryTotal+=g.getOrdinaryTotal();
+ branchTotal+=g.getBranchTotal();
+ }
+ resultDTO.setGroupTotal(groupTotal);
+ resultDTO.setOrdinaryTotal(ordinaryTotal);
+ resultDTO.setOrdinaryRatio(resultDTO.getOrdinaryTotal() == 0 || resultDTO.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getOrdinaryTotal() / (float) resultDTO.getGroupTotal())));
+ resultDTO.setBranchTotal(branchTotal);
+ resultDTO.setBranchRatio(resultDTO.getBranchTotal() == 0 || resultDTO.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getBranchTotal() / (float) resultDTO.getGroupTotal())));
//3.查询组织下最新话题日统计数据
//状态话题-机关日统计数据表最新日期三种状态数据
//机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念
- List topic = dataStatsDao.getAgencyTopic(formDTO.getAgencyId(), formDTO.getDateId());
+ List topic = dataStatsDao.getAgencyTopic(agencyList, formDTO.getDateId());
//转议题话题-机关日统计数据表
- AgencyBasicDataResultDTO.Topic topicSHiftIssue = dataStatsDao.getAgencyTopicShiftIssue(formDTO.getAgencyId(), formDTO.getDateId());
+ List topicSHiftIssue = dataStatsDao.getAgencyTopicShiftIssue(agencyList, formDTO.getDateId());
//热议中话题-机关日统计数据
- AgencyBasicDataResultDTO.Topic hotdiscuss = dataStatsDao.getAgencyTopicHotDiscuss(formDTO.getAgencyId(), formDTO.getDateId());
- AtomicReference closedTotal = new AtomicReference<>(0);
- if (topic.size() > NumConstant.ZERO) {
- resultDTO.setTopicTotal(topic.stream().collect(Collectors.summingInt(AgencyBasicDataResultDTO.Topic::getTopicCount)));
- topic.forEach(t -> {
- if (t.getTopicStatus().equals("closed")) {
- closedTotal.set(t.getTopicCount());
- }
- });
- }
+ List hotdiscuss = dataStatsDao.getAgencyTopicHotDiscuss(agencyList, formDTO.getDateId());
+ //话题总数
+ resultDTO.setTopicTotal(topic.stream().collect(Collectors.summingInt(AgencyBasicDataResultDTO.Topic::getTopicCount)));
+ int closedTotal = topic.stream().filter(t -> t.getTopicStatus().equals("closed")).mapToInt(AgencyBasicDataResultDTO.Topic::getTopicCount).sum();
//转议题
- if (null != topicSHiftIssue) {
- resultDTO.setShiftIssueTotal(topicSHiftIssue.getShiftedIssueTotal());
- resultDTO.setShiftIssueRatio(resultDTO.getShiftIssueTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftIssueTotal() / (float) resultDTO.getTopicTotal())));
- }
+ int shiftIssueTotal = topicSHiftIssue.stream().mapToInt(AgencyBasicDataResultDTO.Topic::getShiftedIssueTotal).sum();
+ resultDTO.setShiftIssueTotal(shiftIssueTotal);
+ resultDTO.setShiftIssueRatio(resultDTO.getShiftIssueTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftIssueTotal() / (float) resultDTO.getTopicTotal())));
//热议中
- if (null != hotdiscuss) {
- resultDTO.setDiscussingTotal(hotdiscuss.getTopicCount());
- resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal())));
- }
+ int discussingTotal = hotdiscuss.stream().mapToInt(AgencyBasicDataResultDTO.Topic::getTopicCount).sum();
+ resultDTO.setDiscussingTotal(discussingTotal);
+ resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal())));
//已处理
- resultDTO.setClosedTopicTotal(closedTotal.get());
+ resultDTO.setClosedTopicTotal(closedTotal);
resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal())));
//4.查询组织下最新议题日统计数据
- AgencyBasicDataResultDTO issue = dataStatsDao.getAgencyIssue(formDTO.getAgencyId(), formDTO.getDateId());
- if (null != issue) {
- resultDTO.setIssueTotal(issue.getIssueTotal());
- resultDTO.setVotingTotal(issue.getVotingTotal());
- resultDTO.setVotingRatio(resultDTO.getVotingTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getVotingTotal() / (float) resultDTO.getIssueTotal())));
- resultDTO.setClosedIssueTotal(issue.getClosedIssueTotal());
- resultDTO.setClosedIssueRatio(resultDTO.getClosedIssueTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedIssueTotal() / (float) resultDTO.getIssueTotal())));
- resultDTO.setShiftProjectTotal(issue.getShiftProjectTotal());
- resultDTO.setShiftProjectRatio(resultDTO.getShiftProjectTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftProjectTotal() / (float) resultDTO.getIssueTotal())));
- }
+ List issueList = dataStatsDao.getAgencyIssue(agencyList, formDTO.getDateId());
+ int issueTotal = 0;
+ int votingTotal = 0;
+ int closedIssueTotal = 0;
+ int shiftProjectTotal = 0;
+ for (AgencyBasicDataResultDTO i : issueList){
+ issueTotal+=i.getIssueTotal();
+ votingTotal+=i.getVotingTotal();
+ closedIssueTotal+=i.getClosedIssueTotal();
+ shiftProjectTotal+=i.getShiftProjectTotal();
+ }
+ resultDTO.setIssueTotal(issueTotal);
+ resultDTO.setVotingTotal(votingTotal);
+ resultDTO.setVotingRatio(resultDTO.getVotingTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getVotingTotal() / (float) resultDTO.getIssueTotal())));
+ resultDTO.setClosedIssueTotal(closedIssueTotal);
+ resultDTO.setClosedIssueRatio(resultDTO.getClosedIssueTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedIssueTotal() / (float) resultDTO.getIssueTotal())));
+ resultDTO.setShiftProjectTotal(shiftProjectTotal);
+ resultDTO.setShiftProjectRatio(resultDTO.getShiftProjectTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftProjectTotal() / (float) resultDTO.getIssueTotal())));
//5.查询组织下最新项目日统计数据
- AgencyBasicDataResultDTO project = dataStatsDao.getAgencyProject(formDTO.getAgencyId(), formDTO.getDateId());
- if (null != project) {
- resultDTO.setProjectTotal(project.getProjectTotal());
- resultDTO.setPendingTotal(project.getPendingTotal());
- resultDTO.setPendingRatio(resultDTO.getPendingTotal() == 0 || resultDTO.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getPendingTotal() / (float) resultDTO.getProjectTotal())));
- resultDTO.setClosedProjectTotal(project.getClosedProjectTotal());
- resultDTO.setClosedProjectRatio(resultDTO.getClosedProjectTotal() == 0 || resultDTO.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedProjectTotal() / (float) resultDTO.getProjectTotal())));
- }
+ List projectList = dataStatsDao.getAgencyProject(agencyList, formDTO.getDateId());
+ int projectTotal = 0;
+ int pendingTotal = 0;
+ int closedProjectTotal = 0;
+ for (AgencyBasicDataResultDTO p : projectList){
+ projectTotal+=p.getProjectTotal();
+ pendingTotal+=p.getPendingTotal();
+ closedProjectTotal+=p.getClosedProjectTotal();
+ }
+ resultDTO.setProjectTotal(projectTotal);
+ resultDTO.setPendingTotal(pendingTotal);
+ resultDTO.setPendingRatio(resultDTO.getPendingTotal() == 0 || resultDTO.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getPendingTotal() / (float) resultDTO.getProjectTotal())));
+ resultDTO.setClosedProjectTotal(closedProjectTotal);
+ resultDTO.setClosedProjectRatio(resultDTO.getClosedProjectTotal() == 0 || resultDTO.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedProjectTotal() / (float) resultDTO.getProjectTotal())));
return resultDTO;
}
@@ -266,23 +296,25 @@ public class DataStatsServiceImpl implements DataStatsService {
formDTO.setType("user");
}
- //1.查询当前组织的直属下级组织信息【机关维度】
- List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId());
+ //1.查询直属下级组织列表,有子客户的按areaCode查没有的按agencyId查
+ List subAgencyList = indexService.getSubAgencyListByAgency(formDTO.getAgencyId());
if (subAgencyList.size() < NumConstant.ONE) {
return resultList;
}
- List agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList());
+ List agencyIds = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList());
//2.查询直属下级组织注册用户日统计数据,默认按用户总数降序
List list = dataStatsDao.getSubAgencyUser(agencyIds, formDTO.getDateId());
//3.封装数据
- for (DimAgencyEntity sub : subAgencyList) {
+ for (ScreenCustomerAgencyDTO sub : subAgencyList) {
SubAgencyUserResultDTO dto = new SubAgencyUserResultDTO();
- dto.setAgencyId(sub.getId());
+ dto.setAgencyId(sub.getAgencyId());
dto.setAgencyName(sub.getAgencyName());
+ dto.setLevel(null == sub.getLevel() ? "" : sub.getLevel());
+ dto.setAreaCode(null == sub.getAreaCode() ? "" : sub.getAreaCode());
for (SubAgencyUserResultDTO u : list) {
- if (sub.getId().equals(u.getAgencyId())) {
+ if (sub.getAgencyId().equals(u.getAgencyId())) {
dto.setUserTotal(u.getUserTotal());
dto.setPartyMemberTotal(u.getPartyMemberTotal());
dto.setResiTotal(u.getResiTotal());
@@ -335,23 +367,23 @@ public class DataStatsServiceImpl implements DataStatsService {
formDTO.setType("user");
}
- //1.查询组织直属网格列表【网格维度】
- List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId());
+ //1.查询指标库组织直属网格列表【这个客户组织网格数据包括小程序的和项目上报的】
+ List gridList = indexService.getSubGridList(formDTO.getAgencyId());
if (gridList.size() < NumConstant.ONE) {
return resultList;
}
- List gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList());
+ List gridIds = gridList.stream().map(ScreenCustomerGridDTO::getGridId).collect(Collectors.toList());
//2.查询网格层级注册用户日统计数据,默认按用户总数降序
List list = dataStatsDao.getSubGridUser(gridIds, formDTO.getDateId());
//3.封装数据
- for (DimGridEntity gr : gridList) {
+ for (ScreenCustomerGridDTO gr : gridList) {
SubGridUserResultDTO dto = new SubGridUserResultDTO();
- dto.setGridId(gr.getId());
+ dto.setGridId(gr.getGridId());
dto.setGridName(gr.getGridName());
for (SubGridUserResultDTO re : list) {
- if (gr.getId().equals(re.getGridId())) {
+ if (gr.getGridId().equals(re.getGridId())) {
dto.setUserTotal(re.getUserTotal());
dto.setPartyMemberTotal(re.getPartyMemberTotal());
dto.setResiTotal(re.getResiTotal());
@@ -402,23 +434,25 @@ public class DataStatsServiceImpl implements DataStatsService {
formDTO.setType("group");
}
- //1.查询当前组织的直属下级组织信息【机关维度】
- List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId());
+ //1.查询直属下级组织列表,有子客户的按areaCode查没有的按agencyId查
+ List subAgencyList = indexService.getSubAgencyListByAgency(formDTO.getAgencyId());
if (subAgencyList.size() < NumConstant.ONE) {
return resultList;
}
- List agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList());
+ List agencyIds = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList());
//2.查询直属下级组织小组日统计数据,默认按群组总数降序
List list = dataStatsDao.getSubAgencyGroup(agencyIds, formDTO.getDateId());
//3.封装数据
- for (DimAgencyEntity sub : subAgencyList) {
+ for (ScreenCustomerAgencyDTO sub : subAgencyList) {
SubAgencyGroupResultDTO dto = new SubAgencyGroupResultDTO();
- dto.setAgencyId(sub.getId());
+ dto.setAgencyId(sub.getAgencyId());
dto.setAgencyName(sub.getAgencyName());
+ dto.setLevel(null == sub.getLevel() ? "" : sub.getLevel());
+ dto.setAreaCode(null == sub.getAreaCode() ? "" : sub.getAreaCode());
for (SubAgencyGroupResultDTO u : list) {
- if (sub.getId().equals(u.getAgencyId())) {
+ if (sub.getAgencyId().equals(u.getAgencyId())) {
dto.setGroupTotal(u.getGroupTotal());
dto.setOrdinaryTotal(u.getOrdinaryTotal());
dto.setBranchTotal(u.getBranchTotal());
@@ -468,23 +502,23 @@ public class DataStatsServiceImpl implements DataStatsService {
formDTO.setType("group");
}
- //1.查询组织直属网格列表【网格维度】
- List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId());
+ //1.查询指标库组织直属网格列表【这个客户组织网格数据包括小程序的和项目上报的】
+ List gridList = indexService.getSubGridList(formDTO.getAgencyId());
if (gridList.size() < NumConstant.ONE) {
return resultList;
}
- List gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList());
+ List gridIds = gridList.stream().map(ScreenCustomerGridDTO::getGridId).collect(Collectors.toList());
//2.查询网格层级小组日统计数据,默认按群组总数降序
List list = dataStatsDao.getSubGridGroup(gridIds, formDTO.getDateId());
//3.封装数据并返回
- for (DimGridEntity gr : gridList) {
+ for (ScreenCustomerGridDTO gr : gridList) {
SubGridGroupResultDTO dto = new SubGridGroupResultDTO();
- dto.setGridId(gr.getId());
+ dto.setGridId(gr.getGridId());
dto.setGridName(gr.getGridName());
for (SubGridGroupResultDTO re : list) {
- if (gr.getId().equals(re.getGridId())) {
+ if (gr.getGridId().equals(re.getGridId())) {
dto.setGroupTotal(re.getGroupTotal());
dto.setOrdinaryTotal(re.getOrdinaryTotal());
dto.setBranchTotal(re.getBranchTotal());
@@ -535,12 +569,12 @@ public class DataStatsServiceImpl implements DataStatsService {
formDTO.setType("topic");
}
- //1.查询当前组织的直属下级组织信息【机关维度】
- List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId());
+ //1.查询直属下级组织列表,有子客户的按areaCode查没有的按agencyId查
+ List subAgencyList = indexService.getSubAgencyListByAgency(formDTO.getAgencyId());
if (subAgencyList.size() < NumConstant.ONE) {
return resultList;
}
- List agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList());
+ List agencyIds = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList());
//2.查询直属下级组织状态话题-日统计数据
//机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念
@@ -556,7 +590,7 @@ public class DataStatsServiceImpl implements DataStatsService {
AtomicInteger shiftIssueTotal = new AtomicInteger(0);
AtomicInteger hotdiscussTotal = new AtomicInteger(0);
topic.forEach(t -> {
- if (t.getAgencyId().equals(sub.getId())) {
+ if (t.getAgencyId().equals(sub.getAgencyId())) {
topicTotal.addAndGet(t.getTopicCount());
if (t.getTopicStatus().equals("closed")) {
closedTotal.set(t.getTopicCount());
@@ -564,18 +598,20 @@ public class DataStatsServiceImpl implements DataStatsService {
}
});
topicShiftIssue.forEach(t -> {
- if (t.getAgencyId().equals(sub.getId())) {
+ if (t.getAgencyId().equals(sub.getAgencyId())) {
shiftIssueTotal.addAndGet(t.getShiftedIssueTotal());
}
});
hotdiscuss.forEach(t -> {
- if (t.getAgencyId().equals(sub.getId())) {
+ if (t.getAgencyId().equals(sub.getAgencyId())) {
hotdiscussTotal.addAndGet(t.getTopicCount());
}
});
- resultDTO.setAgencyId(sub.getId());
+ resultDTO.setAgencyId(sub.getAgencyId());
resultDTO.setAgencyName(sub.getAgencyName());
+ resultDTO.setLevel(null == sub.getLevel() ? "" : sub.getLevel());
+ resultDTO.setAreaCode(null == sub.getAreaCode() ? "" : sub.getAreaCode());
resultDTO.setTopicTotal(topicTotal.get());
resultDTO.setDiscussingTotal(hotdiscussTotal.get());
resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal())));
@@ -629,12 +665,12 @@ public class DataStatsServiceImpl implements DataStatsService {
formDTO.setType("topic");
}
- //1.查询组织直属网格列表【网格维度】
- List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId());
+ //1.查询指标库组织直属网格列表【这个客户组织网格数据包括小程序的和项目上报的】
+ List gridList = indexService.getSubGridList(formDTO.getAgencyId());
if (gridList.size() < NumConstant.ONE) {
return resultList;
}
- List gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList());
+ List gridIds = gridList.stream().map(ScreenCustomerGridDTO::getGridId).collect(Collectors.toList());
//2.查询网格层级话题数据
//查询网格层级状态话题-日统计数据 机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念,热议中=总量-关闭数-屏蔽数-转议题数
@@ -650,7 +686,7 @@ public class DataStatsServiceImpl implements DataStatsService {
AtomicInteger shiftIssueTotal = new AtomicInteger(0);
AtomicInteger hotdiscussTotal = new AtomicInteger(0);
topic.forEach(t -> {
- if (t.getGridId().equals(gr.getId())) {
+ if (t.getGridId().equals(gr.getGridId())) {
topicTotal.addAndGet(t.getTopicCount());
if (t.getTopicStatus().equals("closed")) {
closedTotal.set(t.getTopicCount());
@@ -658,17 +694,17 @@ public class DataStatsServiceImpl implements DataStatsService {
}
});
topicShiftIssue.forEach(t -> {
- if (t.getGridId().equals(gr.getId())) {
+ if (t.getGridId().equals(gr.getGridId())) {
shiftIssueTotal.addAndGet(t.getShiftedIssueTotal());
}
});
hotdiscuss.forEach(t -> {
- if (t.getGridId().equals(gr.getId())) {
+ if (t.getGridId().equals(gr.getGridId())) {
hotdiscussTotal.addAndGet(t.getTopicCount());
}
});
- resultDTO.setGridId(gr.getId());
+ resultDTO.setGridId(gr.getGridId());
resultDTO.setGridName(gr.getGridName());
resultDTO.setTopicTotal(topicTotal.get());
resultDTO.setDiscussingTotal(hotdiscussTotal.get());
@@ -722,23 +758,25 @@ public class DataStatsServiceImpl implements DataStatsService {
formDTO.setType("issue");
}
- //1.查询当前组织的直属下级组织信息【机关维度】
- List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId());
+ //1.查询直属下级组织列表,有子客户的按areaCode查没有的按agencyId查
+ List subAgencyList = indexService.getSubAgencyListByAgency(formDTO.getAgencyId());
if (subAgencyList.size() < NumConstant.ONE) {
return resultList;
}
- List agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList());
+ List agencyIds = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList());
//2.查询直属下级组织议题日统计数据,默认按议题总数降序
List list = dataStatsDao.getSubAgencyIssue(agencyIds, formDTO.getDateId());
//3.封装数据
- for (DimAgencyEntity sub : subAgencyList) {
+ for (ScreenCustomerAgencyDTO sub : subAgencyList) {
SubAgencyIssueResultDTO dto = new SubAgencyIssueResultDTO();
- dto.setAgencyId(sub.getId());
+ dto.setAgencyId(sub.getAgencyId());
dto.setAgencyName(sub.getAgencyName());
+ dto.setLevel(null == sub.getLevel() ? "" : sub.getLevel());
+ dto.setAreaCode(null == sub.getAreaCode() ? "" : sub.getAreaCode());
for (SubAgencyIssueResultDTO u : list) {
- if (sub.getId().equals(u.getAgencyId())) {
+ if (sub.getAgencyId().equals(u.getAgencyId())) {
dto.setIssueTotal(u.getIssueTotal());
dto.setVotingTotal(u.getVotingTotal());
dto.setClosedIssueTotal(u.getClosedIssueTotal());
@@ -792,23 +830,23 @@ public class DataStatsServiceImpl implements DataStatsService {
formDTO.setType("issue");
}
- //1.查询组织直属网格列表【网格维度】
- List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId());
+ //1.查询指标库组织直属网格列表【这个客户组织网格数据包括小程序的和项目上报的】
+ List gridList = indexService.getSubGridList(formDTO.getAgencyId());
if (gridList.size() < NumConstant.ONE) {
return resultList;
}
- List gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList());
+ List gridIds = gridList.stream().map(ScreenCustomerGridDTO::getGridId).collect(Collectors.toList());
//2.查询网格层级议题日统计数据,默认按议题总数降序
List list = dataStatsDao.getSubGridIssue(gridIds, formDTO.getDateId());
//3.封装数据
- for (DimGridEntity gr : gridList) {
+ for (ScreenCustomerGridDTO gr : gridList) {
SubGridIssueResultDTO dto = new SubGridIssueResultDTO();
- dto.setGridId(gr.getId());
+ dto.setGridId(gr.getGridId());
dto.setGridName(gr.getGridName());
for (SubGridIssueResultDTO re : list) {
- if (gr.getId().equals(re.getGridId())) {
+ if (gr.getGridId().equals(re.getGridId())) {
dto.setIssueTotal(re.getIssueTotal());
dto.setVotingTotal(re.getVotingTotal());
dto.setClosedIssueTotal(re.getClosedIssueTotal());
@@ -862,23 +900,25 @@ public class DataStatsServiceImpl implements DataStatsService {
formDTO.setType("project");
}
- //1.查询当前组织的直属下级组织信息【机关维度】
- List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId());
+ //1.查询直属下级组织列表,有子客户的按areaCode查没有的按agencyId查
+ List subAgencyList = indexService.getSubAgencyListByAgency(formDTO.getAgencyId());
if (subAgencyList.size() < NumConstant.ONE) {
return resultList;
}
- List agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList());
+ List agencyIds = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList());
//2.查询直属下级组织项目日统计数据,默认按项目总数降序
List list = dataStatsDao.getSubAgencyProject(agencyIds, formDTO.getDateId());
//3.封装数据
- for (DimAgencyEntity sub : subAgencyList) {
+ for (ScreenCustomerAgencyDTO sub : subAgencyList) {
SubAgencyProjectResultDTO dto = new SubAgencyProjectResultDTO();
- dto.setAgencyId(sub.getId());
+ dto.setAgencyId(sub.getAgencyId());
dto.setAgencyName(sub.getAgencyName());
+ dto.setLevel(null == sub.getLevel() ? "" : sub.getLevel());
+ dto.setAreaCode(null == sub.getAreaCode() ? "" : sub.getAreaCode());
for (SubAgencyProjectResultDTO u : list) {
- if (sub.getId().equals(u.getAgencyId())) {
+ if (sub.getAgencyId().equals(u.getAgencyId())) {
dto.setProjectTotal(u.getProjectTotal());
dto.setPendingTotal(u.getPendingTotal());
dto.setClosedProjectTotal(u.getClosedProjectTotal());
@@ -928,23 +968,23 @@ public class DataStatsServiceImpl implements DataStatsService {
formDTO.setType("project");
}
- //1.查询组织直属网格列表【网格维度】
- List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId());
+ //1.查询指标库组织直属网格列表【这个客户组织网格数据包括小程序的和项目上报的】
+ List gridList = indexService.getSubGridList(formDTO.getAgencyId());
if (gridList.size() < NumConstant.ONE) {
return resultList;
}
- List gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList());
+ List gridIds = gridList.stream().map(ScreenCustomerGridDTO::getGridId).collect(Collectors.toList());
//2.查询网格层级项目日统计数据,默认按项目总数降序
List list = dataStatsDao.getSubGridProject(gridIds, formDTO.getDateId());
//3.封装数据
- for (DimGridEntity gr : gridList) {
+ for (ScreenCustomerGridDTO gr : gridList) {
SubGridProjectResultDTO dto = new SubGridProjectResultDTO();
- dto.setGridId(gr.getId());
+ dto.setGridId(gr.getGridId());
dto.setGridName(gr.getGridName());
for (SubGridProjectResultDTO re : list) {
- if (gr.getId().equals(re.getGridId())) {
+ if (gr.getGridId().equals(re.getGridId())) {
dto.setProjectTotal(re.getProjectTotal());
dto.setPendingTotal(re.getPendingTotal());
dto.setClosedProjectTotal(re.getClosedProjectTotal());
@@ -1086,6 +1126,7 @@ public class DataStatsServiceImpl implements DataStatsService {
public AgencyGovrnResultDTO agencyGovrn(AgencyGovrnFormDTO formDTO) {
AgencyGovrnResultDTO resultDTO = new AgencyGovrnResultDTO();
resultDTO.setAgencyId(formDTO.getAgencyId());
+ resultDTO.setLevel(formDTO.getLevel());
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.THREE);
@@ -1095,6 +1136,42 @@ public class DataStatsServiceImpl implements DataStatsService {
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
formDTO.setDateId(format.format(yesterday));
}
+ ScreenCustomerAgencyDTO agencyDTO = indexService.getAgencyInfo(formDTO.getAgencyId());
+ if (CollectionUtils.isNotEmpty(customerRelation.haveSubCustomer(agencyDTO.getCustomerId()))) {
+ if (OrgConstant.PROVINCE.equals(agencyDTO.getLevel()) || OrgConstant.CITY.equals(agencyDTO.getLevel()) || OrgConstant.DISTRICT.equals(agencyDTO.getLevel())) {
+ List subAgencyIds = indexService.getAgencyByAreaCodeAgencyId(formDTO.getAgencyId(), agencyDTO.getAreaCode());
+ if (CollectionUtils.isEmpty(subAgencyIds)) {
+ subAgencyIds = new ArrayList<>();
+ }
+ subAgencyIds.add(formDTO.getAgencyId());
+ List list = dataStatsDao.getAgencyGovernDaily(subAgencyIds, formDTO.getDateId());
+ if (CollectionUtils.isNotEmpty(list)) {
+ //问题解决总数
+ Integer problemResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getProblemResolvedCount).sum();
+ //未出小组即未转议题的:话题关闭已解决数
+ Integer inGroupTopicResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getInGroupTopicResolvedCount).sum();
+ //未出小组即未转议题的:话题关闭无需解决数
+ Integer inGroupTopicUnResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getInGroupTopicUnResolvedCount).sum();
+ //未出当前网格的,结案项目数
+ Integer gridSelfGovernProjectTotal = list.stream().mapToInt(FactAgencyGovernDailyEntity::getGridSelfGovernProjectTotal).sum();
+ //由社区结案的项目总数
+ Integer communityClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getCommunityClosedCount).sum();
+ //由街道结案的项目总数
+ Integer streetClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getStreetClosedCount).sum();
+ //由区直部门结案的项目总数
+ Integer districtDeptClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getDistrictDeptClosedCount).sum();
+
+ resultDTO.setProblemResolvedCount(problemResolvedCount);
+ resultDTO.setGroupSelfGovernRatio(getPercentage(inGroupTopicResolvedCount + inGroupTopicUnResolvedCount, problemResolvedCount));
+ resultDTO.setGridSelfGovernRatio(getPercentage(gridSelfGovernProjectTotal, problemResolvedCount));
+ resultDTO.setCommunityResolvedRatio(getPercentage(communityClosedCount, problemResolvedCount));
+ resultDTO.setStreetResolvedRatio(getPercentage(streetClosedCount, problemResolvedCount));
+ resultDTO.setDistrictDeptResolvedRatio(getPercentage(districtDeptClosedCount, problemResolvedCount));
+
+ return resultDTO;
+ }
+ }
+ }
//1.按日期查询当前组织事件治理指数
List agencyIds = new ArrayList<>();
agencyIds.add(formDTO.getAgencyId());
@@ -1133,6 +1210,18 @@ public class DataStatsServiceImpl implements DataStatsService {
return resultList;
}
List agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList());
+ ScreenCustomerAgencyDTO agencyDTO = indexService.getAgencyInfo(formDTO.getAgencyId());
+ if (CollectionUtils.isNotEmpty(customerRelation.haveSubCustomer(agencyDTO.getCustomerId()))) {
+ List subAgencies = indexService.getSubAgencyList(formDTO.getAgencyId(), agencyDTO.getAreaCode());
+ agencyIds = subAgencies.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList());
+ subAgencyList = subAgencies.stream().map(item -> {
+ DimAgencyEntity entity = new DimAgencyEntity();
+ entity.setId(item.getAgencyId());
+ entity.setAgencyName(item.getAgencyName());
+ entity.setLevel(item.getLevel());
+ return entity;
+ }).collect(Collectors.toList());
+ }
//2.按日期查询所有下级组织的事件治理指数
List list = dataStatsDao.getAgencyGovern(agencyIds, formDTO.getDateId());
@@ -1231,22 +1320,22 @@ public class DataStatsServiceImpl implements DataStatsService {
}
//1.查询组织直属网格列表【网格维度】
- List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId());
+ List gridList = indexService.getSubGridList(formDTO.getAgencyId());
if (gridList.size() < NumConstant.ONE) {
return resultList;
}
- List gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList());
+ List gridIds = gridList.stream().map(ScreenCustomerGridDTO::getGridId).collect(Collectors.toList());
//2.按日期查找组织直属网格事件治理指数列表
List list = dataStatsDao.getGridGovern(gridIds, formDTO.getDateId());
//3.封装数据
- for (DimGridEntity gr : gridList) {
+ for (ScreenCustomerGridDTO gr : gridList) {
GridGovrnResultDTO dto = new GridGovrnResultDTO();
- dto.setGridId(gr.getId());
+ dto.setGridId(gr.getGridId());
dto.setGridName(gr.getGridName());
for (GridGovrnResultDTO re : list) {
- if (gr.getId().equals(re.getGridId())) {
+ if (gr.getGridId().equals(re.getGridId())) {
dto.setProblemResolvedCount(re.getProblemResolvedCount());
dto.setGroupSelfGovernRatio(re.getGroupSelfGovernRatio());
dto.setGridSelfGovernRatio(re.getGridSelfGovernRatio());
@@ -1298,6 +1387,19 @@ public class DataStatsServiceImpl implements DataStatsService {
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
formDTO.setDateId(format.format(yesterday));
}
+ if (OrgConstant.AGENCY.equals(formDTO.getOrgType())) {
+ ScreenCustomerAgencyDTO agencyDTO = indexService.getAgencyInfo(formDTO.getOrgId());
+ if (CollectionUtils.isNotEmpty(customerRelation.haveSubCustomer(agencyDTO.getCustomerId()))) {
+ if (OrgConstant.PROVINCE.equals(agencyDTO.getLevel()) || OrgConstant.CITY.equals(agencyDTO.getLevel()) || OrgConstant.DISTRICT.equals(agencyDTO.getLevel())) {
+ ScreenGovernRankDataDailyDTO governData = indexService.getGovernRank(formDTO.getOrgId(), agencyDTO.getAreaCode(), formDTO.getDateId());
+ resultDTO.setGovernRatio(getPercentage(governData.getGovernCount(), governData.getClosedCount()));
+ resultDTO.setResolvedRatio(getPercentage(governData.getResolvedCount(), governData.getClosedCount()));
+ resultDTO.setResponseRatio(getPercentage(governData.getResponseCount(), governData.getTransferCount()));
+ resultDTO.setSatisfactionRatio(getPercentage(governData.getSatisfactionCount(), governData.getClosedProjectCount()));
+ return resultDTO;
+ }
+ }
+ }
//1.按类型、日期查询治理指数下响应解决满意自治四个统计率
GovrnRatioResultDTO dto = indexService.governRatio(formDTO);
@@ -1326,4 +1428,15 @@ public class DataStatsServiceImpl implements DataStatsService {
public GridMemberDataAnalysisResultDTO getGridMemberIssueProjectStats(String staffId) {
return factGridMemberStatisticsDailyDao.getGridMemberIssueProjectStats( staffId);
}
+ private String getPercentage(Integer countInt, Integer totalInt) {
+ if (NumConstant.ZERO == totalInt) {
+ return "0%";
+ }
+ BigDecimal count = new BigDecimal(countInt);
+ BigDecimal total = new BigDecimal(totalInt);
+ BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
+ BigDecimal ratio = count.multiply(hundred).divide(total, NumConstant.ONE, RoundingMode.HALF_UP);
+ return ratio.toString().concat("%");
+ }
+
}
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java
index 909a3dc208..43be38a84f 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java
@@ -2,6 +2,11 @@ package com.epmet.dataaggre.service.evaluationindex;
import com.epmet.dataaggre.dto.datastats.form.GovrnRatioFormDTO;
import com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO;
+import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO;
+import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO;
+import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO;
+
+import java.util.List;
/**
* @Author sun
@@ -15,4 +20,55 @@ public interface EvaluationIndexService {
* @author sun
*/
GovrnRatioResultDTO governRatio(GovrnRatioFormDTO formDTO);
+
+ /**
+ * @Description 查询areaCode对应的直属下级且不是agencyId对应的客户id的客户组织列表
+ * @author sun
+ */
+ List getAgencyByAreaCodeAgencyId(String agencyId, String areaCode);
+
+ /**
+ * @Description 查询直属下级组织列表,有areaCode的按areaCode查,没有的按agencyId查
+ * @author sun
+ */
+ List getSubAgencyList(String agencyId, String areaCode);
+
+ /**
+ * @Description 查询指标库组织直属网格列表【这个客户组织网格数据包括小程序的和项目上报的】
+ * @author sun
+ */
+ List getSubGridList(String agencyId);
+
+ /**
+ * 根据组织ID获取治理指数
+ * @author zhaoqifeng
+ * @date 2021/6/25 16:33
+ * @param agencyId
+ * @param areaCode
+ * @param dateId
+ * @return java.util.List
+ */
+ ScreenGovernRankDataDailyDTO getGovernRank(String agencyId, String areaCode, String dateId);
+
+ /**
+ * 获取组织信息
+ * @author zhaoqifeng
+ * @date 2021/6/29 13:57
+ * @param agencyId
+ * @return com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO
+ */
+ ScreenCustomerAgencyDTO getAgencyInfo(String agencyId);
+
+ /**
+ * @Description 根据组织Id查询是否存在子客户,存在的按areaCode查询当前客户之外的客户组织列表
+ * @author sun
+ */
+ List getAgencyIdsByAgencyId(String agencyId);
+
+ /**
+ * @Description 查询直属下级组织列表,有子客户的按areaCode查没有的按agencyId查
+ * @author sun
+ */
+ List getSubAgencyListByAgency(String agencyId);
+
}
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java
index bec7bafd90..fc9e6b8ba6 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java
@@ -7,14 +7,21 @@ import com.epmet.dataaggre.dao.datastats.DataStatsDao;
import com.epmet.dataaggre.dao.evaluationindex.EvaluationIndexDao;
import com.epmet.dataaggre.dto.datastats.form.GovrnRatioFormDTO;
import com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO;
+import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO;
+import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO;
+import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO;
import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService;
+import com.epmet.dataaggre.service.opercrm.CustomerRelation;
import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
+import java.util.ArrayList;
import java.util.Date;
+import java.util.List;
/**
* @Author sun
@@ -26,6 +33,8 @@ import java.util.Date;
public class EvaluationIndexServiceImpl implements EvaluationIndexService {
@Autowired
private EvaluationIndexDao evaluationIndexDao;
+ @Autowired
+ private CustomerRelation customerRelation;
/**
* @Param formDTO
@@ -37,4 +46,99 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService {
return evaluationIndexDao.getAgnecyOrGridGoverRatio(formDTO.getOrgId(),formDTO.getOrgType(),formDTO.getDateId());
}
+ /**
+ * @Description 查询areaCode对应的直属下级且不是agencyId对应的客户id的客户组织列表
+ * @author sun
+ */
+ @Override
+ public List getAgencyByAreaCodeAgencyId(String agencyId, String areaCode) {
+ return evaluationIndexDao.getAgencyByAreaCodeAgencyId(agencyId,areaCode);
+ }
+
+ /**
+ * @Description 查询直属下级组织列表,有areaCode的按areaCode查,没有的按agencyId查
+ * @author sun
+ */
+ @Override
+ public List getSubAgencyList(String agencyId, String areaCode) {
+ return evaluationIndexDao.getSubAgencyList(agencyId,areaCode);
+ }
+
+ /**
+ * @Description 查询指标库组织直属网格列表【这个客户组织网格数据包括小程序的和项目上报的】
+ * @author sun
+ */
+ @Override
+ public List getSubGridList(String agencyId) {
+ return evaluationIndexDao.getSubGridList(agencyId);
+ }
+
+ /**
+ * 根据组织ID获取治理指数
+ *
+ * @param agencyId
+ * @param areaCode
+ * @param dateId
+ * @return java.util.List
+ * @author zhaoqifeng
+ * @date 2021/6/25 16:33
+ */
+ @Override
+ public ScreenGovernRankDataDailyDTO getGovernRank(String agencyId, String areaCode, String dateId) {
+ List agencyIdList = getAgencyByAreaCodeAgencyId(agencyId, areaCode);
+ if (CollectionUtils.isEmpty(agencyIdList)) {
+ agencyIdList = new ArrayList<>();
+ }
+ agencyIdList.add(agencyId);
+ return evaluationIndexDao.getGovernRankList(agencyIdList, dateId);
+ }
+
+ /**
+ * 获取组织信息
+ *
+ * @param agencyId
+ * @return com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO
+ * @author zhaoqifeng
+ * @date 2021/6/29 13:57
+ */
+ @Override
+ public ScreenCustomerAgencyDTO getAgencyInfo(String agencyId) {
+ return evaluationIndexDao.getAgencyInfo(agencyId);
+ }
+
+ /**
+ * @Description 根据组织Id查询是否存在子客户,存在的按areaCode查询当前客户之外的客户组织列表
+ * @author sun
+ */
+ @Override
+ public List getAgencyIdsByAgencyId(String agencyId) {
+ //1.查询agencyId对应组织信息
+ ScreenCustomerAgencyDTO dto = evaluationIndexDao.getByAgencyId(agencyId);
+ //2.判断客户是否存在子客户
+ List list = customerRelation.haveSubCustomer(dto.getCustomerId());
+ if (!CollectionUtils.isNotEmpty(list)) {
+ return new ArrayList<>();
+ }
+ //3.存在子客户的,查询当前组织的areaCode对应的直属下级且不是agencyId对应的客户id的但是存在父子客户关系的客户组织列表
+ return evaluationIndexDao.getAgencyIdsByAgencyId(agencyId, dto.getAreaCode(), list);
+ }
+
+ /**
+ * @Description 查询直属下级组织列表,有子客户的按areaCode查没有的按agencyId查且是在当前客户和子客户范围内查询
+ * @author sun
+ */
+ @Override
+ public List getSubAgencyListByAgency(String agencyId) {
+ //1.查询agencyId对应组织信息
+ ScreenCustomerAgencyDTO dto = evaluationIndexDao.getByAgencyId(agencyId);
+ //2.判断客户是否存在子客户
+ List list = customerRelation.haveSubCustomer(dto.getCustomerId());
+ if (!CollectionUtils.isNotEmpty(list)) {
+ return evaluationIndexDao.getSubAgencyListByAgency(agencyId, null, null);
+ } else {
+ list.add(dto.getCustomerId());
+ return evaluationIndexDao.getSubAgencyListByAgency(null, dto.getAreaCode(), list);
+ }
+ }
+
}
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/CustomerRelation.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/CustomerRelation.java
index af0dc94e88..71d96fe17b 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/CustomerRelation.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/CustomerRelation.java
@@ -10,4 +10,13 @@ import java.util.List;
*/
public interface CustomerRelation {
List selectUsedAreaCodeList(String areaCode);
+
+ /**
+ * 是否有子客户
+ * @author zhaoqifeng
+ * @date 2021/6/29 11:06
+ * @param customerId
+ * @return List
+ */
+ List haveSubCustomer(String customerId);
}
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/impl/CustomerRelationImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/impl/CustomerRelationImpl.java
index 045232e1a7..af5f40e53f 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/impl/CustomerRelationImpl.java
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/impl/CustomerRelationImpl.java
@@ -5,6 +5,7 @@ import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.opercrm.CustomerRelationDao;
import com.epmet.dataaggre.service.opercrm.CustomerRelation;
import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -27,4 +28,17 @@ public class CustomerRelationImpl implements CustomerRelation {
public List selectUsedAreaCodeList(String areaCode) {
return customerRelationDao.selectUsedAreaCodeList(areaCode);
}
+
+ /**
+ * 是否有子客户
+ *
+ * @param customerId
+ * @return boolean
+ * @author zhaoqifeng
+ * @date 2021/6/29 11:06
+ */
+ @Override
+ public List haveSubCustomer(String customerId) {
+ return customerRelationDao.selectAllSubCustomerIds(customerId);
+ }
}
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml
index fb5757da88..7b4361e463 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml
@@ -12,9 +12,10 @@
fact_reg_user_agency_daily
WHERE
del_flag = '0'
- AND agency_id = #{agencyId}
AND date_id = #{dateId}
- LIMIT 1
+
+ agency_id = #{agencyId}
+
@@ -26,9 +27,10 @@
fact_group_total_agency_daily
WHERE
del_flag = '0'
- AND agency_id = #{agencyId}
AND date_id = #{dateId}
- LIMIT 1
+
+ agency_id = #{agencyId}
+
@@ -40,9 +42,10 @@
WHERE
del_flag = '0'
AND topic_status_id in('discussing','closed','hidden')
- AND agency_id = #{agencyId}
AND date_id = #{dateId}
- LIMIT 3
+
+ agency_id = #{agencyId}
+
@@ -53,9 +56,10 @@
fact_topic_issue_agency_daily
WHERE
del_flag = '0'
- AND agency_id = #{agencyId}
AND date_id = #{dateId}
- LIMIT 1
+
+ agency_id = #{agencyId}
+
@@ -66,9 +70,10 @@
fact_topic_hotdiscuss_agency_daily
WHERE
del_flag = '0'
- AND agency_id = #{agencyId}
AND date_id = #{dateId}
- LIMIT 1
+
+ agency_id = #{agencyId}
+
@@ -81,9 +86,10 @@
fact_issue_agency_daily
WHERE
del_flag = '0'
- AND agency_id = #{agencyId}
AND date_id = #{dateId}
- LIMIT 1
+
+ agency_id = #{agencyId}
+
@@ -95,9 +101,10 @@
fact_agency_project_daily
WHERE
del_flag = '0'
- AND agency_id = #{agencyId}
AND date_id = #{dateId}
- LIMIT 1
+
+ agency_id = #{agencyId}
+
@@ -653,5 +660,30 @@
ORDER BY problem_resolved_count DESC
+
+ SELECT
+ AGENCY_ID,
+ `LEVEL`,
+ PROBLEM_RESOLVED_COUNT,
+ GROUP_SELF_GOVERN_RATIO,
+ GRID_SELF_GOVERN_RATIO,
+ COMMUNITY_CLOSED_RATIO,
+ STREET_CLOSED_RATIO,
+ DISTRICT_DEPT_CLOSED_RATIO,
+ IN_GROUP_TOPIC_RESOLVED_COUNT,
+ IN_GROUP_TOPIC_UN_RESOLVED_COUNT,
+ GRID_SELF_GOVERN_PROJECT_TOTAL,
+ COMMUNITY_CLOSED_COUNT,
+ STREET_CLOSED_COUNT,
+ DISTRICT_DEPT_CLOSED_COUNT
+ FROM
+ fact_agency_govern_daily
+ WHERE
+ DEL_FLAG = '0'
+ AND DATE_ID = #{dateId}
+
+ AGENCY_ID = #{agencyId}
+
+
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml
index a0c2e0c245..d248aa13df 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml
@@ -20,4 +20,158 @@
AND date_id = #{dateId}
+
+ SELECT
+ agency_id
+ FROM
+ screen_customer_agency
+ WHERE
+ del_flag = '0'
+ AND parent_area_code = #{areaCode}
+ AND customer_id != (
+ SELECT
+ customer_id
+ FROM
+ screen_customer_agency
+ WHERE
+ agency_id = #{agencyId}
+ )
+
+
+
+ SELECT
+ customer_id AS customerId,
+ agency_id AS agencyId,
+ agency_name AS agencyName,
+ level AS level,
+ area_code AS areaCode,
+ parent_area_code AS parentAreaCode
+ FROM
+ SCREEN_CUSTOMER_AGENCY
+ WHERE
+ del_flag = '0'
+
+
+ AND parent_area_code = #{areaCode}
+
+
+ AND pid = #{agencyId}
+
+
+
+
+
+ SELECT
+ customer_id AS customerId,
+ grid_id AS gridId,
+ grid_name AS gridName,
+ parent_agency_id AS parentAgencyId,
+ area_marks AS areaMarks,
+ center_mark AS centerMark,
+ party_mark AS partyMark,
+ data_end_time AS dataEndTime,
+ all_parent_ids AS allParentIds
+ FROM
+ screen_customer_grid
+ WHERE
+ del_flag = '0'
+ AND parent_agency_id = #{agencyId}
+
+
+ SELECT
+ IFNULL( SUM( RESPONSE_COUNT ), 0 ) AS responseCount,
+ IFNULL( SUM( TRANSFER_COUNT ), 0 ) AS transferCount,
+ IFNULL( SUM( RESOLVED_COUNT ), 0 ) AS resolvedCount,
+ IFNULL( SUM( CLOSED_COUNT ), 0 ) AS closedCount,
+ IFNULL( SUM( GOVERN_COUNT ), 0 ) AS governCount,
+ IFNULL( SUM( SATISFACTION_COUNT ), 0 ) AS satisfactionCount,
+ IFNULL( SUM( CLOSED_PROJECT_COUNT ), 0 ) AS closedProjectCount
+ FROM
+ screen_govern_rank_data_daily
+ WHERE
+ DEL_FLAG = '0'
+
+ ORG_ID = #{agencyId}
+
+ AND ORG_TYPE = 'agency'
+ AND DATE_ID = #{dateId}
+
+
+ SELECT
+ customer_id,
+ agency_id ,
+ agency_name,
+ level,
+ area_code,
+ parent_area_code
+ FROM
+ SCREEN_CUSTOMER_AGENCY
+ WHERE
+ del_flag = '0'
+ and AGENCY_ID = #{agencyId}
+
+
+
+ SELECT
+ customer_id AS customerId,
+ agency_id AS agencyId,
+ agency_name AS agencyName,
+ level AS level,
+ area_code AS areaCode,
+ parent_area_code AS parentAreaCode
+ FROM
+ screen_customer_agency
+ WHERE
+ del_flag = '0'
+ AND agency_id = #{agencyId}
+
+
+
+ SELECT
+ agency_id
+ FROM
+ screen_customer_agency
+ WHERE
+ del_flag = '0'
+ AND parent_area_code = #{areaCode}
+ AND customer_id != (
+ SELECT
+ customer_id
+ FROM
+ screen_customer_agency
+ WHERE
+ agency_id = #{agencyId}
+ )
+
+ customer_id = #{customerId}
+
+
+
+
+ SELECT
+ customer_id AS customerId,
+ agency_id AS agencyId,
+ agency_name AS agencyName,
+ level AS level,
+ area_code AS areaCode,
+ parent_area_code AS parentAreaCode
+ FROM
+ screen_customer_agency
+ WHERE
+ del_flag = '0'
+
+
+ AND parent_area_code = #{areaCode}
+
+
+ AND pid = #{agencyId}
+
+
+
+
+ customer_id = #{customerId}
+
+
+
+
\ No newline at end of file
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercrm/CustomerRelationDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercrm/CustomerRelationDao.xml
index 169a44070f..439efdb207 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercrm/CustomerRelationDao.xml
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercrm/CustomerRelationDao.xml
@@ -14,4 +14,13 @@
AND cr.AREA_CODE LIKE concat(#{areaCode}, '%')
AND cr.AREA_CODE != #{areaCode}
+
+ SELECT
+ cr.CUSTOMER_ID
+ FROM
+ customer_relation cr
+ WHERE
+ cr.DEL_FLAG = '0'
+ AND cr.PIDS like CONCAT(#{customerId},'%')
+
\ No newline at end of file
diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenCustomerGridDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenCustomerGridDTO.java
new file mode 100644
index 0000000000..10c2a503c3
--- /dev/null
+++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenCustomerGridDTO.java
@@ -0,0 +1,119 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * 网格(党支部)信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-08-26
+ */
+@Data
+public class ScreenCustomerGridDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 主键ID 主键ID
+ */
+ private String id;
+
+ /**
+ * 客户id
+ */
+ private String customerId;
+
+ /**
+ * 网格id
+ */
+ private String gridId;
+
+ /**
+ * 组织名称
+ */
+ private String gridName;
+
+ /**
+ * 网格所属组织id
+ */
+ private String parentAgencyId;
+
+ /**
+ * 坐标区域
+ */
+ private String areaMarks;
+
+ /**
+ * 中心点位
+ */
+ private String centerMark;
+
+ /**
+ * 党支部(=网格)的位置
+ */
+ private String partyMark;
+
+ /**
+ * 删除标识 0.未删除 1.已删除
+ */
+ private Integer delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+ /**
+ * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)
+ */
+ private String dataEndTime;
+
+ /**
+ * 所有上级ID,用英文逗号分开
+ */
+ private String allParentIds;
+ private String pid;
+ private String pids;
+ private String areaCode;
+}
\ No newline at end of file
diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/AgencyDetailMulticFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/AgencyDetailMulticFormDTO.java
new file mode 100644
index 0000000000..003e925379
--- /dev/null
+++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/AgencyDetailMulticFormDTO.java
@@ -0,0 +1,34 @@
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+/**
+ * 工作端小程序-数据上面的 当前组织调用此接口
+ *
+ * @author yinzuomei@elink-cn.com
+ * @date 2021/6/24 15:26
+ */
+@Data
+public class AgencyDetailMulticFormDTO implements Serializable {
+ private static final long serialVersionUID = 6603177626712295270L;
+ /**
+ * 内部错误分组
+ * */
+ public interface AddUserInternalGroup{}
+
+ /**
+ * 机关组织Id
+ */
+ @NotBlank(message = "机关组织ID不能为空" , groups = {AddUserInternalGroup.class})
+ private String agencyId;
+
+
+ /**
+ * 当前登录用户所属的客户id
+ */
+ private String customerId;
+
+}
diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/project/MassesDiscontentFormV2DTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/project/MassesDiscontentFormV2DTO.java
new file mode 100644
index 0000000000..55df09cdfe
--- /dev/null
+++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/project/MassesDiscontentFormV2DTO.java
@@ -0,0 +1,57 @@
+package com.epmet.dto.form.project;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+/**
+ * 群众不满列表查询入参DTO,从指标库取值
+ *
+ * @author yinzuomei@elink-cn.com
+ * @date 2021/6/24 10:55
+ */
+@Data
+public class MassesDiscontentFormV2DTO implements Serializable {
+ public interface MassesDiscontentFormV2 {
+ }
+
+ /**
+ * 时间区间,三个月:threeMonth;半年:sixMonth;一年:twelveMonth
+ * 一个月按照30天,三个月90天,半年180天,一年365天
+ */
+ @NotBlank(message = "timeSection不能为空,取值:三个月:threeMonth;半年:sixMonth;一年:twelveMonth", groups = MassesDiscontentFormV2.class)
+ private String timeSection;
+
+ /**
+ * asc:分数由低到高
+ * desc:分数由高到低
+ */
+ @NotBlank(message = "sortType不能为空,取值:asc:分数由低到高;desc:分数由高到低", groups = MassesDiscontentFormV2.class)
+ private String sortType;
+
+ /**
+ * 组织ID
+ */
+ @NotBlank(message = "agencyId不能为空", groups = MassesDiscontentFormV2.class)
+ private String agencyId;
+
+ @NotNull(message = "pageNo不能为空", groups = MassesDiscontentFormV2.class)
+ private Integer pageNo;
+
+ @NotNull(message = "pageSize不能为空", groups = MassesDiscontentFormV2.class)
+ private Integer pageSize;
+
+ /**
+ * 当前agency对应的区域编码,由前端传入,前端从/data/report/screen/agency/agencydetail这取值
+ */
+ private String areaCode;
+
+
+
+
+ //以下属性无需前端传入
+ private String startDate;
+ private String endDate;
+}
diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/AgencyDetailMulticResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/AgencyDetailMulticResultDTO.java
new file mode 100644
index 0000000000..7b34abcec9
--- /dev/null
+++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/AgencyDetailMulticResultDTO.java
@@ -0,0 +1,104 @@
+package com.epmet.dto.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 描述一下
+ *
+ * @author yinzuomei@elink-cn.com
+ * @date 2021/6/24 15:31
+ */
+@Data
+public class AgencyDetailMulticResultDTO implements Serializable {
+ /**
+ * 机关组织Id
+ */
+ private String agencyId = "";
+
+ /**
+ * 组织名称
+ */
+ private String agencyName = "";
+
+ /**
+ * 机关级别(社区级:community,
+ * 乡(镇、街道)级:street,
+ * 区县级: district,
+ * 市级: city
+ * 省级:province) 机关级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province)
+ */
+ private String level = "";
+
+ /**
+ * 地区编码
+ */
+ private String areaCode = "";
+
+ /**
+ * 【省份】名称
+ */
+ private String province = "";
+
+ /**
+ * 【城市】名称
+ */
+ private String city = "";
+
+ /**
+ * 【区县】名称
+ */
+ private String district = "";
+
+ /**
+ * 本机关的所有上级机关
+ */
+ private List parentList;
+
+ /**
+ * 街道
+ */
+ private String street="";
+
+ /**
+ * 社区
+ */
+ private String community="";
+
+ /**
+ * open: 选择地区编码必填;closed: 无需选择地区编码;;0409新增返参
+ */
+ private String areaCodeSwitch;
+
+ /**
+ * 组织区划的名称
+ */
+ private String areaName;
+
+ /**
+ * 当前组织对应客户根组织级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province)
+ */
+ private String rootlevel;
+
+
+ //以下参数是06.24新增
+ private String rootAgencyId;
+ private String parentAreaCode;
+ /**
+ * 是否有字客户
+ */
+ private Boolean haveSubCustomer;
+
+ /**
+ * 子客户列表
+ */
+ private List subCustomerIds;
+
+ // @JsonIgnore
+ /**
+ * 当前agencyId所属的客户id
+ */
+ private String customerId;
+}
diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java
new file mode 100644
index 0000000000..60683bf779
--- /dev/null
+++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java
@@ -0,0 +1,46 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto.result;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+
+/**
+ * 组织首页-获取组织机构信息接口-本机关的所有上级机关信息
+ *
+ * @author sun
+ */
+@Data
+public class ParentListResultDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 机关组织Id
+ */
+ private String id = "";
+ /**
+ * 机关组织名称
+ */
+ private String name = "";
+
+
+}
\ No newline at end of file
diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/ScreenCustomerAgencyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/ScreenCustomerAgencyDTO.java
index 5ceeca49a7..a07fa65053 100644
--- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/ScreenCustomerAgencyDTO.java
+++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/ScreenCustomerAgencyDTO.java
@@ -46,4 +46,14 @@ public class ScreenCustomerAgencyDTO implements Serializable {
* 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701
*/
private String parentAreaCode;
+
+ /**
+ * 父级id ,顶级,此列为0
+ */
+ private String pid;
+
+ /**
+ * 所有上级ID,用逗号(英文)分开
+ */
+ private String pids;
}
diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/MassesDiscontentResultV2DTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/MassesDiscontentResultV2DTO.java
new file mode 100644
index 0000000000..627edc6daa
--- /dev/null
+++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/MassesDiscontentResultV2DTO.java
@@ -0,0 +1,69 @@
+package com.epmet.dto.result.project;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 群众不满列表查询返参DTO,从指标库取值
+ *
+ * @author yinzuomei@elink-cn.com
+ * @date 2021/6/24 11:02
+ */
+@Data
+public class MassesDiscontentResultV2DTO implements Serializable {
+ private static final long serialVersionUID = 403953150174574960L;
+ /**
+ * 项目ID
+ */
+ private String projectId;
+
+ /**
+ * 议题ID
+ */
+ private String issueId;
+
+ /**
+ * 话题所在网格
+ */
+ private String gridName;
+
+ /**
+ * 话题图片
+ */
+ private List photos;
+
+ /**
+ * 话题内容
+ */
+ private String topicContent;
+
+ /**
+ * 项目分类标签
+ */
+ private String projectCategory;
+
+ /**
+ * 项目评价分数
+ * 直接取整数位展示
+ */
+ private BigDecimal score;
+
+ @JsonIgnore
+ private String customerId;
+ @JsonIgnore
+ private String parentAgencyId;
+ @JsonIgnore
+ private String areaCode;
+
+ public MassesDiscontentResultV2DTO() {
+ this.gridName = "";
+ this.photos = new ArrayList<>();
+ this.topicContent = "";
+ this.projectCategory = "";
+ }
+}
diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/RootAgencyFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/RootAgencyFormDTO.java
index 42a67c936f..ce778cf651 100644
--- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/RootAgencyFormDTO.java
+++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/RootAgencyFormDTO.java
@@ -21,4 +21,9 @@ public class RootAgencyFormDTO implements Serializable {
@NotBlank(message = "组织ID不能为空",groups = {RootAgencyFormDTO.AddUserInternalGroup.class})
private String agencyId;
+ /**
+ * token中客户Id
+ */
+ private String customerId;
+
}
diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java
index 1c7391dd93..ece032ba4d 100644
--- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java
+++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java
@@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serializable;
+import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Set;
@@ -24,6 +25,11 @@ public class ScreenProjectDetailResultDTO implements Serializable {
* 项目id
*/
private String projectId;
+ /**
+ * 项目标题,06.25新增,工作端小程序难点赌点+群众不满详情用
+ */
+ private String projectTitle;
+
/**
* 议题内容,其实就是项目内容
*/
@@ -66,6 +72,11 @@ public class ScreenProjectDetailResultDTO implements Serializable {
*/
private List processList;
+ /**
+ * 满意度得分 06.25新增,这个返参目前大屏和工作端小程序都没有用到,工作端小程序详情的得分是取得列表返回去的值
+ */
+ private BigDecimal score;
+
@Data
public static class processDTO{
private String processId;
diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java
index 7b07db5c72..ac850effbe 100644
--- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java
+++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java
@@ -22,4 +22,11 @@ public interface ProjectConstant {
String PROCESS_FAILURE = "查询项目进展失败......";
+ /**
+ * 三个月,六个月,12个月
+ */
+ String THREE_MONTH = "threeMonth";
+ String SIX_MONTH = "sixMonth";
+ String TWELVE_MONTH = "twelveMonth";
+ String YESTERDAY = "yesterday";
}
diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/DifficultyRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/DifficultyRankFormDTO.java
index 5a3936db6a..8f62ab848e 100644
--- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/DifficultyRankFormDTO.java
+++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/DifficultyRankFormDTO.java
@@ -40,4 +40,15 @@ public class DifficultyRankFormDTO implements Serializable {
* 组织类型: 网格:grid ; 组织:agency
*/
private String orgType;
+
+ /**
+ * 当前agency对应的区域编码,由前端传入,前端从/data/report/screen/agency/agencydetail这取值
+ */
+ private String areaCode;
+
+ //以下属性无需前端赋值
+ /**
+ * 当前登录用户所属客户id
+ */
+ private String customerId;
}
\ No newline at end of file
diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDifficultRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDifficultRankResultDTO.java
index f781d62d15..f3d1967599 100644
--- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDifficultRankResultDTO.java
+++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDifficultRankResultDTO.java
@@ -3,7 +3,6 @@ package com.epmet.project.dto.result;
import lombok.Data;
import java.io.Serializable;
-import java.util.ArrayList;
import java.util.List;
/**
@@ -25,11 +24,17 @@ public class ProjectDifficultRankResultDTO implements Serializable {
* 项目标题
* */
private String title;
-
+ // 3个街道和产品这边状态码不一样..
/**
* 状态: 待处理: pending; 结案closed
* */
private String statusCode;
+ // pending 处理中
+ // closed 已结案
+ // 10 已结案
+ // 5 已关闭
+ // 0 处理中
+ private String statusDesc;
/**
* 社区-网格名
diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectNextAgencyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectNextAgencyResultDTO.java
index 2c867a6398..9aaf0b6050 100644
--- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectNextAgencyResultDTO.java
+++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectNextAgencyResultDTO.java
@@ -1,9 +1,9 @@
package com.epmet.project.dto.result;
+import com.epmet.commons.tools.constant.StrConstant;
import lombok.Data;
import java.io.Serializable;
-import java.util.List;
/**
* @Description 难点赌点-当前登录人员本级一级下一级组织机构/网格 返参DTO
@@ -30,5 +30,15 @@ public class ProjectNextAgencyResultDTO implements Serializable {
* */
private String orgType;
+ /**
+ * orgId对应的areaCode。 只有当前客户有子客户时,才会返回指,否则返回null或者空字符串
+ * */
+ private String areaCode;
+ public ProjectNextAgencyResultDTO(){
+ this.orgId= StrConstant.EPMETY_STR;
+ this.orgName= StrConstant.EPMETY_STR;
+ this.orgType= StrConstant.EPMETY_STR;
+ this.areaCode= StrConstant.EPMETY_STR;
+ }
}
diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java
index 3a2f5cfebb..29d8cb939b 100644
--- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java
+++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java
@@ -1,5 +1,7 @@
package com.epmet.datareport.controller.fact;
+import com.epmet.commons.tools.annotation.LoginUser;
+import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.fact.FactIndexService;
@@ -98,8 +100,9 @@ public class FactIndexController {
* @author sun
*/
@PostMapping("index/rootagency")
- public Result rootAgency(@RequestBody RootAgencyFormDTO formDTO) {
+ public Result rootAgency(@LoginUser TokenDto tokenDto, @RequestBody RootAgencyFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, RootAgencyFormDTO.AddUserInternalGroup.class);
+ formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result().ok(factIndexService.rootAgency(formDTO));
}
diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java
index 2f704b6b16..6f485e507e 100644
--- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java
+++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java
@@ -11,6 +11,8 @@ import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectQuantity
import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyService;
import com.epmet.datareport.service.project.ProjectService;
import com.epmet.dto.form.ProcessListFormDTO;
+import com.epmet.dto.form.project.MassesDiscontentFormV2DTO;
+import com.epmet.dto.result.project.MassesDiscontentResultV2DTO;
import com.epmet.project.constant.ProjectConstant;
import com.epmet.project.dto.form.DifficultyRankFormDTO;
import com.epmet.project.dto.form.ProjectIncrTrendFormDTO;
@@ -114,6 +116,21 @@ public class ProjectController {
return new Result>().ok(projectService.getDifficultyRank(param));
}
+ /**
+ * @return com.epmet.commons.tools.utils.Result>
+ * @param formDTO
+ * @author yinzuomei
+ * @description 难点赌点-耗时最长|涉及部门最多|处理次数 返回该组织下所有的难点堵点的 数据
+ * 2021.06.21新增次API,多客户版本,eg:平阴县的工作人员可以看到8个街道的难点赌点
+ * @Date 2021/6/23 13:09
+ **/
+ @PostMapping("difficultyrank-multic")
+ public Result> difficultyRankMultic(@RequestHeader("CustomerId") String customerId,@RequestBody DifficultyRankFormDTO formDTO){
+ formDTO.setCustomerId(customerId);
+ ValidatorUtils.validateEntity(formDTO, DifficultyRankFormDTO.DifficultyRankInternalGroup.class);
+ return new Result>().ok(projectService.difficultyRankMultic(formDTO));
+ }
+
/**
* @Description 难点赌点-耗时最长|涉及部门最多|处理次数
* @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614
@@ -127,6 +144,20 @@ public class ProjectController {
return new Result>().ok(projectService.getMyNextAgency(tokenDto));
}
+ /**
+ * @return com.epmet.commons.tools.utils.Result>
+ * @param tokenDto
+ * @author yinzuomei
+ * @description 001、难点堵点-组织下拉框
+ * 需求描述:下拉框显示当前用户所属组织和下级组织 ;1)如果当前用户是街道工作人员, 显示所属街道和该街道下的社区+直属网格;2)如果当前用户是社区人员, 显示所属社区和该社区下的网格+直属网格。
+ * 210622: 新增此API, 后端改为从指标库取值 , 保证平阴县的工作人员,看到的下拉框是平阴县、以及8个街道
+ * @Date 2021/6/22 14:20
+ **/
+ @PostMapping("mynextagency-multic")
+ public Result> myNextAgencyMultic(@LoginUser TokenDto tokenDto){
+ return new Result>().ok(projectService.myNextAgencyMultic(tokenDto.getUserId(),tokenDto.getCustomerId()));
+ }
+
/**
* 002、项目分类字典查询
* 查询当前客户的父客户下,项目分类字典
@@ -140,4 +171,18 @@ public class ProjectController {
public Result> categoryDict(@RequestHeader("CustomerId") String customerId) {
return new Result>().ok(projectService.getCategoryDict(customerId));
}
+
+ /**
+ * @return com.epmet.commons.tools.utils.Result>
+ * @param formDTO
+ * @author yinzuomei
+ * @description 群众不满列表,改为从指标库的screen_project_data取值
+ * sql里面写死<75分的展示
+ * @Date 2021/6/24 11:13
+ **/
+ @PostMapping("massesdiscontent-multic")
+ public Result> queryMassesDiscontentMultic(@RequestBody MassesDiscontentFormV2DTO formDTO){
+ ValidatorUtils.validateEntity(formDTO, MassesDiscontentFormV2DTO.MassesDiscontentFormV2.class);
+ return new Result>().ok(projectService.queryMassesDiscontentMultic(formDTO));
+ }
}
diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java
index 1eba0b727c..6c71a15009 100644
--- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java
+++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java
@@ -1,10 +1,14 @@
package com.epmet.datareport.controller.screen;
+import com.epmet.commons.tools.annotation.LoginUser;
+import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.AgencyService;
import com.epmet.dto.form.AddAreaCodeDictFormDTO;
+import com.epmet.dto.form.AgencyDetailMulticFormDTO;
import com.epmet.dto.form.AreaCodeDictFormDTO;
+import com.epmet.dto.result.AgencyDetailMulticResultDTO;
import com.epmet.dto.result.AreaCodeDictResultDTO;
import com.epmet.dto.result.commonservice.AddAreaCodeDictResultDTO;
import com.epmet.dto.result.plugins.AgencyNodeDTO;
@@ -110,4 +114,19 @@ public class AgencyController {
}
return new Result<>();
}
+
+
+ /**
+ * @return com.epmet.commons.tools.utils.Result
+ * @param
+ * @author yinzuomei
+ * @description 工作端小程序-数据上面的 当前组织调用此接口
+ * @Date 2021/6/24 15:29
+ **/
+ @PostMapping("agencydetail-multic")
+ public Result queryAgencyDetailMultiC(@LoginUser TokenDto tokenDto, @RequestBody AgencyDetailMulticFormDTO formDTO){
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ ValidatorUtils.validateEntity(formDTO, AgencyDetailMulticFormDTO.AddUserInternalGroup.class);
+ return new Result().ok(agencyService.queryAgencyDetailMultiC(formDTO));
+ }
}
diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
index 986a880aac..a951b18406 100644
--- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
+++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
@@ -17,6 +17,8 @@
package com.epmet.datareport.dao.evaluationindex.screen;
+import com.epmet.dto.ScreenCustomerGridDTO;
+import com.epmet.dto.result.ParentListResultDTO;
import com.epmet.dto.result.ScreenCustomerAgencyDTO;
import com.epmet.dto.result.plugins.AgencyNodeDTO;
import com.epmet.dto.result.plugins.DeptNodeDTO;
@@ -98,7 +100,7 @@ public interface ScreenCustomerAgencyDao {
* @Description 根据组织ID判断是否根组织
* @author sun
*/
- int selectRootAgency(@Param("agencyId") String agencyId);
+ int selectRootAgency(@Param("agencyId") String agencyId, @Param("customerId") String customerId);
/**
* desc: 根据orgId获取组织信息
@@ -170,4 +172,35 @@ public interface ScreenCustomerAgencyDao {
* @date 2021/6/8 1:27 下午
*/
List selectGrid(@Param("agencyId")String agencyId,@Param("areaCode")String areaCode);
+
+ /**
+ * 查询当前组织的下一级组织,可根据areaCode查询,也可根据pid查询
+ *
+ * @param areaCode
+ * @param pid
+ * @return java.util.List
+ */
+ List selectNextAgencyList(@Param("areaCode") String areaCode, @Param("pid") String pid, @Param("allCustomerIds") List allCustomerIds);
+
+ /**
+ * 查询当前组织的下面的网格,可根据areaCode查询,也可根据parentAgencyId查询
+ *
+ * @param areaCode
+ * @param parentAgencyId
+ * @return java.util.List
+ */
+ List selectGridDTOList(@Param("areaCode") String areaCode, @Param("parentAgencyId") String parentAgencyId,@Param("allCustomerIds") List allCustomerIds);
+
+ List selectPAgencyById(@Param("listStr")List pidList);
+
+ /**
+ * @return com.epmet.dto.result.ScreenCustomerAgencyDTO
+ * @param customerId
+ * @author yinzuomei
+ * @description 根据客户id,返回当前客户下的跟组织信息
+ * @Date 2021/6/24 17:43
+ **/
+ ScreenCustomerAgencyDTO selectCustomerRootAgency(String customerId);
+
+ ScreenCustomerAgencyDTO selectByAreaCode(String areaCode);
}
\ No newline at end of file
diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/project/ProjectDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/project/ProjectDao.java
index 870c25a6d2..d323c244c8 100644
--- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/project/ProjectDao.java
+++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/project/ProjectDao.java
@@ -1,5 +1,6 @@
package com.epmet.datareport.dao.project;
+import com.epmet.dto.result.project.MassesDiscontentResultV2DTO;
import com.epmet.project.dto.FactAgencyProjectDailyDTO;
import com.epmet.project.dto.form.DifficultyRankFormDTO;
import com.epmet.project.dto.result.*;
@@ -66,6 +67,14 @@ public interface ProjectDao {
**/
List difficultyRank(DifficultyRankFormDTO difficultyRankFormDTO);
+ /**
+ * 工作端-数据:难点赌点列表查询V2,多客户版本
+ *
+ * @param formDTO
+ * @return com.epmet.project.dto.result.ProjectDifficultRankResultDTO
+ */
+ List difficultyRankV2(DifficultyRankFormDTO formDTO);
+
/**
* @Description 查询难点堵点的图片list
* @param
@@ -74,4 +83,21 @@ public interface ProjectDao {
* @date 2020.10.20 10:13
**/
List getDifficultyImgList(String eventId);
+
+ /**
+ * @return java.util.List
+ * @param agencyId
+ * @param areaCode
+ * @param startDate
+ * @param endDate
+ * @param sortType
+ * @author yinzuomei
+ * @description 群众不满列表,改为从指标库的screen_project_data取值 sql里面写死<75分的展示
+ * @Date 2021/6/24 13:16
+ **/
+ List selectMassesDiscontentMultic(@Param("agencyId") String agencyId,
+ @Param("areaCode") String areaCode,
+ @Param("startDate") String startDate,
+ @Param("endDate") String endDate,
+ @Param("sortType") String sortType);
}
diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/redis/DataReportRedis.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/redis/DataReportRedis.java
new file mode 100644
index 0000000000..f9bdc24a1e
--- /dev/null
+++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/redis/DataReportRedis.java
@@ -0,0 +1,39 @@
+package com.epmet.datareport.redis;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.map.MapUtil;
+import com.epmet.commons.tools.redis.RedisUtils;
+import com.epmet.dto.result.AgencyDetailMulticResultDTO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * 描述一下
+ *
+ * @author yinzuomei@elink-cn.com
+ * @date 2021/6/29 15:46
+ */
+@Component
+public class DataReportRedis {
+ @Autowired
+ private RedisUtils redisUtils;
+ private String agencyDetailKeyPrefix="epmet:screen:";
+
+ public AgencyDetailMulticResultDTO queryAgencyDetailMulticResultDTO(String customerId, String agencyId) {
+ String agencyDetailKey=agencyDetailKeyPrefix.concat(customerId).concat(":").concat(agencyId);
+ Map map = redisUtils.hGetAll(agencyDetailKey);
+ if (MapUtil.isEmpty(map)) {
+ return null;
+ }
+ AgencyDetailMulticResultDTO dto = BeanUtil.mapToBean(map, AgencyDetailMulticResultDTO.class, true);
+ return dto;
+ }
+
+ public void setAgencyDetailMulticResultDTO(String customerId, String agencyId, AgencyDetailMulticResultDTO agencysResultDTO) {
+ String agencyDetailKey = agencyDetailKeyPrefix.concat(customerId).concat(":").concat(agencyId);
+ Map map = BeanUtil.beanToMap(agencysResultDTO);
+ redisUtils.hMSet(agencyDetailKey, map, RedisUtils.DEFAULT_EXPIRE);
+ }
+}
diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java
index 4f11f160ab..aa142bed95 100644
--- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java
+++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java
@@ -1,11 +1,14 @@
package com.epmet.datareport.service.evaluationindex.screen;
import com.epmet.dto.AgencyInfoDTO;
+import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.form.AddAreaCodeDictFormDTO;
+import com.epmet.dto.form.AgencyDetailMulticFormDTO;
import com.epmet.dto.form.AreaCodeDictFormDTO;
+import com.epmet.dto.result.AgencyDetailMulticResultDTO;
import com.epmet.dto.result.AreaCodeDictResultDTO;
-import com.epmet.dto.result.commonservice.AddAreaCodeDictResultDTO;
import com.epmet.dto.result.ScreenCustomerAgencyDTO;
+import com.epmet.dto.result.commonservice.AddAreaCodeDictResultDTO;
import com.epmet.dto.result.plugins.AgencyNodeDTO;
import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO;
import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO;
@@ -73,4 +76,32 @@ public interface AgencyService {
List getNextAgencyIds(String areaCode,String agencyId);
AgencyInfoDTO getAgencyInfoDTO(String areaCode, String agencyId);
+
+ /**
+ * 查询当前组织的下一级组织,可根据areaCode查询,也可根据pid查询
+ *
+ * @param areaCode
+ * @param pid
+ * @param allSubCustomerIds 当前客户的所有子客户
+ * @return java.util.List
+ */
+ List queryNextAgencyList(String areaCode, String pid,List allSubCustomerIds);
+
+ /**
+ * 查询当前组织的下面的网格,可根据areaCode查询,也可根据parentAgencyId查询
+ *
+ * @param areaCode
+ * @param parentAgencyId
+ * @param allSubCustomerIds 当前客户的所有子客户
+ * @return java.util.List
+ */
+ List queryGridList(String areaCode, String parentAgencyId,List allSubCustomerIds);
+
+ /**
+ * 工作端小程序-数据上面的 当前组织调用此接口
+ *
+ * @param formDTO
+ * @return com.epmet.dto.result.AgencyDetailMulticResultDTO
+ */
+ AgencyDetailMulticResultDTO queryAgencyDetailMultiC(AgencyDetailMulticFormDTO formDTO);
}
diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java
index 535362f3ea..538df72f10 100644
--- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java
+++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java
@@ -2,20 +2,28 @@ package com.epmet.datareport.service.evaluationindex.screen.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
+import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.constant.NumConstant;
+import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.AgencyTreeUtils;
+import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerGridDao;
+import com.epmet.datareport.redis.DataReportRedis;
import com.epmet.datareport.service.evaluationindex.screen.AgencyService;
import com.epmet.dto.AgencyInfoDTO;
+import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.form.AddAreaCodeDictFormDTO;
+import com.epmet.dto.form.AgencyDetailMulticFormDTO;
import com.epmet.dto.form.AreaCodeDictFormDTO;
+import com.epmet.dto.result.AgencyDetailMulticResultDTO;
import com.epmet.dto.result.AreaCodeDictResultDTO;
-import com.epmet.dto.result.commonservice.AddAreaCodeDictResultDTO;
+import com.epmet.dto.result.ParentListResultDTO;
import com.epmet.dto.result.ScreenCustomerAgencyDTO;
+import com.epmet.dto.result.commonservice.AddAreaCodeDictResultDTO;
import com.epmet.dto.result.plugins.AgencyNodeDTO;
import com.epmet.evaluationindex.screen.constant.ScreenConstant;
import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO;
@@ -25,6 +33,8 @@ import com.epmet.evaluationindex.screen.dto.result.AgencyDistributionResultDTO;
import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO;
import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
+import com.epmet.feign.GovOrgOpenFeignClient;
+import com.epmet.feign.OperCrmOpenFeignClient;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.exceptions.TooManyResultsException;
@@ -33,6 +43,8 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
import java.util.List;
/**
@@ -52,6 +64,12 @@ public class AgencyServiceImpl implements AgencyService {
private ScreenCustomerGridDao screenCustomerGridDao;
@Autowired
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
+ @Autowired
+ private GovOrgOpenFeignClient govOrgOpenFeignClient;
+ @Autowired
+ private OperCrmOpenFeignClient operCrmOpenFeignClient;
+ @Autowired
+ private DataReportRedis dataReportRedis;
/**
* @Description 1、组织机构树
@@ -322,4 +340,171 @@ public class AgencyServiceImpl implements AgencyService {
agencyInfoDTO.setSubGridIds(screenCustomerGridDao.selectSubGridIds(areaCode,agencyId));
return agencyInfoDTO;
}
+
+ /**
+ * 查询当前组织的下一级组织,可根据areaCode查询,也可根据pid查询
+ *
+ * @param areaCode
+ * @param pid
+ * @param allSubCustomerIds 当前客户的所有子客户
+ * @return java.util.List
+ */
+ @Override
+ public List queryNextAgencyList(String areaCode, String pid,List allSubCustomerIds) {
+ return screenCustomerAgencyDao.selectNextAgencyList(areaCode,pid,allSubCustomerIds);
+ }
+
+ /**
+ * 查询当前组织的下面的网格,可根据areaCode查询,也可根据parentAgencyId查询
+ *
+ * @param areaCode
+ * @param parentAgencyId
+ * @param allSubCustomerIds 当前客户的所有子客户
+ * @return java.util.List
+ */
+ @Override
+ public List queryGridList(String areaCode, String parentAgencyId,List allSubCustomerIds) {
+ return screenCustomerAgencyDao.selectGridDTOList(areaCode,parentAgencyId,allSubCustomerIds);
+ }
+
+ /**
+ * 工作端小程序-数据上面的 当前组织调用此接口
+ *
+ * @param formDTO
+ * @return com.epmet.dto.result.AgencyDetailMulticResultDTO
+ */
+ @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
+ @Override
+ public AgencyDetailMulticResultDTO queryAgencyDetailMultiC(AgencyDetailMulticFormDTO formDTO) {
+ AgencyDetailMulticResultDTO agencysResultDTO =dataReportRedis.queryAgencyDetailMulticResultDTO(formDTO.getCustomerId(),formDTO.getAgencyId());
+ if (null != agencysResultDTO) {
+ log.info("queryAgencyDetailMultiC从redis取值入参:"+ JSON.toJSONString(formDTO));
+ return agencysResultDTO;
+ }
+ agencysResultDTO = new AgencyDetailMulticResultDTO();
+ List parentList = new ArrayList<>();
+ agencysResultDTO.setParentList(parentList);
+
+ //1:查询本机关详细信息
+ ScreenCustomerAgencyDTO customerAgencyDTO = screenCustomerAgencyDao.selectByAgencyId(formDTO.getAgencyId());
+ if (null == customerAgencyDTO) {
+ return agencysResultDTO;
+ }
+ agencysResultDTO = ConvertUtils.sourceToTarget(customerAgencyDTO, AgencyDetailMulticResultDTO.class);
+ //当前组织的客户id。
+ agencysResultDTO.setCustomerId(customerAgencyDTO.getCustomerId());
+
+ //2、当前登录用户所属客户,的跟级组织
+ ScreenCustomerAgencyDTO rootAgency=screenCustomerAgencyDao.selectCustomerRootAgency(formDTO.getCustomerId());
+ agencysResultDTO.setRootlevel(rootAgency.getLevel());
+ agencysResultDTO.setRootAgencyId(rootAgency.getAgencyId());
+
+ //3、当前登录用户所属客户,是否开启了area_code开关
+ // 这个接口返回areaCodeSwitch应该没有啥用...先注释吧
+ /*Result govOrgRes=govOrgOpenFeignClient.getAreaCodeSwitch(formDTO.getCustomerId());
+ log.info("当前登录用户所属客户,是否开启了area_code开关,返参:"+ JSON.toJSONString(govOrgRes));
+ if(govOrgRes.success()&&StringUtils.isNotBlank(govOrgRes.getData())){
+ agencysResultDTO.setAreaCodeSwitch(govOrgRes.getData());
+ }else{
+ agencysResultDTO.setAreaCodeSwitch("closed");
+ }*/
+ agencysResultDTO.setAreaCodeSwitch("closed");
+
+
+ //4、如果当前客户不存在子客户则areaCode置为空
+ Result> crmRes=operCrmOpenFeignClient.getAllSubCustomerIds(formDTO.getCustomerId());
+ if (crmRes.success() &&CollectionUtils.isEmpty(crmRes.getData())) {
+ //不存在子客户,则areaCode相关返参都默认为空字符串
+ agencysResultDTO.setAreaCode(StrConstant.EPMETY_STR);
+ agencysResultDTO.setAreaName(StrConstant.EPMETY_STR);
+ agencysResultDTO.setParentAreaCode(StrConstant.EPMETY_STR);
+ agencysResultDTO.setHaveSubCustomer(false);
+ agencysResultDTO.setSubCustomerIds(new ArrayList<>());
+ }else{
+ agencysResultDTO.setAreaName(agencysResultDTO.getAgencyName());
+ agencysResultDTO.setHaveSubCustomer(true);
+ agencysResultDTO.setSubCustomerIds(crmRes.getData());
+ }
+
+ log.info("当前组织的客户id="+agencysResultDTO.getCustomerId()+";当前登录用户所属的客户id="+formDTO.getCustomerId());
+ if(agencysResultDTO.getHaveSubCustomer()){
+ if (formDTO.getCustomerId().equals(agencysResultDTO.getCustomerId())
+ && (StringUtils.isBlank(customerAgencyDTO.getPids())
+ ||NumConstant.ZERO_STR.equals(customerAgencyDTO.getPid()))) {
+ log.info(String.format("1)当前组织agencyId=%s,为根基组织,不需要查询parentList",formDTO.getAgencyId()));
+ agencysResultDTO.setParentList(parentList);
+ }else{
+ // 5、多客户时根据area_code查询上级,自下向上,查询到当前客户的跟组织即可stop
+ log.info("多客户版本parentList、level要重新赋值;agencysResultDTO.getParentAreaCode()="+agencysResultDTO.getParentAreaCode());
+ ScreenCustomerAgencyDTO parentAgency=screenCustomerAgencyDao.selectByAreaCode(agencysResultDTO.getParentAreaCode());
+ if (null != parentAgency) {
+ agencysResultDTO.setLevel(getAgencyLevelMultiC(parentAgency));
+ List temp = getParentListMultic(parentList, parentAgency, formDTO.getCustomerId(), agencysResultDTO.getRootAgencyId());
+ agencysResultDTO.setParentList(temp);
+ }
+ }
+ }else{
+ //单客户
+ //6:查询当前组织的所有上级组织,按自上而下层级顺序
+ if (formDTO.getCustomerId().equals(agencysResultDTO.getCustomerId())
+ && (StringUtils.isBlank(customerAgencyDTO.getPids())
+ ||NumConstant.ZERO_STR.equals(customerAgencyDTO.getPid()))) {
+ log.info(String.format("2)当前组织agencyId=%s,为根基组织,不需要查询parentList",formDTO.getAgencyId()));
+ agencysResultDTO.setParentList(parentList);
+ }else{
+ List pidList =new ArrayList<>();
+ if(customerAgencyDTO.getPids().contains(StrConstant.COLON)){
+ pidList= Arrays.asList(customerAgencyDTO.getPids().split(StrConstant.COLON));
+ }else if(customerAgencyDTO.getPids().contains(StrConstant.COMMA)){
+ pidList= Arrays.asList(customerAgencyDTO.getPids().split(StrConstant.COMMA));
+ }
+ if(!CollectionUtils.isEmpty(pidList)){
+ //单客户,存在上级时查询...
+ agencysResultDTO.setParentList(screenCustomerAgencyDao.selectPAgencyById(pidList));
+ }
+ }
+ }
+ dataReportRedis.setAgencyDetailMulticResultDTO(formDTO.getCustomerId(),formDTO.getAgencyId(),agencysResultDTO);
+ return agencysResultDTO;
+ }
+
+ private List getParentListMultic(List resList, ScreenCustomerAgencyDTO firstParent, String currentUserCustomerId, String rootAgencyId) {
+ ParentListResultDTO resultDTO = new ParentListResultDTO();
+ resultDTO.setId(firstParent.getAgencyId());
+ resultDTO.setName(firstParent.getAgencyName());
+ resultDTO.setLevel(firstParent.getLevel());
+ resultDTO.setAreaCode(firstParent.getAreaCode());
+ resList.add(resultDTO);
+ if (firstParent.getCustomerId().equals(currentUserCustomerId) && firstParent.getAgencyId().equals(rootAgencyId)) {
+ Collections.reverse(resList);
+ return resList;
+ } else {
+ String parentAgencyAreaCode = firstParent.getParentAreaCode();
+ if (StringUtils.isNotBlank(parentAgencyAreaCode)) {
+ parentAgencyAreaCode = parentAgencyAreaCode.replaceAll("(0)+$", "");
+ }
+ ScreenCustomerAgencyDTO parentAgency = screenCustomerAgencyDao.selectByAreaCode(parentAgencyAreaCode);
+ if (null != parentAgency) {
+ return getParentListMultic(resList, parentAgency, currentUserCustomerId, rootAgencyId);
+ } else {
+ return resList;
+ }
+ }
+ }
+
+ private String getAgencyLevelMultiC(ScreenCustomerAgencyDTO parentAgency) {
+ String level=StrConstant.EPMETY_STR;
+ if(null!=parentAgency){
+ if(Constant.PROVINCE.equals(parentAgency.getLevel())){
+ return Constant.CITY;
+ }else if(Constant.CITY.equals(parentAgency.getLevel())){
+ return Constant.DISTRICT;
+ }else if(Constant.DISTRICT.equals(parentAgency.getLevel())){
+ return Constant.STREET;
+ }else if(Constant.STREET.equals(parentAgency.getLevel())){
+ return Constant.COMMUNITY;
+ }
+ }
+ return level;
+ }
}
diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java
index 7a5eeee0d1..80d2161ebb 100644
--- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java
+++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java
@@ -486,7 +486,7 @@ public class FactIndexServiceImpl implements FactIndexService {
public RootAgencyResultDTO rootAgency(RootAgencyFormDTO formDTO) {
RootAgencyResultDTO resultDTO = new RootAgencyResultDTO();
//1.根据agencyId查询是否为根级组织
- int num = screenCustomerAgencyDao.selectRootAgency(formDTO.getAgencyId());
+ int num = screenCustomerAgencyDao.selectRootAgency(formDTO.getAgencyId(), formDTO.getCustomerId());
if (num < NumConstant.ONE) {
resultDTO.setIsRoot(false);
}
diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java
index 917113fe12..e2d1a06654 100644
--- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java
+++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java
@@ -1,6 +1,8 @@
package com.epmet.datareport.service.project;
import com.epmet.commons.tools.security.dto.TokenDto;
+import com.epmet.dto.form.project.MassesDiscontentFormV2DTO;
+import com.epmet.dto.result.project.MassesDiscontentResultV2DTO;
import com.epmet.project.dto.form.DifficultyRankFormDTO;
import com.epmet.dto.form.ProcessListFormDTO;
import com.epmet.project.dto.form.ProjectIncrTrendFormDTO;
@@ -62,6 +64,14 @@ public interface ProjectService {
**/
List getDifficultyRank(DifficultyRankFormDTO param);
+ /**
+ * 难点赌点-耗时最长|涉及部门最多|处理次数
+ *
+ * @param formDTO
+ * @return com.epmet.project.dto.result.ProjectDifficultRankResultDTO
+ */
+ List difficultyRankMultic(DifficultyRankFormDTO formDTO);
+
/**
* @Description 难点赌点-获取组织下拉框
* @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614
@@ -80,4 +90,23 @@ public interface ProjectService {
* @Date 14:26 2021-03-22
**/
List getCategoryDict(String customerId);
+
+ /**
+ * 001、难点堵点-组织下拉框
+ * 需求描述:下拉框显示当前用户所属组织和下级组织 ;1)如果当前用户是街道工作人员, 显示所属街道和该街道下的社区+直属网格;2)如果当前用户是社区人员, 显示所属社区和该社区下的网格+直属网格。
+ * 210622: 新增此API, 后端改为从指标库取值 , 保证平阴县的工作人员,看到的下拉框是平阴县、以及8个街道
+ *
+ * @param staffId 当前登录用户id
+ * @param currentCustomerId 当前客户id
+ * @return com.epmet.project.dto.result.ProjectNextAgencyResultDTO
+ */
+ List myNextAgencyMultic(String staffId,String currentCustomerId);
+
+ /**
+ * 群众不满列表,改为从指标库的screen_project_data取值,sql里面写死<75分的展示
+ *
+ * @param formDTO
+ * @return com.epmet.dto.result.project.MassesDiscontentResultV2DTO
+ */
+ List queryMassesDiscontentMultic(MassesDiscontentFormV2DTO formDTO);
}
diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java
index 4d2df70470..33fd65dd1b 100644
--- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java
+++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java
@@ -4,20 +4,25 @@ import com.alibaba.fastjson.JSON;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
+import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.DataSourceConstant;
+import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectDataDao;
import com.epmet.datareport.dao.project.ProjectDao;
-import com.epmet.datareport.service.evaluationindex.screen.ScreenDifficultyDataService;
+import com.epmet.datareport.service.evaluationindex.screen.AgencyService;
import com.epmet.datareport.service.project.ProjectService;
import com.epmet.dto.CustomerAgencyDTO;
+import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.form.LoginUserDetailsFormDTO;
import com.epmet.dto.form.ProcessListFormDTO;
import com.epmet.dto.form.SubAgencyFormDTO;
+import com.epmet.dto.form.project.MassesDiscontentFormV2DTO;
import com.epmet.dto.result.*;
+import com.epmet.dto.result.project.MassesDiscontentResultV2DTO;
import com.epmet.evaluationindex.screen.dto.result.DepartmentNameListResultDTO;
import com.epmet.feign.*;
import com.epmet.project.constant.ProjectConstant;
@@ -25,12 +30,13 @@ import com.epmet.project.dto.CustomerCategoryDTO;
import com.epmet.project.dto.FactAgencyProjectDailyDTO;
import com.epmet.project.dto.form.DifficultyRankFormDTO;
import com.epmet.project.dto.form.ProjectIncrTrendFormDTO;
-import com.epmet.project.dto.result.*;
import com.epmet.project.dto.result.ProjectDetailResultDTO;
+import com.epmet.project.dto.result.*;
import com.epmet.resi.group.dto.topic.ResiTopicDTO;
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -59,9 +65,6 @@ public class ProjectServiceImpl implements ProjectService {
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private GovProjectOpenFeignClient govProjectOpenFeignClient;
- @Autowired
- private ScreenDifficultyDataService screenDifficultyDataService;
-
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
@@ -70,6 +73,10 @@ public class ProjectServiceImpl implements ProjectService {
private GovIssueOpenFeignClient govIssueOpenFeignClient;
@Autowired
private OperCrmOpenFeignClient operCrmOpenFeignClient;
+ @Autowired
+ private AgencyService screenAgencyService;
+ @Autowired
+ private ScreenProjectDataDao screenProjectDataDao;
/**
* @Author sun
@@ -357,6 +364,48 @@ public class ProjectServiceImpl implements ProjectService {
return result;
}
+ /**
+ * 难点赌点-耗时最长|涉及部门最多|处理次数
+ *
+ * @param formDTO
+ * @return com.epmet.project.dto.result.ProjectDifficultRankResultDTO
+ */
+ @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
+ @Override
+ public List difficultyRankMultic(DifficultyRankFormDTO formDTO) {
+ //1、查询当前客户是否包含子客户
+ //多客户测试写死值,别忘了注释掉呀
+ // formDTO.setCustomerId("613cc61a6b8ce4c70d21bd413dac72cc");
+ // formDTO.setAgencyId("30705f91f1295ae77d372b868596a5e7");
+
+ //06.24决定areaCode让前端传入, 前端从前端从/data/report/screen/agency/agencydetail这取值取值
+ /*Result> crmRes = operCrmOpenFeignClient.getAllSubCustomerIds(formDTO.getCustomerId());
+ if (crmRes.success() && CollectionUtils.isNotEmpty(crmRes.getData())) {
+ log.warn("❤当前客户存在子客户❤");
+ //2、查询组织信息
+ Result agencyResult = govOrgOpenFeignClient.getAgencyById(formDTO.getAgencyId());
+ if (!agencyResult.success() || null == agencyResult.getData()) {
+ throw new RenException(String.format("查询组织信息异常,agencyId:%s", formDTO.getAgencyId()));
+ }
+ formDTO.setAreaCode(agencyResult.getData().getAreaCode());
+ }*/
+ // 只有平阴根据areaCode查询,其余的还是按照agencyId查询
+ if (StringUtils.isNotBlank(formDTO.getAreaCode()) && !"370124".equals(formDTO.getAreaCode())) {
+ formDTO.setAreaCode(StrConstant.EPMETY_STR);
+ }
+ // 3、升级原来的列表查询接口
+ PageHelper.startPage(null == formDTO.getPageNo() ? NumConstant.ONE : formDTO.getPageNo(), formDTO.getTopNum());
+ List result = projectDao.difficultyRankV2(formDTO);
+ for (int i = 0; i < result.size(); i++) {
+ List imgUrlList = projectDao.getDifficultyImgList(result.get(i).getProjectId());
+ result.get(i).setImgUrlList(imgUrlList);
+ }
+ if (CollectionUtils.isEmpty(result)) {
+ return new ArrayList<>();
+ }
+ return result;
+ }
+
@Override
public List getCategoryDict(String customerId) {
List result = new ArrayList<>();
@@ -394,4 +443,132 @@ public class ProjectServiceImpl implements ProjectService {
}
return result;
}
+
+ /**
+ * 001、难点堵点-组织下拉框
+ * 需求描述:下拉框显示当前用户所属组织和下级组织 ;1)如果当前用户是街道工作人员, 显示所属街道和该街道下的社区+直属网格;2)如果当前用户是社区人员, 显示所属社区和该社区下的网格+直属网格。
+ * 210622: 新增此API, 后端改为从指标库取值 , 保证平阴县的工作人员,看到的下拉框是平阴县、以及8个街道
+ *
+ * @param staffId 当前登录用户id
+ * @param currentCustomerId 当前客户id
+ * @return com.epmet.project.dto.result.ProjectNextAgencyResultDTO
+ */
+ @Override
+ public List myNextAgencyMultic(String staffId,String currentCustomerId) {
+ //多客户测试写死值,别忘了注释掉呀
+ // staffId="3f04e397cc226e4e2f2531ac4363e3f9";
+ // currentCustomerId="613cc61a6b8ce4c70d21bd413dac72cc";
+ //1、当前工作人员所属组织信息
+ Result staffResult = govOrgOpenFeignClient.getAgencyByStaff(staffId);
+ if (!staffResult.success() || null == staffResult.getData()) {
+ throw new RenException(String.format("查询当前工作人员所属组织信息异常,staffId:%s", staffId));
+ }
+ List resultList = new ArrayList<>();
+ ProjectNextAgencyResultDTO staffAgency = new ProjectNextAgencyResultDTO();
+ staffAgency.setOrgId(staffResult.getData().getId());
+ staffAgency.setOrgName(staffResult.getData().getOrganizationName());
+ staffAgency.setOrgType("agency");
+ staffAgency.setAreaCode(staffResult.getData().getAreaCode());
+ resultList.add(staffAgency);
+ //2、查询指标库当前组织的下级组织
+ List agencyDTOList =new ArrayList<>();
+ Result> crmRes = operCrmOpenFeignClient.getAllSubCustomerIds(currentCustomerId);
+ if (crmRes.success() && CollectionUtils.isNotEmpty(crmRes.getData())) {
+ log.warn("❤当前客户存在子客户❤");
+ crmRes.getData().add(currentCustomerId);
+ //如果包含子客户,则根据areaCode查询下一级
+ agencyDTOList = screenAgencyService.queryNextAgencyList(staffResult.getData().getAreaCode(), StrConstant.EPMETY_STR,crmRes.getData());
+ } else {
+ //当前客户没有子客户,根据agencyId查询下一级组织
+ agencyDTOList = screenAgencyService.queryNextAgencyList(StrConstant.EPMETY_STR, staffResult.getData().getId(),null);
+ }
+ if (CollectionUtils.isNotEmpty(agencyDTOList)) {
+ agencyDTOList.forEach(agencyDTO -> {
+ ProjectNextAgencyResultDTO nextAgency = new ProjectNextAgencyResultDTO();
+ nextAgency.setOrgId(agencyDTO.getAgencyId());
+ nextAgency.setOrgName(agencyDTO.getAgencyName());
+ nextAgency.setOrgType("agency");
+ if (crmRes.success() && CollectionUtils.isNotEmpty(crmRes.getData())) {
+ //只有当前客户存在子客户时,才返回areaCode
+ nextAgency.setAreaCode(agencyDTO.getAreaCode());
+ }
+ resultList.add(nextAgency);
+ });
+ }
+ //3、查询指标库当前组织的下级网格
+ List gridList = new ArrayList<>();
+ if (crmRes.success() && CollectionUtils.isNotEmpty(crmRes.getData())) {
+ //如果包含子客户,则根据areaCode查询下一级网格
+ crmRes.getData().add(currentCustomerId);
+ gridList=screenAgencyService.queryGridList(staffResult.getData().getAreaCode(), StrConstant.EPMETY_STR,crmRes.getData());
+ } else {
+ //当前客户没有子客户,根据agencyId查询下一级网格
+ gridList=screenAgencyService.queryGridList(StrConstant.EPMETY_STR,staffResult.getData().getId(),null);
+ }
+ if (CollectionUtils.isNotEmpty(gridList)) {
+ gridList.forEach(gridDTO -> {
+ ProjectNextAgencyResultDTO grid = new ProjectNextAgencyResultDTO();
+ grid.setOrgId(gridDTO.getGridId());
+ grid.setOrgName(gridDTO.getGridName());
+ grid.setOrgType("grid");
+ if (crmRes.success() && CollectionUtils.isNotEmpty(crmRes.getData())) {
+ //只有当前客户存在子客户时,才返回areaCode
+ grid.setAreaCode(gridDTO.getAreaCode());
+ }
+ resultList.add(grid);
+ });
+ }
+ return resultList;
+ }
+
+ /**
+ * 群众不满列表,改为从指标库的screen_project_data取值,sql里面写死<75分的展示
+ *
+ * @param formDTO
+ * @return com.epmet.dto.result.project.MassesDiscontentResultV2DTO
+ */
+ @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
+ @Override
+ public List queryMassesDiscontentMultic(MassesDiscontentFormV2DTO formDTO) {
+ PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
+ formDTO.setEndDate(getDateId(ProjectConstant.YESTERDAY));
+ formDTO.setStartDate(getDateId(formDTO.getTimeSection()));
+ log.info(JSON.toJSONString(formDTO,true));
+ //已结案、并且来源于议题、在当前时间范围内的、
+ List list = projectDao.selectMassesDiscontentMultic(formDTO.getAgencyId(),
+ formDTO.getAreaCode(),
+ formDTO.getStartDate(),
+ formDTO.getEndDate(),
+ formDTO.getSortType());
+ list.forEach(project -> {
+ project.setPhotos(screenProjectDataDao.selectProjectImgs(project.getProjectId(), project.getCustomerId()));
+ });
+ return list;
+ }
+
+ /**
+ * @Description 处理时间
+ * @Param dateType
+ * @author zxc
+ * @date 2021/5/18 2:28 下午
+ */
+ public String getDateId(String dateType){
+ String result = DateUtils.getBeforeNDay(NumConstant.ONE);
+ switch (dateType) {
+ case ProjectConstant.THREE_MONTH:
+ result = DateUtils.getBeforeNDay(NumConstant.NINETY);
+ break;
+ case ProjectConstant.SIX_MONTH:
+ result = DateUtils.getBeforeNDay(NumConstant.ONE_HUNDRED_AND_EIGHTY);
+ break;
+ case ProjectConstant.TWELVE_MONTH:
+ result = DateUtils.getBeforeNDay(NumConstant.THREE_HUNDRED_AND_SIXTY_FIVE);
+ break;
+ case ProjectConstant.YESTERDAY:
+ result = DateUtils.getBeforeNDay(NumConstant.ONE);
+ break;
+ default:
+ }
+ return result;
+ }
}
diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml
index d06d7ac03d..fced0091a6 100644
--- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml
+++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml
@@ -267,6 +267,78 @@
DESC
+
+
+ SELECT
+ diff.EVENT_ID AS projectId,
+ ifnull(diff.EVENT_CONTENT,diff.EVENT_TITLE) AS title,
+ diff.EVENT_STATUS_CODE AS statusCode,
+ IFNULL(diff.EVENT_STATUS_DESC,'') as statusDesc,
+ diff.EVENT_SOURCE AS gridName,
+ diff.EVENT_IMG_URL AS imgUrl,
+ floor(diff.EVENT_COST_TIME/60) AS totalHours,
+ diff.EVENT_RE_ORG AS reOrg,
+ diff.EVENT_HANDLED_COUNT AS handledCount
+ FROM
+ (
+ select scg.AREA_CODE,sdd1.* from screen_difficulty_data sdd1
+ left join screen_customer_grid scg
+ on(sdd1.ORG_ID=scg.GRID_ID)
+ where sdd1.DEL_FLAG='0'
+ and scg.DEL_FLAG='0'
+ and sdd1.ORG_TYPE='grid'
+
+ and scg.AREA_CODE like concat(#{areaCode},'%')
+
+
+
+
+ AND sdd1.ORG_ID = #{agencyId,jdbcType=VARCHAR}
+
+
+ AND sdd1.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%')
+
+
+
+
+ AND sdd1.EVENT_STATUS_CODE in('pending','0')
+
+
+ AND sdd1.EVENT_STATUS_CODE in('closed','10','5')
+
+ union
+ select sca.AREA_CODE,sdd2.* from screen_difficulty_data sdd2
+ left join screen_customer_agency sca
+ on(sdd2.ORG_ID=sca.AGENCY_ID)
+ where sdd2.DEL_FLAG='0'
+ and sca.DEL_FLAG='0'
+ and sdd2.ORG_TYPE='agency'
+
+ and sca.AREA_CODE like concat(#{areaCode},'%')
+
+
+
+
+ AND sdd2.ORG_ID = #{agencyId,jdbcType=VARCHAR}
+
+
+ AND sdd2.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%')
+
+
+
+
+ AND sdd2.EVENT_STATUS_CODE in('pending','0')
+
+
+ AND sdd2.EVENT_STATUS_CODE in('closed','10','5')
+
+ ) diff
+ ORDER BY
+ CASE #{type} WHEN 'timelongest' THEN diff.EVENT_COST_TIME
+ WHEN 'mosthandled' THEN diff.EVENT_HANDLED_COUNT
+ ELSE diff.EVENT_RE_ORG END
+ DESC
+
select EVENT_IMG_URL
@@ -275,4 +347,45 @@
WHERE EVENT_ID = #{eventId}
ORDER BY SORT
+
+
+
+ SELECT
+ spd.PROJECT_ID as projectId,
+ '' AS issueId,
+ IFNULL( spd.ORG_NAME, '' ) AS gridName,
+ IFNULL( spd.PROJECT_CONTENT, '' ) AS topicContent,
+ IFNULL( spd.ALL_CATEGORY_NAME, '' ) AS projectCategory,
+ floor( spd.SATISFACTION_SCORE) AS score,
+ spd.CUSTOMER_ID as customerId,
+ spd.PARENT_ID as parentAgencyId,
+ sca.AREA_CODE as areaCode
+ FROM
+ SCREEN_PROJECT_DATA spd
+ left join screen_customer_agency sca
+ on(spd.PARENT_ID =sca.AGENCY_ID )
+ WHERE
+ spd.DEL_FLAG = '0'
+ and sca.DEL_FLAG='0'
+ AND spd.CLOSE_CASE_TIME IS NOT NULL
+ and spd.SATISFACTION_SCORE is not null
+ AND DATE_FORMAT( spd.CLOSE_CASE_TIME, '%Y%m%d' ) >= #{startDate}
+ AND DATE_FORMAT( spd.CLOSE_CASE_TIME, '%Y%m%d' ) <= #{endDate}
+ AND spd.SATISFACTION_SCORE < 75
+
+
+ and sca.area_code is not null
+ and sca.area_code like concat(#{areaCode},'%')
+
+
+ and spd.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%')
+
+
+
+ ORDER BY spd.SATISFACTION_SCORE DESC,spd.CLOSE_CASE_TIME desc
+
+
+ ORDER BY spd.SATISFACTION_SCORE ASC,spd.CLOSE_CASE_TIME desc
+
+
diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml
index 03dcd38d40..83770370b5 100644
--- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml
+++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml
@@ -116,6 +116,7 @@
del_flag = '0'
AND pid = '0'
AND agency_id = #{agencyId}
+ AND customer_id = #{customerId}
@@ -340,4 +341,93 @@
AND cg.ALL_PARENT_IDS LIKE CONCAT(#{agencyId}, '%')
+
+
+
+ SELECT
+ *
+ FROM
+ screen_customer_agency sca
+ WHERE
+ sca.DEL_FLAG = '0'
+
+ AND sca.PID = #{pid}
+
+
+ AND sca.PARENT_AREA_CODE =#{areaCode}
+
+
+ and sca.customer_id in
+
+ #{customerId}
+
+
+
+
+
+
+ SELECT
+ *
+ FROM
+ screen_customer_grid scg
+ WHERE
+ scg.DEL_FLAG = '0'
+
+ AND scg.AREA_CODE = #{areaCode}
+
+
+ AND scg.PARENT_AGENCY_ID = #{parentAgencyId}
+
+
+ and scg.customer_id in
+
+ #{customerId}
+
+
+
+
+
+
+ SELECT
+ sca.AGENCY_ID as id,
+ sca.AGENCY_NAME AS 'name',
+ level
+ from screen_customer_agency sca
+ WHERE del_flag = '0'
+
+ AND AGENCY_ID IN
+
+ #{id}
+
+ ORDER BY field(
+ AGENCY_ID,
+
+ #{id}
+
+ )
+
+
+
+
+
+ SELECT
+ sca.*
+ FROM
+ screen_customer_agency sca
+ WHERE
+ sca.DEL_FLAG = '0'
+ AND sca.PID = '0'
+ AND sca.CUSTOMER_ID = #{customerId}
+
+
+
+ SELECT
+ sca.*
+ FROM
+ screen_customer_agency sca
+ WHERE
+ sca.DEL_FLAG = '0'
+ AND sca.AREA_CODE = #{areaCode}
+ limit 1
+
diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml
index f00cc4c23e..5b573343e2 100644
--- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml
+++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml
@@ -92,13 +92,13 @@
- INNER JOIN screen_customer_grid org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.GRID_ID = score.ORG_ID AND org.DEL_FLAG = '0'
+ INNER JOIN screen_customer_grid org ON org.GRID_ID = score.ORG_ID AND org.DEL_FLAG = '0'
- INNER JOIN screen_customer_agency org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.AGENCY_ID = score.ORG_ID AND org.DEL_FLAG = '0'
+ INNER JOIN screen_customer_agency org ON org.AGENCY_ID = score.ORG_ID AND org.DEL_FLAG = '0'
- INNER JOIN screen_customer_dept org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.DEPT_ID = score.ORG_ID AND org.DEL_FLAG = '0'
+ INNER JOIN screen_customer_dept org ON org.DEPT_ID = score.ORG_ID AND org.DEL_FLAG = '0'
@@ -206,13 +206,13 @@
- INNER JOIN screen_customer_grid org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.GRID_ID = score.ORG_ID AND org.DEL_FLAG = '0'
+ INNER JOIN screen_customer_grid org ON org.GRID_ID = score.ORG_ID AND org.DEL_FLAG = '0'
- INNER JOIN screen_customer_agency org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.AGENCY_ID = score.ORG_ID AND org.DEL_FLAG = '0'
+ INNER JOIN screen_customer_agency org ON org.AGENCY_ID = score.ORG_ID AND org.DEL_FLAG = '0'
- INNER JOIN screen_customer_dept org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.DEPT_ID = score.ORG_ID AND org.DEL_FLAG = '0'
+ INNER JOIN screen_customer_dept org ON org.DEPT_ID = score.ORG_ID AND org.DEL_FLAG = '0'
@@ -278,13 +278,13 @@
- INNER JOIN screen_customer_grid org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.GRID_ID = score.ORG_ID AND org.DEL_FLAG = '0'
+ INNER JOIN screen_customer_grid org ON org.GRID_ID = score.ORG_ID AND org.DEL_FLAG = '0'
- INNER JOIN screen_customer_agency org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.AGENCY_ID = score.ORG_ID AND org.DEL_FLAG = '0'
+ INNER JOIN screen_customer_agency org ON org.AGENCY_ID = score.ORG_ID AND org.DEL_FLAG = '0'
- INNER JOIN screen_customer_dept org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.DEPT_ID = score.ORG_ID AND org.DEL_FLAG = '0'
+ INNER JOIN screen_customer_dept org ON org.DEPT_ID = score.ORG_ID AND org.DEL_FLAG = '0'
diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml
index ad0132dd85..35bf90d165 100644
--- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml
+++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml
@@ -34,16 +34,16 @@
score.ORG_TYPE orgType
FROM
screen_index_data_yearly score
-
+
- INNER JOIN screen_customer_grid org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.GRID_ID = score.ORG_ID AND org.DEL_FLAG = '0'
+ INNER JOIN screen_customer_grid org ON org.GRID_ID = score.ORG_ID AND org.DEL_FLAG = '0'
- INNER JOIN screen_customer_agency org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.AGENCY_ID = score.ORG_ID AND org.DEL_FLAG = '0'
+ INNER JOIN screen_customer_agency org ON org.AGENCY_ID = score.ORG_ID AND org.DEL_FLAG = '0'
-
- INNER JOIN screen_customer_dept org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.DEPT_ID = score.ORG_ID AND org.DEL_FLAG = '0'
+
+ INNER JOIN screen_customer_dept org ON org.DEPT_ID = score.ORG_ID AND org.DEL_FLAG = '0'
diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml
index 0f0cb8c58c..543b9d3eb4 100644
--- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml
+++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml
@@ -60,15 +60,17 @@
SELECT
project_id as projectId,
- project_content AS projectContent,
+ IFNULL(PROJECT_TITLE,'') as projectTitle,
+ IFNULL(project_content,'') AS projectContent,
project_create_time as reportTime,
- ALL_CATEGORY_NAME as categoryName,
- LINK_USER_ID as reportUserId,
- LINK_NAME as reportUserName,
- link_mobile as mobile,
- project_address as reportAddress,
+ IFNULL(ALL_CATEGORY_NAME,'') as categoryName,
+ IFNULL(LINK_USER_ID,'') as reportUserId,
+ IFNULL(LINK_NAME,'') as reportUserName,
+ IFNULL(link_mobile,'') as mobile,
+ IFNULL(project_address,'') as reportAddress,
CUSTOMER_ID as customerId,
- PROJECT_STATUS_CODE as projectStatusCode
+ PROJECT_STATUS_CODE as projectStatusCode,
+ floor( SATISFACTION_SCORE) AS score
FROM
screen_project_data
WHERE
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyGroupTotalFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyGroupTotalFormDTO.java
new file mode 100644
index 0000000000..c5fed7b1cf
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyGroupTotalFormDTO.java
@@ -0,0 +1,88 @@
+package com.epmet.dto.basereport.form;
+
+import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
+import lombok.Data;
+
+import javax.validation.constraints.NotEmpty;
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @Description 基础数据上报-组织群组总数-接口入参
+ * @Auth sun
+ */
+@Data
+public class AgencyGroupTotalFormDTO implements Serializable {
+ private static final long serialVersionUID = 1L;
+ /**
+ * 数据集合对象
+ */
+ @NotEmpty(message = "至少有一条数据", groups = {AgencyGroupTotalFormDTO.saveList.class})
+ private List dataList;
+
+ /**
+ * 为true时需要删除历史数据
+ */
+ private Boolean isFirst;
+ public interface saveList extends CustomerClientShowGroup {}
+
+ @Data
+ public static class DataList {
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 机构ID 关联机关dim表
+ */
+ private String agencyId;
+
+ /**
+ * 父级机关ID
+ */
+ private String pid;
+
+ /**
+ * 统计日期 关联日期dim表
+ */
+ private String dateId;
+
+ /**
+ * 周ID
+ */
+ private String weekId = "";
+
+ /**
+ * 月份ID
+ */
+ private String monthId = "";
+
+ /**
+ * 季度ID
+ */
+ private String quarterId = "";
+
+ /**
+ * 年ID
+ */
+ private String yearId = "";
+
+ /**
+ * 当前组织及下级小组总数
+ */
+ private Integer groupTotal = 0;
+
+ /**
+ * 当前组织及下级楼院小组总数
+ */
+ private Integer ordinaryTotal = 0;
+
+ /**
+ * 当前组织及下级支部小组总数
+ */
+ private Integer branchTotal = 0;
+ }
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyHotTopicFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyHotTopicFormDTO.java
new file mode 100644
index 0000000000..9fb08407ce
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyHotTopicFormDTO.java
@@ -0,0 +1,88 @@
+package com.epmet.dto.basereport.form;
+
+import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
+import lombok.Data;
+
+import javax.validation.constraints.NotEmpty;
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @Description 基础数据上报-组织热议话题数据-接口入参
+ * @Auth sun
+ */
+@Data
+public class AgencyHotTopicFormDTO implements Serializable {
+ private static final long serialVersionUID = 1L;
+ /**
+ * 数据集合对象
+ */
+ @NotEmpty(message = "至少有一条数据", groups = {AgencyHotTopicFormDTO.saveList.class})
+ private List dataList;
+
+ /**
+ * 为true时需要删除历史数据
+ */
+ private Boolean isFirst;
+ public interface saveList extends CustomerClientShowGroup {}
+
+ @Data
+ public static class DataList {
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 机构ID 关联机关dm表
+ */
+ private String agencyId;
+
+ /**
+ * 父级机关ID
+ */
+ private String pid;
+
+ /**
+ * 统计日期 关联日期dm表
+ */
+ private String dateId;
+
+ /**
+ * 周ID
+ */
+ private String weekId = "";
+
+ /**
+ * 月ID
+ */
+ private String monthId = "";
+
+ /**
+ * 季度ID
+ */
+ private String quarterId = "";
+
+ /**
+ * 年ID
+ */
+ private String yearId = "";
+
+ /**
+ * 话题总数
+ */
+ private Integer topicTotal = 0;
+
+ /**
+ * 话题状态【热议中:hot_discuss】
+ */
+ private String status = "";
+
+ /**
+ * 状态话题数量
+ */
+ private Integer topicCount = 0;
+ }
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyIssueFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyIssueFormDTO.java
new file mode 100644
index 0000000000..d57740cb12
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyIssueFormDTO.java
@@ -0,0 +1,200 @@
+package com.epmet.dto.basereport.form;
+
+import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
+import lombok.Data;
+
+import javax.validation.constraints.NotEmpty;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * @Description 基础数据上报-组织议题数据-接口入参
+ * @Auth sun
+ */
+@Data
+public class AgencyIssueFormDTO implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ public interface AgencyIssueForm extends CustomerClientShowGroup{}
+
+ /**
+ * 为true时需要删除历史数据
+ */
+ private Boolean isFirst;
+ /**
+ * 数据集合对象
+ */
+ @NotEmpty(message = "数据集合对象不能为空",groups = AgencyIssueForm.class)
+ private List dataList;
+
+ @Data
+ public static class DataList{
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 组织ID
+ */
+ private String agencyId;
+
+ /**
+ * 上级组织ID
+ */
+ private String pid;
+
+ /**
+ * 年度ID
+ */
+ private String yearId;
+
+ /**
+ * 季度ID
+ */
+ private String quarterId;
+
+ /**
+ * 月度ID
+ */
+ private String monthId;
+
+ /**
+ * 周ID
+ */
+ private String weekId;
+
+ /**
+ * 日期ID
+ */
+ private String dateId;
+
+ /**
+ * 当日议题增量
+ */
+ private Integer issueIncr;
+
+ /**
+ * 议题总数
+ */
+ private Integer issueTotal;
+
+ /**
+ * 当日已转项目的议题数增量
+ */
+ private Integer shiftProjectIncr;
+
+ /**
+ * 已转项目的议题总数
+ */
+ private Integer shiftProjectTotal;
+
+ /**
+ * 已转项目所占百分比
+ */
+ private BigDecimal shiftProjectPercent;
+
+ /**
+ * 当日表决中议题数增量
+ */
+ private Integer votingIncr;
+
+ /**
+ * 表决中议题总数
+ */
+ private Integer votingTotal;
+
+ /**
+ * 表决中议题所占百分比
+ */
+ private BigDecimal votingPercent;
+
+ /**
+ * 当日已关闭议题数增量
+ */
+ private Integer closedIncr;
+
+ /**
+ * 当日已关闭议题中已解决数量
+ */
+ private Integer closedResolvedIncr;
+
+ /**
+ * 当日已关闭议题中无需解决数量
+ */
+ private Integer closedUnresolvedIncr;
+
+ /**
+ * 已关闭议题总数
+ */
+ private Integer closedTotal;
+
+ /**
+ * 已关闭议题中已解决总数
+ */
+ private Integer closedResolvedTotal;
+
+ /**
+ * 已关闭议题中未解决总数
+ */
+ private Integer closedUnresolvedTotal;
+
+ /**
+ * 已关闭议题所占百分比
+ */
+ private BigDecimal closedPercent;
+
+ /**
+ * 已关闭议题中已解决百分比
+ */
+ private BigDecimal closedResolvedPercent;
+
+ /**
+ * 已关闭议题中未解决百分比
+ */
+ private BigDecimal closedUnresolvedPercent;
+
+ /**
+ * 当日已结案议题数
+ */
+ private Integer closedCaseIncr;
+
+ /**
+ * 当日已结案议题中已解决数
+ */
+ private Integer closedCaseResolvedIncr;
+
+ /**
+ * 当日已结案议题中未解决数
+ */
+ private Integer closedCaseUnresolvedIncr;
+
+ /**
+ * 已结案议题总数
+ */
+ private Integer closedCaseTotal;
+
+ /**
+ * 已结案议题中已解决总数
+ */
+ private Integer closedCaseResolvedTotal;
+
+ /**
+ * 已结案议题中未解决总数
+ */
+ private Integer closedCaseUnresolvedTotal;
+
+ /**
+ * 已结案议题中已解决百分比
+ */
+ private BigDecimal closedCaseResolvedPercent;
+
+ /**
+ * 已结案议题中未解决百分比
+ */
+ private BigDecimal closedCaseUnresolvedPercent;
+ }
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyProjectFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyProjectFormDTO.java
new file mode 100644
index 0000000000..7702a90a4b
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyProjectFormDTO.java
@@ -0,0 +1,146 @@
+package com.epmet.dto.basereport.form;
+
+import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
+import lombok.Data;
+
+import javax.validation.constraints.NotEmpty;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * @Description 基础数据上报-组织项目数据-接口入参
+ * @Auth sun
+ */
+@Data
+public class AgencyProjectFormDTO implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ public interface AgencyProjectForm extends CustomerClientShowGroup {}
+
+ /**
+ * 为true时需要删除历史数据
+ */
+ private Boolean isFirst;
+ /**
+ * 数据集合对象
+ */
+ @NotEmpty(message = "数据集合对象不能为空",groups = AgencyProjectForm.class)
+ private List dataList;
+
+ @Data
+ public static class DataList{
+
+ /**
+ * 客户Id 【dim_customer.id】
+ */
+ private String customerId;
+
+ /**
+ * 机关Id 【dim_agency.id】
+ */
+ private String agencyId;
+
+ /**
+ * 上级组织Id【dim_agency.pid】
+ */
+ private String parentId;
+
+ /**
+ * 日维度Id 【dim_date.id】
+ */
+ private String dateId;
+
+ /**
+ * 周维度Id 【dim_week.id】
+ */
+ private String weekId;
+
+ /**
+ * 月维度Id 【dim_month.id】
+ */
+ private String monthId;
+
+ /**
+ * 季ID
+ */
+ private String quarterId;
+
+ /**
+ * 年维度Id 【dim_year.id】
+ */
+ private String yearId;
+
+ /**
+ * 截止当日项目总数 【当前组织及下级项目总数】
+ */
+ private Integer projectTotal = 0;
+
+ /**
+ * 截止当日处理中项目数 【当前组织及下级所有未结案项目总数】
+ */
+ private Integer pendingTotal = 0;
+
+ /**
+ * 截止当日处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】
+ */
+ private BigDecimal pendingRatio = new BigDecimal("0");
+
+ /**
+ * 截止当日已结案项目数 【当前组织及下级已结案项目总数】
+ */
+ private Integer closedTotal = 0;
+
+ /**
+ * 截止当日已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】
+ */
+ private BigDecimal closedRatio = new BigDecimal("0");
+
+ /**
+ * 截止当日已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】
+ */
+ private Integer resolvedTotal = 0;
+
+ /**
+ * 截止当日已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】
+ */
+ private BigDecimal resolvedRatio = new BigDecimal("0");
+
+ /**
+ * 截止当日已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】
+ */
+ private Integer unresolvedTotal = 0;
+
+ /**
+ * 截止当日已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】
+ */
+ private BigDecimal unresolvedRatio = new BigDecimal("0");
+
+ /**
+ * 当日项目总数 【当前组织及下级项目总数】
+ */
+ private Integer projectIncr = 0;
+
+ /**
+ * 当日处理中项目数 【当前组织及下级前一日新增处理中项目数】
+ */
+ private Integer pendingIncr = 0;
+
+ /**
+ * 当日已结案项目数 【当前组织及下级前一日新增结案项目数】
+ */
+ private Integer closedIncr = 0;
+
+ /**
+ * 当日已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】
+ */
+ private Integer resolvedIncr = 0;
+
+ /**
+ * 当日已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】
+ */
+ private Integer unresolvedIncr = 0;
+ }
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyRegUserFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyRegUserFormDTO.java
new file mode 100644
index 0000000000..bf7d2d3478
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyRegUserFormDTO.java
@@ -0,0 +1,109 @@
+package com.epmet.dto.basereport.form;
+
+import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
+import lombok.Data;
+
+import javax.validation.constraints.NotEmpty;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * @Description 基础数据上报-组织机关注册用户数据-接口入参
+ * @Auth sun
+ */
+@Data
+public class AgencyRegUserFormDTO implements Serializable {
+ private static final long serialVersionUID = 1L;
+ /**
+ * 数据集合对象
+ */
+ @NotEmpty(message = "至少有一条数据", groups = {AgencyRegUserFormDTO.saveList.class})
+ private List dataList;
+
+ /**
+ * 为true时需要删除历史数据
+ */
+ private Boolean isFirst;
+ public interface saveList extends CustomerClientShowGroup {}
+
+ @Data
+ public static class DataList {
+ BigDecimal bi = new BigDecimal(0);
+ /**
+ * 客户id
+ */
+ private String customerId;
+
+ /**
+ * 机关id
+ */
+ private String agencyId;
+
+ /**
+ *
+ */
+ private String dateId;
+
+ /**
+ *
+ */
+ private String weekId = "";
+
+ /**
+ *
+ */
+ private String yearId = "";
+
+ /**
+ * 注册用户总数
+ */
+ private Integer regTotal = 0;
+
+ /**
+ * 居民总数
+ */
+ private Integer resiTotal = 0;
+
+ /**
+ * 热心居民总数
+ */
+ private Integer warmHeartedTotal = 0;
+
+ /**
+ * 党员总数
+ */
+ private Integer partymemberTotal = 0;
+
+ /**
+ * 本日注册居民日增量
+ */
+ private Integer regIncr = 0;
+
+ /**
+ * 本日热心居民日增量
+ */
+ private Integer warmIncr = 0;
+
+ /**
+ * 本日党员认证日增量
+ */
+ private Integer partymemberIncr = 0;
+
+ /**
+ * 居民总数占比
+ */
+ private BigDecimal resiProportion = bi;
+
+ /**
+ * 党员总数占比
+ */
+ private BigDecimal partymemberProportion = bi;
+
+ /**
+ * 热心居民占比
+ */
+ private BigDecimal warmHeartedProportion = bi;
+ }
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyTopicIssueFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyTopicIssueFormDTO.java
new file mode 100644
index 0000000000..046b947bec
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyTopicIssueFormDTO.java
@@ -0,0 +1,84 @@
+package com.epmet.dto.basereport.form;
+
+import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
+import lombok.Data;
+
+import javax.validation.constraints.NotEmpty;
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @Description 基础数据上报-组织话题转议题数据-接口入参
+ * @Auth sun
+ */
+@Data
+public class AgencyTopicIssueFormDTO implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ public interface AgencyTopicIssueForm extends CustomerClientShowGroup{}
+
+ /**
+ * 为true时需要删除历史数据
+ */
+ private Boolean isFirst;
+ /**
+ * 数据集合对象
+ */
+ @NotEmpty(message = "数据集合对象不能为空",groups = AgencyTopicIssueForm.class)
+ private List dataList;
+
+ @Data
+ public static class DataList{
+
+ /**
+ * 客户Id
+ * */
+ private String customerId;
+
+ /**
+ * 父级机关ID
+ */
+ private String pid;
+
+ /**
+ * 机关ID
+ */
+ private String agencyId;
+
+ /**
+ * 日期ID
+ */
+ private String dateId;
+
+ /**
+ * 周ID
+ */
+ private String weekId;
+
+ /**
+ * 月ID
+ */
+ private String monthId;
+
+ /**
+ * 季ID
+ */
+ private String quarterId;
+
+ /**
+ * 年ID
+ */
+ private String yearId;
+
+ /**
+ * 已转议题数量
+ */
+ private Integer issueTotal;
+
+ /**
+ * 已转议题当日增量
+ */
+ private Integer issueIncr;
+ }
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyTopicStatusFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyTopicStatusFormDTO.java
new file mode 100644
index 0000000000..6bb5eac899
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyTopicStatusFormDTO.java
@@ -0,0 +1,100 @@
+package com.epmet.dto.basereport.form;
+
+import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
+import lombok.Data;
+
+import javax.validation.constraints.NotEmpty;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * @Description 基础数据上报-组织状态话题数据-接口入参
+ * @Auth sun
+ */
+@Data
+public class AgencyTopicStatusFormDTO implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ public interface AgencyTopicStatusForm extends CustomerClientShowGroup{}
+
+ /**
+ * 为true时需要删除历史数据
+ */
+ private Boolean isFirst;
+ /**
+ * 数据集合对象
+ */
+ @NotEmpty(message = "数据集合对象不能为空",groups = AgencyTopicStatusForm.class)
+ private List dataList;
+
+ @Data
+ public static class DataList {
+
+ /**
+ * 客户Id
+ * */
+ private String customerId;
+
+ /**
+ * 机构ID 关联机关dm表
+ */
+ private String agencyId;
+
+ /**
+ * 父级机关ID
+ */
+ private String pid;
+
+ /**
+ * 统计日期 关联日期dm表
+ */
+ private String dateId;
+
+ /**
+ * 周ID
+ */
+ private String weekId;
+
+ /**
+ * 月ID
+ */
+ private String monthId;
+
+ /**
+ * 季度ID
+ */
+ private String quarterId;
+
+ /**
+ * 年ID
+ */
+ private String yearId;
+
+ /**
+ * 话题状态ID 关联dim_topic_status表
+ 讨论中 discussing
+ 已屏蔽 hidden
+ 已关闭 closed
+ 已转项目 shift_project
+ */
+ private String topicStatusId;
+
+ /**
+ * 话题数量 指定状态的话题数量
+ */
+ private Integer topicCount;
+
+ /**
+ * 话题状态百分比 指定状态话题数/话题总数
+ 总数在topic_total_agency_daily中
+ */
+ private BigDecimal topicProportion;
+
+ /**
+ * 话题增量 单位时间内的状态话题的增加数
+ */
+ private Integer topicIncrement;
+ }
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridGroupTotalFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridGroupTotalFormDTO.java
new file mode 100644
index 0000000000..8fb2dc7e25
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridGroupTotalFormDTO.java
@@ -0,0 +1,88 @@
+package com.epmet.dto.basereport.form;
+
+import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotEmpty;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * @Description 基础数据上报-网格群组总数-接口入参
+ * @Auth sun
+ */
+@Data
+public class GridGroupTotalFormDTO implements Serializable {
+ private static final long serialVersionUID = 1L;
+ /**
+ * 数据集合对象
+ */
+ @NotEmpty(message = "至少有一条数据", groups = {saveList.class})
+ private List dataList;
+ /**
+ * 为true时需要删除历史数据
+ */
+ private Boolean isFirst;
+ public interface saveList extends CustomerClientShowGroup {}
+
+ @Data
+ public static class DataList {
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 机构ID 关联机关dim表
+ */
+ private String agencyId;
+
+ /**
+ * 网格ID
+ */
+ private String gridId;
+
+ /**
+ * 统计日期 关联日期dim表
+ */
+ private String dateId;
+
+ /**
+ * 周ID
+ */
+ private String weekId = "";
+
+ /**
+ * 月份ID
+ */
+ private String monthId = "";
+
+ /**
+ * 季度ID
+ */
+ private String quarterId = "";
+
+ /**
+ * 年ID
+ */
+ private String yearId = "";
+
+ /**
+ * 网格下小组总数
+ */
+ private Integer groupTotal = 0;
+
+ /**
+ * 网格下楼院小组总数
+ */
+ private Integer ordinaryTotal = 0;
+
+ /**
+ * 网格下支部小组总数
+ */
+ private Integer branchTotal = 0;
+ }
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridHotTopicFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridHotTopicFormDTO.java
new file mode 100644
index 0000000000..54d1029231
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridHotTopicFormDTO.java
@@ -0,0 +1,88 @@
+package com.epmet.dto.basereport.form;
+
+import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
+import lombok.Data;
+
+import javax.validation.constraints.NotEmpty;
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @Description 基础数据上报-网格热议话题数据-接口入参
+ * @Auth sun
+ */
+@Data
+public class GridHotTopicFormDTO implements Serializable {
+ private static final long serialVersionUID = 1L;
+ /**
+ * 数据集合对象
+ */
+ @NotEmpty(message = "至少有一条数据", groups = {GridHotTopicFormDTO.saveList.class})
+ private List dataList;
+
+ /**
+ * 为true时需要删除历史数据
+ */
+ private Boolean isFirst;
+ public interface saveList extends CustomerClientShowGroup {}
+
+ @Data
+ public static class DataList {
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 机关ID
+ */
+ private String agencyId;
+
+ /**
+ * 网格ID 关联网格dm表
+ */
+ private String gridId;
+
+ /**
+ * 日期ID
+ */
+ private String dateId;
+
+ /**
+ * 周ID
+ */
+ private String weekId = "";
+
+ /**
+ * 月ID
+ */
+ private String monthId = "";
+
+ /**
+ * 季度ID
+ */
+ private String quarterId = "";
+
+ /**
+ * 年ID
+ */
+ private String yearId = "";
+
+ /**
+ * 话题总数
+ */
+ private Integer topicTotal = 0;
+
+ /**
+ * 话题状态【热议中:hot_discuss】
+ */
+ private String status = "";
+
+ /**
+ * 状态话题数量
+ */
+ private Integer topicCount = 0;
+ }
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridIssueFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridIssueFormDTO.java
new file mode 100644
index 0000000000..4fd03e434b
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridIssueFormDTO.java
@@ -0,0 +1,200 @@
+package com.epmet.dto.basereport.form;
+
+import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
+import lombok.Data;
+
+import javax.validation.constraints.NotEmpty;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * @Description 基础数据上报-网格议题数据-接口入参
+ * @Auth sun
+ */
+@Data
+public class GridIssueFormDTO implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ public interface GridIssueForm extends CustomerClientShowGroup{}
+
+ /**
+ * 为true时需要删除历史数据
+ */
+ private Boolean isFirst;
+ /**
+ * 数据集合对象
+ */
+ @NotEmpty(message = "数据集合对象不能为空",groups = GridIssueForm.class)
+ private List dataList;
+
+ @Data
+ public static class DataList{
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 组织ID
+ */
+ private String agencyId;
+
+ /**
+ * 网格ID
+ */
+ private String gridId;
+
+ /**
+ * 年度ID
+ */
+ private String yearId;
+
+ /**
+ * 季度ID
+ */
+ private String quarterId;
+
+ /**
+ * 月度ID
+ */
+ private String monthId;
+
+ /**
+ * 周ID
+ */
+ private String weekId;
+
+ /**
+ * 日期ID
+ */
+ private String dateId;
+
+ /**
+ * 当日议题增量
+ */
+ private Integer issueIncr;
+
+ /**
+ * 议题总数
+ */
+ private Integer issueTotal;
+
+ /**
+ * 当日已转项目的议题数增量
+ */
+ private Integer shiftProjectIncr;
+
+ /**
+ * 已转项目的议题总数
+ */
+ private Integer shiftProjectTotal;
+
+ /**
+ * 已转项目所占百分比
+ */
+ private BigDecimal shiftProjectPercent;
+
+ /**
+ * 当日表决中议题数增量
+ */
+ private Integer votingIncr;
+
+ /**
+ * 表决中议题总数
+ */
+ private Integer votingTotal;
+
+ /**
+ * 表决中议题所占百分比
+ */
+ private BigDecimal votingPercent;
+
+ /**
+ * 当日已关闭议题数增量
+ */
+ private Integer closedIncr;
+
+ /**
+ * 当日已关闭议题中已解决数量
+ */
+ private Integer closedResolvedIncr;
+
+ /**
+ * 当日已关闭议题中无需解决数量
+ */
+ private Integer closedUnresolvedIncr;
+
+ /**
+ * 已关闭议题总数
+ */
+ private Integer closedTotal;
+
+ /**
+ * 已关闭议题中已解决总数
+ */
+ private Integer closedResolvedTotal;
+
+ /**
+ * 已关闭议题中未解决总数
+ */
+ private Integer closedUnresolvedTotal;
+
+ /**
+ * 已关闭议题所占百分比
+ */
+ private BigDecimal closedPercent;
+
+ /**
+ * 已关闭议题中已解决百分比
+ */
+ private BigDecimal closedResolvedPercent;
+
+ /**
+ * 已关闭议题中未解决百分比
+ */
+ private BigDecimal closedUnresolvedPercent;
+
+ /**
+ * 当日已结案议题数
+ */
+ private Integer closedCaseIncr;
+
+ /**
+ * 当日已结案议题中已解决数
+ */
+ private Integer closedCaseResolvedIncr;
+
+ /**
+ * 当日已结案议题中未解决数
+ */
+ private Integer closedCaseUnresolvedIncr;
+
+ /**
+ * 已结案议题总数
+ */
+ private Integer closedCaseTotal;
+
+ /**
+ * 已结案议题中已解决总数
+ */
+ private Integer closedCaseResolvedTotal;
+
+ /**
+ * 已结案议题中未解决总数
+ */
+ private Integer closedCaseUnresolvedTotal;
+
+ /**
+ * 已结案议题中已解决百分比
+ */
+ private BigDecimal closedCaseResolvedPercent;
+
+ /**
+ * 已结案议题中未解决百分比
+ */
+ private BigDecimal closedCaseUnresolvedPercent;
+ }
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridProjectFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridProjectFormDTO.java
new file mode 100644
index 0000000000..b85f741c82
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridProjectFormDTO.java
@@ -0,0 +1,145 @@
+package com.epmet.dto.basereport.form;
+
+import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
+import lombok.Data;
+
+import javax.validation.constraints.NotEmpty;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * @Description 基础数据上报-网格项目数据-接口入参
+ * @Auth sun
+ */
+@Data
+public class GridProjectFormDTO implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ public interface GridProjectForm extends CustomerClientShowGroup {}
+
+ /**
+ * 为true时需要删除历史数据
+ */
+ private Boolean isFirst;
+ /**
+ * 数据集合对象
+ */
+ @NotEmpty(message = "数据集合对象不能为空",groups = GridProjectForm.class)
+ private List dataList;
+
+ @Data
+ public static class DataList{
+
+ /**
+ * 客户Id 【dim_customer.id】
+ */
+ private String customerId;
+
+ /**
+ * 机关Id 【dim_agency.id】
+ */
+ private String agencyId;
+
+ /**
+ * 网格Id 【dim_grid.id】
+ */
+ private String gridId;
+
+ /**
+ * 日维度Id 【dim_date.id】
+ */
+ private String dateId;
+
+ /**
+ * 周维度Id 【dim_week.id】
+ */
+ private String weekId;
+
+ /**
+ * 月维度Id 【dim_month.id】
+ */
+ private String monthId;
+
+ /**
+ * 季ID
+ */
+ private String quarterId;
+
+ /**
+ * 年维度Id 【dim_year.id】
+ */
+ private String yearId;
+
+ /**
+ * 截止当日网格下项目总数 【当前组织及下级项目总数】
+ */
+ private Integer projectTotal = 0;
+
+ /**
+ * 截止当日网格下处理中项目数 【当前组织及下级所有未结案项目总数】
+ */
+ private Integer pendingTotal = 0;
+
+ /**
+ * 截止当日网格下处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】
+ */
+ private BigDecimal pendingRatio = new BigDecimal("0");
+
+ /**
+ * 截止当日网格下已结案项目数 【当前组织及下级已结案项目总数】
+ */
+ private Integer closedTotal = 0;
+
+ /**
+ * 截止当日网格下已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】
+ */
+ private BigDecimal closedRatio = new BigDecimal("0");
+
+ /**
+ * 截止当日已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】
+ */
+ private Integer resolvedTotal = 0;
+
+ /**
+ * 截止当日已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】
+ */
+ private BigDecimal resolvedRatio = new BigDecimal("0");
+
+ /**
+ * 截止当日已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】
+ */
+ private Integer unresolvedTotal = 0;
+
+ /**
+ * 截止当日已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】
+ */
+ private BigDecimal unresolvedRatio = new BigDecimal("0");
+
+ /**
+ * 当日已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】
+ */
+ private Integer resolvedIncr = 0;
+
+ /**
+ * 当日已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】
+ */
+ private Integer unresolvedIncr = 0;
+
+ /**
+ * 当日网格下项目总数 【该网格下项目总数】
+ */
+ private Integer projectIncr = 0;
+
+ /**
+ * 当日网格下处理中项目数 【该网格下未结案项目总数】
+ */
+ private Integer pendingIncr = 0;
+
+ /**
+ * 当日网格下已结案项目数 【该网格下已结案项目总数】
+ */
+ private Integer closedIncr = 0;
+ }
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridRegUserFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridRegUserFormDTO.java
new file mode 100644
index 0000000000..84f18f226c
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridRegUserFormDTO.java
@@ -0,0 +1,114 @@
+package com.epmet.dto.basereport.form;
+
+import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
+import lombok.Data;
+
+import javax.validation.constraints.NotEmpty;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * @Description 基础数据上报-网格注册用户数据-接口入参
+ * @Auth sun
+ */
+@Data
+public class GridRegUserFormDTO implements Serializable {
+ private static final long serialVersionUID = 1L;
+ /**
+ * 数据集合对象
+ */
+ @NotEmpty(message = "至少有一条数据", groups = {GridRegUserFormDTO.saveList.class})
+ private List dataList;
+
+ /**
+ * 为true时需要删除历史数据
+ */
+ private Boolean isFirst;
+ public interface saveList extends CustomerClientShowGroup {}
+
+ @Data
+ public static class DataList {
+ BigDecimal bi = new BigDecimal(0);
+ /**
+ * 客户id
+ */
+ private String customerId;
+
+ /**
+ * 机关id
+ */
+ private String agencyId;
+
+ /**
+ * 网格id
+ */
+ private String gridId;
+
+ /**
+ * 日维度Id
+ */
+ private String dateId;
+
+ /**
+ * 周维度Id
+ */
+ private String weekId = "";
+
+ /**
+ * 年维度Id
+ */
+ private String yearId = "";
+
+ /**
+ * 注册用户总数
+ */
+ private Integer regTotal = 0;
+
+ /**
+ * 居民总数
+ */
+ private Integer resiTotal = 0;
+
+ /**
+ * 热心居民总数
+ */
+ private Integer warmHeartedTotal = 0;
+
+ /**
+ * 党员总数
+ */
+ private Integer partymemberTotal = 0;
+
+ /**
+ * 本日注册居民日增量
+ */
+ private Integer regIncr = 0;
+
+ /**
+ * 本日热心居民日增量
+ */
+ private Integer warmIncr = 0;
+
+ /**
+ * 本日党员认证日增量
+ */
+ private Integer partymemberIncr = 0;
+
+ /**
+ * 居民总数占比
+ */
+ private BigDecimal resiProportion = bi;
+
+ /**
+ * 党员总数占比
+ */
+ private BigDecimal partymemberProportion = bi;
+
+ /**
+ * 热心居民占比
+ */
+ private BigDecimal warmHeartedProportion = bi;
+ }
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridTopicIssueFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridTopicIssueFormDTO.java
new file mode 100644
index 0000000000..bd40463640
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridTopicIssueFormDTO.java
@@ -0,0 +1,85 @@
+package com.epmet.dto.basereport.form;
+
+import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
+import lombok.Data;
+
+import javax.validation.constraints.NotEmpty;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * @Description 基础数据上报-网格话题转议题数据-接口入参
+ * @Auth sun
+ */
+@Data
+public class GridTopicIssueFormDTO implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ public interface GridTopicIssueForm extends CustomerClientShowGroup{}
+
+ /**
+ * 为true时需要删除历史数据
+ */
+ private Boolean isFirst;
+ /**
+ * 数据集合对象
+ */
+ @NotEmpty(message = "数据集合对象不能为空",groups = GridTopicIssueForm.class)
+ private List dataList;
+
+ @Data
+ public static class DataList{
+
+ /**
+ * 客户Id
+ * */
+ private String customerId;
+
+ /**
+ * 机关ID
+ */
+ private String agencyId;
+
+ /**
+ * 网格ID
+ */
+ private String gridId;
+
+ /**
+ * 日期ID
+ */
+ private String dateId;
+
+ /**
+ * 周ID
+ */
+ private String weekId;
+
+ /**
+ * 月ID
+ */
+ private String monthId;
+
+ /**
+ * 季度ID
+ */
+ private String quarterId;
+
+ /**
+ * 年ID
+ */
+ private String yearId;
+
+ /**
+ * 新增转议题数
+ */
+ private Integer issueIncr;
+
+ /**
+ * 转议题总数
+ */
+ private Integer issueTotal;
+ }
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridTopicStatusFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridTopicStatusFormDTO.java
new file mode 100644
index 0000000000..519ea28a37
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridTopicStatusFormDTO.java
@@ -0,0 +1,99 @@
+package com.epmet.dto.basereport.form;
+
+import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
+import lombok.Data;
+
+import javax.validation.constraints.NotEmpty;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * @Description 基础数据上报-网格状态话题数据-接口入参
+ * @Auth sun
+ */
+@Data
+public class GridTopicStatusFormDTO implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ public interface GridTopicStatusForm extends CustomerClientShowGroup{}
+
+ /**
+ * 为true时需要删除历史数据
+ */
+ private Boolean isFirst;
+ /**
+ * 数据集合对象
+ */
+ @NotEmpty(message = "数据集合对象不能为空",groups = GridTopicStatusForm.class)
+ private List dataList;
+
+ @Data
+ public static class DataList{
+
+ /**
+ * 客户Id
+ * */
+ private String customerId;
+
+ /**
+ * 机关ID
+ */
+ private String agencyId;
+
+ /**
+ * 网格ID 关联网格dm表
+ */
+ private String gridId;
+
+ /**
+ * 日期ID
+ */
+ private String dateId;
+
+ /**
+ * 周ID
+ */
+ private String weekId;
+
+ /**
+ * 月ID
+ */
+ private String monthId;
+
+ /**
+ * 季度ID
+ */
+ private String quarterId;
+
+ /**
+ * 年ID
+ */
+ private String yearId;
+
+ /**
+ * 话题状态ID 讨论中 discussing
+ 已屏蔽 hidden
+ 已关闭 closed
+ 已转项目 shift_project
+ */
+ private String topicStatusId;
+
+ /**
+ * 话题数量
+ */
+ private Integer topicCount;
+
+ /**
+ * 话题状态占比 指定状态话题数/话题总数
+ 总数在topic_total_grid_daily中
+ */
+ private BigDecimal topicProportion;
+
+ /**
+ * 话题增量
+ */
+ private Integer topicIncrement;
+ }
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/result/.gitkeep b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/result/.gitkeep
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java
new file mode 100644
index 0000000000..3f9c614f8a
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java
@@ -0,0 +1,181 @@
+package com.epmet.dto.extract;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @author zhaoqifeng
+ * @dscription
+ * @date 2021/6/24 15:32
+ */
+@Data
+public class FactAgencyGovernDailyDTO implements Serializable {
+ private static final long serialVersionUID = 4776545209536007717L;
+ private String id;
+ /**
+ * 客户id
+ */
+ private String customerId;
+
+ /**
+ * 数据更新至:yyyyMMdd;
+ */
+ private String dateId;
+
+ /**
+ * 组织id
+ */
+ private String agencyId;
+
+ /**
+ * agency_id所属的机关级别(社区级:community,
+ 乡(镇、街道)级:street,
+ 区县级: district,
+ 市级: city
+ 省级:province)
+ */
+ private String level;
+
+ /**
+ * 组织i所属的组织id
+ */
+ private String pid;
+
+ /**
+ * 组织i所有上级id
+ */
+ private String pids;
+
+ /**
+ * 界面展示:问题解决总数=1+2+3+4+5+6+7+8
+ */
+ private Integer problemResolvedCount;
+
+ /**
+ * 界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数
+ */
+ private BigDecimal groupSelfGovernRatio;
+
+ /**
+ * 界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数
+ */
+ private BigDecimal gridSelfGovernRatio;
+
+ /**
+ * 界面展示:社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数
+ */
+ private BigDecimal communityClosedRatio;
+
+ /**
+ * 界面展示:街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数
+ */
+ private BigDecimal streetClosedRatio;
+
+ /**
+ * 界面展示:区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数
+ */
+ private BigDecimal districtDeptClosedRatio;
+
+ /**
+ * 1、当前组织内,话题关闭已解决数
+ */
+ private Integer topicResolvedCount;
+
+ /**
+ * 2、当前组织内,话题关闭无需解决数
+ */
+ private Integer topicUnResolvedCount;
+
+ /**
+ * 3、当前组织内,议题关闭已解决数
+ */
+ private Integer issueResolvedCount;
+
+ /**
+ * 4、当前组织内,议题关闭无需解决数
+ */
+ private Integer issueUnResolvedCount;
+
+ /**
+ * 5、当前组织内:来源于议题的项目:结案已解决数
+ */
+ private Integer issueProjectResolvedCount;
+
+ /**
+ * 6、当前组织内:来源于议题的项目:结案无需解决数
+ */
+ private Integer issueProjectUnResolvedCount;
+
+ /**
+ * 7、当前组织内:项目立项,结案已解决数;默认为0,
+ */
+ private Integer approvalProjectResolvedCount;
+
+ /**
+ * 8、当前组织内:项目立项,结案无需解决数;默认为0,
+ */
+ private Integer approvalProjectUnResolvedCount;
+
+ /**
+ * 9、当前组织内,未出小组即未转议题的:话题关闭已解决数
+ */
+ private Integer inGroupTopicResolvedCount;
+
+ /**
+ * 10、当前组织内,未出小组即未转议题的:话题关闭无需解决数
+ */
+ private Integer inGroupTopicUnResolvedCount;
+
+ /**
+ * 未出当前网格的,结案项目数
+ */
+ private Integer gridSelfGovernProjectTotal;
+
+ /**
+ * 当前组织内结案的项目中:由社区结案的项目总数
+ */
+ private Integer communityClosedCount;
+
+ /**
+ * 当前组织内结案的项目中:由街道结案的项目总数
+ */
+ private Integer streetClosedCount;
+
+ /**
+ * 当前组织内结案的项目中:由区直部门结案的项目总数
+ */
+ private Integer districtDeptClosedCount;
+
+ /**
+ * 删除标识 默认为0
+ */
+ private String delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ *
+ */
+ private String createdBy;
+
+ /**
+ *
+ */
+ private Date createdTime;
+
+ /**
+ *
+ */
+ private String updatedBy;
+
+ /**
+ *
+ */
+ private Date updatedTime;
+}
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java
new file mode 100644
index 0000000000..778ffcb9a4
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java
@@ -0,0 +1,193 @@
+package com.epmet.dto.extract;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @author zhaoqifeng
+ * @dscription
+ * @date 2021/6/24 15:34
+ */
+@Data
+public class FactGridGovernDailyDTO implements Serializable {
+ private static final long serialVersionUID = -5492115478082510064L;
+ private String id;
+ /**
+ * 客户id
+ */
+ private String customerId;
+
+ /**
+ * 数据更新至:yyyyMMdd;
+ */
+ private String dateId;
+
+ /**
+ * 网格id
+ */
+ private String gridId;
+
+ /**
+ * 网格所属的组织id
+ */
+ private String pid;
+
+ /**
+ * 网格所有上级id
+ */
+ private String pids;
+
+ /**
+ * 界面展示:问题解决总数=1+2+3+4+5+6+7+8
+ */
+ private Integer problemResolvedCount;
+
+ /**
+ * 界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数
+ */
+ private BigDecimal groupSelfGovernRatio;
+
+ /**
+ * 界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数
+ */
+ private BigDecimal gridSelfGovernRatio;
+
+ /**
+ * 界面展示:社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数
+ */
+ private BigDecimal communityClosedRatio;
+
+ /**
+ * 界面展示:街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数
+ */
+ private BigDecimal streetClosedRatio;
+
+ /**
+ * 界面展示:区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数
+ */
+ private BigDecimal districtDeptClosedRatio;
+
+ /**
+ * 1、当前网格内,话题关闭已解决数
+ */
+ private Integer topicResolvedCount;
+
+ /**
+ * 2、当前网格内,话题关闭无需解决数
+ */
+ private Integer topicUnResolvedCount;
+
+ /**
+ * 3、当前网格内,议题关闭已解决数
+ */
+ private Integer issueResolvedCount;
+
+ /**
+ * 4、当前网格内,议题关闭无需解决数
+ */
+ private Integer issueUnResolvedCount;
+
+ /**
+ * 5、当前网格内:来源于议题的项目:结案已解决数
+ */
+ private Integer issueProjectResolvedCount;
+
+ /**
+ * 6、当前网格内:来源于议题的项目:结案无需解决数
+ */
+ private Integer issueProjectUnResolvedCount;
+
+ /**
+ * 7、当前网格内:项目立项,结案已解决数;默认为0,
+ */
+ private Integer approvalProjectResolvedCount;
+
+ /**
+ * 8、当前网格内:项目立项,结案无需解决数;默认为0,
+ */
+ private Integer approvalProjectUnResolvedCount;
+
+ /**
+ * 9、当前网格内,未出小组即未转议题的:话题关闭已解决数
+ */
+ private Integer inGroupTopicResolvedCount;
+
+ /**
+ * 10、当前网格内,未出小组即未转议题的:话题关闭无需解决数
+ */
+ private Integer inGroupTopicUnResolvedCount;
+
+ /**
+ * 11、来源于议题的项目,未出网格结案并且已解决的项目数
+ */
+ private Integer fromIssueResolvedInGridCount;
+
+ /**
+ * 12、来源于议题的项目,未出网格结案并且无需解决的项目数
+ */
+ private Integer fromIssueUnResolvedInGridCount;
+
+ /**
+ * 13、来源于项目立项的项目,未出网格结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0
+ */
+ private Integer fromAgencyResolvedInGridCount;
+
+ /**
+ * 14、来源于项目立项的项目,未出网格结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0
+ */
+ private Integer fromAgencyUnResolvedInGridCount;
+
+ /**
+ * 15、未出当前网格的,结案项目数=11+12+13+14
+ */
+ private Integer gridSelfGovernProjectTotal;
+
+
+ /**
+ * 当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数
+ */
+ private Integer communityClosedCount;
+
+ /**
+ * 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数
+ */
+ private Integer streetClosedCount;
+
+ /**
+ * 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数
+ */
+ private Integer districtDeptClosedCount;
+
+ /**
+ * 删除标识 默认为0
+ */
+ private String delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ *
+ */
+ private String createdBy;
+
+ /**
+ *
+ */
+ private Date createdTime;
+
+ /**
+ *
+ */
+ private String updatedBy;
+
+ /**
+ *
+ */
+ private Date updatedTime;
+}
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/AgencyGovernDailyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/AgencyGovernDailyFormDTO.java
new file mode 100644
index 0000000000..3f1c3a1bc7
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/AgencyGovernDailyFormDTO.java
@@ -0,0 +1,28 @@
+package com.epmet.dto.extract.form;
+
+import com.epmet.dto.extract.FactAgencyGovernDailyDTO;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author zhaoqifeng
+ * @dscription
+ * @date 2021/6/24 15:28
+ */
+@Data
+public class AgencyGovernDailyFormDTO implements Serializable {
+ private static final long serialVersionUID = 106752296400100448L;
+ /**
+ * 当为true时后台将删除本月数据
+ */
+ private Boolean isFirst;
+
+ /**
+ * yyyyMMdd
+ */
+ private String dateId;
+
+ private List dataList;
+}
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridGovernDailyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridGovernDailyFormDTO.java
new file mode 100644
index 0000000000..173ba43011
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridGovernDailyFormDTO.java
@@ -0,0 +1,28 @@
+package com.epmet.dto.extract.form;
+
+import com.epmet.dto.extract.FactGridGovernDailyDTO;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author zhaoqifeng
+ * @dscription
+ * @date 2021/6/24 15:36
+ */
+@Data
+public class GridGovernDailyFormDTO implements Serializable {
+ private static final long serialVersionUID = 1630151176835406040L;
+ /**
+ * 当为true时后台将删除本月数据
+ */
+ private Boolean isFirst;
+
+ /**
+ * yyyyMMdd
+ */
+ private String dateId;
+
+ private List dataList;
+}
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenGovernRankDataDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenGovernRankDataDailyDTO.java
index 29d988da64..9a1bc174c1 100644
--- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenGovernRankDataDailyDTO.java
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenGovernRankDataDailyDTO.java
@@ -99,6 +99,35 @@ public class ScreenGovernRankDataDailyDTO implements Serializable {
*/
private BigDecimal satisfactionRatio;
+ /**
+ * 响应数
+ */
+ private Integer responseCount;
+ /**
+ * 项目转入次数
+ */
+ private Integer transferCount;
+ /**
+ * 解决项目数
+ */
+ private Integer resolvedCount;
+ /**
+ * 已关闭项目数
+ */
+ private Integer closedCount;
+ /**
+ * 自治项目数
+ */
+ private Integer governCount;
+ /**
+ * 满意项目数
+ */
+ private Integer satisfactionCount;
+ /**
+ * 已关闭项目(由议题转的项目)数
+ */
+ private Integer closedProjectCount;
+
/**
* 删除标识 0未删除;1已删除
*/
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java
index 1d42d5964f..fe859bfac0 100644
--- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java
@@ -180,5 +180,9 @@ public class ScreenProjectDataDTO implements Serializable {
private String topicId;
private Integer responseCount;
+ /**
+ * 满意度得分
+ */
+ private BigDecimal satisfactionScore;
}
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java
index aca9d358ce..f0f6422e94 100644
--- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java
@@ -115,4 +115,9 @@ public class ScreenProjectDataInfoFormDTO implements Serializable {
* 议题图片地址
*/
private String[] projectImgUrl;
+
+ /**
+ * 满意度得分
+ */
+ private BigDecimal satisfactionScore;
}
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataDailyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataDailyFormDTO.java
new file mode 100644
index 0000000000..f5b4cdb15d
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataDailyFormDTO.java
@@ -0,0 +1,29 @@
+package com.epmet.dto.screencoll.form;
+
+import com.epmet.dto.screen.ScreenGovernRankDataDailyDTO;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author zhaoqifeng
+ * @dscription
+ * @date 2021/6/24 10:04
+ */
+@Data
+public class GovernRankDataDailyFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 3485797660632260565L;
+ /**
+ * 当为true时后台将删除本月数据
+ */
+ private Boolean isFirst;
+
+ /**
+ * yyyyMMdd
+ */
+ private String dateId;
+
+ private List dataList;
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/BaseReportConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/BaseReportConstant.java
new file mode 100644
index 0000000000..0c6669c3bd
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/BaseReportConstant.java
@@ -0,0 +1,13 @@
+package com.epmet.constant;
+
+/**
+ * @Author zxc
+ * @DateTime 2021/6/24 5:19 下午
+ * @DESC
+ */
+public interface BaseReportConstant {
+
+ String DATA_IS_NULL = "上传%s数据为空";
+
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/BaseReportController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/BaseReportController.java
new file mode 100644
index 0000000000..f8990a9a8f
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/BaseReportController.java
@@ -0,0 +1,201 @@
+package com.epmet.controller;
+
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.validator.ValidatorUtils;
+import com.epmet.dto.basereport.form.*;
+import com.epmet.service.BaseReportService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @Author sun
+ * @Description 部分基础数据上报
+ */
+@RestController
+@RequestMapping("basereport")
+public class BaseReportController {
+
+ @Autowired
+ private BaseReportService baseReportService;
+
+ /**
+ * @Param formDTO
+ * @Description 网格注册用户数据
+ * @author sun
+ */
+ @PostMapping("gridreguser")
+ public Result gridRegUser(@RequestBody GridRegUserFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, GridRegUserFormDTO.saveList.class);
+ baseReportService.gridRegUser(formDTO);
+ return new Result();
+ }
+
+ /**
+ * @Param formDTO
+ * @Description 组织机关注册用户数据
+ * @author sun
+ */
+ @PostMapping("agencyreguser")
+ public Result agencyRegUser(@RequestBody AgencyRegUserFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, AgencyRegUserFormDTO.saveList.class);
+ baseReportService.agencyRegUser(formDTO);
+ return new Result();
+ }
+
+ /**
+ * @Param formDTO
+ * @Description 网格群组总数
+ * @author sun
+ */
+ @PostMapping("gridgrouptotal")
+ public Result gridGroupTotal(@RequestBody GridGroupTotalFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, GridGroupTotalFormDTO.saveList.class);
+ baseReportService.gridGroupTotal(formDTO);
+ return new Result();
+ }
+
+ /**
+ * @Param formDTO
+ * @Description 组织群组总数
+ * @author sun
+ */
+ @PostMapping("agencygrouptotal")
+ public Result agencyGroupTotal(@RequestBody AgencyGroupTotalFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, AgencyGroupTotalFormDTO.saveList.class);
+ baseReportService.agencyGroupTotal(formDTO);
+ return new Result();
+ }
+
+ /**
+ * @Param formDTO
+ * @Description 网格热议话题数据
+ * @author sun
+ */
+ @PostMapping("gridhottopic")
+ public Result gridHotTopic(@RequestBody GridHotTopicFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, GridHotTopicFormDTO.saveList.class);
+ baseReportService.gridHotTopic(formDTO);
+ return new Result();
+ }
+
+ /**
+ * @Param formDTO
+ * @Description 组织热议话题数据
+ * @author sun
+ */
+ @PostMapping("agencyhottopic")
+ public Result agencyHotTopic(@RequestBody AgencyHotTopicFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, AgencyHotTopicFormDTO.saveList.class);
+ baseReportService.agencyHotTopic(formDTO);
+ return new Result();
+ }
+
+ /**
+ * @Description 网格状态话题数据-008
+ * @Param formDTO
+ * @author zxc
+ * @date 2021/6/25 3:09 下午
+ */
+ @PostMapping("gridtopicstatus")
+ public Result gridTopicStatus(@RequestBody GridTopicStatusFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, GridTopicStatusFormDTO.GridTopicStatusForm.class);
+ baseReportService.gridTopicStatus(formDTO);
+ return new Result();
+ }
+
+ /**
+ * @Description 组织状态话题数据-007
+ * @Param formDTO
+ * @author zxc
+ * @date 2021/6/25 3:09 下午
+ */
+ @PostMapping("agencytopicstatus")
+ public Result agencyTopicStatus(@RequestBody AgencyTopicStatusFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, AgencyTopicStatusFormDTO.AgencyTopicStatusForm.class);
+ baseReportService.agencyTopicStatus(formDTO);
+ return new Result();
+ }
+
+ /**
+ * @Description 网格话题转议题数据-006
+ * @Param formDTO
+ * @author zxc
+ * @date 2021/6/25 1:51 下午
+ */
+ @PostMapping("gridtopicissue")
+ public Result gridTopicIssue(@RequestBody GridTopicIssueFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, GridTopicIssueFormDTO.GridTopicIssueForm.class);
+ baseReportService.gridTopicIssue(formDTO);
+ return new Result();
+ }
+
+ /**
+ * @Description 组织话题转议题数据-005
+ * @Param formDTO
+ * @author zxc
+ * @date 2021/6/25 1:50 下午
+ */
+ @PostMapping("agencytopicissue")
+ public Result agencyTopicIssue(@RequestBody AgencyTopicIssueFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, AgencyTopicIssueFormDTO.AgencyTopicIssueForm.class);
+ baseReportService.agencyTopicIssue(formDTO);
+ return new Result();
+ }
+
+ /**
+ * @Description 网格议题数据-004
+ * @Param formDTO
+ * @author zxc
+ * @date 2021/6/25 1:50 下午
+ */
+ @PostMapping("gridissue")
+ public Result gridIssue(@RequestBody GridIssueFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, GridIssueFormDTO.GridIssueForm.class);
+ baseReportService.gridIssue(formDTO);
+ return new Result();
+ }
+
+ /**
+ * @Description 组织议题数据-003
+ * @Param formDTO
+ * @author zxc
+ * @date 2021/6/25 1:50 下午
+ */
+ @PostMapping("agencyissue")
+ public Result agencyIssue(@RequestBody AgencyIssueFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, AgencyIssueFormDTO.AgencyIssueForm.class);
+ baseReportService.agencyIssue(formDTO);
+ return new Result();
+ }
+
+ /**
+ * @Description 网格项目数据-002
+ * @Param formDTO
+ * @author zxc
+ * @date 2021/6/25 1:50 下午
+ */
+ @PostMapping("gridproject")
+ public Result gridProject(@RequestBody GridProjectFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, GridProjectFormDTO.GridProjectForm.class);
+ baseReportService.gridProject(formDTO);
+ return new Result();
+ }
+
+ /**
+ * @Description 组织项目数据-001
+ * @Param formDTO
+ * @author zxc
+ * @date 2021/6/25 1:50 下午
+ */
+ @PostMapping("agencyproject")
+ public Result agencyProject(@RequestBody AgencyProjectFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, AgencyProjectFormDTO.AgencyProjectForm.class);
+ baseReportService.agencyProject(formDTO);
+ return new Result();
+ }
+
+
+}
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 202dac9013..b0b1e80421 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
@@ -44,6 +44,7 @@ import com.epmet.service.evaluationindex.indexcal.*;
import com.epmet.service.evaluationindex.screen.*;
import com.epmet.service.stats.DimAgencyService;
import com.epmet.service.stats.DimCustomerPartymemberService;
+import com.epmet.service.stats.DimCustomerService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -123,6 +124,8 @@ public class DemoController {
private FactAgencyGovernDailyService factAgencyGovernDailyService;
@Autowired
private FactGridMemberStatisticsDailyService factGridMemberStatisticsDailyService;
+ @Autowired
+ private DimCustomerService dimCustomerService;
@GetMapping("testAlarm")
public void testAlarm() {
@@ -944,4 +947,22 @@ public class DemoController {
return new Result();
}
+
+ /**
+ * @return com.epmet.commons.tools.utils.Result
+ * @param
+ * @author yinzuomei
+ * @description 将产品内部客户,来源于议题并且已结案的项目,赋值满意度得分
+ * @Date 2021/6/23 15:55
+ **/
+ @PostMapping("update-satisfaction-core")
+ public Result updateProjectSatisfactionScore(){
+ List customerIds=dimCustomerService.getAllCustomerId();
+ customerIds.forEach(customerId->{
+ screenProjectSettleService.updateProjectSatisfactionScore(customerId,null,null);
+ log.info("更新完成");
+ });
+ return new Result();
+ }
+
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/GovernanceDataReportController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/GovernanceDataReportController.java
new file mode 100644
index 0000000000..77913ac0d9
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/GovernanceDataReportController.java
@@ -0,0 +1,74 @@
+package com.epmet.controller;
+
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.dto.extract.form.AgencyGovernDailyFormDTO;
+import com.epmet.dto.extract.form.GridGovernDailyFormDTO;
+import com.epmet.dto.screencoll.form.GovernRankDataDailyFormDTO;
+import com.epmet.service.GovernanceDataReportService;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.sql.ResultSet;
+
+/**
+ * 治理能力数据上报
+ *
+ * @author zhaoqifeng
+ * @date 2021/6/24 15:16
+ */
+@RestController
+@RequestMapping("governance")
+public class GovernanceDataReportController {
+
+ @Resource
+ private GovernanceDataReportService governanceDataReportService;
+
+
+ /**
+ * 基层治理-治理能力排行数据(按天统计)
+ *
+ * @param customerId
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result
+ * @author zhaoqifeng
+ * @date 2021/6/24 10:02
+ */
+ @PostMapping("governrankdatadaily")
+ public Result governRankDataDaily(@RequestHeader("CustomerId") String customerId, @RequestBody GovernRankDataDailyFormDTO formDTO) {
+ governanceDataReportService.insertGovernRankDataDaily(formDTO, customerId);
+ return new Result();
+ }
+
+
+ /**
+ * 组织的治理指数,按天统计
+ *
+ * @param customerId
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result
+ * @author zhaoqifeng
+ * @date 2021/6/24 15:38
+ */
+ @PostMapping("agencygoverndaily")
+ public Result agencyGovernDaily(@RequestHeader("CustomerId") String customerId, @RequestBody AgencyGovernDailyFormDTO formDTO) {
+ governanceDataReportService.insertAgencyGovernDaily(formDTO, customerId);
+ return new Result();
+ }
+
+ /**
+ * 网格的治理指数,按天统计
+ *
+ * @param customerId
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result
+ * @author zhaoqifeng
+ * @date 2021/6/24 15:38
+ */
+ @PostMapping("gridgoverndaily")
+ public Result gridGovernDaily(@RequestHeader("CustomerId") String customerId, @RequestBody GridGovernDailyFormDTO formDTO) {
+ governanceDataReportService.insertGridGovernDaily(formDTO, customerId);
+ return new Result();
+ }
+
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java
index 9f2a4b06cd..9add28ae1c 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java
@@ -147,7 +147,11 @@ public class IndexCalculateController {
long start = System.currentTimeMillis();
Boolean aBoolean = indexCalculateService.indexCalculate(formDTO);
if (aBoolean) {
- log.error("客户Id:{},monthId:{},全部指标计算完成,结果:{},总耗时:{}秒", formDTO.getCustomerId(), formDTO.getMonthId(), aBoolean, (System.currentTimeMillis() - start) / 1000);
+ log.error("客户Id:{},monthId:{},全部指标计算完成,结果:{},总耗时:{}秒",
+ formDTO.getCustomerId(),
+ formDTO.getMonthId(),
+ aBoolean,
+ (System.currentTimeMillis() - start) / 1000);
}
redisUtils.delete(RedisKeys.getCustomerStatsCalFlag(formDTO.getCustomerId()));
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java
index 5410417202..447110eeb1 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java
@@ -18,12 +18,12 @@
package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
-import com.epmet.dto.project.result.ProjectExceedParamsResultDTO;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
+import java.math.BigDecimal;
import java.util.List;
/**
@@ -64,4 +64,6 @@ public interface ScreenProjectDataDao extends BaseDao {
* @return int
*/
void deleteByProjectIds(@Param("list") List list);
+
+ int updateProjectSatisfactionScore(@Param("projectId")String projectId, @Param("score")BigDecimal score);
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java
index c4047cb0b3..704aa3ee26 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java
@@ -28,6 +28,7 @@ import com.epmet.entity.project.ProjectEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
+import java.math.BigDecimal;
import java.util.List;
/**
@@ -163,4 +164,34 @@ public interface ProjectDao extends BaseDao {
String selectValueByKey(@Param("customerId") String customerId, @Param("parameterKey") String parameterKey);
List selectProjectListByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId, @Param("projectOrigin") String projectOrigin);
+
+ /**
+ * 计算某个项目的群满意度得分
+ *
+ * @param customerId
+ * @param projectId
+ * @return 得分
+ */
+ BigDecimal selectProjectSatisfactionScore(@Param("customerId")String customerId,
+ @Param("projectId")String projectId);
+
+ /**
+ * 查询当天(dateId)有评价记录的项目id
+ *
+ * @param customerId
+ * @param dateId
+ * @return
+ */
+ List selectEvaluateProjectIds(@Param("customerId") String customerId, @Param("dateId")String dateId);
+
+ /**
+ * 可根据状态筛选项目id
+ *
+ * @param customerId
+ * @param projectStatus 状态:待处理 pending,结案closed
+ * @return
+ */
+ List selectClosedProjectIds(@Param("customerId")String customerId,
+ @Param("origin")String origin,
+ @Param("projectStatus")String projectStatus);
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java
new file mode 100644
index 0000000000..66a80a58fe
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java
@@ -0,0 +1,227 @@
+package com.epmet.dao.stats;
+
+import com.epmet.dto.basereport.form.AgencyProjectFormDTO;
+import com.epmet.dto.basereport.form.AgencyRegUserFormDTO;
+import com.epmet.dto.basereport.form.GridRegUserFormDTO;
+import com.epmet.dto.basereport.form.*;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @Author sun
+ * @Description 部分基础数据上报
+ */
+@Mapper
+public interface BaseReportDao {
+
+ /**
+ * @Description 根据dateId删除客户网格注册用户数据
+ * @author sun
+ */
+ int delGridRegUser(@Param("customerId") String customerId, @Param("dateId") String dateId);
+
+ /**
+ * @Description 批量新增客户网格注册用户数据
+ * @author sun
+ */
+ void insertBatchGridRegUser(@Param("list") List dataList);
+
+ /**
+ * @Description 根据dateId删除客户组织注册用户数据
+ * @author sun
+ */
+ int delAgencyRegUser(@Param("customerId") String customerId, @Param("dateId") String dateId);
+
+ /**
+ * @Description 批量新增客户组织注册用户数据
+ * @author sun
+ */
+ void insertBatchAgencyRegUser(@Param("list") List dataList);
+
+ /**
+ * @Description 根据dateId删除客户网格群组总数数据
+ * @author sun
+ */
+ int delGridGroupTotal(@Param("customerId") String customerId, @Param("dateId") String dateId);
+
+ /**
+ * @Description 批量新增客户网格群组总数数据
+ * @author sun
+ */
+ void insertBatchGridGroupTotal(@Param("list") List dataList);
+
+ /**
+ * @Description 根据dateId删除客户组织群组总数数据
+ * @author sun
+ */
+ int delAgencyGroupTotal(@Param("customerId") String customerId, @Param("dateId") String dateId);
+
+ /**
+ * @Description 批量新增客户组织群组总数数据
+ * @author sun
+ */
+ void insertBatchAgencyGroupTotal(@Param("list") List dataList);
+
+ /**
+ * @Description 根据dateId删除客户网格热议话题数据
+ * @author sun
+ */
+ int delGridHotTopic(@Param("customerId") String customerId, @Param("dateId") String dateId);
+
+ /**
+ * @Description 批量新增客户网格热议话题数据
+ * @author sun
+ */
+ void insertBatchGridHotTopic(@Param("list") List dataList);
+
+ /**
+ * @Description 根据dateId删除客户组织热议话题数据
+ * @author sun
+ */
+ int delAgencyHotTopic(@Param("customerId") String customerId, @Param("dateId") String dateId);
+
+ /**
+ * @Description 批量新增客户组织热议话题数据
+ * @author sun
+ */
+ void insertBatchAgencyHotTopic(@Param("list") List dataList);
+
+ /**
+ * @Description 根据dateId删除客户组织项目数据
+ * @Param customerId
+ * @Param dateId
+ * @author zxc
+ * @date 2021/6/24 5:30 下午
+ */
+ int delAgencyProject(@Param("customerId") String customerId, @Param("dateId") String dateId);
+
+ /**
+ * @Description 批量新增组织项目数据
+ * @Param dataList
+ * @author zxc
+ * @date 2021/6/25 9:14 上午
+ */
+ void insertAgencyProject(@Param("list")List dataList);
+
+ /**
+ * @Description 根据dateId删除客户网格项目数据
+ * @Param customerId
+ * @Param dateId
+ * @author zxc
+ * @date 2021/6/25 10:36 上午
+ */
+ int delGridProject(@Param("customerId") String customerId, @Param("dateId") String dateId);
+
+ /**
+ * @Description 批量新增网格项目数据
+ * @Param dataList
+ * @author zxc
+ * @date 2021/6/25 10:37 上午
+ */
+ void insertGridProject(@Param("list")List dataList);
+
+ /**
+ * @Description 删除组织议题数据
+ * @Param customerId
+ * @Param dateId
+ * @author zxc
+ * @date 2021/6/25 10:53 上午
+ */
+ int delAgencyIssue(@Param("customerId") String customerId, @Param("dateId") String dateId);
+
+ /**
+ * @Description 新增组织议题数据
+ * @Param dataList
+ * @author zxc
+ * @date 2021/6/25 10:54 上午
+ */
+ void insertAgencyIssue(@Param("list")List dataList);
+
+ /**
+ * @Description 删除网格议题数据
+ * @Param customerId
+ * @Param dateId
+ * @author zxc
+ * @date 2021/6/25 2:00 下午
+ */
+ int delGridIssue(@Param("customerId") String customerId, @Param("dateId") String dateId);
+
+ /**
+ * @Description 新增网格议题数据
+ * @Param dataList
+ * @author zxc
+ * @date 2021/6/25 2:00 下午
+ */
+ void insertGridIssue(@Param("list")List dataList);
+
+ /**
+ * @Description 删除组织话题转议题数据
+ * @Param customerId
+ * @Param dateId
+ * @author zxc
+ * @date 2021/6/25 2:13 下午
+ */
+ int delAgencyTopicIssue(@Param("customerId") String customerId, @Param("dateId") String dateId);
+
+ /**
+ * @Description 新增组织话题转议题数据
+ * @Param dataList
+ * @author zxc
+ * @date 2021/6/25 2:14 下午
+ */
+ void insertAgencyTopicIssue(@Param("list")List dataList);
+
+ /**
+ * @Description 删除网格话题转议题数据
+ * @Param customerId
+ * @Param dateId
+ * @author zxc
+ * @date 2021/6/25 2:41 下午
+ */
+ int delGridTopicIssue(@Param("customerId") String customerId, @Param("dateId") String dateId);
+
+ /**
+ * @Description 新增网格话题转议题数据
+ * @Param dataList
+ * @author zxc
+ * @date 2021/6/25 2:41 下午
+ */
+ void insertGridTopicIssue(@Param("list")List dataList);
+
+ /**
+ * @Description 删除组织状态话题数据
+ * @Param customerId
+ * @Param dateId
+ * @author zxc
+ * @date 2021/6/25 3:17 下午
+ */
+ int delAgencyTopicStatus(@Param("customerId") String customerId, @Param("dateId") String dateId);
+
+ /**
+ * @Description 增加组织状态话题数据
+ * @Param dataList
+ * @author zxc
+ * @date 2021/6/25 3:18 下午
+ */
+ void insertAgencyTopicStatus(@Param("list")List dataList);
+
+ /**
+ * @Description 删除网格状态话题数据
+ * @Param customerId
+ * @Param dateId
+ * @author zxc
+ * @date 2021/6/25 3:30 下午
+ */
+ int delGridTopicStatus(@Param("customerId") String customerId, @Param("dateId") String dateId);
+
+ /**
+ * @Description 增加网格状态话题数据
+ * @Param dataList
+ * @author zxc
+ * @date 2021/6/25 3:30 下午
+ */
+ void insertGridTopicStatus(@Param("list")List dataList);
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataDailyEntity.java
index 8bbe10f526..d2f2c16625 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataDailyEntity.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataDailyEntity.java
@@ -18,13 +18,11 @@
package com.epmet.entity.evaluationindex.screen;
import com.baomidou.mybatisplus.annotation.TableName;
-
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
-import java.util.Date;
/**
* 基层治理-治理能力排行数据(按月统计)
@@ -99,4 +97,33 @@ public class ScreenGovernRankDataDailyEntity extends BaseEpmetEntity {
*/
private BigDecimal satisfactionRatio;
+ /**
+ * 响应数
+ */
+ private Integer responseCount;
+ /**
+ * 项目转入次数
+ */
+ private Integer transferCount;
+ /**
+ * 解决项目数
+ */
+ private Integer resolvedCount;
+ /**
+ * 已关闭项目数
+ */
+ private Integer closedCount;
+ /**
+ * 自治项目数
+ */
+ private Integer governCount;
+ /**
+ * 满意项目数
+ */
+ private Integer satisfactionCount;
+ /**
+ * 已关闭项目(由议题转的项目)数
+ */
+ private Integer closedProjectCount;
+
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java
index 9ef584bad8..52c9a19ab3 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java
@@ -144,5 +144,8 @@ public class ScreenProjectDataEntity extends BaseEpmetEntity {
*/
private String allParentIds;
-
+ /**
+ * 满意度得分
+ */
+ private BigDecimal satisfactionScore;
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/BaseReportService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/BaseReportService.java
new file mode 100644
index 0000000000..50b5f3579d
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/BaseReportService.java
@@ -0,0 +1,109 @@
+package com.epmet.service;
+
+
+import com.epmet.dto.basereport.form.*;
+
+/**
+ * @Author sun
+ * @Description 部分基础数据上报
+ */
+public interface BaseReportService {
+
+ /**
+ * @Param formDTO
+ * @Description 网格注册用户数据
+ * @author sun
+ */
+ void gridRegUser(GridRegUserFormDTO formDTO);
+
+ /**
+ * @Param formDTO
+ * @Description 组织机关注册用户数据
+ * @author sun
+ */
+ void agencyRegUser(AgencyRegUserFormDTO formDTO);
+
+ /**
+ * @Param formDTO
+ * @Description 网格群组总数
+ * @author sun
+ */
+ void gridGroupTotal(GridGroupTotalFormDTO formDTO);
+
+ /**
+ * @Param formDTO
+ * @Description 组织群组总数
+ * @author sun
+ */
+ void agencyGroupTotal(AgencyGroupTotalFormDTO formDTO);
+
+ /**
+ * @Param formDTO
+ * @Description 网格热议话题数据
+ * @author sun
+ */
+ void gridHotTopic(GridHotTopicFormDTO formDTO);
+
+ /**
+ * @Param formDTO
+ * @Description 组织热议话题数据
+ * @author sun
+ */
+ void agencyHotTopic(AgencyHotTopicFormDTO formDTO);
+
+ /**
+ * @Param formDTO
+ * @Description 网格状态话题数据-008
+ * @author sun
+ */
+ void gridTopicStatus(GridTopicStatusFormDTO formDTO);
+
+ /**
+ * @Param formDTO
+ * @Description 组织状态话题数据-007
+ * @author sun
+ */
+ void agencyTopicStatus(AgencyTopicStatusFormDTO formDTO);
+
+ /**
+ * @Param formDTO
+ * @Description 网格话题转议题数据-006
+ * @author sun
+ */
+ void gridTopicIssue(GridTopicIssueFormDTO formDTO);
+
+ /**
+ * @Param formDTO
+ * @Description 组织话题转议题数据-005
+ * @author sun
+ */
+ void agencyTopicIssue(AgencyTopicIssueFormDTO formDTO);
+
+ /**
+ * @Param formDTO
+ * @Description 网格议题数据-004
+ * @author sun
+ */
+ void gridIssue(GridIssueFormDTO formDTO);
+
+ /**
+ * @Param formDTO
+ * @Description 组织议题数据-003
+ * @author sun
+ */
+ void agencyIssue(AgencyIssueFormDTO formDTO);
+
+ /**
+ * @Param formDTO
+ * @Description 网格项目数据-002
+ * @author sun
+ */
+ void gridProject(GridProjectFormDTO formDTO);
+
+ /**
+ * @Param formDTO
+ * @Description 组织项目数据-001
+ * @author sun
+ */
+ void agencyProject(AgencyProjectFormDTO formDTO);
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/GovernanceDataReportService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/GovernanceDataReportService.java
new file mode 100644
index 0000000000..db9808bf3f
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/GovernanceDataReportService.java
@@ -0,0 +1,48 @@
+package com.epmet.service;
+
+import com.epmet.dto.extract.form.AgencyGovernDailyFormDTO;
+import com.epmet.dto.extract.form.GridGovernDailyFormDTO;
+import com.epmet.dto.screencoll.form.GovernRankDataDailyFormDTO;
+
+/**
+ * 治理能力数据上报
+ *
+ * @author zhaoqifeng
+ * @date 2021/6/24 15:18
+ */
+public interface GovernanceDataReportService {
+
+ /**
+ * 基层治理-治理能力排行数据(按天统计)
+ *
+ * @param formDTO
+ * @param customerId
+ * @return void
+ * @author zhaoqifeng
+ * @date 2021/6/24 10:14
+ */
+ void insertGovernRankDataDaily(GovernRankDataDailyFormDTO formDTO, String customerId);
+
+ /**
+ * 组织的治理指数,按天统计
+ *
+ * @param formDTO
+ * @param customerId
+ * @return void
+ * @author zhaoqifeng
+ * @date 2021/6/24 15:40
+ */
+ void insertAgencyGovernDaily(AgencyGovernDailyFormDTO formDTO, String customerId);
+
+ /**
+ * 网格的治理指数,按天统计
+ *
+ * @param formDTO
+ * @param customerId
+ * @return void
+ * @author zhaoqifeng
+ * @date 2021/6/24 15:40
+ */
+ void insertGridGovernDaily(GridGovernDailyFormDTO formDTO, String customerId);
+
+}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactAgencyGovernDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactAgencyGovernDailyService.java
index 0504164079..647d0650a3 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactAgencyGovernDailyService.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactAgencyGovernDailyService.java
@@ -18,8 +18,11 @@
package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.commons.mybatis.service.BaseService;
+import com.epmet.dto.extract.FactAgencyGovernDailyDTO;
import com.epmet.entity.evaluationindex.extract.FactAgencyGovernDailyEntity;
+import java.util.List;
+
/**
* 组织的治理指数,按天统计
*
@@ -38,4 +41,23 @@ public interface FactAgencyGovernDailyService extends BaseService list);
+
}
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java
index 15447342ab..6d62d67c29 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java
@@ -18,9 +18,12 @@
package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.commons.mybatis.service.BaseService;
+import com.epmet.dto.extract.FactGridGovernDailyDTO;
import com.epmet.dto.extract.form.ExtractFactGridGovernDailyFromDTO;
import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity;
+import java.util.List;
+
/**
* 网格的治理指数,按天统计
*
@@ -41,4 +44,22 @@ public interface FactGridGovernDailyService extends BaseService list);
}
\ No newline at end of file
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java
index 6629836e02..9cae42b818 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java
@@ -17,10 +17,13 @@
package com.epmet.service.evaluationindex.extract.todata.impl;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
+import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.constant.*;
import com.epmet.dao.evaluationindex.extract.FactAgencyGovernDailyDao;
+import com.epmet.dto.extract.FactAgencyGovernDailyDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.stats.DimAgencyDTO;
import com.epmet.entity.evaluationindex.extract.FactAgencyGovernDailyEntity;
@@ -301,6 +304,36 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>();
+ wrapper.eq(FactAgencyGovernDailyEntity :: getCustomerId, customerId)
+ .eq(FactAgencyGovernDailyEntity :: getDateId, dateId);
+ return baseDao.delete(wrapper);
+ }
+
+ /**
+ * 批量插入
+ *
+ * @param list
+ * @return void
+ * @author zhaoqifeng
+ * @date 2021/6/24 15:56
+ */
+ @Override
+ public void insertBatch(List list) {
+ this.insertBatch(ConvertUtils.sourceToTarget(list, FactAgencyGovernDailyEntity.class));
+ }
+
private FactAgencyGovernDailyEntity initEntity(DimAgencyDTO agency, String dateId) {
FactAgencyGovernDailyEntity entity = new FactAgencyGovernDailyEntity();
entity.setCustomerId(agency.getCustomerId());
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java
index 68523f199c..56346813b5 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java
@@ -17,19 +17,19 @@
package com.epmet.service.evaluationindex.extract.todata.impl;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
+import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.constant.DimObjectActionConstant;
import com.epmet.constant.DimObjectStatusConstant;
import com.epmet.constant.ProjectConstant;
import com.epmet.dao.evaluationindex.extract.FactGridGovernDailyDao;
+import com.epmet.dto.extract.FactGridGovernDailyDTO;
import com.epmet.dto.extract.FactOriginProjectLogDailyDTO;
import com.epmet.dto.extract.form.ExtractFactGridGovernDailyFromDTO;
import com.epmet.dto.org.GridInfoDTO;
-import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity;
-import com.epmet.entity.evaluationindex.extract.GovernGridClosedTotalCommonDTO;
-import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO;
-import com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO;
+import com.epmet.entity.evaluationindex.extract.*;
import com.epmet.entity.org.CustomerAgencyEntity;
import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService;
@@ -247,6 +247,36 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>();
+ wrapper.eq(FactGridGovernDailyEntity :: getCustomerId, customerId)
+ .eq(FactGridGovernDailyEntity :: getDateId, dateId);
+ return baseDao.delete(wrapper);
+ }
+
+ /**
+ * 批量插入
+ *
+ * @param list
+ * @return void
+ * @author zhaoqifeng
+ * @date 2021/6/24 16:09
+ */
+ @Override
+ public void insertBatch(List list) {
+ this.insertBatch(ConvertUtils.sourceToTarget(list, FactGridGovernDailyEntity.class));
+ }
+
private Map getGovernGridClosedTotalCommonDTOMap(String customerId, List gridIds) {
Map resultMap = new HashMap<>();
for (String gridId : gridIds) {
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenProjectSettleService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenProjectSettleService.java
index fe147887b0..c9fa1b17d7 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenProjectSettleService.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenProjectSettleService.java
@@ -24,4 +24,14 @@ public interface ScreenProjectSettleService {
*/
void extractScreenData(ScreenCentralZoneDataFormDTO param);
+ /**
+ * 更新项目得分
+ *
+ * @param customerId
+ * @param dateId //dateId可以为空,如果为空重新计算当前客户下所有的项目的分数; dateId不为空,只计算当天存在评价记录的项目,更新项目对应的得分。
+ * @param projectId 项目id可为空
+ * @return void
+ */
+ void updateProjectSatisfactionScore(String customerId,String dateId,String projectId);
+
}
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java
index ebdb11825b..e1410b94d5 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java
@@ -348,6 +348,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
+ entity.setSatisfactionCount(dto.getCount());
+ entity.setClosedProjectCount(dto.getSum());
BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP);
if (ratio.compareTo(hundred) > 0) {
ratio = hundred;
@@ -367,6 +369,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (ratio.compareTo(hundred) > 0) {
ratio = hundred;
}
+ entity.setGovernCount(grid.getCount());
+ entity.setClosedCount(grid.getSum());
entity.setGovernRatio(ratio);
}
}));
@@ -383,6 +387,12 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (ratio.compareTo(hundred) > 0) {
ratio = hundred;
}
+ entity.setResponseCount(dto.getCount());
+ entity.setTransferCount(dto.getSum());
+ BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP);
+ if (ratio.compareTo(hundred) > 0) {
+ ratio = hundred;
+ }
entity.setResponseRatio(ratio);
}
}));
@@ -395,6 +405,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
+ entity.setResolvedCount(dto.getCount());
+ entity.setClosedCount(dto.getSum());
BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP);
if (ratio.compareTo(hundred) > 0) {
ratio = hundred;
@@ -438,6 +450,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
+ entity.setSatisfactionCount(dto.getCount());
+ entity.setClosedProjectCount(dto.getSum());
BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP);
if (ratio.compareTo(hundred) > 0) {
ratio = hundred;
@@ -459,6 +473,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
ratio = hundred;
}
entity.setResponseRatio(ratio);
+ entity.setResponseCount(dto.getCount());
+ entity.setTransferCount(dto.getSum());
}
}));
}
@@ -469,6 +485,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
+ entity.setGovernCount(dto.getCount());
+ entity.setClosedCount(dto.getSum());
BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP);
if (ratio.compareTo(hundred) > 0) {
ratio = hundred;
@@ -485,6 +503,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
+ entity.setResolvedCount(dto.getCount());
+ entity.setClosedCount(dto.getSum());
BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP);
if (ratio.compareTo(hundred) > 0) {
ratio = hundred;
@@ -532,6 +552,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
ratio = hundred;
}
entity.setSatisfactionRatio(ratio);
+ entity.setSatisfactionCount(dto.getCount());
+ entity.setClosedProjectCount(dto.getSum());
}
}));
}
@@ -548,6 +570,9 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
ratio = hundred;
}
entity.setResponseRatio(ratio);
+ entity.setResponseCount(dto.getCount());
+ entity.setTransferCount(dto.getSum());
+
}
}));
}
@@ -558,6 +583,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
+ entity.setGovernCount(dto.getCount());
+ entity.setClosedCount(dto.getSum());
BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP);
if (ratio.compareTo(hundred) > 0) {
ratio = hundred;
@@ -574,6 +601,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
+ entity.setResolvedCount(dto.getCount());
+ entity.setClosedCount(dto.getSum());
BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP);
if (ratio.compareTo(hundred) > 0) {
ratio = hundred;
@@ -616,6 +645,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
+ entity.setSatisfactionCount(dto.getCount());
+ entity.setClosedProjectCount(dto.getSum());
BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP);
if (ratio.compareTo(hundred) > 0) {
ratio = hundred;
@@ -637,6 +668,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
ratio = hundred;
}
entity.setResponseRatio(ratio);
+ entity.setResponseCount(dto.getCount());
+ entity.setTransferCount(dto.getSum());
}
}));
}
@@ -647,6 +680,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
+ entity.setGovernCount(dto.getCount());
+ entity.setClosedCount(dto.getSum());
BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP);
if (ratio.compareTo(hundred) > 0) {
ratio = hundred;
@@ -663,6 +698,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
+ entity.setResolvedCount(dto.getCount());
+ entity.setClosedCount(dto.getSum());
BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP);
if (ratio.compareTo(hundred) > 0) {
ratio = hundred;
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java
index 14d6fade19..600786782c 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java
@@ -324,6 +324,13 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
} catch (Exception e) {
log.error("大屏项目数据抽取_按天抽取_按天统计失败,customerId为:" + customerId + "dateId为:" + dateId, e);
}
+ try{
+ //dateId可以为空,如果为空重新计算当前客户下所有的项目的分数
+ //dateId不为空,只计算当天存在评价记录的项目,更新项目对应的得分。
+ screenProjectSettleService.updateProjectSatisfactionScore(customerId,dateId,null);
+ }catch(Exception e){
+ log.error("群众不满得分更新失败");
+ }
}
/**
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java
index 781211b4bf..16d073b953 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java
@@ -102,6 +102,8 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic
} else {
meta.setLinkUserId(meta.getLinkName());
}
+ //项目满意度得分
+ meta.setSatisfactionScore(projectService.calProjectSatisfactionScore(param.getCustomerId(),meta.getProjectId()));
return meta;
})).collect(Collectors.toList());
}
@@ -170,4 +172,36 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic
}
+ /**
+ * 更新项目得分
+ *
+ * @param customerId
+ * @param dateId //dateId可以为空,如果为空重新计算当前客户下所有的项目的分数; dateId不为空,只计算当天存在评价记录的项目,更新项目对应的得分。
+ * @param projectId 项目id可为空
+ * @return void
+ */
+ @Override
+ public void updateProjectSatisfactionScore(String customerId, String dateId,String projectId) {
+ if(StringUtils.isNotBlank(projectId)){
+ projectService.calProjectSatisfactionScore(customerId,projectId);
+ return;
+ }
+ List projectIds=new ArrayList<>();
+ if(StringUtils.isNotBlank(dateId)){
+ List list=projectService.selectEvaluateProjectIds(customerId,dateId);
+ if(!CollectionUtils.isEmpty(list)){
+ projectIds.addAll(list);
+ }
+ }else{
+ // 只有来源于议题的项目,才有分数
+ List