Browse Source

Merge remote-tracking branch 'remotes/origin/dev' into dev_index_explain_fix

dev
jianjun 4 years ago
parent
commit
94eab60e03
  1. 9
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java
  2. 4
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  3. 16
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java
  4. 4
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/OrgConstant.java
  5. 8
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgencyGovrnFormDTO.java
  6. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GovrnRatioFormDTO.java
  7. 4
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyGroupResultDTO.java
  8. 4
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyIssueResultDTO.java
  9. 4
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyProjectResultDTO.java
  10. 4
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyTopicResultDTO.java
  11. 4
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyUserResultDTO.java
  12. 49
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenCustomerAgencyDTO.java
  13. 119
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenCustomerGridDTO.java
  14. 161
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenGovernRankDataDailyDTO.java
  15. 25
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java
  16. 61
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java
  17. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercrm/CustomerRelationDao.java
  18. 174
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/FactAgencyGovernDailyEntity.java
  19. 357
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  20. 56
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java
  21. 104
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java
  22. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/CustomerRelation.java
  23. 14
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/impl/CustomerRelationImpl.java
  24. 60
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml
  25. 154
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml
  26. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercrm/CustomerRelationDao.xml
  27. 119
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenCustomerGridDTO.java
  28. 34
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/AgencyDetailMulticFormDTO.java
  29. 57
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/project/MassesDiscontentFormV2DTO.java
  30. 104
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/AgencyDetailMulticResultDTO.java
  31. 46
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java
  32. 10
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/ScreenCustomerAgencyDTO.java
  33. 69
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/MassesDiscontentResultV2DTO.java
  34. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyFormDTO.java
  35. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/RootAgencyFormDTO.java
  36. 11
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java
  37. 24
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java
  38. 7
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java
  39. 11
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/DifficultyRankFormDTO.java
  40. 9
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDifficultRankResultDTO.java
  41. 12
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectNextAgencyResultDTO.java
  42. 5
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java
  43. 45
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java
  44. 19
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java
  45. 35
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
  46. 26
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/project/ProjectDao.java
  47. 39
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/redis/DataReportRedis.java
  48. 33
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java
  49. 187
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java
  50. 69
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java
  51. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java
  52. 29
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java
  53. 187
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java
  54. 8
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/DateUtils.java
  55. 113
      epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml
  56. 90
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml
  57. 18
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml
  58. 10
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml
  59. 16
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml
  60. 42
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml
  61. 88
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyGroupTotalFormDTO.java
  62. 88
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyHotTopicFormDTO.java
  63. 200
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyIssueFormDTO.java
  64. 146
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyProjectFormDTO.java
  65. 109
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyRegUserFormDTO.java
  66. 84
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyTopicIssueFormDTO.java
  67. 100
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyTopicStatusFormDTO.java
  68. 88
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridGroupTotalFormDTO.java
  69. 88
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridHotTopicFormDTO.java
  70. 200
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridIssueFormDTO.java
  71. 145
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridProjectFormDTO.java
  72. 114
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridRegUserFormDTO.java
  73. 85
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridTopicIssueFormDTO.java
  74. 99
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridTopicStatusFormDTO.java
  75. 0
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/result/.gitkeep
  76. 181
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java
  77. 193
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java
  78. 28
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/AgencyGovernDailyFormDTO.java
  79. 28
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridGovernDailyFormDTO.java
  80. 20
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/form/UpdateProjectSatisfactionScoreFormDTO.java
  81. 29
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenGovernRankDataDailyDTO.java
  82. 4
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java
  83. 5
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java
  84. 29
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataDailyFormDTO.java
  85. 20
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinFormDTO.java
  86. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/BaseReportConstant.java
  87. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/GovernConstant.java
  88. 201
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/BaseReportController.java
  89. 34
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  90. 74
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/GovernanceDataReportController.java
  91. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java
  92. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java
  93. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.java
  94. 23
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserJoinDao.java
  95. 31
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java
  96. 227
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java
  97. 31
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataDailyEntity.java
  98. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java
  99. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenUserJoinEntity.java
  100. 39
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/mq/ProjectChangedCustomListener.java

9
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";
}

4
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java

@ -469,4 +469,8 @@ public class RedisKeys {
public static String getCorsConfigKey() {
return rootPrefix.concat("sys:cors");
}
public static String getProjectChangedMsgDistinceKey(String customerId) {
return rootPrefix.concat("project_changed:consume:").concat(customerId);
}
}

16
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java

@ -446,6 +446,22 @@ public class DateUtils {
return DateUtils.format(date,DateUtils.DATE_PATTERN_YYYYMM);
}
/**
* @Description 获取指定 月份的前n月 返回yyyyMM
* @Param beforeMonth
* @Param monthId
* @author zxc
* @date 2021/7/9 2:44 下午
*/
public static String getBeforeNMonthByMonth(int beforeMonth, String monthId){
StringBuilder builder = new StringBuilder(monthId);
builder.insert(NumConstant.FOUR,"-");
builder.insert(builder.length(),"-01");
LocalDate parse = LocalDate.parse(builder.toString());
LocalDate localDate = parse.minusMonths(beforeMonth);
return localDate.toString().replace("-","").substring(NumConstant.ZERO,NumConstant.SIX);
}
/**
* @return java.util.List<java.lang.String> 返回yyyyMMdd
* @param startTime yyyyMMdd

4
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";
}

8
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 {}
}

2
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 {}
}

4
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;
//楼院小组总数

4
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;
//表决中总数

4
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;
//处理中总数

4
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;
//热议中总数

4
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;
//党员总数

49
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;
}

119
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

161
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

25
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<AgencyBasicDataResultDTO> getAgnecyRegUser(@Param("agencyIds") List<String> agencyIds, @Param("dateId") String dateId);
/**
* @Description 查询组织下最新群组日统计数据
* @author sun
*/
AgencyBasicDataResultDTO getAgnecyGroup(@Param("agencyId") String agencyId, @Param("dateId") String dateId);
List<AgencyBasicDataResultDTO> getAgnecyGroup(@Param("agencyIds") List<String> agencyIds, @Param("dateId") String dateId);
/**
* @Description 查询组织下最新状态话题-机关日统计数据表
* @author sun
*/
List<AgencyBasicDataResultDTO.Topic> getAgencyTopic(@Param("agencyId") String agencyId, @Param("dateId") String dateId);
List<AgencyBasicDataResultDTO.Topic> getAgencyTopic(@Param("agencyIds") List<String> agencyIds, @Param("dateId") String dateId);
/**
* @Description 查询组织下最新转议题话题-机关日统计数据表
* @author sun
*/
AgencyBasicDataResultDTO.Topic getAgencyTopicShiftIssue(@Param("agencyId") String agencyId, @Param("dateId") String dateId);
List<AgencyBasicDataResultDTO.Topic> getAgencyTopicShiftIssue(@Param("agencyIds") List<String> agencyIds, @Param("dateId") String dateId);
/**
* @Description 热议中话题-机关日统计数据
* @author sun
*/
AgencyBasicDataResultDTO.Topic getAgencyTopicHotDiscuss(@Param("agencyId") String agencyId, @Param("dateId") String dateId);
List<AgencyBasicDataResultDTO.Topic> getAgencyTopicHotDiscuss(@Param("agencyIds") List<String> agencyIds, @Param("dateId") String dateId);
/**
* @Description 查询组织下最新议题日统计数据
* @author sun
*/
AgencyBasicDataResultDTO getAgencyIssue(@Param("agencyId") String agencyId, @Param("dateId") String dateId);
List<AgencyBasicDataResultDTO> getAgencyIssue(@Param("agencyIds") List<String> agencyIds, @Param("dateId") String dateId);
/**
* @Description 查询组织下最新项目日统计数据
* @author sun
*/
AgencyBasicDataResultDTO getAgencyProject(@Param("agencyId") String agencyId, @Param("dateId") String dateId);
List<AgencyBasicDataResultDTO> getAgencyProject(@Param("agencyIds") List<String> agencyIds, @Param("dateId") String dateId);
/**
* @Description 查询当前组织的直属下级组织信息
@ -242,4 +243,14 @@ public interface DataStatsDao {
* @author sun
*/
List<GridGovrnResultDTO> getGridGovern(@Param("gridIds") List<String> 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<FactAgencyGovernDailyEntity> getAgencyGovernDaily(@Param("agencyIds") List<String> agencyIds, @Param("dateId") String dateId);
}

61
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<String> getAgencyByAreaCodeAgencyId(@Param("agencyId") String agencyId, @Param("areaCode") String areaCode);
/**
* @Description 查询直属下级组织列表有areaCode的按areaCode查没有的按agencyId查
* @author sun
*/
List<ScreenCustomerAgencyDTO> getSubAgencyList(@Param("agencyId") String agencyId, @Param("areaCode") String areaCode);
/**
* @Description 查询指标库组织直属网格列表这个客户组织网格数据包括小程序的和项目上报的
* @author sun
*/
List<ScreenCustomerGridDTO> getSubGridList(@Param("agencyId") String agencyId);
/**
* 根据组织Id查询治理指数
* @author zhaoqifeng
* @date 2021/6/25 16:36
* @param agencyIds
* @param dateId
* @return java.util.List<com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO>
*/
ScreenGovernRankDataDailyDTO getGovernRankList(@Param("agencyIds") List<String> 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<String> getAgencyIdsByAgencyId(@Param("agencyId") String agencyId, @Param("areaCode") String areaCode, @Param("list") List<String> list);
/**
* @Description 查询直属下级组织列表有areaCode的按areaCode查没有的按agencyId查且是在当前客户和子客户范围内查询
* @author sun
*/
List<ScreenCustomerAgencyDTO> getSubAgencyListByAgency(@Param("agencyId") String agencyId, @Param("areaCode") String areaCode, @Param("list") List<String> list);
}

9
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<String> selectUsedAreaCodeList(String areaCode);
/**
* 根据customerId查询其所有下级子客户id
* @author zhaoqifeng
* @date 2021/6/29 11:04
* @param customerId
* @return java.util.List<java.lang.String>
*/
List<String> selectAllSubCustomerIds(String customerId);
}

174
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

357
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<String> 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<AgencyBasicDataResultDTO> 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<AgencyBasicDataResultDTO> 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<AgencyBasicDataResultDTO.Topic> topic = dataStatsDao.getAgencyTopic(formDTO.getAgencyId(), formDTO.getDateId());
List<AgencyBasicDataResultDTO.Topic> topic = dataStatsDao.getAgencyTopic(agencyList, formDTO.getDateId());
//转议题话题-机关日统计数据表
AgencyBasicDataResultDTO.Topic topicSHiftIssue = dataStatsDao.getAgencyTopicShiftIssue(formDTO.getAgencyId(), formDTO.getDateId());
List<AgencyBasicDataResultDTO.Topic> topicSHiftIssue = dataStatsDao.getAgencyTopicShiftIssue(agencyList, formDTO.getDateId());
//热议中话题-机关日统计数据
AgencyBasicDataResultDTO.Topic hotdiscuss = dataStatsDao.getAgencyTopicHotDiscuss(formDTO.getAgencyId(), formDTO.getDateId());
AtomicReference<Integer> 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<AgencyBasicDataResultDTO.Topic> 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<AgencyBasicDataResultDTO> 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<AgencyBasicDataResultDTO> 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<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId());
//1.查询直属下级组织列表,有子客户的按areaCode查没有的按agencyId查
List<ScreenCustomerAgencyDTO> subAgencyList = indexService.getSubAgencyListByAgency(formDTO.getAgencyId());
if (subAgencyList.size() < NumConstant.ONE) {
return resultList;
}
List<String> agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList());
List<String> agencyIds = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList());
//2.查询直属下级组织注册用户日统计数据,默认按用户总数降序
List<SubAgencyUserResultDTO> 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<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId());
//1.查询指标库组织直属网格列表【这个客户组织网格数据包括小程序的和项目上报的
List<ScreenCustomerGridDTO> gridList = indexService.getSubGridList(formDTO.getAgencyId());
if (gridList.size() < NumConstant.ONE) {
return resultList;
}
List<String> gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList());
List<String> gridIds = gridList.stream().map(ScreenCustomerGridDTO::getGridId).collect(Collectors.toList());
//2.查询网格层级注册用户日统计数据,默认按用户总数降序
List<SubGridUserResultDTO> 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<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId());
//1.查询直属下级组织列表,有子客户的按areaCode查没有的按agencyId查
List<ScreenCustomerAgencyDTO> subAgencyList = indexService.getSubAgencyListByAgency(formDTO.getAgencyId());
if (subAgencyList.size() < NumConstant.ONE) {
return resultList;
}
List<String> agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList());
List<String> agencyIds = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList());
//2.查询直属下级组织小组日统计数据,默认按群组总数降序
List<SubAgencyGroupResultDTO> 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<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId());
//1.查询指标库组织直属网格列表【这个客户组织网格数据包括小程序的和项目上报的
List<ScreenCustomerGridDTO> gridList = indexService.getSubGridList(formDTO.getAgencyId());
if (gridList.size() < NumConstant.ONE) {
return resultList;
}
List<String> gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList());
List<String> gridIds = gridList.stream().map(ScreenCustomerGridDTO::getGridId).collect(Collectors.toList());
//2.查询网格层级小组日统计数据,默认按群组总数降序
List<SubGridGroupResultDTO> 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<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId());
//1.查询直属下级组织列表,有子客户的按areaCode查没有的按agencyId查
List<ScreenCustomerAgencyDTO> subAgencyList = indexService.getSubAgencyListByAgency(formDTO.getAgencyId());
if (subAgencyList.size() < NumConstant.ONE) {
return resultList;
}
List<String> agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList());
List<String> 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<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId());
//1.查询指标库组织直属网格列表【这个客户组织网格数据包括小程序的和项目上报的
List<ScreenCustomerGridDTO> gridList = indexService.getSubGridList(formDTO.getAgencyId());
if (gridList.size() < NumConstant.ONE) {
return resultList;
}
List<String> gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList());
List<String> 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<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId());
//1.查询直属下级组织列表,有子客户的按areaCode查没有的按agencyId查
List<ScreenCustomerAgencyDTO> subAgencyList = indexService.getSubAgencyListByAgency(formDTO.getAgencyId());
if (subAgencyList.size() < NumConstant.ONE) {
return resultList;
}
List<String> agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList());
List<String> agencyIds = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList());
//2.查询直属下级组织议题日统计数据,默认按议题总数降序
List<SubAgencyIssueResultDTO> 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<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId());
//1.查询指标库组织直属网格列表【这个客户组织网格数据包括小程序的和项目上报的
List<ScreenCustomerGridDTO> gridList = indexService.getSubGridList(formDTO.getAgencyId());
if (gridList.size() < NumConstant.ONE) {
return resultList;
}
List<String> gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList());
List<String> gridIds = gridList.stream().map(ScreenCustomerGridDTO::getGridId).collect(Collectors.toList());
//2.查询网格层级议题日统计数据,默认按议题总数降序
List<SubGridIssueResultDTO> 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<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId());
//1.查询直属下级组织列表,有子客户的按areaCode查没有的按agencyId查
List<ScreenCustomerAgencyDTO> subAgencyList = indexService.getSubAgencyListByAgency(formDTO.getAgencyId());
if (subAgencyList.size() < NumConstant.ONE) {
return resultList;
}
List<String> agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList());
List<String> agencyIds = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList());
//2.查询直属下级组织项目日统计数据,默认按项目总数降序
List<SubAgencyProjectResultDTO> 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<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId());
//1.查询指标库组织直属网格列表【这个客户组织网格数据包括小程序的和项目上报的
List<ScreenCustomerGridDTO> gridList = indexService.getSubGridList(formDTO.getAgencyId());
if (gridList.size() < NumConstant.ONE) {
return resultList;
}
List<String> gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList());
List<String> gridIds = gridList.stream().map(ScreenCustomerGridDTO::getGridId).collect(Collectors.toList());
//2.查询网格层级项目日统计数据,默认按项目总数降序
List<SubGridProjectResultDTO> 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<String> subAgencyIds = indexService.getAgencyByAreaCodeAgencyId(formDTO.getAgencyId(), agencyDTO.getAreaCode());
if (CollectionUtils.isEmpty(subAgencyIds)) {
subAgencyIds = new ArrayList<>();
}
subAgencyIds.add(formDTO.getAgencyId());
List<FactAgencyGovernDailyEntity> 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<String> agencyIds = new ArrayList<>();
agencyIds.add(formDTO.getAgencyId());
@ -1133,6 +1210,18 @@ public class DataStatsServiceImpl implements DataStatsService {
return resultList;
}
List<String> agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList());
ScreenCustomerAgencyDTO agencyDTO = indexService.getAgencyInfo(formDTO.getAgencyId());
if (CollectionUtils.isNotEmpty(customerRelation.haveSubCustomer(agencyDTO.getCustomerId()))) {
List<ScreenCustomerAgencyDTO> 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<AgencyGovrnResultDTO> list = dataStatsDao.getAgencyGovern(agencyIds, formDTO.getDateId());
@ -1231,22 +1320,22 @@ public class DataStatsServiceImpl implements DataStatsService {
}
//1.查询组织直属网格列表【网格维度】
List<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId());
List<ScreenCustomerGridDTO> gridList = indexService.getSubGridList(formDTO.getAgencyId());
if (gridList.size() < NumConstant.ONE) {
return resultList;
}
List<String> gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList());
List<String> gridIds = gridList.stream().map(ScreenCustomerGridDTO::getGridId).collect(Collectors.toList());
//2.按日期查找组织直属网格事件治理指数列表
List<GridGovrnResultDTO> 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("%");
}
}

56
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<String> getAgencyByAreaCodeAgencyId(String agencyId, String areaCode);
/**
* @Description 查询直属下级组织列表有areaCode的按areaCode查没有的按agencyId查
* @author sun
*/
List<ScreenCustomerAgencyDTO> getSubAgencyList(String agencyId, String areaCode);
/**
* @Description 查询指标库组织直属网格列表这个客户组织网格数据包括小程序的和项目上报的
* @author sun
*/
List<ScreenCustomerGridDTO> getSubGridList(String agencyId);
/**
* 根据组织ID获取治理指数
* @author zhaoqifeng
* @date 2021/6/25 16:33
* @param agencyId
* @param areaCode
* @param dateId
* @return java.util.List<com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO>
*/
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<String> getAgencyIdsByAgencyId(String agencyId);
/**
* @Description 查询直属下级组织列表有子客户的按areaCode查没有的按agencyId查
* @author sun
*/
List<ScreenCustomerAgencyDTO> getSubAgencyListByAgency(String agencyId);
}

104
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<String> getAgencyByAreaCodeAgencyId(String agencyId, String areaCode) {
return evaluationIndexDao.getAgencyByAreaCodeAgencyId(agencyId,areaCode);
}
/**
* @Description 查询直属下级组织列表有areaCode的按areaCode查没有的按agencyId查
* @author sun
*/
@Override
public List<ScreenCustomerAgencyDTO> getSubAgencyList(String agencyId, String areaCode) {
return evaluationIndexDao.getSubAgencyList(agencyId,areaCode);
}
/**
* @Description 查询指标库组织直属网格列表这个客户组织网格数据包括小程序的和项目上报的
* @author sun
*/
@Override
public List<ScreenCustomerGridDTO> getSubGridList(String agencyId) {
return evaluationIndexDao.getSubGridList(agencyId);
}
/**
* 根据组织ID获取治理指数
*
* @param agencyId
* @param areaCode
* @param dateId
* @return java.util.List<com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO>
* @author zhaoqifeng
* @date 2021/6/25 16:33
*/
@Override
public ScreenGovernRankDataDailyDTO getGovernRank(String agencyId, String areaCode, String dateId) {
List<String> 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<String> getAgencyIdsByAgencyId(String agencyId) {
//1.查询agencyId对应组织信息
ScreenCustomerAgencyDTO dto = evaluationIndexDao.getByAgencyId(agencyId);
//2.判断客户是否存在子客户
List<String> 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<ScreenCustomerAgencyDTO> getSubAgencyListByAgency(String agencyId) {
//1.查询agencyId对应组织信息
ScreenCustomerAgencyDTO dto = evaluationIndexDao.getByAgencyId(agencyId);
//2.判断客户是否存在子客户
List<String> 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);
}
}
}

9
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<String> selectUsedAreaCodeList(String areaCode);
/**
* 是否有子客户
* @author zhaoqifeng
* @date 2021/6/29 11:06
* @param customerId
* @return List<String>
*/
List<String> haveSubCustomer(String customerId);
}

14
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<String> selectUsedAreaCodeList(String areaCode) {
return customerRelationDao.selectUsedAreaCodeList(areaCode);
}
/**
* 是否有子客户
*
* @param customerId
* @return boolean
* @author zhaoqifeng
* @date 2021/6/29 11:06
*/
@Override
public List<String> haveSubCustomer(String customerId) {
return customerRelationDao.selectAllSubCustomerIds(customerId);
}
}

60
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
<foreach item="agencyId" collection="agencyIds" open="AND (" separator="or" close=")" index="">
agency_id = #{agencyId}
</foreach>
</select>
<select id="getAgnecyGroup" resultType="com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO">
@ -26,9 +27,10 @@
fact_group_total_agency_daily
WHERE
del_flag = '0'
AND agency_id = #{agencyId}
AND date_id = #{dateId}
LIMIT 1
<foreach item="agencyId" collection="agencyIds" open="AND (" separator="or" close=")" index="">
agency_id = #{agencyId}
</foreach>
</select>
<select id="getAgencyTopic" resultType="com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO$Topic">
@ -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
<foreach item="agencyId" collection="agencyIds" open="AND (" separator="or" close=")" index="">
agency_id = #{agencyId}
</foreach>
</select>
<select id="getAgencyTopicShiftIssue" resultType="com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO$Topic">
@ -53,9 +56,10 @@
fact_topic_issue_agency_daily
WHERE
del_flag = '0'
AND agency_id = #{agencyId}
AND date_id = #{dateId}
LIMIT 1
<foreach item="agencyId" collection="agencyIds" open="AND (" separator="or" close=")" index="">
agency_id = #{agencyId}
</foreach>
</select>
<select id="getAgencyTopicHotDiscuss" resultType="com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO$Topic">
@ -66,9 +70,10 @@
fact_topic_hotdiscuss_agency_daily
WHERE
del_flag = '0'
AND agency_id = #{agencyId}
AND date_id = #{dateId}
LIMIT 1
<foreach item="agencyId" collection="agencyIds" open="AND (" separator="or" close=")" index="">
agency_id = #{agencyId}
</foreach>
</select>
<select id="getAgencyIssue" resultType="com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO">
@ -81,9 +86,10 @@
fact_issue_agency_daily
WHERE
del_flag = '0'
AND agency_id = #{agencyId}
AND date_id = #{dateId}
LIMIT 1
<foreach item="agencyId" collection="agencyIds" open="AND (" separator="or" close=")" index="">
agency_id = #{agencyId}
</foreach>
</select>
<select id="getAgencyProject" resultType="com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO">
@ -95,9 +101,10 @@
fact_agency_project_daily
WHERE
del_flag = '0'
AND agency_id = #{agencyId}
AND date_id = #{dateId}
LIMIT 1
<foreach item="agencyId" collection="agencyIds" open="AND (" separator="or" close=")" index="">
agency_id = #{agencyId}
</foreach>
</select>
<select id="getSubAgencyList" resultType="com.epmet.dataaggre.entity.datastats.DimAgencyEntity">
@ -653,5 +660,30 @@
</foreach>
ORDER BY problem_resolved_count DESC
</select>
<select id="getAgencyGovernDaily" resultType="com.epmet.dataaggre.entity.datastats.FactAgencyGovernDailyEntity">
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}
<foreach item="agencyId" collection="agencyIds" open="AND (" separator="or" close=")" index="">
AGENCY_ID = #{agencyId}
</foreach>
</select>
</mapper>

154
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml

@ -20,4 +20,158 @@
AND date_id = #{dateId}
</select>
<select id="getAgencyByAreaCodeAgencyId" resultType="java.lang.String">
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>
<select id="getSubAgencyList" resultType="com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO">
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'
<choose>
<when test="areaCode != null and areaCode.trim() != ''">
AND parent_area_code = #{areaCode}
</when>
<otherwise>
AND pid = #{agencyId}
</otherwise>
</choose>
</select>
<select id="getSubGridList" resultType="com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO">
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>
<select id="getGovernRankList" resultType="com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO">
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'
<foreach item="agencyId" collection="agencyIds" open="AND (" separator="or" close=")" index="">
ORG_ID = #{agencyId}
</foreach>
AND ORG_TYPE = 'agency'
AND DATE_ID = #{dateId}
</select>
<select id="getAgencyInfo" resultType="com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO">
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>
<select id="getByAgencyId" resultType="com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO">
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>
<select id="getAgencyIdsByAgencyId" resultType="java.lang.String">
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}
)
<foreach collection="list" item="customerId" open="AND (" separator=" OR " close=")">
customer_id = #{customerId}
</foreach>
</select>
<select id="getSubAgencyListByAgency" resultType="com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO">
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'
<choose>
<when test="areaCode != null and areaCode.trim() != ''">
AND parent_area_code = #{areaCode}
</when>
<otherwise>
AND pid = #{agencyId}
</otherwise>
</choose>
<if test="null != list and list.size() > 0">
<foreach collection="list" item="customerId" open="AND (" separator=" OR " close=")">
customer_id = #{customerId}
</foreach>
</if>
</select>
</mapper>

9
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>
<select id="selectAllSubCustomerIds" resultType="java.lang.String">
SELECT
cr.CUSTOMER_ID
FROM
customer_relation cr
WHERE
cr.DEL_FLAG = '0'
AND cr.PIDS like CONCAT(#{customerId},'%')
</select>
</mapper>

119
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

34
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;
}

57
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;
}

104
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<ParentListResultDTO> 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<String> subCustomerIds;
// @JsonIgnore
/**
* 当前agencyId所属的客户id
*/
private String customerId;
}

46
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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 = "";
}

10
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;
}

69
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<String> 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 = "";
}
}

5
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyFormDTO.java

@ -21,4 +21,9 @@ public class AgencyFormDTO implements Serializable {
@NotBlank(message = "机关Id不能为空" , groups = CommonAgencyIdGroup.class)
private String agencyId;
/**
* 平阴县默认穿370124,跟随8个街道点击事件传入街道的areaCode
* */
private String areaCode;
}

5
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;
}

11
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<processDTO> processList;
/**
* 满意度得分 06.25新增这个返参目前大屏和工作端小程序都没有用到工作端小程序详情的得分是取得列表返回去的值
*/
private BigDecimal score;
@Data
public static class processDTO{
private String processId;

24
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java

@ -8,7 +8,7 @@ import java.math.BigDecimal;
/**
* @Description 用户参与各项指标以及增长查询结果dto
* @ClassName UserJoinIndicatorGrowthRateResultDTO
* @Auth wangc
* @author wangc
* @Date 2020-08-21 16:07
*/
@Data
@ -16,25 +16,33 @@ public class UserJoinIndicatorGrowthRateResultDTO implements Serializable {
private static final long serialVersionUID = -8830240350298414599L;
private String id;
/**
* 总参与数
* */
private Integer total;
/**
* 总参与数月增长
* */
private BigDecimal monthIncr;
/**
* incr上升, decr下降
* 总参与数incr上升, decr下降
* */
private String monthTrend;
/**
* 人均议题
* */
private BigDecimal averageIssue;
/**
* 较上月百分比
* 人均议题较上月百分比
* */
private BigDecimal issueCompareLatestMonth;
/**
* 较上月趋势incr上升decr下降
* 人均议题较上月趋势incr上升decr下降
* */
private String issueCompareLatestTrend;
@ -43,7 +51,13 @@ public class UserJoinIndicatorGrowthRateResultDTO implements Serializable {
*/
private BigDecimal averageJoin;
/**
* 平均参与度: 较上月百分比
*/
private BigDecimal joinCompareLatestMonth;
/**
* 平均参与度较上月趋势incr上升decr下降
*/
private String joinCompareLatestTrend;
}

7
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";
}

11
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;
}

9
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;
/**
* 社区-网格名

12
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;
}
}

5
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<RootAgencyResultDTO> rootAgency(@RequestBody RootAgencyFormDTO formDTO) {
public Result<RootAgencyResultDTO> rootAgency(@LoginUser TokenDto tokenDto, @RequestBody RootAgencyFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, RootAgencyFormDTO.AddUserInternalGroup.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<RootAgencyResultDTO>().ok(factIndexService.rootAgency(formDTO));
}

45
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<List<ProjectDifficultRankResultDTO>>().ok(projectService.getDifficultyRank(param));
}
/**
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.project.dto.result.ProjectDifficultRankResultDTO>>
* @param formDTO
* @author yinzuomei
* @description 难点赌点-耗时最长|涉及部门最多|处理次数 返回该组织下所有的难点堵点的 数据
* 2021.06.21新增次API,多客户版本eg:平阴县的工作人员可以看到8个街道的难点赌点
* @Date 2021/6/23 13:09
**/
@PostMapping("difficultyrank-multic")
public Result<List<ProjectDifficultRankResultDTO>> difficultyRankMultic(@RequestHeader("CustomerId") String customerId,@RequestBody DifficultyRankFormDTO formDTO){
formDTO.setCustomerId(customerId);
ValidatorUtils.validateEntity(formDTO, DifficultyRankFormDTO.DifficultyRankInternalGroup.class);
return new Result<List<ProjectDifficultRankResultDTO>>().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<List<ProjectNextAgencyResultDTO>>().ok(projectService.getMyNextAgency(tokenDto));
}
/**
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.project.dto.result.ProjectNextAgencyResultDTO>>
* @param tokenDto
* @author yinzuomei
* @description 001难点堵点-组织下拉框
* 需求描述下拉框显示当前用户所属组织和下级组织 1如果当前用户是街道工作人员 显示所属街道和该街道下的社区+直属网格2如果当前用户是社区人员 显示所属社区和该社区下的网格+直属网格
* 210622: 新增此API 后端改为从指标库取值 保证平阴县的工作人员看到的下拉框是平阴县以及8个街道
* @Date 2021/6/22 14:20
**/
@PostMapping("mynextagency-multic")
public Result<List<ProjectNextAgencyResultDTO>> myNextAgencyMultic(@LoginUser TokenDto tokenDto){
return new Result<List<ProjectNextAgencyResultDTO>>().ok(projectService.myNextAgencyMultic(tokenDto.getUserId(),tokenDto.getCustomerId()));
}
/**
* 002项目分类字典查询
* 查询当前客户的父客户下项目分类字典
@ -140,4 +171,18 @@ public class ProjectController {
public Result<List<ProjectCategoryDictResultDTO>> categoryDict(@RequestHeader("CustomerId") String customerId) {
return new Result<List<ProjectCategoryDictResultDTO>>().ok(projectService.getCategoryDict(customerId));
}
/**
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.MassesDiscontentResultDTO>>
* @param formDTO
* @author yinzuomei
* @description 群众不满列表改为从指标库的screen_project_data取值
* sql里面写死<75分的展示
* @Date 2021/6/24 11:13
**/
@PostMapping("massesdiscontent-multic")
public Result<List<MassesDiscontentResultV2DTO>> queryMassesDiscontentMultic(@RequestBody MassesDiscontentFormV2DTO formDTO){
ValidatorUtils.validateEntity(formDTO, MassesDiscontentFormV2DTO.MassesDiscontentFormV2.class);
return new Result<List<MassesDiscontentResultV2DTO>>().ok(projectService.queryMassesDiscontentMultic(formDTO));
}
}

19
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<AgencyDetailMulticResultDTO> queryAgencyDetailMultiC(@LoginUser TokenDto tokenDto, @RequestBody AgencyDetailMulticFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO, AgencyDetailMulticFormDTO.AddUserInternalGroup.class);
return new Result<AgencyDetailMulticResultDTO>().ok(agencyService.queryAgencyDetailMultiC(formDTO));
}
}

35
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<GridManagerListResultDTO> selectGrid(@Param("agencyId")String agencyId,@Param("areaCode")String areaCode);
/**
* 查询当前组织的下一级组织可根据areaCode查询也可根据pid查询
*
* @param areaCode
* @param pid
* @return java.util.List<com.epmet.dto.result.ScreenCustomerAgencyDTO>
*/
List<ScreenCustomerAgencyDTO> selectNextAgencyList(@Param("areaCode") String areaCode, @Param("pid") String pid, @Param("allCustomerIds") List<String> allCustomerIds);
/**
* 查询当前组织的下面的网格可根据areaCode查询也可根据parentAgencyId查询
*
* @param areaCode
* @param parentAgencyId
* @return java.util.List<com.epmet.dto.result.ScreenCustomerAgencyDTO>
*/
List<ScreenCustomerGridDTO> selectGridDTOList(@Param("areaCode") String areaCode, @Param("parentAgencyId") String parentAgencyId,@Param("allCustomerIds") List<String> allCustomerIds);
List<ParentListResultDTO> selectPAgencyById(@Param("listStr")List<String> 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);
}

26
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<ProjectDifficultRankResultDTO> difficultyRank(DifficultyRankFormDTO difficultyRankFormDTO);
/**
* 工作端-数据难点赌点列表查询V2,多客户版本
*
* @param formDTO
* @return com.epmet.project.dto.result.ProjectDifficultRankResultDTO
*/
List<ProjectDifficultRankResultDTO> difficultyRankV2(DifficultyRankFormDTO formDTO);
/**
* @Description 查询难点堵点的图片list
* @param
@ -74,4 +83,21 @@ public interface ProjectDao {
* @date 2020.10.20 10:13
**/
List<String> getDifficultyImgList(String eventId);
/**
* @return java.util.List<com.epmet.dto.result.project.MassesDiscontentResultV2DTO>
* @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<MassesDiscontentResultV2DTO> selectMassesDiscontentMultic(@Param("agencyId") String agencyId,
@Param("areaCode") String areaCode,
@Param("startDate") String startDate,
@Param("endDate") String endDate,
@Param("sortType") String sortType);
}

39
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<String, Object> 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<String, Object> map = BeanUtil.beanToMap(agencysResultDTO);
redisUtils.hMSet(agencyDetailKey, map, RedisUtils.DEFAULT_EXPIRE);
}
}

33
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<String> getNextAgencyIds(String areaCode,String agencyId);
AgencyInfoDTO getAgencyInfoDTO(String areaCode, String agencyId);
/**
* 查询当前组织的下一级组织可根据areaCode查询也可根据pid查询
*
* @param areaCode
* @param pid
* @param allSubCustomerIds 当前客户的所有子客户
* @return java.util.List<com.epmet.dto.result.ScreenCustomerAgencyDTO>
*/
List<ScreenCustomerAgencyDTO> queryNextAgencyList(String areaCode, String pid,List<String> allSubCustomerIds);
/**
* 查询当前组织的下面的网格可根据areaCode查询也可根据parentAgencyId查询
*
* @param areaCode
* @param parentAgencyId
* @param allSubCustomerIds 当前客户的所有子客户
* @return java.util.List<com.epmet.dto.result.ScreenCustomerAgencyDTO>
*/
List<ScreenCustomerGridDTO> queryGridList(String areaCode, String parentAgencyId,List<String> allSubCustomerIds);
/**
* 工作端小程序-数据上面的 当前组织调用此接口
*
* @param formDTO
* @return com.epmet.dto.result.AgencyDetailMulticResultDTO
*/
AgencyDetailMulticResultDTO queryAgencyDetailMultiC(AgencyDetailMulticFormDTO formDTO);
}

187
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<com.epmet.dto.result.ScreenCustomerAgencyDTO>
*/
@Override
public List<ScreenCustomerAgencyDTO> queryNextAgencyList(String areaCode, String pid,List<String> allSubCustomerIds) {
return screenCustomerAgencyDao.selectNextAgencyList(areaCode,pid,allSubCustomerIds);
}
/**
* 查询当前组织的下面的网格可根据areaCode查询也可根据parentAgencyId查询
*
* @param areaCode
* @param parentAgencyId
* @param allSubCustomerIds 当前客户的所有子客户
* @return java.util.List<com.epmet.dto.result.ScreenCustomerAgencyDTO>
*/
@Override
public List<ScreenCustomerGridDTO> queryGridList(String areaCode, String parentAgencyId,List<String> 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<ParentListResultDTO> 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<String> 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<List<String>> 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<ParentListResultDTO> 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<String> 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<ParentListResultDTO> getParentListMultic(List<ParentListResultDTO> 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;
}
}

69
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java

@ -26,6 +26,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
@ -133,30 +134,58 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService {
* @author wangc
* @date 2020.08.20 14:37
**/
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
@Override
public PublicPartiProfileResultDTO publicPartiProfile(AgencyFormDTO param) {
ScreenCustomerAgencyDTO agencyInfo = agencyInfo(param.getAgencyId());
Result<List<String>> crmResp = crmClient.getAllSubCustomerIds(agencyInfo.getCustomerId());
List<String> subCustomers;
if(null == crmResp || !crmResp.success()|| org.apache.commons.collections4.CollectionUtils.isEmpty(crmResp.getData())) {subCustomers = null ;}
else {subCustomers = crmResp.getData();}
String monthId = dateUtils.getPreviousMonthId(NumConstant.ONE);
UserJoinIndicatorGrowthRateResultDTO latest = new UserJoinIndicatorGrowthRateResultDTO();
if (StringUtils.isNotBlank(param.getAreaCode()) && "370124".equals(param.getAreaCode())) {
latest= screenUserJoinDao.selectUserJoinDataByAreaCode(param.getAreaCode(), monthId);
if (null == latest) {
log.warn(String.format("平阴县查询screen_user_join表为空,monthId:%s", monthId));
return new PublicPartiProfileResultDTO();
}
UserJoinIndicatorGrowthRateResultDTO beforeTwoMonth = screenUserJoinDao.selectUserJoinDataByAreaCode(param.getAreaCode(), dateUtils.getPreviousMonthId(NumConstant.TWO));
if (null == beforeTwoMonth) {
log.warn(String.format("平阴县查询screen_user_join表为空,monthId:%s",dateUtils.getPreviousMonthId(NumConstant.TWO)));
return new PublicPartiProfileResultDTO();
}else{
//举例,today is 20210707 , latest是06月份的数据,beforeTwoMonth是05月份的数据
String monthId = dateUtils.getCurrentMonthId();
UserJoinIndicatorGrowthRateResultDTO latest = CollectionUtils.isEmpty(subCustomers) ||StringUtils.isBlank(agencyInfo.getAreaCode())?
screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId) :
screenUserJoinDao.selectUserJoinDataByAreaCode(agencyInfo.getAreaCode(),monthId);
//保证获取公众参与概率数据的最大可能性
int time = NumConstant.TWELVE;
while ((null == latest || latest.getId() == null) && time > NumConstant.ONE) {
time--;
monthId = dateUtils.getPreviousMonthIdByDest(null, monthId);
latest = CollectionUtils.isEmpty(subCustomers)||StringUtils.isBlank(agencyInfo.getAreaCode()) ?
screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId) :
screenUserJoinDao.selectUserJoinDataByAreaCode(agencyInfo.getAreaCode(),monthId);
}
// 总参与数6月份比5月份增加了?
int incrTotal = latest.getTotal() - beforeTwoMonth.getTotal();
// 总参与数月增长:增加的占5月份的占比???
BigDecimal monthIncr = NumConstant.ZERO == beforeTwoMonth.getTotal() ? BigDecimal.ZERO : BigDecimal.valueOf(incrTotal / beforeTwoMonth.getTotal());
latest.setMonthIncr(monthIncr);
latest.setMonthTrend(monthIncr.compareTo(BigDecimal.ZERO) > 0 ? "incr" : "decr");
//人均议题数6月份比五月份增加了?
BigDecimal issueIncrTotal = latest.getAverageIssue().subtract(beforeTwoMonth.getAverageIssue());
//人均议题数月增长:增加的占5月份的占比???
BigDecimal issueCompareLatestMonth = BigDecimal.ZERO.compareTo(beforeTwoMonth.getAverageIssue()) == 0 ? BigDecimal.ZERO : issueIncrTotal.divide(beforeTwoMonth.getAverageIssue(), 2, RoundingMode.HALF_UP);
latest.setIssueCompareLatestMonth(issueCompareLatestMonth);
latest.setIssueCompareLatestTrend(issueCompareLatestMonth.compareTo(BigDecimal.ZERO) > 0 ? "incr" : "decr");
if (null == latest) return new PublicPartiProfileResultDTO();
// 平均参与度6月份比5月份增加了?
BigDecimal incrJoinCompareLatestMonth=latest.getJoinCompareLatestMonth().subtract(beforeTwoMonth.getJoinCompareLatestMonth());
//平均参与度月增长:增加的占5月份的占比???
BigDecimal joinCompareLatestMonth = BigDecimal.ZERO.compareTo(beforeTwoMonth.getJoinCompareLatestMonth()) == 0 ? BigDecimal.ZERO : incrJoinCompareLatestMonth.divide(beforeTwoMonth.getJoinCompareLatestMonth(), 2, RoundingMode.HALF_UP);
latest.setJoinCompareLatestMonth(joinCompareLatestMonth);
latest.setJoinCompareLatestTrend(joinCompareLatestMonth.compareTo(BigDecimal.ZERO) > 0 ? "incr" : "decr");
}
} else {
latest = screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId);
//保证获取公众参与概率数据的最大可能性
int time = NumConstant.TWELVE;
while ((null == latest || latest.getId() == null) && time > NumConstant.ONE) {
time--;
monthId = dateUtils.getPreviousMonthIdByDest(null, monthId);
latest = screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId);
}
}
if (null == latest) {
return new PublicPartiProfileResultDTO();
}
PublicPartiProfileResultDTO result = ConvertUtils.sourceToTarget(latest, PublicPartiProfileResultDTO.class);
result.setMonthIncr(convertPercentStr(latest.getMonthIncr(), NumConstant.ZERO));
result.setJoinCompareLatestMonth(convertPercentStr(latest.getJoinCompareLatestMonth().abs(), NumConstant.ZERO));

2
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);
}

29
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<ProjectDifficultRankResultDTO> getDifficultyRank(DifficultyRankFormDTO param);
/**
* 难点赌点-耗时最长|涉及部门最多|处理次数
*
* @param formDTO
* @return com.epmet.project.dto.result.ProjectDifficultRankResultDTO
*/
List<ProjectDifficultRankResultDTO> 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<ProjectCategoryDictResultDTO> getCategoryDict(String customerId);
/**
* 001难点堵点-组织下拉框
* 需求描述下拉框显示当前用户所属组织和下级组织 1如果当前用户是街道工作人员 显示所属街道和该街道下的社区+直属网格2如果当前用户是社区人员 显示所属社区和该社区下的网格+直属网格
* 210622: 新增此API 后端改为从指标库取值 保证平阴县的工作人员看到的下拉框是平阴县以及8个街道
*
* @param staffId 当前登录用户id
* @param currentCustomerId 当前客户id
* @return com.epmet.project.dto.result.ProjectNextAgencyResultDTO
*/
List<ProjectNextAgencyResultDTO> myNextAgencyMultic(String staffId,String currentCustomerId);
/**
* 群众不满列表改为从指标库的screen_project_data取值sql里面写死<75分的展示
*
* @param formDTO
* @return com.epmet.dto.result.project.MassesDiscontentResultV2DTO
*/
List<MassesDiscontentResultV2DTO> queryMassesDiscontentMultic(MassesDiscontentFormV2DTO formDTO);
}

187
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<ProjectDifficultRankResultDTO> difficultyRankMultic(DifficultyRankFormDTO formDTO) {
//1、查询当前客户是否包含子客户
//多客户测试写死值,别忘了注释掉呀
// formDTO.setCustomerId("613cc61a6b8ce4c70d21bd413dac72cc");
// formDTO.setAgencyId("30705f91f1295ae77d372b868596a5e7");
//06.24决定areaCode让前端传入, 前端从前端从/data/report/screen/agency/agencydetail这取值取值
/*Result<List<String>> crmRes = operCrmOpenFeignClient.getAllSubCustomerIds(formDTO.getCustomerId());
if (crmRes.success() && CollectionUtils.isNotEmpty(crmRes.getData())) {
log.warn("❤当前客户存在子客户❤");
//2、查询组织信息
Result<CustomerAgencyDTO> 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<ProjectDifficultRankResultDTO> result = projectDao.difficultyRankV2(formDTO);
for (int i = 0; i < result.size(); i++) {
List<String> imgUrlList = projectDao.getDifficultyImgList(result.get(i).getProjectId());
result.get(i).setImgUrlList(imgUrlList);
}
if (CollectionUtils.isEmpty(result)) {
return new ArrayList<>();
}
return result;
}
@Override
public List<ProjectCategoryDictResultDTO> getCategoryDict(String customerId) {
List<ProjectCategoryDictResultDTO> 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<ProjectNextAgencyResultDTO> myNextAgencyMultic(String staffId,String currentCustomerId) {
//多客户测试写死值,别忘了注释掉呀
// staffId="3f04e397cc226e4e2f2531ac4363e3f9";
// currentCustomerId="613cc61a6b8ce4c70d21bd413dac72cc";
//1、当前工作人员所属组织信息
Result<CustomerAgencyDTO> staffResult = govOrgOpenFeignClient.getAgencyByStaff(staffId);
if (!staffResult.success() || null == staffResult.getData()) {
throw new RenException(String.format("查询当前工作人员所属组织信息异常,staffId:%s", staffId));
}
List<ProjectNextAgencyResultDTO> 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<ScreenCustomerAgencyDTO> agencyDTOList =new ArrayList<>();
Result<List<String>> 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<ScreenCustomerGridDTO> 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<MassesDiscontentResultV2DTO> 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<MassesDiscontentResultV2DTO> 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;
}
}

8
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/DateUtils.java

@ -107,17 +107,17 @@ public class DateUtils {
}
/**
* @Description 得到上个月的monthId
* @param
* @Description 前n个月
* @param beforeMonthNum
* @return
* @author wangc
* @date 2020.08.20 10:19
**/
public String getPreviousMonthId(){
public String getPreviousMonthId(int beforeMonthNum){
SimpleDateFormat format = new SimpleDateFormat("yyyyMM");
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date()); // 设置为当前时间
calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) - 1); // 设置为上一个月
calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) - beforeMonthNum); // 设置为上一个月
return format.format(calendar.getTime());
}

113
epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml

@ -267,6 +267,78 @@
DESC
</select>
<!-- 工作端-数据:难点赌点列表查询V2,多客户版本 -->
<select id="difficultyRankV2" parameterType="com.epmet.project.dto.form.DifficultyRankFormDTO" resultType="com.epmet.project.dto.result.ProjectDifficultRankResultDTO">
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'
<if test="areaCode != null and areaCode != ''">
and scg.AREA_CODE like concat(#{areaCode},'%')
</if>
<if test="areaCode == null || areaCode == ''">
<choose>
<when test="orgType != null and orgType == 'grid'">
AND sdd1.ORG_ID = #{agencyId,jdbcType=VARCHAR}
</when>
<otherwise>
AND sdd1.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%')
</otherwise>
</choose>
</if>
<if test="status!= null and status == 'pending'">
AND sdd1.EVENT_STATUS_CODE in('pending','0')
</if>
<if test="status!= null and status == 'closed'">
AND sdd1.EVENT_STATUS_CODE in('closed','10','5')
</if>
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'
<if test="areaCode != null and areaCode != ''">
and sca.AREA_CODE like concat(#{areaCode},'%')
</if>
<if test="areaCode == null || areaCode == ''">
<choose>
<when test="orgType != null and orgType == 'grid'">
AND sdd2.ORG_ID = #{agencyId,jdbcType=VARCHAR}
</when>
<otherwise>
AND sdd2.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%')
</otherwise>
</choose>
</if>
<if test="status!= null and status == 'pending'">
AND sdd2.EVENT_STATUS_CODE in('pending','0')
</if>
<if test="status!= null and status == 'closed'">
AND sdd2.EVENT_STATUS_CODE in('closed','10','5')
</if>
) 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>
<!-- 查询难点赌点-耗时最长|涉及部门最多|处理次数 -->
<select id="getDifficultyImgList" resultType="string">
select EVENT_IMG_URL
@ -275,4 +347,45 @@
WHERE EVENT_ID = #{eventId}
ORDER BY SORT
</select>
<!-- 群众不满列表,改为从指标库的screen_project_data取值 sql里面写死<75分的展示 -->
<select id="selectMassesDiscontentMultic" parameterType="map" resultType="com.epmet.dto.result.project.MassesDiscontentResultV2DTO">
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' ) &gt;= #{startDate}
AND DATE_FORMAT( spd.CLOSE_CASE_TIME, '%Y%m%d' ) &lt;= #{endDate}
AND spd.SATISFACTION_SCORE &lt; 75
<choose >
<when test="areaCode != null and areaCode.trim() != ''">
and sca.area_code is not null
and sca.area_code like concat(#{areaCode},'%')
</when>
<otherwise>
and spd.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%')
</otherwise>
</choose>
<if test="sortType == 'desc' ">
ORDER BY spd.SATISFACTION_SCORE DESC,spd.CLOSE_CASE_TIME desc
</if>
<if test="sortType == 'asc' ">
ORDER BY spd.SATISFACTION_SCORE ASC,spd.CLOSE_CASE_TIME desc
</if>
</select>
</mapper>

90
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}
</select>
<select id="selectRootAgencyIdByBizType" resultType="com.epmet.evaluationindex.screen.dto.result.TreeResultDTO">
@ -340,4 +341,93 @@
AND cg.ALL_PARENT_IDS LIKE CONCAT(#{agencyId}, '%')
</if>
</select>
<!-- 查询当前组织的下一级组织,可根据areaCode查询,也可根据pid查询 -->
<select id="selectNextAgencyList" parameterType="map" resultType="com.epmet.dto.result.ScreenCustomerAgencyDTO">
SELECT
*
FROM
screen_customer_agency sca
WHERE
sca.DEL_FLAG = '0'
<if test="pid != null and pid != ''">
AND sca.PID = #{pid}
</if>
<if test="areaCode != null and areaCode != ''">
AND sca.PARENT_AREA_CODE =#{areaCode}
</if>
<if test="allCustomerIds != null and allCustomerIds.size() > 0">
and sca.customer_id in
<foreach collection="allCustomerIds" item="customerId" open="(" separator="," close=" )">
#{customerId}
</foreach>
</if>
</select>
<!-- 查询当前组织的下面的网格,可根据areaCode查询,也可根据parentAgencyId查询 -->
<select id="selectGridDTOList" parameterType="map" resultType="com.epmet.dto.ScreenCustomerGridDTO">
SELECT
*
FROM
screen_customer_grid scg
WHERE
scg.DEL_FLAG = '0'
<if test="areaCode != null and areaCode != ''">
AND scg.AREA_CODE = #{areaCode}
</if>
<if test="parentAgencyId != null and parentAgencyId != ''">
AND scg.PARENT_AGENCY_ID = #{parentAgencyId}
</if>
<if test="allCustomerIds != null and allCustomerIds.size() > 0">
and scg.customer_id in
<foreach collection="allCustomerIds" item="customerId" open="(" separator="," close=" )">
#{customerId}
</foreach>
</if>
</select>
<!-- 按照foreach中遍历的Id顺序排序(按组织机构自上而下排序) -->
<select id="selectPAgencyById" resultType="com.epmet.dto.result.ParentListResultDTO">
SELECT
sca.AGENCY_ID as id,
sca.AGENCY_NAME AS 'name',
level
from screen_customer_agency sca
WHERE del_flag = '0'
<if test="listStr != null and listStr.size() > 0">
AND AGENCY_ID IN
<foreach item="id" collection="listStr" open="(" separator="," close=")" index="">
#{id}
</foreach>
ORDER BY field(
AGENCY_ID,
<foreach item="id" collection="listStr" separator=",">
#{id}
</foreach>
)
</if>
</select>
<!-- 根据客户id,返回当前客户下的跟组织信息 -->
<select id="selectCustomerRootAgency" resultType="com.epmet.dto.result.ScreenCustomerAgencyDTO">
SELECT
sca.*
FROM
screen_customer_agency sca
WHERE
sca.DEL_FLAG = '0'
AND sca.PID = '0'
AND sca.CUSTOMER_ID = #{customerId}
</select>
<select id="selectByAreaCode" resultType="com.epmet.dto.result.ScreenCustomerAgencyDTO">
SELECT
sca.*
FROM
screen_customer_agency sca
WHERE
sca.DEL_FLAG = '0'
AND sca.AREA_CODE = #{areaCode}
limit 1
</select>
</mapper>

18
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml

@ -92,13 +92,13 @@
<if test="orgType != null and orgType != ''">
<choose>
<when test="orgType == 'grid'">
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'
</when>
<when test="orgType == 'agency'">
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'
</when>
<when test="orgType == 'department'">
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'
</when>
</choose>
</if>
@ -206,13 +206,13 @@
<if test="orgType != null and orgType != ''">
<choose>
<when test="orgType == 'grid'">
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'
</when>
<when test="orgType == 'agency'">
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'
</when>
<when test="orgType == 'department'">
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'
</when>
</choose>
</if>
@ -278,13 +278,13 @@
<if test="orgType != null and orgType != ''">
<choose>
<when test="orgType == 'grid'">
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'
</when>
<when test="orgType == 'agency'">
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'
</when>
<when test="orgType == 'department'">
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'
</when>
</choose>
</if>

10
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
<if test="orgType != null and orgType != ''">
<if test="orgType != null and orgType != ''">
<choose>
<when test="orgType == 'grid'">
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'
</when>
<when test="orgType == 'agency'">
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'
</when>
<when test="orgType == 'department'">
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'
<when test="orgType == 'department'">
INNER JOIN screen_customer_dept org ON org.DEPT_ID = score.ORG_ID AND org.DEL_FLAG = '0'
</when>
</choose>
</if>

16
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml

@ -60,15 +60,17 @@
<select id="projectDistributionDetail" resultType="com.epmet.evaluationindex.screen.dto.result.ScreenProjectDetailResultDTO">
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

42
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml

@ -28,36 +28,22 @@
<!-- 根据地区码查询用户参与数据 -->
<select id="selectUserJoinDataByAreaCode" resultType="com.epmet.evaluationindex.screen.dto.result.UserJoinIndicatorGrowthRateResultDTO">
SELECT
scj.ID,
IFNULL(avg( scj.JOIN_TOTAL ),0) AS total,
IFNULL(ROUND( avg( scj.AVG_JOIN ), 1 ),0) AS averageJoin,
IFNULL(avg( scj.JOIN_TOTAL_UP_RATE ),0) AS monthIncr,
(case when IFNULL(avg( scj.JOIN_TOTAL_UP_RATE ),0) &gt;0 then 'incr'
when IFNULL(avg( scj.JOIN_TOTAL_UP_RATE ),0) &lt; 0 then 'decr'
else 'eq'
end )as monthTrend,
ROUND( IFNULL(avg( scj.AVG_ISSUE ),0), 1 ) AS averageIssue,
IFNULL(avg( scj.AVG_ISSUE_UP_RATE ),0) AS issueCompareLatestMonth,
(
case when IFNULL(avg( scj.AVG_ISSUE_UP_RATE ),0) &gt; 0 then 'incr'
when IFNULL(avg( scj.AVG_ISSUE_UP_RATE ),0) &lt; 0 then 'decr'
else 'eq'
end
)as issueCompareLatestTrend,
IFNULL(avg( scj.AGVG_JOIN_UP_RATE) ,0) AS joinCompareLatestMonth,
(
case when IFNULL(avg( scj.AGVG_JOIN_UP_RATE ),0) &gt; 0 then 'incr'
when IFNULL(avg( scj.AGVG_JOIN_UP_RATE ),0) &lt; 0 then 'decr'
else 'eq'
end
)as joinCompareLatestTrend
ifnull(sum(suj.JOIN_TOTAL),0) as total,
0 as monthIncr,
''as monthTrend,
round(IFNULL(sum(suj.avg_issue_fz)/sum(suj.avg_issue_fm),0),2) as averageIssue,
0 as issueCompareLatestMonth,
'' as issueCompareLatestTrend,
round(ifnull(sum(suj.avg_join_fz)/sum(suj.avg_join_fm),0),2)as averageJoin,
0 as joinCompareLatestMonth,
'' as joinCompareLatestTrend
FROM
screen_user_join scj
LEFT JOIN screen_customer_agency agency ON scj.org_id = agency.agency_id
screen_user_join suj
INNER JOIN screen_customer_agency sca ON ( suj.ORG_ID = sca.AGENCY_ID AND sca.DEL_FLAG = '0' )
WHERE
scj.DEL_FLAG = '0'
AND scj.MONTH_ID = #{monthId}
AND agency.PARENT_AREA_CODE =#{areaCode}
suj.ORG_TYPE = 'agency'
AND sca.PARENT_AREA_CODE = #{areaCode}
AND suj.MONTH_ID = #{monthId}
</select>

88
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> 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;
}
}

88
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> 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;
}
}

200
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> 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;
}
}

146
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> dataList;
@Data
public static class DataList{
/**
* 客户Id dim_customer.id
*/
private String customerId;
/**
* 机关Id dim_agency.id
*/
private String agencyId;
/**
* 上级组织Iddim_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;
}
}

109
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> 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;
}
}

84
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> 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;
}
}

100
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> 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;
}
}

88
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> 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;
}
}

88
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> 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;
}
}

200
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> 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;
}
}

145
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> 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;
}
}

114
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> 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;
}
}

85
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> 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;
}
}

99
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> 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;
}
}

0
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/result/.gitkeep

181
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;
}

193
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;
}

28
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<FactAgencyGovernDailyDTO> dataList;
}

28
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<FactGridGovernDailyDTO> dataList;
}

20
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/form/UpdateProjectSatisfactionScoreFormDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.project.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 描述一下
*
* @author yinzuomei@elink-cn.com
* @date 2021/7/11 14:42
*/
@Data
public class UpdateProjectSatisfactionScoreFormDTO implements Serializable {
private static final long serialVersionUID = 8358341102854725024L;
private String projectId;
private String projectCustomerId;
private List<String> customerIdList;
}

29
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已删除
*/

4
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;
}

5
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;
}

29
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<ScreenGovernRankDataDailyDTO> dataList;
}

20
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinFormDTO.java

@ -50,6 +50,16 @@ public class UserJoinFormDTO implements Serializable {
*/
private BigDecimal avgIssue;
/**
* 人均议题分子
*/
private Integer avgIssueFz;
/**
* 人均议题分母
*/
private Integer avgIssueFm;
/**
* 总的参与次数
*/
@ -59,4 +69,14 @@ public class UserJoinFormDTO implements Serializable {
* 平均参与度
*/
private BigDecimal avgJoin;
/**
* 平均参与度分子
*/
private Integer avgJoinFz;
/**
* 平均参与度分母
*/
private Integer avgJoinFm;
}

13
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数据为空";
}

16
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/GovernConstant.java

@ -0,0 +1,16 @@
package com.epmet.constant;
/**
* @Author zxc
* @DateTime 2021/7/9 3:24 下午
* @DESC
*/
public interface GovernConstant {
/**
* 增长incr下降decr 相等 eq
*/
String INCR = "incr";
String DECR = "decr";
String EQ = "eq";
}

201
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();
}
}

34
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java

@ -23,6 +23,7 @@ import com.epmet.dto.extract.form.ExtractFactGridGovernDailyFromDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.form.ExtractScreenFormDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.project.form.UpdateProjectSatisfactionScoreFormDTO;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity;
@ -44,7 +45,9 @@ 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.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -123,6 +126,8 @@ public class DemoController {
private FactAgencyGovernDailyService factAgencyGovernDailyService;
@Autowired
private FactGridMemberStatisticsDailyService factGridMemberStatisticsDailyService;
@Autowired
private DimCustomerService dimCustomerService;
@GetMapping("testAlarm")
public void testAlarm() {
@ -944,4 +949,33 @@ 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(@RequestBody UpdateProjectSatisfactionScoreFormDTO formDTO){
if(StringUtils.isNotBlank(formDTO.getProjectId())){
screenProjectSettleService.updateProjectSatisfactionScore(formDTO.getProjectCustomerId(),null,formDTO.getProjectId());
return new Result().ok("项目满意度得分更新成功");
}
if(CollectionUtils.isNotEmpty(formDTO.getCustomerIdList())){
formDTO.getCustomerIdList().forEach(customerId->{
screenProjectSettleService.updateProjectSatisfactionScore(customerId,null,null);
log.info("更新完成");
});
}else{
List<String> customerIds=dimCustomerService.getAllCustomerId();
customerIds.forEach(customerId->{
screenProjectSettleService.updateProjectSatisfactionScore(customerId,null,null);
log.info("所有客户数据更新完成");
});
}
return new Result();
}
}

74
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();
}
}

6
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()));

22
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;
/**
@ -46,4 +46,24 @@ public interface ScreenProjectDataDao extends BaseDao<ScreenProjectDataEntity> {
void insertBatch(@Param("list") List<ScreenProjectDataDTO> list);
void updateBatch(@Param("list") List<ScreenProjectDataDTO> list,@Param("dateId") String dateId);
/**
* 根据项目ID删除数据
* @author zhaoqifeng
* @date 2021/7/9 17:33
* @param projectId
* @return int
*/
int deleteByProjectId(@Param("customerId") String customerId, @Param("projectId") String projectId);
/**
* 根据项目ID删除数据
* @author zhaoqifeng
* @date 2021/7/9 17:33
* @param list
* @return int
*/
void deleteByProjectIds(@Param("customerId") String customerId, @Param("list") List<String> list);
int updateProjectSatisfactionScore(@Param("projectId")String projectId, @Param("score")BigDecimal score);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.java

@ -37,4 +37,6 @@ public interface ScreenProjectImgDataDao extends BaseDao<ScreenProjectImgDataEnt
void deleteByProjectIds(@Param("list") List<String> list);
void insertBatch(@Param("list") List<ScreenProjectImgDataDTO> list);
int deleteByProjectId(@Param("customerId") String customerId, @Param("projectId") String projectId);
}

23
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserJoinDao.java

@ -37,7 +37,6 @@ public interface ScreenUserJoinDao extends BaseDao<ScreenUserJoinEntity> {
* 11基层治理-公众参与
* 0) 查询上月的基础数据可用来计算本月的增长率
* @param customerId
* @param yearId
* @param monthId
* @param orgIds 组织Id集合
* @return java.util.List<com.epmet.entity.screen.ScreenUserJoinEntity>
@ -45,7 +44,6 @@ public interface ScreenUserJoinDao extends BaseDao<ScreenUserJoinEntity> {
* @Date 14:46 2020-08-21
**/
List<ScreenUserJoinEntity> selectLastMonthScreenUserJoinList(@Param("customerId") String customerId,
@Param("yearId") String yearId,
@Param("monthId") String monthId,
@Param("orgIds") String[] orgIds);
@ -62,6 +60,17 @@ public interface ScreenUserJoinDao extends BaseDao<ScreenUserJoinEntity> {
Integer deleteUserJoin(@Param("customerId") String customerId,
@Param("monthId") String monthId);
/**
* @Description 根据类别删除
* @Param customerId
* @Param monthId
* @Param delFlag
* @author zxc
* @date 2021/7/9 2:21 下午
*/
Integer deleteUserJoinByCategory(@Param("customerId") String customerId,@Param("monthId") String monthId,
@Param("delFlag") String delFlag);
/**
* 11基层治理-公众参与
* 2) 在批量新增
@ -72,4 +81,14 @@ public interface ScreenUserJoinDao extends BaseDao<ScreenUserJoinEntity> {
* @Date 10:52 2020-08-18
**/
void batchInsertUserJoin(@Param("list") List<ScreenUserJoinEntity> list, @Param("customerId")String customerId);
/**
* @Description 根据月份查询screenUserJoin
* @Param customerId
* @Param monthId
* @Param flag agency grid
* @author zxc
* @date 2021/7/9 3:13 下午
*/
List<ScreenUserJoinEntity> selectScreenUserJoin(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("flag")String flag);
}

31
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<ProjectEntity> {
String selectValueByKey(@Param("customerId") String customerId, @Param("parameterKey") String parameterKey);
List<ProjectDTO> 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<String> selectEvaluateProjectIds(@Param("customerId") String customerId, @Param("dateId")String dateId);
/**
* 可根据状态筛选项目id
*
* @param customerId
* @param projectStatus 状态:待处理 pending结案closed
* @return
*/
List<String> selectClosedProjectIds(@Param("customerId")String customerId,
@Param("origin")String origin,
@Param("projectStatus")String projectStatus);
}

227
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<GridRegUserFormDTO.DataList> dataList);
/**
* @Description 根据dateId删除客户组织注册用户数据
* @author sun
*/
int delAgencyRegUser(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @Description 批量新增客户组织注册用户数据
* @author sun
*/
void insertBatchAgencyRegUser(@Param("list") List<AgencyRegUserFormDTO.DataList> dataList);
/**
* @Description 根据dateId删除客户网格群组总数数据
* @author sun
*/
int delGridGroupTotal(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @Description 批量新增客户网格群组总数数据
* @author sun
*/
void insertBatchGridGroupTotal(@Param("list") List<GridGroupTotalFormDTO.DataList> dataList);
/**
* @Description 根据dateId删除客户组织群组总数数据
* @author sun
*/
int delAgencyGroupTotal(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @Description 批量新增客户组织群组总数数据
* @author sun
*/
void insertBatchAgencyGroupTotal(@Param("list") List<AgencyGroupTotalFormDTO.DataList> dataList);
/**
* @Description 根据dateId删除客户网格热议话题数据
* @author sun
*/
int delGridHotTopic(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @Description 批量新增客户网格热议话题数据
* @author sun
*/
void insertBatchGridHotTopic(@Param("list") List<GridHotTopicFormDTO.DataList> dataList);
/**
* @Description 根据dateId删除客户组织热议话题数据
* @author sun
*/
int delAgencyHotTopic(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @Description 批量新增客户组织热议话题数据
* @author sun
*/
void insertBatchAgencyHotTopic(@Param("list") List<AgencyHotTopicFormDTO.DataList> 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<AgencyProjectFormDTO.DataList> 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<GridProjectFormDTO.DataList> 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<AgencyIssueFormDTO.DataList> 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<GridIssueFormDTO.DataList> 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<AgencyTopicIssueFormDTO.DataList> 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<GridTopicIssueFormDTO.DataList> 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<AgencyTopicStatusFormDTO.DataList> 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<GridTopicStatusFormDTO.DataList> dataList);
}

31
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;
}

5
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;
}

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenUserJoinEntity.java

@ -92,6 +92,16 @@ public class ScreenUserJoinEntity extends BaseEpmetEntity {
*/
private BigDecimal avgIssue;
/**
* 人均议题分子
*/
private Integer avgIssueFz;
/**
* 人均议题分母
*/
private Integer avgIssueFm;
/**
* 人均议题较上月增长率(采集的时候后台自己计算)
*/
@ -107,6 +117,16 @@ public class ScreenUserJoinEntity extends BaseEpmetEntity {
*/
private BigDecimal avgJoin;
/**
* 平均参与度分子
*/
private Integer avgJoinFz;
/**
* 平均参与度分母
*/
private Integer avgJoinFm;
/**
* 平均参与度较上月增长率(采集的时候后台自己计算)
*/

39
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/mq/ProjectChangedCustomListener.java

@ -5,6 +5,8 @@ import com.epmet.commons.rocketmq.messages.ProjectChangedMQMsg;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.service.evaluationindex.extract.todata.FactOriginExtractService;
@ -21,6 +23,7 @@ import org.apache.rocketmq.common.message.MessageExt;
import org.redisson.api.RLock;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.redis.core.RedisTemplate;
import javax.annotation.PreDestroy;
import java.util.Date;
@ -41,24 +44,16 @@ import java.util.stream.Collectors;
public class ProjectChangedCustomListener implements MessageListenerConcurrently {
private Logger logger = LoggerFactory.getLogger(getClass());
/**
* 控制通知类型消息的消费频率
*/
private static final Cache<String, String> customerIdCache = CacheBuilder.newBuilder().maximumSize(NumConstant.ONE_HUNDRED)
.expireAfterWrite(NumConstant.THIRTY,TimeUnit.SECONDS).build();
private RedisUtils redisUtils;
@Override
public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> msgs, ConsumeConcurrentlyContext context) {
long start = System.currentTimeMillis();
try {
List<String> customerIds = msgs.stream().map(messageExt -> new String(messageExt.getBody())).distinct().collect(Collectors.toList());
for (String customerId : customerIds) {
//获取缓存 如果不存在缓存中 则执行消费 并放入缓存中
String ifPresent = customerIdCache.getIfPresent(customerId);
if (StringUtils.isBlank(ifPresent)){
consumeMessage(customerId);
customerIdCache.put(customerId,customerId);
}
List<String> msgStrs = msgs.stream().map(messageExt -> new String(messageExt.getBody())).distinct().collect(Collectors.toList());
for (String msgStr : msgStrs) {
consumeMessage(msgStr);
}
} catch (Exception e) {
//失败不重发
@ -76,6 +71,23 @@ public class ProjectChangedCustomListener implements MessageListenerConcurrently
log.warn("consumeMessage msg body is blank");
return;
}
if (redisUtils == null) {
redisUtils = SpringContextUtils.getBean(RedisUtils.class);
}
String redisKey = RedisKeys.getProjectChangedMsgDistinceKey(msgObj.getCustomerId());
if (redisUtils.get(redisKey) == null) {
consumeMessage(msgObj);
log.info("消费了项目变动消息,customer id:{}", msgObj.getCustomerId());
// 有效期30秒
redisUtils.set(redisKey, msg, 30);
} else {
log.info("该客户的项目变动消息刚刚消费,请等待30秒,customer id:{}", msgObj.getCustomerId());
}
}
public void consumeMessage(ProjectChangedMQMsg msgObj) {
DistributedLock distributedLock = null;
RLock lock = null;
try {
@ -128,6 +140,7 @@ public class ProjectChangedCustomListener implements MessageListenerConcurrently
}
}
}
@PreDestroy
public void saveCalStatus() {
//todo

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save