Browse Source

Merge remote-tracking branch 'remotes/origin/dev_screen_data_2.0' into dev_temp

# Conflicts:
#	epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java
#	epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java
master
jianjun 5 years ago
parent
commit
5041f11abf
  1. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java
  2. 14
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java
  3. 19
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ProjectEvaluateConstant.java
  4. 155
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMainDailyDTO.java
  5. 128
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectOrgPeriodDailyDTO.java
  6. 16
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFormDTO.java
  7. 20
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractIndexFormDTO.java
  8. 148
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GovernAbilityGridMonthlyFormDTO.java
  9. 20
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridHeartedFormDTO.java
  10. 30
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridIssueCountResultDTO.java
  11. 178
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/PartyAbilityGridMonthlyFormDTO.java
  12. 30
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/AutoNoMyResultDTO.java
  13. 16
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/CalSatisfactionResultDTO.java
  14. 25
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/CreateTopicCountResultDTO.java
  15. 25
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridProjectClosedTotalResultDTO.java
  16. 31
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridProjectCountResultDTO.java
  17. 30
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridUserCountResultDTO.java
  18. 32
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/NotReturnProjectResultDTO.java
  19. 25
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgResponseTimeResultDTO.java
  20. 21
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgStatisticsResultDTO.java
  21. 25
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyActiveResultDTO.java
  22. 25
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyCreateGroupCountResultDTO.java
  23. 37
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ProjectEvaluateResultDTO.java
  24. 24
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ProjectParticipatedAgencyResultDTO.java
  25. 25
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PublishCountResultDTO.java
  26. 25
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ShiftProjectCountResultDTO.java
  27. 41
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/ExtractGroupMemberActionRecordResultDTO.java
  28. 20
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/FinishOrgDTO.java
  29. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProcessInfoDTO.java
  30. 95
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgPeriodResultDTO.java
  31. 49
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgRelationWhenResponseResultDTO.java
  32. 36
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/result/GridAttributesResultDTO.java
  33. 23
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java
  34. 26
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java
  35. 210
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/FactExtractOpenFeignClientFallBack.java
  36. 52
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  37. 84
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java
  38. 37
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexOriginExtractController.java
  39. 139
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java
  40. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java
  41. 51
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java
  42. 89
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java
  43. 55
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java
  44. 99
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java
  45. 52
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicLogDailyDao.java
  46. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java
  47. 34
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java
  48. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java
  49. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java
  50. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java
  51. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java
  52. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java
  53. 32
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java
  54. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimAgencyDao.java
  55. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java
  56. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java
  57. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedAgencyDailyDao.java
  58. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedGridDailyDao.java
  59. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java
  60. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java
  61. 119
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMainDailyEntity.java
  62. 98
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectOrgPeriodDailyEntity.java
  63. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/CalCpcIndexService.java
  64. 36
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/CalGridIndexService.java
  65. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactIndexGovernAbilityGridMonthlyService.java
  66. 31
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactIndexPartyAbilityGridMonthlyService.java
  67. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactIndexServiceAbilityGridMonthlyService.java
  68. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginExtractService.java
  69. 94
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginProjectLogDailyService.java
  70. 53
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginProjectMainDailyService.java
  71. 50
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicLogDailyService.java
  72. 26
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicMainDailyService.java
  73. 34
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/GroupExtractService.java
  74. 78
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java
  75. 26
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/ProjectExtractService.java
  76. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/ProjectPeriodExtractService.java
  77. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexOriginExtractService.java
  78. 105
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java
  79. 435
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalCpcIndexServiceImpl.java
  80. 425
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java
  81. 37
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactIndexGovernAbilityGridMonthlyServiceImpl.java
  82. 37
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactIndexPartyAbilityGridMonthlyServiceImpl.java
  83. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactIndexServiceAbilityGridMonthlyServiceImpl.java
  84. 107
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginExtractServiceImpl.java
  85. 145
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginProjectLogDailyServiceImpl.java
  86. 62
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginProjectMainDailyServiceImpl.java
  87. 77
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicLogDailyServiceImpl.java
  88. 47
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicMainDailyServiceImpl.java
  89. 145
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/GroupExtractServiceImpl.java
  90. 113
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java
  91. 177
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/ProjectExtractServiceImpl.java
  92. 104
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/ProjectPeriodExtractServiceImpl.java
  93. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java
  94. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyService.java
  95. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollCommunityService.java
  96. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollDistrictDepartmentService.java
  97. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollDistrictService.java
  98. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollStreetService.java
  99. 23
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityOrgMonthlyServiceImpl.java
  100. 23
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityOrgMonthlyServiceImpl.java

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java

@ -38,6 +38,7 @@ public interface NumConstant {
int ONE_THOUSAND = 1000;
int MAX = 99999999;
int EIGHTY_EIGHT = 88;
int EIGHTY = 80;
double ZERO_DOT_ZERO = 0.0;

14
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java

@ -18,4 +18,18 @@ public interface ExtractConstant {
String ISSUE_PROCESS = "查询查询议题process集合为空";
String SHIFT_PROJECT = "shift_project";
String CLOSED = "closed";
String GRID_ORG_TYPE = "grid";
String RETURN_ACTION_CODE = "return";
String EVALUATE_BAD = "bad";
String EVALUATE_GOOD = "good";
String EVALUATE_PERFECT = "perfect";
}

19
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ProjectEvaluateConstant.java

@ -0,0 +1,19 @@
package com.epmet.constant;
import com.epmet.commons.tools.constant.NumConstant;
/**
* @Author zxc
* @DateTime 2020/9/18 3:49 下午
*/
public interface ProjectEvaluateConstant {
// BigDecimal BAD = new BigDecimal(NumConstant.SIXTY);
// BigDecimal GOOD = new BigDecimal(NumConstant.EIGHTY);
// BigDecimal PERFECT = new BigDecimal(NumConstant.ONE_HUNDRED);
Integer BAD = NumConstant.SIXTY;
Integer GOOD = NumConstant.EIGHTY;
Integer PERFECT = NumConstant.ONE_HUNDRED;
}

155
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMainDailyDTO.java

@ -0,0 +1,155 @@
/**
* 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.extract;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO;
import lombok.Data;
/**
* 业务数据抽取-小组相关
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-16
*/
@Data
public class FactOriginGroupMainDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 组的Id
*/
private String id;
private String customerId;
/**
* 状态审核通过 - approved 审核中 - under_auditting 审核未通过 - rejected 已屏蔽 - hidden 已关闭 - closed
Ps: 如果一个小组被拒绝当前小组的状态将永久停留在审核未通过
*/
private String groupState;
/**
* 小组所在网格Id
*/
private String gridId;
/**
* 小组所在机关Id
*/
private String agencyId;
/**
* 小组所在组织的父机关Id
*/
private String parentId;
/**
* 小组所在组织所有父类Id集合
*/
private String pids;
/**
* 建群申请审核通过的时期
*/
private String dateId;
/**
* 建群申请审核通过的周期
*/
private String weekId;
/**
* 建群申请审核通过的月份
*/
private String monthId;
/**
* 建群申请审核通过的季度
*/
private String quarterId;
/**
* 建群申请审核通过的年
*/
private String yearId;
/**
* 群众人数
*/
private Integer resiMemberCount;
/**
* 组内总人数
*/
private Integer memberTotal;
/**
* 群主ID
*/
private String groupOwnerId;
/**
* 群主是否热心居民 可以update
*/
private Integer isOwnerHearted;
/**
* 群主是否党员 可以update
*/
private Integer isOwnerParty;
/**
* 删除标识 默认为0
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
*
*/
private String createdBy;
/**
*
*/
private Date createdTime;
/**
*
*/
private String updatedBy;
/**
*
*/
private Date updatedTime;
private List<ExtractGroupMemberActionRecordResultDTO> members = new ArrayList();
}

128
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectOrgPeriodDailyDTO.java

@ -0,0 +1,128 @@
/**
* 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.extract;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 业务数据抽取-机关项目响应时间
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-16
*/
@Data
public class FactOriginProjectOrgPeriodDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String id;
private String customerId;
/**
* 项目ID
*/
private String projectId;
/**
*
*/
private String orgId;
/**
* grid agenct dept
*/
private String orgType;
/**
* 如果是机关则为父级机关(若已是顶级机关则为0)如果是网格和部门则为所属机关
*/
private String pid;
/**
* 最后一个节点是PID若无则为空
*/
private String pids;
/**
* 流转到的日期
*/
private Date informedDate;
/**
* 流转走或结案的日期
*/
private Date handledDate;
/**
* 响应时长从流转到自己到流转走共耗时/小时(不算法定节假日和周末)
*/
private Integer totalPeriod;
/**
* 截至第一次响应时长从流转到第一次处理(响应结案流转)耗时大于等于上一项值
*/
private Integer periodTillReplyFirstly;
/**
* resloved unresolved
*/
private String isResolved;
/**
* 办结的操作return(回退)transfer(流转)closed(结案)但是不包括response(响应)
* */
private String operation;
/**
* 删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
*
*/
private Date createdTime;
/**
*
*/
private String createdBy;
/**
*
*/
private Date updatedTime;
/**
*
*/
private String updatedBy;
}

16
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFormDTO.java

@ -15,11 +15,21 @@ public class ExtractFormDTO implements Serializable {
private static final long serialVersionUID = -6180252151765854242L;
public interface ExtractForm extends CustomerClientShowGroup{}
public interface ExtractForm extends CustomerClientShowGroup {
}
@NotBlank(message = "客户ID不能为空",groups = ExtractForm.class)
@NotBlank(message = "客户ID不能为空", groups = ExtractForm.class)
private String customerId;
@NotBlank(message = "dateId不能为空",groups = ExtractForm.class)
@NotBlank(message = "dateId不能为空", groups = ExtractForm.class)
private String dateId;
/**
* 开始时间
*/
private String startDate;
/**
* 结束时间
*/
private String endDate;
}

20
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractIndexFormDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.extract.form;
import lombok.Data;
import java.io.Serializable;
/**
* desc抽取指标数据 参数dto
*/
@Data
public class ExtractIndexFormDTO implements Serializable {
private static final long serialVersionUID = 1248641210655148366L;
private String customerId;
private String monthId;
}

148
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GovernAbilityGridMonthlyFormDTO.java

@ -0,0 +1,148 @@
/**
* 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.extract.form;
import java.io.Serializable;
import java.util.Date;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.math.BigDecimal;
/**
* 治理能力-网格相关事实表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-18
*/
@Data
public class GovernAbilityGridMonthlyFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID 主键
*/
private String id;
/**
* 客户Id
*/
private String customerId;
/**
* 网格所属机关Id
*/
private String agencyId;
/**
* 网格Id
*/
private String gridId;
/**
* 月维度IdyyyyMM
*/
private String monthId;
/**
* 季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4
*/
private String quarterId;
/**
* 年Id:yyyy
*/
private String yearId;
/**
* 网格总议题数
*/
private Integer issueTotal;
/**
* 网格人均议题数目
*/
private Integer avgIssueCount;
/**
* 网格议题转项目率
*/
private BigDecimal issueToProjectRatio;
/**
* 网格总项目数
*/
private Integer projectTotal;
/**
* 网格自治项目数 统计期网格自身内办结的项目数目
*/
private Integer selfSolveProjectCount;
/**
* 网格办结项目数 统计期内办结的项目数目
*/
private Integer resolveProjectCount;
/**
* 网格吹哨部门准确率
*/
private BigDecimal transferRightRatio;
/**
* 网格内解决的项目的满意度
*/
private BigDecimal satisfactionRatio;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 更新人
*/
private String updatedBy;
public GovernAbilityGridMonthlyFormDTO() {
this.issueTotal = NumConstant.ZERO;
this.avgIssueCount = NumConstant.ZERO;
this.issueToProjectRatio = new BigDecimal(NumConstant.ZERO);
this.projectTotal = NumConstant.ZERO;
this.selfSolveProjectCount = NumConstant.ZERO;
this.resolveProjectCount = NumConstant.ZERO;
this.transferRightRatio = new BigDecimal(NumConstant.ZERO);
this.satisfactionRatio = new BigDecimal(NumConstant.ZERO);
this.delFlag = NumConstant.ZERO_STR;
this.revision = NumConstant.ZERO;
this.createdBy = "APP_USER";
this.updatedBy = "APP_USER";
}
}

20
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridHeartedFormDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.extract.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @ClassName GridHeartedFormDTO
* @Auth wangc
* @Date 2020-09-20 12:42
*/
@Data
public class GridHeartedFormDTO implements Serializable {
private static final long serialVersionUID = 9069263069122734316L;
private String userId;
private String gridId;
}

30
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridIssueCountResultDTO.java

@ -0,0 +1,30 @@
package com.epmet.dto.extract.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/18 10:12 上午
*/
@Data
public class GridIssueCountResultDTO implements Serializable {
private static final long serialVersionUID = -1222149631076688225L;
/**
* 网格总议题数目
*/
private Integer issueTotal;
/**
* 网格人均议题数目
*/
private Integer avgIssueCount;
/**
* 网格ID
*/
private String gridId;
}

178
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/PartyAbilityGridMonthlyFormDTO.java

@ -0,0 +1,178 @@
/**
* 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.extract.form;
import java.io.Serializable;
import java.util.Date;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.math.BigDecimal;
/**
* 党建能力-网格相关事实表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-19
*/
@Data
public class PartyAbilityGridMonthlyFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID 主键
*/
private String id;
/**
* 客户Id
*/
private String customerId;
/**
* 机关Id
*/
private String agencyId;
/**
* 网格Id
*/
private String gridId;
/**
* 月维度Id:yyyyMM
*/
private String monthId;
/**
* 季度Id yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4
*/
private String quarterId;
/**
* 年Idyyyy
*/
private String yearId;
/**
* 网格群众用户数
*/
private Integer userCount;
/**
* 网格党员用户数
*/
private Integer partyCount;
/**
* 网格活跃群众用户数
*/
private Integer activeUserCount;
/**
* 网格活跃党员用户数
*/
private Integer activePartyCount;
/**
* 网格党员人均提出话题数
*/
private Integer partyAvgTopicCount;
/**
* 网格群众人均提出话题数
*/
private Integer userAvgTopicCount;
/**
* 网格党员人均提出的议题转项目数
*/
private Integer partyAvgShiftProjectCount;
/**
* 网格群众人均提出的议题转项目数
*/
private Integer userAvgShiftProjectCount;
/**
* 建群党员数累计值 去重
*/
private Integer createGroupPartyCount;
/**
* 网格发文数
*/
private Integer publishArticleCount;
/**
* 网格议题转项目率
*/
private BigDecimal issueToProjectRatio;
/**
* 组织三会一课次数
*/
private Integer createThreeMeetsCount;
/**
* 党员参加三会一课人次
*/
private Integer joinThreeMeetsCount;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 更新人
*/
private String updatedBy;
public PartyAbilityGridMonthlyFormDTO() {
this.userCount = NumConstant.ZERO;
this.partyCount = NumConstant.ZERO;
this.activeUserCount = NumConstant.ZERO;
this.activePartyCount = NumConstant.ZERO;
this.partyAvgTopicCount = NumConstant.ZERO;
this.userAvgTopicCount = NumConstant.ZERO;
this.partyAvgShiftProjectCount = NumConstant.ZERO;
this.userAvgShiftProjectCount = NumConstant.ZERO;
this.createGroupPartyCount = NumConstant.ZERO;
this.publishArticleCount = NumConstant.ZERO;
this.issueToProjectRatio = new BigDecimal(NumConstant.ZERO);
this.createThreeMeetsCount = NumConstant.ZERO;
this.joinThreeMeetsCount = NumConstant.ZERO;
this.delFlag = NumConstant.ZERO_STR;
this.revision = NumConstant.ZERO;
this.createdBy = "APP_USER";
this.updatedBy = "APP_USER";
}
}

30
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/AutoNoMyResultDTO.java

@ -0,0 +1,30 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/18 5:22 下午
*/
@Data
public class AutoNoMyResultDTO implements Serializable {
private static final long serialVersionUID = 5812052000386418907L;
/**
* 动作code
*/
private String actionCode;
/**
* 网格ID
*/
private String gridId;
/**
* 项目ID
*/
private String projectId;
}

16
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/CalSatisfactionResultDTO.java

@ -0,0 +1,16 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/18 4:01 下午
*/
@Data
public class CalSatisfactionResultDTO implements Serializable {
private static final long serialVersionUID = -7514945819312915670L;
}

25
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/CreateTopicCountResultDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/19 1:55 下午
*/
@Data
public class CreateTopicCountResultDTO implements Serializable {
private static final long serialVersionUID = 500844515980125608L;
/**
* 网格ID
*/
private String gridId;
/**
* 网格 党员/群众 人均提出话题数
*/
private Integer createTopicCount;
}

25
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridProjectClosedTotalResultDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/18 2:02 下午
*/
@Data
public class GridProjectClosedTotalResultDTO implements Serializable {
private static final long serialVersionUID = 5144371528837124674L;
/**
* 网格ID
*/
private String gridId;
/**
* 网格办结项目数
*/
private Integer resolveProjectCount;
}

31
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridProjectCountResultDTO.java

@ -0,0 +1,31 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Author zxc
* @DateTime 2020/9/18 1:22 下午
*/
@Data
public class GridProjectCountResultDTO implements Serializable {
private static final long serialVersionUID = -1348707512443965601L;
/**
* 网格总项目数
*/
private Integer projectTotal;
/**
* 网格ID
*/
private String gridId;
/**
* 网格议题转项目率
*/
private BigDecimal issueToProjectRatio;
}

30
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridUserCountResultDTO.java

@ -0,0 +1,30 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/19 10:59 上午
*/
@Data
public class GridUserCountResultDTO implements Serializable {
private static final long serialVersionUID = -2912049598149499392L;
/**
* 注册居民本月增量
*/
private Integer userCount;
/**
* 注册党员本月增量
*/
private Integer partyCount;
/**
* 网格ID
*/
private String gridId;
}

32
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/NotReturnProjectResultDTO.java

@ -0,0 +1,32 @@
package com.epmet.dto.extract.result;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Author zxc
* @DateTime 2020/9/18 2:46 下午
*/
@Data
public class NotReturnProjectResultDTO implements Serializable {
private static final long serialVersionUID = -2931817313224740122L;
/**
* 网格ID
*/
private String gridId;
/**
* 未被退回的项目
*/
private Integer notReturnProject = NumConstant.ZERO;
/**
* 网格吹哨部门准确率
*/
private BigDecimal transferRightRatio = new BigDecimal(NumConstant.ZERO);
}

25
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgResponseTimeResultDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Description 各机关响应时间
* @ClassName OrgResponseTimeResultDTO
* @Auth wangc
* @Date 2020-09-21 02:03
*/
@Data
public class OrgResponseTimeResultDTO implements Serializable {
private static final long serialVersionUID = 6017440139236985959L;
private String agencyId;
private BigDecimal responseTime;
private BigDecimal projectTotal;
private BigDecimal distinctProjectTotal;
}

21
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgStatisticsResultDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/18 14:39
*/
@Data
public class OrgStatisticsResultDTO implements Serializable {
private static final long serialVersionUID = 9221060553279124719L;
private String customerId;
private String agencyId;
private String orgId;
private Integer count;
private Integer sum;
private String ratio;
}

25
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyActiveResultDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/21 9:35 上午
*/
@Data
public class PartyActiveResultDTO implements Serializable {
private static final long serialVersionUID = 4694666116463447613L;
/**
* 网格ID
*/
private String gridId;
/**
* 动作操作用户ID
*/
private String userId;
}

25
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyCreateGroupCountResultDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/19 3:30 下午
*/
@Data
public class PartyCreateGroupCountResultDTO implements Serializable {
private static final long serialVersionUID = -4193777575465275095L;
/**
* 网格ID
*/
private String gridId;
/**
* 建群党员数
*/
private Integer partyCreateGroupCount;
}

37
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ProjectEvaluateResultDTO.java

@ -0,0 +1,37 @@
package com.epmet.dto.extract.result;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Author zxc
* @DateTime 2020/9/18 3:23 下午
*/
@Data
public class ProjectEvaluateResultDTO implements Serializable {
private static final long serialVersionUID = 6042094904405338630L;
/**
* 动作code
*/
private String actionCode;
/**
* 网格ID
*/
private String gridId;
/**
* 满意度评价对应的分数
*/
private Integer score = NumConstant.ZERO;
/**
* 项目ID
*/
private String projectId;
}

24
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ProjectParticipatedAgencyResultDTO.java

@ -0,0 +1,24 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 参与过项目的agencyDTO
* @ClassName ProjectParticipatedAgencyResultDTO
* @Auth wangc
* @Date 2020-09-20 23:40
*/
@Data
public class ProjectParticipatedAgencyResultDTO implements Serializable {
private static final long serialVersionUID = 1071619125612033138L;
private String projectId;
private String agencyId;
private String level;
private int score;
}

25
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PublishCountResultDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/19 2:41 下午
*/
@Data
public class PublishCountResultDTO implements Serializable {
private static final long serialVersionUID = -955208044108055887L;
/**
* 网格ID
*/
private String gridId;
/**
* 发文数量
*/
private Integer publishCount;
}

25
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ShiftProjectCountResultDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/19 2:23 下午
*/
@Data
public class ShiftProjectCountResultDTO implements Serializable {
private static final long serialVersionUID = -262809191405218048L;
/**
* 网格ID
*/
private String gridId;
/**
* 网格 党员/群众 人均提出的议题转项目数
*/
private Integer shiftProjectCount;
}

41
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/ExtractGroupMemberActionRecordResultDTO.java

@ -0,0 +1,41 @@
package com.epmet.dto.group.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Description
* @ClassName ExtractGroupMemberActionRecordResultDTO
* @Auth wangc
* @Date 2020-09-18 21:18
*/
@Data
public class ExtractGroupMemberActionRecordResultDTO implements Serializable {
private static final long serialVersionUID = -74883228267461785L;
private String customerId;
private String groupId;
private String memberId;
private String leaderFlag;
private String dateId;
private String weekId;
private String monthId;
private String quarterId;
private String yearId;
private Date joinDate;
/**
* 目前只有join leader也是join
* */
private String actionCode;
}

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

@ -0,0 +1,20 @@
package com.epmet.dto.project;
import lombok.Data;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/20 21:08
*/
@Data
public class FinishOrgDTO implements Serializable {
private static final long serialVersionUID = -5684606755705833962L;
private String projectId;
private String orgIdPath;
private String pIdPath;
}

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProcessInfoDTO.java

@ -14,6 +14,8 @@ import java.util.Date;
public class ProcessInfoDTO implements Serializable {
private static final long serialVersionUID = 4586424046147127143L;
private String agencyId;
private String departmentId;
private String gridId;
private String projectId;
/**
* 处理结案close退回return部门流转transfer创建项目created

95
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgPeriodResultDTO.java

@ -0,0 +1,95 @@
package com.epmet.dto.project.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Description 从数据库中查询出的 项目 - 机关网格部门机关的响应时长
* FIXME 查询的全都是已经结案的项目如果查询流转中的项目需要修改逻辑较为复杂
* @ClassName ProjectOrgPeriodResultDTO
* @Auth wangc
* @Date 2020-09-16 15:28
*/
@Data
public class ProjectOrgPeriodResultDTO implements Serializable {
private static final long serialVersionUID = 6216112710806237600L;
/**
* 节点Id
* */
private String processId;
/**
* 项目Id
* */
private String projectId;
/**
* 对这个节点的处理如果未处理则为null
* created transfer close return response(查不出response,因为response类型的节点不会与process_staff产生关联需要另取)
* */
private String operation;
/**
* 是这个节点的操作相当于上一个人的操作而不是对于这个节点的处理
* created transfer close return response
* */
private String lastAction;
/**
* 节点所属的机关即上个节点推到这个节点的负责部门
* */
private String departmentName;
/**
* 当前节点所属的Agency如果负责的是部门或者网格则是其所属的机关
* */
private String orgId;
/**
* 如果是部门处理则有值否则null
* */
private String departmentId;
/**
* 如果是网格处理则有值否则null
* */
private String gridId;
/**
* 当前所属的机关的所有Pid集合以及当前的机关Id所以此项不会未null至少也是它的所属Agency
* */
private String orgIdPath;
/**
* 从节点流入到节点流出且当前负责单位确实解决包括退回了的情况下所耗费的时间(以分钟为单位)
* 如果未当前负责单位一直停留在unresolved状态即使做出response或者项目被其他单位结案该项依旧是0不参与办结的计时
* 如果负责单位只是做出回应但未处理(即没有让节点流走)需要查出其相应的第一次响应时间另取
* */
private Integer totalPeriod;
/**
* 节点流入时间
* */
private Date informedDate;
/**
* 节点流出时间如果未解决则未null
* */
private Date handledDate;
/**
* 第一次响应时间
* */
private Date periodTillReplyFirstly;
private String customerId;
private String staffId;
private String isResolved;
}

49
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgRelationWhenResponseResultDTO.java

@ -0,0 +1,49 @@
package com.epmet.dto.project.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Description 查询机关在项目节点上响应的结果
* 查询的是存在响应的所有相关工作人员节点如果同一个人对同一个项目已经做过一次处理并未做出响应而在第二次流转到自己时
* 做出了响应也会连带查询出其第一次未响应过的数据
* @ClassName ProjectOrgRelationWhenResponseResultDTO
* @Auth wangc
* @Date 2020-09-16 17:27
*/
@Data
public class ProjectOrgRelationWhenResponseResultDTO implements Serializable {
private static final long serialVersionUID = 1962332392048752037L;
/**
* 项目Id
* */
private String projectId;
/**
* 节点Id
* */
private String processId;
/**
* 节点动作的发起人
* */
private String staffId;
/**
* 负责人所属的单位名称:xx机关-xx部门 xx机关-xx网格 xx机关
* */
private String departmentName;
/**
* 动作分类
* */
private String operation;
/**
* 节点创建时间动作发起时间
* */
private Date createdTime;
}

36
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/result/GridAttributesResultDTO.java

@ -0,0 +1,36 @@
package com.epmet.dto.stats.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @ClassName GridAttributesResultDTO
* @Auth wangc
* @Date 2020-09-20 12:50
*/
@Data
public class GridAttributesResultDTO implements Serializable {
private static final long serialVersionUID = 466974582608407121L;
/**
* 网格ID
*/
private String gridId;
/**
* 网格所属机关ID
*/
private String agencyId;
/**
* 机关的上级ID
*/
private String parentId;
/**
* 所有上级Id
* */
private String pids;
}

23
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java

@ -3,6 +3,8 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.StatsFormDTO;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractIndexFormDTO;
import com.epmet.dto.group.form.GroupStatsFormDTO;
import com.epmet.dto.issue.form.IssueJobFromDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
@ -175,8 +177,8 @@ public interface DataStatisticalOpenFeignClient {
Result execTopicStatistical(@RequestParam(value = "date", required = false) String date);
/**
* @Description 统计党员
* @param customerIdAndDateIdFormDTO
* @Description 统计党员
* @author zxc
* @date 2020/9/17 3:10 下午
*/
@ -190,4 +192,23 @@ public interface DataStatisticalOpenFeignClient {
*/
@PostMapping("/data/stats/indexcalculate/process-pendding-cals")
Result processPenddingCalculate();
/**
* desc: 抽取业务数据到统计库 小组 话题 议题 项目
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@PostMapping(value = "data/stats/factorigin/extractall")
Result factOriginExtractAll(@RequestBody(required = false) ExtractFormDTO formDTO);
/**
* desc: 抽取统计数据到指标库
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@PostMapping(value = "data/stats/indexorigin/extractall")
Result indexOriginExtractAll(@RequestBody(required = false) ExtractIndexFormDTO formDTO);
}

26
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java

@ -4,6 +4,8 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.StatsFormDTO;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractIndexFormDTO;
import com.epmet.dto.group.form.GroupStatsFormDTO;
import com.epmet.dto.issue.form.IssueJobFromDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
@ -181,4 +183,28 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
public Result processPenddingCalculate() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "processPenddingCalculate");
}
/**
* desc: 抽取业务数据到统计库 小组 话题 议题 项目
*
* @param formDTO
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result factOriginExtractAll(ExtractFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "factOriginExtractAll", formDTO);
}
/**
* desc: 抽取统计数据到指标库
*
* @param formDTO
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result indexOriginExtractAll(ExtractIndexFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "indexOriginExtractAll", formDTO);
}
}

210
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/FactExtractOpenFeignClientFallBack.java

@ -0,0 +1,210 @@
package com.epmet.feign.impl;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.StatsFormDTO;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractIndexFormDTO;
import com.epmet.dto.group.form.GroupStatsFormDTO;
import com.epmet.dto.issue.form.IssueJobFromDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.feign.DataStatisticalOpenFeignClient;
import org.springframework.stereotype.Component;
/**
* desc:
*
* @return:
* @date: 2020/6/22 9:38
* @author: jianjun liu
* email:liujianjun@git.elinkit.com.cn
*/
@Component
public class FactExtractOpenFeignClientFallBack implements DataStatisticalOpenFeignClient {
/**
* desc: 统计文章总数及在线文章总数 包含 机关 部门 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result articleSummaryDailyStatsjob(StatsFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "articleSummaryDailyStatsjob", formDTO);
}
/**
* desc: 定时任务 统计文章总数及在线文章总数 包含 机关 部门 网格
*
* @return:
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result tagUsedDailyStatsjob(StatsFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagUsedDailyStatsjob", formDTO);
}
/**
* desc: 统计发表文章最多的分类 包含 机关 部门 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result tagUsedMonthlyStatsjob(StatsFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagUsedMonthlyStatsjob", formDTO);
}
/**
* desc: 统计发表文章最多的分类 包含 机关 部门 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result tagUsedQuarterlyStatsjob(StatsFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagUsedQuarterlyStatsjob", formDTO);
}
/**
* desc: 统计阅读最多的标签 包含 机关 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result tagViewedDailyStatsjob(StatsFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagViewedDailyStatsjob", formDTO);
}
/**
* desc: 统计阅读最多的标签 包含 机关 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result tagViewedMonthlyStatsjob(StatsFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagViewedMonthlyStatsjob", formDTO);
}
/**
* desc: 统计阅读最多的标签 包含 机关 网格
*
* @param formDTO
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result tagViewedQuarterlyStatsjob(StatsFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagViewedQuarterlyStatsjob", formDTO);
}
@Override
public Result groupGridDaily(GroupStatsFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "groupGridDaily", formDTO);
}
@Override
public Result groupAgencyDaily(GroupStatsFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "groupAgencyDaily", formDTO);
}
@Override
public Result groupAgencyMonthly(GroupStatsFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "groupAgencyMonthly", formDTO);
}
@Override
public Result agencyGridIssueStats() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "agencyGridIssueStats");
}
@Override
public Result agencyGridIssueStatsOfDate(IssueJobFromDTO fromDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "agencyGridIssueStatsOfDate");
}
/**
* @Description 数据统计-项目-机关日月统计
* @Author sun
*/
@Override
public Result agencyProjectStats(StatsFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "agencyProjectStats", formDTO);
}
/**
* @Description 数据统计-项目-网格日月统计
* @Author sun
*/
@Override
public Result gridProjectStats(StatsFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "gridProjectStats", formDTO);
}
@Override
public Result initAllDims() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "initAllDims");
}
/**
* @param
* @return
* @Description 执行用户统计
* @author wangc
* @date 2020.06.29 09:26
**/
@Override
public Result execUserStatistical(String date) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "execUserStatistical", date);
}
/**
* @param
* @return
* @Description 执行话题统计
* @author wangc
* @date 2020.06.29 09:27
**/
@Override
public Result execTopicStatistical(String date) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "execTopicStatistical", date);
}
@Override
public Result getPartyInfo(CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "getPartyInfo", customerIdAndDateIdFormDTO);
}
@Override
public Result processPenddingCalculate() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "processPenddingCalculate");
}
/**
* desc: 抽取业务数据到统计库 小组 话题 议题 项目
*
* @param formDTO
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result factOriginExtractAll(ExtractFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "factOriginExtractAll", formDTO);
}
/**
* desc: 抽取统计数据到指标库
*
* @param formDTO
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result indexOriginExtractAll(ExtractIndexFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "indexOriginExtractAll", formDTO);
}
}

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

@ -15,6 +15,7 @@ import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao;
import com.epmet.dao.stats.DimCustomerDao;
import com.epmet.dao.stats.DimDateDao;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity;
@ -25,6 +26,8 @@ import com.epmet.entity.stats.DimAgencyEntity;
import com.epmet.entity.stats.DimCustomerEntity;
import com.epmet.entity.stats.DimDateEntity;
import com.epmet.service.StatsDemoService;
import com.epmet.service.evaluationindex.extract.CalGridIndexService;
import com.epmet.service.evaluationindex.extract.FactOriginProjectLogDailyService;
import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService;
import com.epmet.service.evaluationindex.indexcal.*;
import com.epmet.service.stats.DimAgencyService;
@ -37,6 +40,7 @@ import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
@ -81,6 +85,8 @@ public class DemoController {
private DimCustomerDao dimCustomerDao;
@Autowired
private FactOriginTopicMainDailyService factOriginTopicMainDailyService;
@Autowired
private FactOriginProjectLogDailyService factOriginProjectLogDailyService;
@GetMapping("testAlarm")
public void testAlarm() {
@ -503,15 +509,21 @@ public class DemoController {
@PostMapping("inserttopicorigin")
public Result topicDataCleaning(@RequestParam("customerId") String customerId, @RequestParam("dateId")String dateId) {
if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) {
factOriginTopicMainDailyService.topicCleaning(customerId,dateId);
ExtractFormDTO param = new ExtractFormDTO();
param.setDateId(dateId);
param.setCustomerId(customerId);
Boolean aBoolean = factOriginTopicMainDailyService.topicCleaning(param);
}else{
QueryWrapper<DimCustomerEntity> customerEntityQueryWrapper = new QueryWrapper<>();
List<DimCustomerEntity> customerEntityList=dimCustomerDao.selectList(customerEntityQueryWrapper);
QueryWrapper<DimDateEntity> wrapper = new QueryWrapper<>();
List<DimDateEntity> dimDateEntityList= dimDateDao.selectList(wrapper);
for(DimCustomerEntity customerEntity:customerEntityList){
for(DimDateEntity dateEntity:dimDateEntityList){
factOriginTopicMainDailyService.topicCleaning(customerEntity.getId(),dateEntity.getId());
for(DimDateEntity dateEntity:dimDateEntityList) {
ExtractFormDTO param = new ExtractFormDTO();
param.setDateId(dateEntity.getId());
param.setCustomerId(customerEntity.getId());
factOriginTopicMainDailyService.topicCleaning(param);
}
}
}
@ -526,4 +538,38 @@ public class DemoController {
partymemberService.statsPartyMember(customerIdAndDateIdFormDTO);
return new Result();
}
@Autowired
private CalGridIndexService calGridIndexService;
@PostMapping("gridparty")
public void gridParty(){
// String customerId = "3ef7e4bb195eb9e622d68b52509aa940";
String customerId = "epmettest";
String monthId = "202008";
calGridIndexService.calGridIndexPartyAbility(customerId,monthId);
}
@PostMapping("gridgovern")
public void gridGovern(){
// String customerId = "3ef7e4bb195eb9e622d68b52509aa940";
String customerId = "epmettest";
String monthId = "202008";
calGridIndexService.calGridIndexGovernAbility(customerId,monthId);
}
@PostMapping("handlemap")
public Result<Map<String,Integer>> handleMap(){
return new Result<Map<String,Integer>>().ok(
factOriginProjectLogDailyService.getProjectHandledAgency("3ef7e4bb195eb9e622d68b52509aa940","202006","month"));
}
@PostMapping("responseration")
public Result<Map<String,BigDecimal>> responseRatio(){
return new Result<Map<String,BigDecimal>>().ok(
factOriginProjectLogDailyService.getAgencyResponseRatio("3ef7e4bb195eb9e622d68b52509aa940","202006","month")
);
}
}

84
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java

@ -1,84 +0,0 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ProjectFormDTO;
import com.epmet.service.evaluationindex.extract.IssueExtractService;
import com.epmet.service.evaluationindex.extract.ProjectExtractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
/**
* 原始数据清洗
*
* @author yinzuomei@elink-cn.com
* @date 2020/9/15 11:06
*/
@RestController
@RequestMapping("factorigin")
public class FactOriginController {
@Autowired
private IssueExtractService issueExtractService;
@Autowired
private FactOriginTopicMainDailyService factOriginTopicMainDailyService;
@Autowired
private ProjectExtractService projectExtractService;
/**
* @Description 议题抽取(main)
* @param extractFormDTO
* @author zxc
* @date 2020/9/15 2:02 下午
*/
@PostMapping("issueextractmain")
public Result issueExtractMain(@RequestBody ExtractFormDTO extractFormDTO){
ValidatorUtils.validateEntity(extractFormDTO, ExtractFormDTO.ExtractForm.class);
issueExtractService.issueExtractMain(extractFormDTO);
return new Result();
}
/**
* @Description 议题抽取(log)
* @param extractFormDTO
* @author zxc
* @date 2020/9/16 9:41 上午
*/
@PostMapping("issueextractlog")
public Result issueExtractLog(@RequestBody ExtractFormDTO extractFormDTO){
ValidatorUtils.validateEntity(extractFormDTO, ExtractFormDTO.ExtractForm.class);
issueExtractService.issueExtractLog(extractFormDTO);
return new Result();
}
/**
* @param customerId yyyyMMdd
* @param dateId yyyyMMdd
* @return com.epmet.commons.tools.utils.Result
* @author yinzuomei
* @description 话题 (fact_origin_topic_main_daily 话题主表_日统计 fact_origin_topic_log_daily 话题明细_日统计)
* @Date 2020/9/15 13:39
**/
@PostMapping("topic")
public Result topicDataCleaning(String customerId,String dateId) {
if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) {
factOriginTopicMainDailyService.topicCleaning(customerId,dateId);
}
return new Result();
}
@PostMapping("project")
public Result projectData(@RequestBody ProjectFormDTO formDTO) {
projectExtractService.saveOriginProjectDaily(formDTO.getCustomerId(), formDTO.getDate());
return new Result();
}
}

37
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexOriginExtractController.java

@ -0,0 +1,37 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.extract.form.ExtractIndexFormDTO;
import com.epmet.service.evaluationindex.extract.dataToIndex.IndexOriginExtractService;
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 yinzuomei@elink-cn.com
* @date 2020/9/15 11:06
*/
@RestController
@RequestMapping("indexorigin")
public class IndexOriginExtractController {
@Autowired
private IndexOriginExtractService indexOriginExtractService;
/**
* desc:抽取统计数据到指标库
*
* @param extractFormDTO 默认统计上一个月
* @return
*/
@PostMapping("extractall")
public Result extractAll(@RequestBody ExtractIndexFormDTO extractFormDTO) {
indexOriginExtractService.indexOriginExtractAll(extractFormDTO);
return new Result();
}
}

139
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java

@ -0,0 +1,139 @@
/**
* 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.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.extract.form.GridHeartedFormDTO;
import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 业务数据抽取-小组相关
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-16
*/
@Mapper
public interface FactOriginGroupMainDailyDao extends BaseDao<FactOriginGroupMainDailyEntity> {
/**
* @Description 查询建群党员数
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/19 3:49 下午
*/
List<PartyCreateGroupCountResultDTO> selectPartyCreateGroupCount(@Param("customerId") String customerId,@Param("monthId") String monthId);
/**
* @Description 查询是否存在该客户下的数据
* @param customerId
* @return
* @author wangc
* @date 2020.09.18 23:30
**/
int selectIfExist(@Param("customerId")String customerId);
/**
* @Description 按照客户Id清除组数据
* @param customerId
* @return
* @author wangc
* @date 2020.09.20 09:58
**/
void deleteBatchByCustomerId(@Param("customerId")String customerId);
/**
* @Description 按照客户Id清除组员数据
* @param customerId
* @return
* @author wangc
* @date 2020.09.20 09:58
**/
void deleteBatchMemberByCustomerId(@Param("customerId")String customerId);
/**
* @Description 按照组Id清除组和组员数据
* @param customerId
* @return
* @author wangc
* @date 2020.09.20 12:16
**/
void deleteBatchByGroupId(@Param("customerId")String customerId,@Param("list") List<String> list);
/**
* @Description 更新群主的党员信息
* @param list
* @return
* @author wangc
* @date 2020.09.20 12:44
**/
int updatePartyFlag(@Param("list") List<String> list,@Param("customerId")String customerId);
/**
* @Description 更新群主的热心居民信息
* @param list
* @return
* @author wangc
* @date 2020.09.20 12:44
**/
int updateHeartedFlag(@Param("list") List<GridHeartedFormDTO> list,@Param("customerId")String customerId);
/**
* @Description 批量插入组主表
* @param list
* @return
* @author wangc
* @date 2020.09.20 15:37
**/
int insertBatchMain(@Param("list") List<FactOriginGroupMainDailyDTO> list);
/**
* @Description 批量插入组员表
* @param list
* @return
* @author wangc
* @date 2020.09.20 15:37
**/
int insertBatchMembers(List<ExtractGroupMemberActionRecordResultDTO> list);
/**
* @param customerId
* @param groupOwnerId
* @return java.util.List<java.lang.String>
* @author yinzuomei
* @description 查询当前用户建的所有群id
* @Date 2020/9/20 21:22
**/
List<String> selectGroupIds(@Param("customerId") String customerId, @Param("groupOwnerId") String groupOwnerId);
/**
* @return java.util.List<java.lang.String>
* @param groupIdList
* @author yinzuomei
* @description 查询组成员数去重
* @Date 2020/9/20 21:29
**/
List<String> selectGroupMemberList(@Param("list") List<String> groupIdList);
}

21
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java

@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.form.IssueLogDailyFormDTO;
import com.epmet.dto.extract.result.PartyActiveResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -51,4 +52,24 @@ public interface FactOriginIssueLogDailyDao extends BaseDao<FactOriginIssueLogDa
*/
void deleteOldLogRecord(@Param("customerId")String customerId,@Param("dateId")String dateId);
/**
* @return java.lang.Integer
* @param userId 用户id
* @param customerId
* @param monthId
* @author yinzuomei
* @description 查询用户在这个月内表决的总次数
* @Date 2020/9/20 21:52
**/
Integer selectCountUserVote(@Param("userId") String userId, @Param("customerId") String customerId, @Param("monthId")String monthId);
/**
* @Description 查询 议题表决党员/群众
* @param customerId
* @param monthId
* @param isParty
* @author zxc
* @date 2020/9/21 9:37 上午
*/
List<PartyActiveResultDTO> selectPartyActiveIssueVote(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("isParty") Integer isParty);
}

51
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java

@ -18,12 +18,16 @@
package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.form.GridIssueCountResultDTO;
import com.epmet.dto.extract.form.IssueMainDailyFormDTO;
import com.epmet.dto.extract.result.GridProjectCountResultDTO;
import com.epmet.dto.extract.result.ShiftProjectCountResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 议题主表
@ -50,4 +54,51 @@ public interface FactOriginIssueMainDailyDao extends BaseDao<FactOriginIssueMain
* @date 2020/9/16 9:33 上午
*/
void deleteOldMainRecord(@Param("customerId")String customerId, @Param("dateId")String dateId);
/**
* @Description 查询网格议题总数网格人均议题数目
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/18 10:20 上午
*/
List<GridIssueCountResultDTO> selectIssueTotal(@Param("customerId") String customerId,@Param("monthId") String monthId);
/**
* @Description 网格总项目数
* @param customerId
* @param monthId
* @param status
* @author zxc
* @date 2020/9/18 1:21 下午
*/
List<GridProjectCountResultDTO> selectGridProjectCount(@Param("customerId") String customerId,@Param("monthId") String monthId, @Param("status") String status);
/**
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>
* @param customerId
* @param monthId
* @author yinzuomei
* @description 党员提出的话题转议题数
* @Date 2020/9/18 13:58
**/
List<Map<String, Integer>> selectShiftIssueCount(@Param("customerId") String customerId,@Param("monthId") String monthId);
/**
* @Description 查询网格 党员/群众 人均提出的议题转项目数
* @param customerId
* @param monthId
* @param isParty
* @author zxc
* @date 2020/9/19 2:26 下午
*/
List<ShiftProjectCountResultDTO> selectShiftProjectCountPlus(@Param("customerId") String customerId,@Param("monthId") String monthId,@Param("isParty") Integer isParty);
/**
* @return java.lang.Integer
* @param topicIdList
* @author yinzuomei
* @description 查询本周期和上周期内自建群内话题转为议题的数量的总和
* @Date 2020/9/20 22:54
**/
Integer selectIssueTotalTwoMonth(@Param("list") List<String> topicIdList);
}

89
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java

@ -18,8 +18,12 @@
package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.*;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 项目明细_日统计
@ -29,5 +33,86 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface FactOriginProjectLogDailyDao extends BaseDao<FactOriginProjectLogDailyEntity> {
}
/**
* 机关被吹哨次数
* @author zhaoqifeng
* @date 2020/9/18 14:46
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectAgencyTransferCount(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("level")String level);
/**
* @Description 查询未被退回的项目数
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/18 2:50 下午
*/
List<NotReturnProjectResultDTO> selectNotReturnProject(@Param("customerId") String customerId,@Param("monthId") String monthId,@Param("actionCode") String actionCode,@Param("orgType") String orgType);
/**
* @Description 查询项目评价信息
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/18 3:28 下午
*/
List<ProjectEvaluateResultDTO> selectProjectEvaluate(@Param("customerId") String customerId,@Param("monthId") String monthId);
/**
* @Description 网格项目自治率查询
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/18 5:25 下午
*/
List<AutoNoMyResultDTO> selectProjectAutoNoMy(@Param("customerId") String customerId,@Param("monthId") String monthId);
/**
* 根据日期删除数据
* @author zhaoqifeng
* @date 2020/9/18 17:32
* @param customerId
* @param date
* @return void
*/
void deleteByDate(@Param("customerId") String customerId, @Param("date") String date);
/**
* 办结项目满意度
* @author zhaoqifeng
* @date 2020/9/20 16:44
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectSatisfaction(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("level")String level);
/**
* 区直部门被吹哨次数
* @author zhaoqifeng
* @date 2020/9/18 14:46
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectDepTransferCount(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("level")String level);
/**
* @Description 查询各项目经受了多少机关
* @param customerId
* @return
* @author wangc
* @date 2020.09.20 23:46
**/
List<ProjectParticipatedAgencyResultDTO> selectProjectParticipatedAgency(@Param("customerId") String customerId, @Param("dimId") String dimId,
@Param("dateType")String dateType);
}

55
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java

@ -19,11 +19,14 @@ package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.FactOriginProjectMainDailyDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 项目主表_日统计
@ -51,4 +54,56 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
* @return java.util.List<com.epmet.dto.extract.FactOriginProjectMainDailyDTO>
*/
List<FactOriginProjectMainDailyDTO> getPendingList(@Param("customerId") String customerId);
/**
* 项目超期数
* @author zhaoqifeng
* @date 2020/9/18 16:28
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectOverdueCount(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* @Description 网格办结项目数
* @param customerId
* @param monthId
* @param status
* @author zxc
* @date 2020/9/18 2:06 下午
*/
List<GridProjectClosedTotalResultDTO> selectGridClosedProject(@Param("customerId") String customerId,@Param("monthId") String monthId,@Param("status") String status);
/**
* 根据日期删除数据
* @author zhaoqifeng
* @date 2020/9/18 17:32
* @param customerId
* @param date
* @return void
*/
void deleteByDate(@Param("customerId") String customerId, @Param("date") String date);
void deleteByDate(@Param("date") String date);
/**
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>
* @param customerId
* @param monthId
* @author yinzuomei
* @description 党员提出的议题转项目数
* @Date 2020/9/18 14:11
**/
List<Map<String, Integer>> selectShiftProjectCount(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* @return java.lang.Integer
* @param customerId
* @param monthId
* @param topicIdList
* @author yinzuomei
* @description 9自建群活跃度议题转项目率
* @Date 2020/9/20 22:27
**/
Integer selectCountByPartyUser(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("list")List<String> topicIdList);
}

99
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java

@ -0,0 +1,99 @@
/**
* 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.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.OrgResponseTimeResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PostMapping;
import java.util.List;
/**
* 业务数据抽取-机关项目响应时间
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-16
*/
@Mapper
public interface FactOriginProjectOrgPeriodDailyDao extends BaseDao<FactOriginProjectOrgPeriodDailyEntity> {
/**
* @Description 查询是否存在数据如果没有则视为第一次扫描该表需要根据业务查询全部数据
* @param
* @return
* @author wangc
* @date 2020.09.17 13:43
**/
int selectIfExisted(@Param("customerId") String customerId);
/**
* @Description 在插入之前先删除所有与这个项目相关的历时信息
* @param list
* @return
* @author wangc
* @date 2020.09.17 14:43
**/
void deleteByProjectId(@Param("projectId") String projectId);
/**
* 获取项目响应度
* @author zhaoqifeng
* @date 2020/9/18 15:52
* @param customerId
* @param monthId
* @param level
* @param orgType
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectResponsiveness(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("level")String level,
@Param("orgType")String orgType);
void deleteByProjectId(@Param("list") List<String> list);
/**
* @Description 批量插入
* @param list
* @return
* @author wangc
* @date 2020.09.18 17:11
**/
void insertBatch(@Param("list") List<FactOriginProjectOrgPeriodDailyEntity> list);
/**
* @Description 查找网格部门对项目的响应系数
* @param customerId
* @return
* @author wangc
* @date 2020.09.21 02:13
**/
List<OrgResponseTimeResultDTO> selectSubOrgResponseCoefficient(@Param("customerId") String customerId,@Param("dimId") String dimId, @Param("dateType") String dateType);
/**
* @Description 查找机关对项目的响应系数
* @param customerId
* @return
* @author wangc
* @date 2020.09.21 02:13
**/
List<OrgResponseTimeResultDTO> selectAgencyResponseCoefficient(@Param("customerId") String customerId,@Param("dimId") String dimId, @Param("dateType") String dateType);
}

52
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicLogDailyDao.java

@ -18,11 +18,13 @@
package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.PartyActiveResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicLogDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 话题明细_日统计
@ -52,4 +54,54 @@ public interface FactOriginTopicLogDailyDao extends BaseDao<FactOriginTopicLogDa
* @Date 2020/9/16 12:54
**/
int insertBatchEntity(@Param("list") List<FactOriginTopicLogDailyEntity> list);
/**
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>
* @param customerId
* @param monthId
* @author yinzuomei
* @description 查询客户下这个月内每个党员评论话题的次数
* @Date 2020/9/18 13:36
**/
List<Map<String, Integer>> selectJoinTopicCount(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>
* @param customerId
* @param monthId
* @author yinzuomei
* @description 党员自建群活跃度话题数
* @Date 2020/9/18 15:05
**/
List<Map<String, Integer>> selectGroupTopicCount(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* @return java.lang.Integer
* @param userId
* @param customerId
* @param monthId
* @author yinzuomei
* @description 查询当前用户在本月内评论的次数
* @Date 2020/9/20 21:46
**/
Integer selectUserCommentCount(@Param("userId") String userId, @Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* @return java.util.List<java.lang.String>
* @param groupIdList
* @author yinzuomei
* @description 组内的所有话题id
* @Date 2020/9/20 22:18
**/
List<String> selectTopicIds(@Param("list") List<String> groupIdList);
/**
* @Description 查询 话题评论党员/群众
* @param customerId
* @param monthId
* @param isParty
* @author zxc
* @date 2020/9/21 9:37 上午
*/
List<PartyActiveResultDTO> selectPartyActiveTopic(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("isParty") Integer isParty);
}

21
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java

@ -18,11 +18,13 @@
package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.CreateTopicCountResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 话题主表_日统计
@ -54,4 +56,23 @@ public interface FactOriginTopicMainDailyDao extends BaseDao<FactOriginTopicMain
* @Date 2020/9/16 12:48
**/
int insertBatchEntity(@Param("list") List<FactOriginTopicMainDailyEntity> list);
/**
* @param customerId
* @param monthId
* @author yinzuomei
* @description 党员提出话题数返回每个党员这个月内提出的话题数
* @Date 2020/9/18 11:05
**/
List<Map<String, Integer>> selectPartyCreateTopicCount(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* @Description 查询网格 党员/群众 人均提出话题数
* @param customerId
* @param monthId
* @param isParty
* @author zxc
* @date 2020/9/19 1:58 下午
*/
List<CreateTopicCountResultDTO> selectCreateTopicCount(@Param("customerId") String customerId, @Param("monthId") String monthId,@Param("isParty")Integer isParty);
}

34
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java

@ -18,6 +18,8 @@
package com.epmet.dao.evaluationindex.indexcoll;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO;
import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.indexcal.PageQueryGridFormDTO;
import com.epmet.dto.indexcollect.form.GridGovrnAbilityFormDTO;
@ -101,4 +103,36 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao<FactIndexGov
* @Date 2020/9/2 14:46
**/
String selectTheOneGrid(CalculateCommonFormDTO formDTO);
/**
* @Description 查询全部网格信息
* @param customerId
* @author zxc
* @date 2020/9/18 10:47 上午
*/
List<GovernAbilityGridMonthlyFormDTO> selectAllGridInfo(String customerId);
/**
* @Description 查询全部网格信息
* @param customerId
* @author zxc
* @date 2020/9/19 10:50 上午
*/
List<PartyAbilityGridMonthlyFormDTO> selectAllGridInfoToParty(String customerId);
/**
* @Description 批量插入治理能力
* @param lists
* @author zxc
* @date 2020/9/19 4:28 下午
*/
void insertGovernAbilityRecord(@Param("lists") List<GovernAbilityGridMonthlyFormDTO> lists);
/**
* @Description 删除治理能力旧纪录
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/19 4:31 下午
*/
void deleteOldGovernAbilityRecord(@Param("customerId")String customerId,@Param("monthId")String monthId);
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java

@ -66,4 +66,15 @@ public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao<FactIndexGovr
* @date 2020/8/26 1:40 下午
*/
List<Map<String,Object>> selectCommunityGovernAbility(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level);
/**
* 根据组织类型删除数据
* @author zhaoqifeng
* @date 2020/9/20 20:52
* @param customerId
* @param monthId
* @param type
* @return java.lang.Integer
*/
Integer deleteByCustomer(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("type") String type);
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java

@ -62,4 +62,13 @@ public interface FactIndexPartyAblityCpcMonthlyDao extends BaseDao<FactIndexPart
List<Map<String, Object>> getCountByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("offset") Integer offset, @Param("pageSize") Integer pageSize);
Map<String, Object> getExtremeValue(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* @return int
* @param list
* @author yinzuomei
* @description 批量插入 入参为entity
* @Date 2020/9/18 10:30
**/
int insertBatchEntity(@Param("list") List<FactIndexPartyAblityCpcMonthlyEntity> list);
}

18
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java

@ -18,6 +18,7 @@
package com.epmet.dao.evaluationindex.indexcoll;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.indexcal.PageQueryGridFormDTO;
import com.epmet.dto.indexcollect.form.GridPartyAbilityFormDTO;
@ -97,4 +98,21 @@ public interface FactIndexPartyAblityGridMonthlyDao extends BaseDao<FactIndexPar
* @Date 2020/9/2 14:45
**/
String selectTheOneGrid(CalculateCommonFormDTO formDTO);
/**
* @Description 网格党建能力插入
* @param lists
* @author zxc
* @date 2020/9/19 10:32 上午
*/
void insertPartyAbility(@Param("lists") List<PartyAbilityGridMonthlyFormDTO> lists);
/**
* @Description 删除旧的党建能力记录
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/19 10:45 上午
*/
void deleteOldPartyAbility(@Param("customerId")String customerId,@Param("monthId")String monthId);
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java

@ -77,4 +77,15 @@ public interface FactIndexPartyAblityOrgMonthlyDao extends BaseDao<FactIndexPart
* @date 2020/8/26 10:49 上午
*/
List<Map<String,Object>> selectPublishArticleCountMap(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level);
/**
* 根据组织类型删除数据
* @author zhaoqifeng
* @date 2020/9/20 20:52
* @param customerId
* @param monthId
* @param type
* @return java.lang.Integer
*/
Integer deleteByCustomer(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("type") String type);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java

@ -1,5 +1,6 @@
package com.epmet.dao.group;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.group.form.GridGroupPeopleFormDTO;
import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO;
import com.epmet.dto.group.form.GridGroupTotalFormDTO;
@ -80,4 +81,13 @@ public interface GroupDataDao {
* @author zxc
*/
List<GroupPeopleCountResultDTO> getAgencyGrid(@Param("gridIds")List<String> gridIds);
/**
* @Description 抽取小组数据
* @param customerId
* @return
* @author wangc
* @date 2020.09.18 22:45
**/
List<FactOriginGroupMainDailyDTO> groupExtracting(@Param("customerId")String customerId,@Param("dateId") String dateId);
}

32
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java

@ -18,7 +18,10 @@
package com.epmet.dao.project;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.project.FinishOrgDTO;
import com.epmet.dto.project.ProcessInfoDTO;
import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO;
import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO;
import com.epmet.entity.project.ProjectEntity;
import com.epmet.entity.project.ProjectProcessEntity;
import org.apache.ibatis.annotations.Mapper;
@ -81,4 +84,33 @@ public interface ProjectProcessDao extends BaseDao<ProjectProcessEntity> {
* @return java.util.List<java.lang.String>
*/
List<ProjectProcessEntity> selectClosedProjectList(@Param("customerId") String customerId, @Param("date") String date);
/**
* @Description 查询项目-机关各个节点历时详情
* @param customerId
* @param projectStatus 项目状态 pending closed 如果是null则全查
* @param dateId
* @return
* @author wangc
* @date 2020.09.17 09:43
**/
List<ProjectOrgPeriodResultDTO> selectProjectOrgPeriod(@Param("customerId") String customerId,@Param("projectStatus")String projectStatus,@Param("dateId") String dateId);
/**
* @Description 查询项目-机关各个节点的响应列表
* @param projects
* @return
* @author wangc
* @date 2020.09.17 17:56
**/
List<ProjectOrgRelationWhenResponseResultDTO> selectResponseTrace(@Param("projects") List<String> projects);
/**
* 获取办结组织
* @author zhaoqifeng
* @date 2020/9/18 18:01
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.project.FinishOrgDTO>
*/
List<FinishOrgDTO> selectFinishOrg(@Param("customerId") String customerId, @Param("date") String date);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimAgencyDao.java

@ -135,4 +135,14 @@ public interface DimAgencyDao extends BaseDao<DimAgencyEntity> {
* @date 2020/9/15 6:15 下午
*/
List<AgencyInfoResultDTO> selectAgencyInfo(@Param("agencyIds")List<String> agencyIds);
/**
* 根据级别获取组织信息
* @author zhaoqifeng
* @date 2020/9/20 17:31
* @param customerId
* @param level
* @return java.util.List<com.epmet.dto.stats.DimAgencyDTO>
*/
List<DimAgencyDTO> selectDimAgencyByLevel(@Param("customerId")String customerId, @Param("level")String level);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java

@ -19,6 +19,7 @@ package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.form.DimCustomerPartyMemberFormDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity;
import com.epmet.entity.stats.DimCustomerPartymemberEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -50,4 +51,13 @@ public interface DimCustomerPartymemberDao extends BaseDao<DimCustomerPartymembe
* @date 2020/9/17 2:43 下午
*/
void deleteOldPartyRecord(@Param("customerId")String customerId,@Param("dateId")String dateId);
/**
* @return java.util.List<com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity>
* @param customerId 客户id
* @author yinzuomei
* @description 查询客户下所有的党员, 构造好党员相关-党建能力初始值
* @Date 2020/9/18 9:00
**/
List<FactIndexPartyAblityCpcMonthlyEntity> selectPartyMemberList(String customerId);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.group.AgencyDTO;
import com.epmet.dto.group.result.AgencyGridInfoResultDTO;
import com.epmet.dto.group.result.SubAgencyIdResultDTO;
import com.epmet.dto.stats.result.GridAttributesResultDTO;
import com.epmet.dto.stats.result.GridBelongAgencyResultDTO;
import com.epmet.entity.stats.DimGridEntity;
import org.apache.ibatis.annotations.Mapper;
@ -69,4 +70,13 @@ public interface DimGridDao extends BaseDao<DimGridEntity> {
* @date 2020/9/17 2:34 下午
*/
List<GridBelongAgencyResultDTO> selectGridBelongAgencyInfo(@Param("gridIds") List<String> gridIds);
/**
* @Description 查询网格的所有所属上级属性
* @param gridIds
* @return
* @author wangc
* @date 2020.09.20 13:01
**/
List<GridAttributesResultDTO> selectGridAttributes(@Param("customerId") String customerId,@Param("gridIds") List<String> gridIds);
}

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedAgencyDailyDao.java

@ -18,10 +18,13 @@
package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO;
import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 文章发布数量机关日统计表
*
@ -38,4 +41,16 @@ public interface FactArticlePublishedAgencyDailyDao extends BaseDao<FactArticleP
* @return
*/
int deleteByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* 获取组织文章数量
* @author zhaoqifeng
* @date 2020/9/20 22:46
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO>
*/
List<FactArticlePublishedAgencyDailyDTO> selectArticleCount(@Param("customerId")String customerId, @Param("monthId")String monthId,
@Param("level")String level);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedGridDailyDao.java

@ -18,6 +18,7 @@
package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.PublishCountResultDTO;
import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity;
import com.epmet.entity.stats.FactArticlePublishedGridDailyEntity;
import org.apache.ibatis.annotations.Mapper;
@ -51,4 +52,13 @@ public interface FactArticlePublishedGridDailyDao extends BaseDao<FactArticlePub
* @return
*/
int deleteByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @Description 查询网格下的文章发文数量
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/19 2:44 下午
*/
List<PublishCountResultDTO> selectArticlePublishCount(@Param("customerId")String customerId,@Param("monthId") String monthId);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java

@ -18,6 +18,7 @@
package com.epmet.dao.stats.user;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.GridUserCountResultDTO;
import com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO;
import com.epmet.entity.stats.user.FactRegUserGridMonthlyEntity;
import org.apache.ibatis.annotations.Mapper;
@ -38,4 +39,13 @@ public interface FactRegUserGridMonthlyDao extends BaseDao<FactRegUserGridMonthl
void deleteByParams(@Param("monthId")String monthId,@Param("customerId")String customerId);
/**
* @Description 查询网格下的客户
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/19 11:10 上午
*/
List<GridUserCountResultDTO> selectGridUserCount(String customerId, String monthId);
}

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java

@ -1,5 +1,6 @@
package com.epmet.dao.user;
import com.epmet.dto.extract.form.GridHeartedFormDTO;
import com.epmet.dto.extract.result.UserPartyResultDTO;
import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO;
import org.apache.ibatis.annotations.Mapper;
@ -105,5 +106,9 @@ public interface UserDao {
* @author zxc
* @date 2020/9/15 4:23 下午
*/
List<UserPartyResultDTO> selectUserIsParty(@Param("userIds") List<String> userIds);;
List<UserPartyResultDTO> selectUserIsParty(@Param("userIds") List<String> userIds);
List<String> selectPartymembersByCustomerId(@Param("customerId")String customerId);
List<GridHeartedFormDTO> selectWarmHeartedByCustomerId(@Param("customerId")String customerId);
}

119
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMainDailyEntity.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.entity.evaluationindex.extract;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 业务数据抽取-小组相关
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-16
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_origin_group_main_daily")
public class FactOriginGroupMainDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
private String customerId;
/**
* 状态审核通过 - approved 审核中 - under_auditting 审核未通过 - rejected 已屏蔽 - hidden 已关闭 - closed
Ps: 如果一个小组被拒绝当前小组的状态将永久停留在审核未通过
*/
private String groupState;
/**
* 小组所在网格Id
*/
private String gridId;
/**
* 小组所在机关Id
*/
private String agencyId;
/**
* 小组所在组织的父机关Id
*/
private String parentId;
/**
* 小组所在组织所有父类Id集合
*/
private String pids;
/**
* 建群申请审核通过的时期
*/
private String dateId;
/**
* 建群申请审核通过的周期
*/
private String weekId;
/**
* 建群申请审核通过的月份
*/
private String monthId;
/**
* 建群申请审核通过的季度
*/
private String quarterId;
/**
* 建群申请审核通过的年
*/
private String yearId;
/**
* 群众人数
*/
private Integer resiMemberCount;
/**
* 组内总人数
*/
private Integer memberTotal;
/**
* 群主ID
*/
private String groupOwnerId;
/**
* 建组时群主是否热心居民不更新
*/
private Integer isOwnerHearted;
/**
* 建组时群主是否党员不更新
*/
private Integer isOwnerParty;
}

98
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectOrgPeriodDailyEntity.java

@ -0,0 +1,98 @@
/**
* 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.entity.evaluationindex.extract;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 业务数据抽取-机关项目响应时间
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-16
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_origin_project_org_period_daily")
public class FactOriginProjectOrgPeriodDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
private String customerId;
/**
* 项目ID
*/
private String projectId;
/**
*
*/
private String orgId;
/**
* grid agenct dept
*/
private String orgType;
/**
* 如果是机关则为父级机关(若已是顶级机关则为0)如果是网格和部门则为所属机关
*/
private String pid;
/**
* 最后一个节点是PID若无则为空
*/
private String pids;
/**
* 流转到的日期
*/
private Date informedDate;
/**
* 流转走或结案的日期
*/
private Date handledDate;
/**
* 响应时长从流转到自己到流转走共耗时/小时(不算法定节假日和周末)
*/
private Integer totalPeriod;
/**
* 截至第一次响应时长从流转到第一次处理(响应结案流转)耗时大于等于上一项值
*/
private Date periodTillReplyFirstly;
/**
* resloved unresolved
*/
private String isResolved;
/**
* 办结的操作return(回退)transfer(流转)closed(结案)但是不包括response(响应)
* */
private String operation;
}

19
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/CalCpcIndexService.java

@ -0,0 +1,19 @@
package com.epmet.service.evaluationindex.extract;
/**
* 党员相关
*
* @author yinzuomei@elink-cn.com
* @date 2020/9/17 14:05
*/
public interface CalCpcIndexService {
/**
* @return void
* @param customerId 客户id
* @param monthId yyyyMM
* @author yinzuomei
* @description 党员相关-党建能力
* @Date 2020/9/17 14:08
**/
void calCpcPartyAbility(String customerId, String monthId);
}

36
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/CalGridIndexService.java

@ -0,0 +1,36 @@
package com.epmet.service.evaluationindex.extract;
/**
* @Author zxc
* @DateTime 2020/9/18 9:52 上午
*/
public interface CalGridIndexService {
/**
* @Description 计算网格指标党建能力
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/18 9:56 上午
*/
Boolean calGridIndexPartyAbility(String customerId,String monthId);
/**
* @Description 计算网格指标治理能力
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/18 9:56 上午
*/
Boolean calGridIndexGovernAbility(String customerId,String monthId);
/**
* @Description 计算网格指标服务能力
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/18 9:56 上午
*/
Boolean calGridIndexServiceAbility(String customerId,String monthId);
}

33
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactIndexGovernAbilityGridMonthlyService.java

@ -0,0 +1,33 @@
package com.epmet.service.evaluationindex.extract;
import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 治理能力-网格相关事实表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-19
*/
public interface FactIndexGovernAbilityGridMonthlyService{
/**
* @Description 批量插入治理能力
* @param lists
* @author zxc
* @date 2020/9/19 4:28 下午
*/
void insertGovernAbilityRecord(@Param("lists") List<GovernAbilityGridMonthlyFormDTO> lists);
/**
* @Description 删除治理能力旧纪录
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/19 4:31 下午
*/
void deleteOldGovernAbilityRecord(@Param("customerId")String customerId,@Param("monthId")String monthId);
}

31
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactIndexPartyAbilityGridMonthlyService.java

@ -0,0 +1,31 @@
package com.epmet.service.evaluationindex.extract;
import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO;
import java.util.List;
/**
* 党建能力-网格相关事实表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-19
*/
public interface FactIndexPartyAbilityGridMonthlyService{
/**
* @Description 网格党建能力插入
* @param lists
* @author zxc
* @date 2020/9/19 10:32 上午
*/
void insertPartyAbility(List<PartyAbilityGridMonthlyFormDTO> lists);
/**
* @Description 删除旧的党建能力记录
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/19 10:45 上午
*/
void deleteOldPartyAbility(String customerId,String monthId);
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactIndexServiceAbilityGridMonthlyService.java

@ -0,0 +1,11 @@
package com.epmet.service.evaluationindex.extract;
/**
* 服务能力-网格相关事实表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-19
*/
public interface FactIndexServiceAbilityGridMonthlyService{
}

18
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginExtractService.java

@ -0,0 +1,18 @@
package com.epmet.service.evaluationindex.extract;
import com.epmet.dto.extract.form.ExtractFormDTO;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/15 14:00
*/
public interface FactOriginExtractService {
/**
* desc:抽取所有业务数据到统计库
*
* @param extractFormDTO
*/
void extractAll(ExtractFormDTO extractFormDTO);
}

94
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginProjectLogDailyService.java

@ -20,8 +20,13 @@ package com.epmet.service.evaluationindex.extract;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.extract.FactOriginProjectLogDailyDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.AutoNoMyResultDTO;
import com.epmet.dto.extract.result.NotReturnProjectResultDTO;
import com.epmet.dto.extract.result.ProjectEvaluateResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@ -92,4 +97,93 @@ public interface FactOriginProjectLogDailyService extends BaseService<FactOrigin
* @date 2020-09-16
*/
void delete(String[] ids);
/**
* 机关被吹哨次数
* @author zhaoqifeng
* @date 2020/9/18 14:53
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getAgencyTransferCount(String customerId, String monthId, String level);
/**
* @Description 查询未被退回的项目数
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/18 2:50 下午
*/
List<NotReturnProjectResultDTO> selectNotReturnProject(String customerId,String monthId,String actionCode,String orgType);
/**
* @Description 查询项目评价信息
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/18 3:28 下午
*/
List<ProjectEvaluateResultDTO> selectProjectEvaluate(String customerId,String monthId);
/**
* 根据日期删除数据
* @author zhaoqifeng
* @date 2020/9/18 17:30
* @param customerId
* @param date
* @return void
*/
void deleteByDate(String customerId, String date);
/**
* @Description 网格项目自治率查询
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/18 5:25 下午
*/
List<AutoNoMyResultDTO> selectProjectAutoNoMy(String customerId,String monthId);
/**
* 办结项目满意度
* @author zhaoqifeng
* @date 2020/9/20 16:43
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getSatisfaction(String customerId, String monthId, String level);
/**
* 机关被吹哨次数
* @author zhaoqifeng
* @date 2020/9/18 14:53
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getDepTransferCount(String customerId, String monthId, String level);
/**
* @Description 查询各机关办结了多少项目
* @param customerId
* @return
* @author wangc
* @date 2020.09.20 23:46
**/
Map<String,Integer> getProjectHandledAgency(String customerId, String dimId,String dateType);
/**
* @Description 计算机关响应度
* @param customerId
* @return
* @author wangc
* @date 2020.09.21 02:16
**/
Map<String, BigDecimal> getAgencyResponseRatio(String customerId, String dimId,String dateType);
}

53
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginProjectMainDailyService.java

@ -20,6 +20,8 @@ package com.epmet.service.evaluationindex.extract;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.extract.FactOriginProjectMainDailyDTO;
import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity;
import java.util.List;
@ -110,4 +112,55 @@ public interface FactOriginProjectMainDailyService extends BaseService<FactOrigi
* @return java.util.List<com.epmet.dto.extract.FactOriginProjectMainDailyDTO>
*/
List<FactOriginProjectMainDailyDTO> getPendingList(String customerId);
/**
* @Description 网格办结项目数
* @param customerId
* @param monthId
* @param status
* @author zxc
* @date 2020/9/18 2:06 下午
*/
List<GridProjectClosedTotalResultDTO> selectGridClosedProject(String customerId,String monthId,String status);
/**
* 项目超期数
* @author zhaoqifeng
* @date 2020/9/18 16:29
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getOverdueCount(String customerId, String monthId);
/**
* 根据日期删除数据
* @author zhaoqifeng
* @date 2020/9/18 17:30
* @param customerId
* @param date
* @return void
*/
void deleteByDate(String customerId, String date);
/**
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>
* @param customerId
* @param monthId
* @author yinzuomei
* @description 党员提出的议题转项目数
* @Date 2020/9/18 14:11
**/
List<Map<String, Integer>> selectShiftProjectCount(String customerId, String monthId);
/**
* @return java.lang.Integer
* @param customerId
* @param monthId
* @param topicIdList
* @author yinzuomei
* @description 9自建群活跃度议题转项目率
* @Date 2020/9/20 22:25
**/
Integer selectCountByPartyUser(String customerId, String monthId, List<String> topicIdList);
}

50
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicLogDailyService.java

@ -19,6 +19,7 @@ package com.epmet.service.evaluationindex.extract;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.extract.result.PartyActiveResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicLogDailyEntity;
import java.util.List;
@ -32,4 +33,53 @@ import java.util.Map;
*/
public interface FactOriginTopicLogDailyService extends BaseService<FactOriginTopicLogDailyEntity> {
/**
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>
* @param customerId
* @param monthId
* @author yinzuomei
* @description 查询客户下这个月内每个党员评论话题的次数
* @Date 2020/9/18 13:35
**/
List<Map<String, Integer>> selectJoinTopicCount(String customerId, String monthId);
/**
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>
* @param customerId
* @param monthId
* @author yinzuomei
* @description 党员自建群活跃度话题数
* @Date 2020/9/18 14:33
**/
List<Map<String, Integer>> selectGroupTopicCount(String customerId, String monthId);
/**
* @return int
* @param userId
* @param customerId
* @param monthId
* @author yinzuomei
* @description
* @Date 2020/9/20 21:43
**/
Integer selectUserCommentCount(String userId,String customerId, String monthId );
/**
* @return java.util.List<java.lang.String>
* @param groupIdList
* @author yinzuomei
* @description 组内的所有话题id
* @Date 2020/9/20 22:17
**/
List<String> selectTopicIds(List<String> groupIdList);
/**
* @Description 查询 话题评论党员/群众
* @param customerId
* @param monthId
* @param isParty
* @author zxc
* @date 2020/9/21 9:37 上午
*/
List<PartyActiveResultDTO> selectPartyActiveTopic(String customerId, String monthId,Integer isParty);
}

26
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicMainDailyService.java

@ -18,10 +18,12 @@
package com.epmet.service.evaluationindex.extract;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.topic.TopicOriginInfoDTO;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.result.CreateTopicCountResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity;
import java.util.List;
import java.util.Map;
/**
@ -34,13 +36,29 @@ public interface FactOriginTopicMainDailyService extends BaseService<FactOriginT
/**
* @return void
* @param customerId 客户id
* @param dateId yyyyMMdd
* @author yinzuomei 数据采集话题本身
* @description fact_origin_topic_log_daily 话题明细_日统计 fact_origin_topic_main_daily 话题主表_日统计
* @Date 2020/9/15 13:40
**/
Boolean topicCleaning(String customerId, String dateId);
Boolean topicCleaning(ExtractFormDTO extractFormDTO);
/**
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>
* @param customerId
* @param monthId yyyyMM
* @author yinzuomei
* @description 党员提出话题数返回每个党员这个月内提出的话题数
* @Date 2020/9/18 11:03
**/
List<Map<String, Integer>> selectPartyCreateTopicCount(String customerId, String monthId);
/**
* @Description 查询网格 党员/群众 人均提出话题数
* @param customerId
* @param monthId
* @param isParty
* @author zxc
* @date 2020/9/19 1:58 下午
*/
List<CreateTopicCountResultDTO> selectCreateTopicCount(String customerId, String monthId,Integer isParty);
}

34
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/GroupExtractService.java

@ -0,0 +1,34 @@
package com.epmet.service.evaluationindex.extract;
import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO;
import java.util.List;
import com.epmet.dto.extract.form.ExtractFormDTO;
/**
* @Desc 业务数据抽取 - 组相关
* @Author wangc
* @DateTime 2020/9/14 5:07 下午
*/
public interface GroupExtractService {
/**
* @Description 查询建群党员数
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/19 3:49 下午
*/
List<PartyCreateGroupCountResultDTO> selectPartyCreateGroupCount(String customerId,String monthId);
/**
* @Description 业务抽取 - 小组祥光
* @param param
* @return
* @author wangc
* @date 2020.09.18 21:07
**/
void extractGroupData(ExtractFormDTO param);
}

78
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java

@ -1,6 +1,15 @@
package com.epmet.service.evaluationindex.extract;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.GridIssueCountResultDTO;
import com.epmet.dto.extract.result.GridProjectCountResultDTO;
import com.epmet.dto.extract.result.PartyActiveResultDTO;
import com.epmet.dto.extract.result.ShiftProjectCountResultDTO;
import java.util.List;
import java.util.List;
import java.util.Map;
/**
* @Author zxc
@ -23,4 +32,73 @@ public interface IssueExtractService {
* @date 2020/9/16 9:41 上午
*/
Boolean issueExtractLog(ExtractFormDTO extractFormDTO);
/**
* @Description 查询网格议题总数网格人均议题数目
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/18 10:20 上午
*/
List<GridIssueCountResultDTO> selectIssueTotal(String customerId, String monthId);
/**
* @Description 网格总项目数
* @param customerId
* @param monthId
* @param status
* @author zxc
* @date 2020/9/18 1:21 下午
*/
List<GridProjectCountResultDTO> selectGridProjectCount(String customerId, String monthId,String status);
/**
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>
* @param customerId
* @param monthId
* @author yinzuomei
* @description 党员提出的话题转议题数
* @Date 2020/9/18 13:57
**/
List<Map<String, Integer>> selectShiftIssueCount(String customerId, String monthId);
/**
* @Description 查询网格 党员/群众 人均提出的议题转项目数
* @param customerId
* @param monthId
* @param isParty
* @author zxc
* @date 2020/9/19 2:26 下午
*/
List<ShiftProjectCountResultDTO> selectShiftProjectCountPlus(String customerId, String monthId,Integer isParty);
/**
* @return java.lang.Integer
* @param userId 用户id
* @param customerId
* @param monthId
* @author yinzuomei
* @description 查询用户在这个月内表决的总次数
* @Date 2020/9/20 21:50
**/
Integer selectCountUserVote(String userId, String customerId, String monthId);
/**
* @return java.lang.Integer
* @param topicIdList
* @author yinzuomei
* @description
* @Date 2020/9/20 22:50
**/
Integer selectIssueTotalTwoMonth(List<String> topicIdList);
/**
* @Description 查询 议题表决党员/群众
* @param customerId
* @param monthId
* @param isParty
* @author zxc
* @date 2020/9/21 9:37 上午
*/
List<PartyActiveResultDTO> selectPartyActiveIssueVote(String customerId, String monthId, Integer isParty);
}

26
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/ProjectExtractService.java

@ -1,5 +1,8 @@
package com.epmet.service.evaluationindex.extract;
import com.epmet.dto.extract.form.ExtractFormDTO;
import java.util.Date;
/**
@ -10,13 +13,22 @@ import java.util.Date;
public interface ProjectExtractService {
/**
* 项目主表明细日统计
*
* @param extractFormDTO
* @return
* @author zhaoqifeng
* @date 2020/9/15 14:38
*/
void saveOriginProjectDaily(ExtractFormDTO extractFormDTO);
/**
* 项目主表明细日统计
* @author zhaoqifeng
* @date 2020/9/15 14:38
* @param customerId
* @param date
* @Description 抽取项目节点历时逻辑
* @param param
* @return
*/
void saveOriginProjectDaily(String customerId, Date date);
* @author wangc
* @date 2020.09.17 14:05
**/
void extractProjectPeriodData(ExtractFormDTO param);
}

21
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/ProjectPeriodExtractService.java

@ -0,0 +1,21 @@
package com.epmet.service.evaluationindex.extract;
import com.epmet.dto.extract.form.ExtractFormDTO;
/**
* @Desc 业务数据抽取 - 项目节点历时
* @Author wangc
* @DateTime 2020/9/14 5:07 下午
*/
public interface ProjectPeriodExtractService {
/**
* @Description 抽取项目节点历时逻辑
* @param param
* @return
* @author wangc
* @date 2020.09.17 14:05
**/
void extractProjectPeriodData(ExtractFormDTO param);
}

18
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexOriginExtractService.java

@ -0,0 +1,18 @@
package com.epmet.service.evaluationindex.extract.dataToIndex;
import com.epmet.dto.extract.form.ExtractIndexFormDTO;
/**
* desc将统计库对象数据抽取到指标库 服务接口
*
* @author yinzuomei@elink-cn.com
* @date 2020/9/17 14:05
*/
public interface IndexOriginExtractService {
/**
* desc从统计库对象抽取指标数据
*
* @param formDTO
*/
void indexOriginExtractAll(ExtractIndexFormDTO formDTO);
}

105
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java

@ -0,0 +1,105 @@
package com.epmet.service.evaluationindex.extract.dataToIndex.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.extract.form.ExtractIndexFormDTO;
import com.epmet.service.evaluationindex.extract.CalCpcIndexService;
import com.epmet.service.evaluationindex.extract.CalGridIndexService;
import com.epmet.service.evaluationindex.extract.dataToIndex.IndexOriginExtractService;
import com.epmet.service.stats.DimCustomerService;
import com.epmet.util.DimIdGenerator;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.concurrent.*;
/**
* desc指标原始数据抽取服务实现类
*/
@Slf4j
@Service
public class IndexOriginExtractServiceImpl implements IndexOriginExtractService {
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder()
.setNameFormat("indexOriginExtract-pool-%d").build();
ExecutorService threadPool = new ThreadPoolExecutor(2, 8,
10L, TimeUnit.MINUTES,
new LinkedBlockingQueue<>(500), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy());
@Autowired
private CalCpcIndexService calCpcIndexService;
@Autowired
private CalGridIndexService calGridIndexService;
@Autowired
private DimCustomerService dimCustomerService;
/**
* desc从统计库对象抽取指标数据
*
* @param formDTO
*/
@Override
public void indexOriginExtractAll(ExtractIndexFormDTO formDTO) {
String monthId = formDTO.getMonthId();
String customerId = formDTO.getCustomerId();
if (StringUtils.isBlank(monthId)) {
monthId = DimIdGenerator.getDateDimId(DateUtils.addDateMonths(new Date(), -1));
}
List<String> customerIds = new ArrayList<>();
if (StringUtils.isNotBlank(customerId)) {
customerIds.add(customerId);
}
int pageNo = NumConstant.ONE;
int pageSize = NumConstant.ONE_HUNDRED;
customerIds = dimCustomerService.selectCustomerIdPage(pageNo, pageSize);
if (CollectionUtils.isEmpty(customerIds)) {
log.error("indexOriginExtractAll 获取客户Id为空");
return;
}
String finalMonthId = monthId;
customerIds.forEach(cId -> {
ExtractIndexFormDTO param = new ExtractIndexFormDTO();
param.setCustomerId(cId);
param.setMonthId(finalMonthId);
submitJob(param);
});
}
private void submitJob(ExtractIndexFormDTO param) {
final String customerId = param.getCustomerId();
final String monthId = param.getMonthId();
threadPool.submit(() -> {
try {
calCpcIndexService.calCpcPartyAbility(customerId, monthId);
} catch (Exception e) {
log.error("抽取【党员相关数据】发生异常,参数:" + JSON.toJSONString(param), e);
}
});
threadPool.submit(() -> {
try {
calGridIndexService.calGridIndexGovernAbility(customerId, monthId);
} catch (Exception e) {
log.error("抽取【网格治理能力数据】发生异常,参数:" + JSON.toJSONString(param), e);
}
try {
calGridIndexService.calGridIndexPartyAbility(customerId, monthId);
} catch (Exception e) {
log.error("抽取【网格党建能力数据】发生异常,参数:" + JSON.toJSONString(param), e);
}
try {
calGridIndexService.calGridIndexServiceAbility(customerId, monthId);
} catch (Exception e) {
log.error("抽取【网格服务能力数据】发生异常,参数:" + JSON.toJSONString(param), e);
}
});
}
}

435
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalCpcIndexServiceImpl.java

@ -0,0 +1,435 @@
package com.epmet.service.evaluationindex.extract.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyDao;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity;
import com.epmet.service.evaluationindex.extract.*;
import com.epmet.service.stats.DimCustomerPartymemberService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 党员相关
*
* @author yinzuomei@elink-cn.com
* @date 2020/9/17 14:06
*/
@Slf4j
@Service
public class CalCpcIndexServiceImpl implements CalCpcIndexService {
@Autowired
private DimCustomerPartymemberService dimCustomerPartymemberService;
@Autowired
private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao;
@Autowired
private FactOriginTopicMainDailyService factOriginTopicMainDailyService;
@Autowired
private FactOriginTopicLogDailyService factOriginTopicLogDailyService;
@Autowired
private IssueExtractService issueExtractService;
@Autowired
private FactOriginProjectMainDailyService factOriginProjectMainDailyService;
@Autowired
private FactOriginGroupMainDailyDao factOriginGroupMainDailyDao;
/**
* @param customerId 客户id
* @param monthId yyyyMM
* @return void
* @author yinzuomei
* @description 党员相关-党建能力
* @Date 2020/9/17 14:08
**/
@Override
public void calCpcPartyAbility(String customerId, String monthId) {
//1、构造初始值
List<FactIndexPartyAblityCpcMonthlyEntity> indexPartyAblityCpcList = dimCustomerPartymemberService.selectPartyMemberList(customerId);
if (CollectionUtils.isEmpty(indexPartyAblityCpcList)) {
log.info("dim_customer_partymember do not any records");
return;
}
String quarterId= DateUtils.getQuarterId(monthId);
String yearId=DateUtils.getYearId(monthId);
//2、删除之前统计过的
deleteFactIndexPartyAblityCpcMonthly(customerId, monthId);
//1、党员提出话题数
Map<String, Integer> createTopicCountMap = calCreateTopicCount(customerId, monthId);
//2、党员参与话题数(支持、反对、评论、浏览)---目前只统计 党员评论话题次数之和
Map<String, Integer> joinTopicCountMap = calJoinTopicCount(customerId, monthId);
//3、党员提出的话题转议题数
Map<String, Integer> shiftIssueCountMap = calShiftIssueCount(customerId, monthId);
//4、党员提出的议题转项目数
Map<String, Integer> shiftProjectCountMap = calShiftProjectCount(customerId, monthId);
//5、参加“三会一课”次数 默认0
//可以先查询出每个党员的 自建群
Map<String, List<String>> userCreatedGroups = queryUserCreatedGroups(customerId, indexPartyAblityCpcList);
//6、党员自建群群众人数 (todo 和monthId无关??)
Map<String, Integer> groupUserCountMap = calgroupUserCount(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups);
//7、党员自建群活跃群众人数
Map<String, Integer> groupActiveUserCountMap = calGroupActiveUserCount(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups);
//8、党员自建群活跃度——话题数 (todo 校验sql正确性)
Map<String, Integer> groupTopicCountMap = calGroupTopicCount(customerId, monthId);
//9、自建群活跃度——议题转项目率
Map<String, BigDecimal> topicToIssueRatioMap = caltopicToIssueRatio(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups);
//3、计算实际值,更新
for (FactIndexPartyAblityCpcMonthlyEntity indexPartyAblityCpcEntity : indexPartyAblityCpcList) {
indexPartyAblityCpcEntity.setMonthId(monthId);
indexPartyAblityCpcEntity.setQuarterId(quarterId);
indexPartyAblityCpcEntity.setYearId(yearId);
//1、党员提出话题数
if (createTopicCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) {
indexPartyAblityCpcEntity.setCreateTopicCount(createTopicCountMap.get(indexPartyAblityCpcEntity.getUserId()));
}
//2、党员参与话题数(支持、反对、评论、浏览)---目前只统计 党员评论话题次数之和
if (joinTopicCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) {
indexPartyAblityCpcEntity.setJoinTopicCount(joinTopicCountMap.get(indexPartyAblityCpcEntity.getUserId()));
}
//3、党员提出的话题转议题数
if (shiftIssueCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) {
indexPartyAblityCpcEntity.setShiftIssueCount(shiftIssueCountMap.get(indexPartyAblityCpcEntity.getUserId()));
}
//4、党员提出的议题转项目数
if (shiftProjectCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) {
indexPartyAblityCpcEntity.setShiftProjectCount(shiftProjectCountMap.get(indexPartyAblityCpcEntity.getUserId()));
}
//5、参加“三会一课”次数 目前没有此业务,默认0
//6、党员自建群群众人数
if (groupUserCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) {
indexPartyAblityCpcEntity.setGroupUserCount(groupUserCountMap.get(indexPartyAblityCpcEntity.getUserId()));
}
//7、党员自建群活跃群众人数
if (groupActiveUserCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) {
indexPartyAblityCpcEntity.setGroupActiveUserCount(groupActiveUserCountMap.get(indexPartyAblityCpcEntity.getUserId()));
}
//8、党员自建群活跃度——话题数
if (groupTopicCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) {
indexPartyAblityCpcEntity.setGroupTopicCount(groupTopicCountMap.get(indexPartyAblityCpcEntity.getUserId()));
}
//9、自建群活跃度——议题转项目率
if (topicToIssueRatioMap.containsKey(indexPartyAblityCpcEntity.getUserId())) {
indexPartyAblityCpcEntity.setTopicToIssueRatio(topicToIssueRatioMap.get(indexPartyAblityCpcEntity.getUserId()));
}
}
//4、分批插入批量插入
List<List<FactIndexPartyAblityCpcMonthlyEntity>> partition = ListUtils.partition(indexPartyAblityCpcList, IndexCalConstant.INSERT_SIZE);
partition.forEach(list -> {
this.FactIndexPartyAblityCpcMonthlyEntity(list);
});
}
/**
* @param customerId
* @param partyMemberList
* @return java.util.Map<java.lang.String, java.util.List < java.lang.String>>
* @author yinzuomei
* @description 查询每个党员的自建群
* @Date 2020/9/20 22:07
**/
private Map<String, List<String>> queryUserCreatedGroups(String customerId, List<FactIndexPartyAblityCpcMonthlyEntity> partyMemberList) {
Map<String, List<String>> map = new HashMap<>();
for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) {
//查询当前党员建了多少个组
List<String> groupIdList = factOriginGroupMainDailyDao.selectGroupIds(customerId, partyMember.getUserId());
if (CollectionUtils.isEmpty(groupIdList)) {
map.put(partyMember.getUserId(), new ArrayList<>());
continue;
} else {
map.put(partyMember.getUserId(), groupIdList);
}
}
return map;
}
/**
* @param customerId
* @param monthId
* @return java.lang.Integer
* @author yinzuomei
* @description 1查询出客户下所有党员对应的-党员提出话题数
* @Date 2020/9/18 10:59
**/
private Map<String, Integer> calCreateTopicCount(String customerId, String monthId) {
List<Map<String, Integer>> mapList = factOriginTopicMainDailyService.selectPartyCreateTopicCount(customerId, monthId);
Map<String, Integer> resultMap = new HashMap<>();
for (Map<String, Integer> map : mapList) {
for (Map.Entry<String, Integer> m : map.entrySet()) {
resultMap.put(m.getKey(), m.getValue());
}
}
return resultMap;
}
/**
* @param customerId
* @param monthId
* @return java.util.Map<java.lang.String, java.lang.Integer>
* @author yinzuomei
* @description 2查询客户下这个月内每个党员评论话题的次数
* @Date 2020/9/18 13:33
**/
private Map<String, Integer> calJoinTopicCount(String customerId, String monthId) {
List<Map<String, Integer>> mapList = factOriginTopicLogDailyService.selectJoinTopicCount(customerId, monthId);
Map<String, Integer> resultMap = new HashMap<>();
for (Map<String, Integer> map : mapList) {
for (Map.Entry<String, Integer> m : map.entrySet()) {
resultMap.put(m.getKey(), m.getValue());
}
}
return resultMap;
}
/**
* @param customerId
* @param monthId
* @return java.util.Map<java.lang.String, java.lang.Integer>
* @author yinzuomei
* @description 3党员提出的话题转议题数
* @Date 2020/9/18 13:53
**/
private Map<String, Integer> calShiftIssueCount(String customerId, String monthId) {
List<Map<String, Integer>> mapList = issueExtractService.selectShiftIssueCount(customerId, monthId);
Map<String, Integer> resultMap = new HashMap<>();
for (Map<String, Integer> map : mapList) {
for (Map.Entry<String, Integer> m : map.entrySet()) {
resultMap.put(m.getKey(), m.getValue());
}
}
return resultMap;
}
/**
* @param customerId
* @param monthId
* @return java.util.Map<java.lang.String, java.lang.Integer>
* @author yinzuomei
* @description 4党员提出的议题转项目数
* @Date 2020/9/18 14:10
**/
private Map<String, Integer> calShiftProjectCount(String customerId, String monthId) {
//查询fact_origin_project_main_daily 表 中议题的议题的状态为 shift_
List<Map<String, Integer>> mapList = factOriginProjectMainDailyService.selectShiftProjectCount(customerId, monthId);
Map<String, Integer> resultMap = new HashMap<>();
for (Map<String, Integer> map : mapList) {
for (Map.Entry<String, Integer> m : map.entrySet()) {
resultMap.put(m.getKey(), m.getValue());
}
}
return resultMap;
}
/**
* @param customerId
* @param monthId
* @return java.util.Map<java.lang.String, java.lang.Integer>
* @author yinzuomei
* @description 6党员自建群群众人数
* @Date 2020/9/18 15:38
**/
private Map<String, Integer> calgroupUserCount(String customerId, String monthId,
List<FactIndexPartyAblityCpcMonthlyEntity> partyMemberList,
Map<String, List<String>> userCreatedGroups) {
/*含义评价周期内党员自建群中群众成员数
数据来源用户社群关系表
计算方法对党员i的所有j个自建群从用户社群关系表中统计属于每个自建群的群众用户总人数并对j个群众用户总数进行不重复累加
对评价结果的影响正向*/
Map<String, Integer> map = new HashMap<>();
for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) {
//查询当前党员建了多少个组
List<String> groupIdList = userCreatedGroups.get(partyMember.getUserId());
if (CollectionUtils.isEmpty(groupIdList)) {
map.put(partyMember.getUserId(), NumConstant.ZERO);
continue;
}
//去重组里面的成员
List<String> memberIdList = factOriginGroupMainDailyDao.selectGroupMemberList(groupIdList);
if (CollectionUtils.isEmpty(memberIdList)) {
map.put(partyMember.getUserId(), NumConstant.ZERO);
continue;
} else {
map.put(partyMember.getUserId(), memberIdList.size());
}
}
return map;
}
/**
* @param customerId
* @param monthId
* @param partyMemberList
* @return java.util.Map<java.lang.String, java.lang.Integer>
* @author yinzuomei
* @description 7党员自建群活跃群众人数
* @Date 2020/9/20 21:36
**/
private Map<String, Integer> calGroupActiveUserCount(String customerId, String monthId,
List<FactIndexPartyAblityCpcMonthlyEntity> partyMemberList,
Map<String, List<String>> userCreatedGroups) {
/*含义评价周期内党员自建群中活跃群众成员数所谓活跃群成员即评价周期内参与话题事件评论点赞点踩总次数大于给定阈值的群众用户
数据来源话题用户阅读表话题评论用户表态表话题评论表事件点赞点踩表事件评论点赞点踩表事件评论表用户信息表
计算方法
a)判断群中的群众成员是否活跃
for each 群众成员 i
统计i的话题阅读次数话题评论次数话题评论表态次数事件点赞点踩次数事件评论点赞点踩次数事件评论总次数
If 总次数>阈值
成员i为活跃群众成员
b)不重复累加活跃群众成员数
对评价结果的影响正向*/
//结合目前产品,数据来源:话题评论、议题表决
Map<String, Integer> map = new HashMap<>();
for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) {
int groupActiveUserCount = 0;
//1、查询当前党员建了多少个组
List<String> groupIdList = userCreatedGroups.get(partyMember.getUserId());
if (CollectionUtils.isEmpty(groupIdList)) {
map.put(partyMember.getUserId(), NumConstant.ZERO);
continue;
}
//2、去重组里面的成员
List<String> memberIdList = factOriginGroupMainDailyDao.selectGroupMemberList(groupIdList);
if (CollectionUtils.isEmpty(memberIdList)) {
map.put(partyMember.getUserId(), NumConstant.ZERO);
continue;
}
//3、判断每个成员是否 “活跃”
for (String memberId : memberIdList) {
//1、判断成员在本月内是否评论过
Integer topicCommentCount = factOriginTopicLogDailyService.selectUserCommentCount(memberId, customerId, monthId);
if (topicCommentCount > 0) {
groupActiveUserCount++;
continue;
}
//2、判断成员在本月内是否表决过(支持or反对)议题
Integer voteCount = issueExtractService.selectCountUserVote(memberId, customerId, monthId);
if (voteCount > 0) {
groupActiveUserCount++;
}
}
//赋值每个党员的 -- 党员自建群活跃群众人数
map.put(partyMember.getUserId(), groupActiveUserCount);
}
return map;
}
/**
* @param customerId
* @param monthId
* @return java.util.Map<java.lang.String, java.lang.Integer>
* @author yinzuomei
* @description 8党员自建群活跃度话题数
* @Date 2020/9/18 14:31
**/
private Map<String, Integer> calGroupTopicCount(String customerId, String monthId) {
/*含义评价周期内党员自建群中话题发布数
数据来源话题表
计算方法从话题表中统计党员自建群i的话题总数对所有自建群话题数累加
对评价结果的影响正向*/
List<Map<String, Integer>> mapList = factOriginTopicLogDailyService.selectGroupTopicCount(customerId, monthId);
Map<String, Integer> resultMap = new HashMap<>();
for (Map<String, Integer> map : mapList) {
for (Map.Entry<String, Integer> m : map.entrySet()) {
resultMap.put(m.getKey(), m.getValue());
}
}
return resultMap;
}
/**
* @param userCreatedGroups 党员自建群
* @return java.util.Map<java.lang.String, java.math.BigDecimal>
* @author yinzuomei
* @description 9自建群活跃度议题转项目率
* @Date 2020/9/20 22:11
**/
private Map<String, BigDecimal> caltopicToIssueRatio(String customerId,
String monthId,
List<FactIndexPartyAblityCpcMonthlyEntity> partyMemberList,
Map<String, List<String>> userCreatedGroups) {
Map<String, BigDecimal> map = new HashMap<>();
for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) {
//如果党员自建群为空,直接赋值0
if (CollectionUtils.isEmpty(userCreatedGroups.get(partyMember.getUserId()))) {
map.put(partyMember.getUserId(), BigDecimal.ZERO);
continue;
}
//自建群出来的话题
List<String> groupIdList = userCreatedGroups.get(partyMember.getUserId());
List<String> topicIdList = factOriginTopicLogDailyService.selectTopicIds(groupIdList);
if (CollectionUtils.isEmpty(topicIdList)) {
map.put(partyMember.getUserId(), BigDecimal.ZERO);
continue;
}
//分子
//本月内新增的项目(and 源于自建群中的话题)
Integer projectTotal = factOriginProjectMainDailyService.selectCountByPartyUser(customerId, monthId, topicIdList);
if (null == projectTotal || projectTotal == NumConstant.ZERO) {
map.put(partyMember.getUserId(), BigDecimal.ZERO);
continue;
}
//分母
//本评价周期+上一个评价周期内自建群中的议题数
Integer issueTotal = issueExtractService.selectIssueTotalTwoMonth(topicIdList);
if (null == issueTotal || issueTotal == NumConstant.ZERO) {
map.put(partyMember.getUserId(), BigDecimal.ZERO);
continue;
}
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(6);
String topicToIssueRatioStr = numberFormat.format((float) projectTotal / issueTotal);
BigDecimal topicToIssueRatio = new BigDecimal(topicToIssueRatioStr);
map.put(partyMember.getUserId(), topicToIssueRatio);
}
return map;
}
/**
* @param customerId
* @param monthId
* @return void
* @author yinzuomei
* @description 删除这个客户这个月 党员相关-党建能力的数据
* @Date 2020/9/18 10:20
**/
@DataSource(value = DataSourceConstant.EVALUATION_INDEX)
public void deleteFactIndexPartyAblityCpcMonthly(String customerId, String monthId) {
int deleteNum;
do {
deleteNum = factIndexPartyAblityCpcMonthlyDao.deleteFactIndexPartyAblityCpcMonthly(customerId, monthId);
} while (deleteNum > NumConstant.ZERO);
}
/**
* @param list
* @return void
* @author yinzuomei
* @description 批量插入党员相关党建能力表
* @Date 2020/9/18 10:27
**/
@DataSource(value = DataSourceConstant.EVALUATION_INDEX)
private void FactIndexPartyAblityCpcMonthlyEntity(List<FactIndexPartyAblityCpcMonthlyEntity> list) {
factIndexPartyAblityCpcMonthlyDao.insertBatchEntity(list);
}
}

425
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java

@ -0,0 +1,425 @@
package com.epmet.service.evaluationindex.extract.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.ExtractConstant;
import com.epmet.constant.ProjectEvaluateConstant;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao;
import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO;
import com.epmet.dto.extract.form.GridIssueCountResultDTO;
import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO;
import com.epmet.dto.extract.result.*;
import com.epmet.service.evaluationindex.extract.*;
import com.epmet.service.stats.FactArticlePublishedGridDailyService;
import com.epmet.service.stats.user.FactRegUserGridMonthlyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
/**
* @Author zxc
* @DateTime 2020/9/18 9:53 上午
*/
@Service
@Slf4j
public class CalGridIndexServiceImpl implements CalGridIndexService {
@Autowired
private IssueExtractService issueExtractService;
@Autowired
private FactIndexGovernAbilityGridMonthlyService governAbilityGridMonthlyService;
@Autowired
private FactIndexPartyAbilityGridMonthlyService partyAbilityGridMonthlyService;
@Autowired
private FactIndexGovrnAblityGridMonthlyDao governAbilityDao;
@Autowired
private FactOriginProjectMainDailyService projectMainService;
@Autowired
private FactOriginProjectLogDailyService projectLogService;
@Autowired
private FactRegUserGridMonthlyService userGridMonthlyService;
@Autowired
private FactOriginTopicMainDailyService topicMainService;
@Autowired
private FactArticlePublishedGridDailyService articlePublishedGridDailyService;
@Autowired
private GroupExtractService groupExtractService;
@Autowired
private FactOriginTopicLogDailyService topicLogService;
/**
* @Description 计算网格指标党建能力
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/18 9:56 上午
*/
@Override
public Boolean calGridIndexPartyAbility(String customerId, String monthId) {
List<PartyAbilityGridMonthlyFormDTO> result = governAbilityDao.selectAllGridInfoToParty(customerId);
if (CollectionUtils.isEmpty(result)){
throw new RenException("客户【"+customerId+"】未查出网格信息");
}
// 网格群众用户数 , 网格党员用户数
List<GridUserCountResultDTO> gridUserCountList = userGridMonthlyService.selectGridUserCount(customerId, monthId);
// 网格党员人均提出话题数
List<CreateTopicCountResultDTO> partyCreateTopicCountList = topicMainService.selectCreateTopicCount(customerId, monthId, NumConstant.ONE);
// 网格群众人均提出话题数
List<CreateTopicCountResultDTO> massCreateTopicCountList = topicMainService.selectCreateTopicCount(customerId, monthId, NumConstant.ZERO);
// 网格党员人均提出的议题转项目数
List<ShiftProjectCountResultDTO> partyShiftProjectCountList = issueExtractService.selectShiftProjectCountPlus(customerId, monthId, NumConstant.ONE);
// 网格群众人均提出的议题转项目数
List<ShiftProjectCountResultDTO> massShiftProjectCountList = issueExtractService.selectShiftProjectCountPlus(customerId, monthId, NumConstant.ZERO);
// 网格的发文数量
List<PublishCountResultDTO> publishCountList = articlePublishedGridDailyService.selectArticlePublishCount(customerId, monthId);
// 网格议题转项目率
List<GridIssueCountResultDTO> gridIssueTotalList = issueExtractService.selectIssueTotal(customerId, monthId);
List<GridProjectCountResultDTO> gridProjectTotalList = issueExtractService.selectGridProjectCount(customerId, monthId, ExtractConstant.SHIFT_PROJECT);
List<GridProjectCountResultDTO> gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueTotalList, gridProjectTotalList);
// 建群党员数
List<PartyCreateGroupCountResultDTO> partyCreateGroupCountList = groupExtractService.selectPartyCreateGroupCount(customerId, monthId);
//结合目前产品,数据来源:话题评论、议题表决
//网格活跃群众用户数
Map<String,Integer> gridMassActiveMap = new HashMap<>(16);
List<PartyActiveResultDTO> massActiveList = topicLogService.selectPartyActiveTopic(customerId, monthId, NumConstant.ZERO);
List<PartyActiveResultDTO> massActiveIssueVote = issueExtractService.selectPartyActiveIssueVote(customerId, monthId, NumConstant.ZERO);
massActiveList.addAll(massActiveIssueVote);
if (!CollectionUtils.isEmpty(massActiveList)) {
Map<String, List<PartyActiveResultDTO>> collectMap = massActiveList.stream().collect(Collectors.groupingBy(PartyActiveResultDTO::getGridId));
collectMap.forEach((gridId, massActive) -> {
List<String> userIds = massActive.stream().map(mass -> mass.getUserId()).distinct().collect(Collectors.toList());
gridMassActiveMap.put(gridId, userIds.size());
});
}
//网格活跃党员用户数
Map<String,Integer> gridPartyActiveMap = new HashMap<>(16);
List<PartyActiveResultDTO> partyActiveList = topicLogService.selectPartyActiveTopic(customerId, monthId, NumConstant.ONE);
List<PartyActiveResultDTO> partyActiveIssueVote = issueExtractService.selectPartyActiveIssueVote(customerId, monthId, NumConstant.ONE);
partyActiveList.addAll(partyActiveIssueVote);
if (!CollectionUtils.isEmpty(partyActiveList)){
Map<String, List<PartyActiveResultDTO>> collectMap = massActiveList.stream().collect(Collectors.groupingBy(PartyActiveResultDTO::getGridId));
collectMap.forEach((gridId, partyActive) -> {
List<String> userIds = partyActive.stream().map(party -> party.getUserId()).distinct().collect(Collectors.toList());
gridPartyActiveMap.put(gridId, userIds.size());
});
}
String quarterId = DateUtils.getQuarterId(monthId);
String yearId = DateUtils.getYearId(monthId);
result.forEach(r -> {
r.setMonthId(monthId);
r.setQuarterId(quarterId);
r.setYearId(yearId);
// 1. 网格群众用户数 , 网格党员用户数
if (!CollectionUtils.isEmpty(gridUserCountList)){
gridUserCountList.forEach(count -> {
if (r.getGridId().equals(count.getGridId())){
BeanUtils.copyProperties(count,r);
}
});
}
// 2. 网格党员人均提出话题数
if (!CollectionUtils.isEmpty(partyCreateTopicCountList)){
partyCreateTopicCountList.forEach(party -> {
if (r.getGridId().equals(party.getGridId())){
r.setPartyAvgTopicCount(party.getCreateTopicCount());
}
});
}
// 3. 网格群众人均提出话题数
if (!CollectionUtils.isEmpty(massCreateTopicCountList)){
massCreateTopicCountList.forEach(mass -> {
if (r.getGridId().equals(mass.getGridId())){
r.setUserAvgTopicCount(mass.getCreateTopicCount());
}
});
}
// 4. 网格党员人均提出的议题转项目数
if (!CollectionUtils.isEmpty(partyShiftProjectCountList)){
partyShiftProjectCountList.forEach(party -> {
if (r.getGridId().equals(party.getGridId())){
r.setPartyAvgShiftProjectCount(party.getShiftProjectCount());
}
});
}
// 5. 网格群众人均提出的议题转项目数
if (!CollectionUtils.isEmpty(massShiftProjectCountList)){
massShiftProjectCountList.forEach(mass -> {
if (r.getGridId().equals(mass.getGridId())){
r.setPartyAvgShiftProjectCount(mass.getShiftProjectCount());
}
});
}
// 6. 网格的发文数量
if (!CollectionUtils.isEmpty(publishCountList)){
publishCountList.forEach(publish -> {
if (r.getGridId().equals(publish.getGridId())){
r.setPublishArticleCount(publish.getPublishCount());
}
});
}
// 7. 网格议题转项目率
if (!CollectionUtils.isEmpty(gridIssueShiftProjectRatio)){
gridIssueShiftProjectRatio.forEach(ratio -> {
if (r.getGridId().equals(ratio.getGridId())){
r.setIssueToProjectRatio(ratio.getIssueToProjectRatio());
}
});
}
// 8. 建群党员数
if (!CollectionUtils.isEmpty(partyCreateGroupCountList)){
partyCreateGroupCountList.forEach(party -> {
if (r.getGridId().equals(party.getGridId())){
r.setCreateGroupPartyCount(party.getPartyCreateGroupCount());
}
});
}
// 9. 网格活跃群众用户数
if (null != gridMassActiveMap){
gridMassActiveMap.forEach((k,v) -> {
if (r.getGridId().equals(k)){
r.setActiveUserCount(v);
}
});
}
// 10. 网格活跃党员用户数
if (null != gridPartyActiveMap){
gridPartyActiveMap.forEach((k,v) -> {
if (r.getGridId().equals(k)){
r.setActivePartyCount(v);
}
});
}
});
delAndInsertPartyAbility(result,customerId,monthId);
return true;
}
/**
* @Description 计算网格指标治理能力
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/18 9:56 上午
*/
@Override
public Boolean calGridIndexGovernAbility(String customerId, String monthId) {
List<GovernAbilityGridMonthlyFormDTO> result = governAbilityDao.selectAllGridInfo(customerId);
if (CollectionUtils.isEmpty(result)){
throw new RenException("客户【"+customerId+"】未查出网格信息");
}
//网格总议题数目,网格人均议题数目
List<GridIssueCountResultDTO> gridIssueTotalList = issueExtractService.selectIssueTotal(customerId, monthId);
//网格总项目数
List<GridProjectCountResultDTO> gridProjectTotalList = issueExtractService.selectGridProjectCount(customerId, monthId, ExtractConstant.SHIFT_PROJECT);
//网格议题转项目率
List<GridProjectCountResultDTO> gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueTotalList, gridProjectTotalList);
//网格自治项目数 从议题创建到项目关闭,包括处理人,自始至终没有出过议题所属网格
List<AutoNoMyResultDTO> projectAutoNoMyList = projectLogService.selectProjectAutoNoMy(customerId, monthId);
Map<String,Integer> autoMap = new HashMap<>(16);
if (!CollectionUtils.isEmpty(projectAutoNoMyList)){
Map<String, List<AutoNoMyResultDTO>> groupByGrid = projectAutoNoMyList.stream().collect(Collectors.groupingBy(AutoNoMyResultDTO::getGridId));
groupByGrid.forEach((gridId,projectList) -> {
Map<String, List<AutoNoMyResultDTO>> groupByProject = projectList.stream().collect(Collectors.groupingBy(AutoNoMyResultDTO::getProjectId));
AtomicReference<Boolean> autoSelf = new AtomicReference<>(true);
AtomicReference<Integer> count = new AtomicReference<>(NumConstant.ZERO);
groupByProject.forEach((projectId,projects) -> {
String disposeGrid = projects.get(NumConstant.ZERO).getGridId();
projects.forEach(p -> {
if (!disposeGrid.equals(p.getGridId())){
autoSelf.set(false);
}
});
if (autoSelf.get()) {
count.getAndSet(count.get() + NumConstant.ONE);
}
});
autoMap.put(gridId,count.get());
});
}
//网格办结项目数
List<GridProjectClosedTotalResultDTO> gridProjectClosedTotalList = projectMainService.selectGridClosedProject(customerId, monthId, ExtractConstant.CLOSED);
//网格吹哨部门准确率 【没被退回的项目数/项目总数 】
List<NotReturnProjectResultDTO> notReturnProjectList = projectLogService.selectNotReturnProject(customerId, monthId, ExtractConstant.RETURN_ACTION_CODE, ExtractConstant.GRID_ORG_TYPE);
if (!CollectionUtils.isEmpty(gridIssueShiftProjectRatio) && !CollectionUtils.isEmpty(notReturnProjectList)){
notReturnProjectList.forEach(not -> {
gridIssueShiftProjectRatio.forEach(total -> {
if (not.getGridId().equals(total.getGridId())){
not.setTransferRightRatio(getRound(new BigDecimal(not.getNotReturnProject()/total.getProjectTotal())));
}
});
});
}
//网格内解决的项目的满意度
//项目评价(分值定义下非常满意100,满意80,不满意(一般)60)的人数的平均分(每个项目的参加人数的分数和/评论人数=一个项目的平均分)+其他项目得分/已关闭项目总数
List<ProjectEvaluateResultDTO> projectEvaluateList = projectLogService.selectProjectEvaluate(customerId, monthId);
Map<String,BigDecimal> resultSatisfactionScore = new HashMap<>(16);
if (!CollectionUtils.isEmpty(projectEvaluateList)){
Map<String, List<ProjectEvaluateResultDTO>> groupByGrid = projectEvaluateList.stream().collect(Collectors.groupingBy(ProjectEvaluateResultDTO::getGridId));
groupByGrid.forEach((gridId,projectEvaluateInfoList) -> {
Map<String,Integer> scoreMap = new HashMap<>(16);
Map<String, List<ProjectEvaluateResultDTO>> groupByProject = projectEvaluateInfoList.stream().collect(Collectors.groupingBy(ProjectEvaluateResultDTO::getProjectId));
groupByProject.forEach((projectId,projectList) -> {
projectList.forEach(project -> {
switch (project.getActionCode()) {
case ExtractConstant.EVALUATE_BAD:
project.setScore(ProjectEvaluateConstant.BAD);
break;
case ExtractConstant.EVALUATE_GOOD:
project.setScore(ProjectEvaluateConstant.GOOD);
break;
case ExtractConstant.EVALUATE_PERFECT:
project.setScore(ProjectEvaluateConstant.PERFECT);
break;
default:
log.warn("calGridIndexGovernAbility orther projectEvaluate,actionCode:{}", project.getActionCode());
}
});
Integer projectAllScore = projectList.stream().mapToInt(ProjectEvaluateResultDTO::getScore).sum();
scoreMap.put(projectId,projectAllScore/projectList.size());
});
AtomicReference<Integer> allScore = new AtomicReference<>(0);
scoreMap.forEach((k,v) -> {
allScore.set(++v);
});
resultSatisfactionScore.put(gridId,getRound(new BigDecimal(allScore.get()/scoreMap.size())));
});
}
String quarterId = DateUtils.getQuarterId(monthId);
String yearId = DateUtils.getYearId(monthId);
result.forEach(r -> {
r.setMonthId(monthId);
r.setQuarterId(quarterId);
r.setYearId(yearId);
// 1. 网格总议题数目,网格人均议题数目
if (!CollectionUtils.isEmpty(gridIssueTotalList)) {
gridIssueTotalList.forEach(total -> {
if (r.getGridId().equals(total.getGridId())) {
BeanUtils.copyProperties(total, r);
}
});
}
// 2. 网格总项目数,网格议题转项目率
if (!CollectionUtils.isEmpty(gridIssueTotalList)){
gridIssueShiftProjectRatio.forEach(projectTotal -> {
if (r.getGridId().equals(projectTotal.getGridId())){
r.setProjectTotal(projectTotal.getProjectTotal());
r.setIssueToProjectRatio(projectTotal.getIssueToProjectRatio());
}
});
}
// 3. 网格办结项目数
if (!CollectionUtils.isEmpty(gridProjectClosedTotalList)){
gridProjectClosedTotalList.forEach(closed -> {
if (r.getGridId().equals(closed.getGridId())){
r.setResolveProjectCount(closed.getResolveProjectCount());
}
});
}
// 4. 网格吹哨部门准确率
if (!CollectionUtils.isEmpty(notReturnProjectList)) {
notReturnProjectList.forEach(not -> {
if (r.getGridId().equals(not.getGridId())) {
r.setTransferRightRatio(not.getTransferRightRatio());
}
});
}
// 5. 网格内解决的项目的满意度
resultSatisfactionScore.forEach((k, v) -> {
if (r.getGridId().equals(k)) {
r.setSatisfactionRatio(v);
}
});
// 6. 网格自治项目数
autoMap.forEach((k, v) -> {
if (r.getGridId().equals(k)) {
r.setSelfSolveProjectCount(v);
}
});
});
delAndInsertGovernAbility(result,customerId,monthId);
return true;
}
/**
* @Description 计算网格指标服务能力
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/18 9:56 上午
*/
@Override
public Boolean calGridIndexServiceAbility(String customerId, String monthId) {
return null;
}
/**
* @Description 小数四舍五入保留六位小数
* @param d
* @author zxc
* @date 2020/9/18 2:01 下午
*/
public BigDecimal getRound(BigDecimal d){
return d.setScale(NumConstant.SIX, BigDecimal.ROUND_HALF_UP);
}
/**
* @Description
* @param gridIssueTotalList
* @param gridProjectTotalList
* @author zxc
* @date 2020/9/19 2:53 下午
*/
public List<GridProjectCountResultDTO> getGridIssueShiftProjectRatio(List<GridIssueCountResultDTO> gridIssueTotalList,List<GridProjectCountResultDTO> gridProjectTotalList){
if (!CollectionUtils.isEmpty(gridIssueTotalList) && !CollectionUtils.isEmpty(gridProjectTotalList)) {
gridProjectTotalList.forEach(project -> {
gridIssueTotalList.forEach(issue -> {
if (project.getGridId().equals(issue.getGridId())) {
project.setIssueToProjectRatio(getRound(new BigDecimal(project.getProjectTotal() / issue.getIssueTotal())));
}
});
});
}
return gridProjectTotalList;
}
/**
* @Description 删除并插入党建能力的记录
* @param result
* @author zxc
* @date 2020/9/19 4:06 下午
*/
@Transactional(rollbackFor = Exception.class)
public void delAndInsertPartyAbility(List<PartyAbilityGridMonthlyFormDTO> result,String customerId,String monthId){
if (!CollectionUtils.isEmpty(result)){
partyAbilityGridMonthlyService.deleteOldPartyAbility(customerId, monthId);
partyAbilityGridMonthlyService.insertPartyAbility(result);
}
}
/**
* @Description 删除并插入治理能力的记录
* @param result
* @author zxc
* @date 2020/9/19 4:06 下午
*/
@Transactional(rollbackFor = Exception.class)
public void delAndInsertGovernAbility(List<GovernAbilityGridMonthlyFormDTO> result,String customerId,String monthId){
if (!CollectionUtils.isEmpty(result)){
governAbilityGridMonthlyService.deleteOldGovernAbilityRecord(customerId, monthId);
governAbilityGridMonthlyService.insertGovernAbilityRecord(result);
}
}
}

37
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactIndexGovernAbilityGridMonthlyServiceImpl.java

@ -0,0 +1,37 @@
package com.epmet.service.evaluationindex.extract.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao;
import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO;
import com.epmet.service.evaluationindex.extract.FactIndexGovernAbilityGridMonthlyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 治理能力-网格相关事实表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-19
*/
@Service
@Slf4j
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class FactIndexGovernAbilityGridMonthlyServiceImpl implements FactIndexGovernAbilityGridMonthlyService {
@Autowired
private FactIndexGovrnAblityGridMonthlyDao governAbilityDao;
@Override
public void insertGovernAbilityRecord(List<GovernAbilityGridMonthlyFormDTO> lists) {
governAbilityDao.insertGovernAbilityRecord(lists);
}
@Override
public void deleteOldGovernAbilityRecord(String customerId, String monthId) {
governAbilityDao.deleteOldGovernAbilityRecord(customerId, monthId);
}
}

37
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactIndexPartyAbilityGridMonthlyServiceImpl.java

@ -0,0 +1,37 @@
package com.epmet.service.evaluationindex.extract.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyDao;
import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO;
import com.epmet.service.evaluationindex.extract.FactIndexPartyAbilityGridMonthlyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 党建能力-网格相关事实表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-19
*/
@Service
@Slf4j
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class FactIndexPartyAbilityGridMonthlyServiceImpl implements FactIndexPartyAbilityGridMonthlyService {
@Autowired
private FactIndexPartyAblityGridMonthlyDao partyAbilityGridDao;
@Override
public void insertPartyAbility(List<PartyAbilityGridMonthlyFormDTO> lists) {
partyAbilityGridDao.insertPartyAbility(lists);
}
@Override
public void deleteOldPartyAbility(String customerId, String monthId) {
partyAbilityGridDao.deleteOldPartyAbility(customerId, monthId);
}
}

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactIndexServiceAbilityGridMonthlyServiceImpl.java

@ -0,0 +1,20 @@
package com.epmet.service.evaluationindex.extract.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.constant.DataSourceConstant;
import com.epmet.service.evaluationindex.extract.FactIndexServiceAbilityGridMonthlyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* 服务能力-网格相关事实表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-19
*/
@Service
@Slf4j
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class FactIndexServiceAbilityGridMonthlyServiceImpl implements FactIndexServiceAbilityGridMonthlyService {
}

107
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginExtractServiceImpl.java

@ -0,0 +1,107 @@
package com.epmet.service.evaluationindex.extract.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.service.evaluationindex.extract.*;
import com.epmet.service.stats.DimCustomerService;
import com.epmet.util.DimIdGenerator;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.concurrent.*;
/**
* desc抽取业务数据 统计库 汇聚类
*/
@Slf4j
@Service
public class FactOriginExtractServiceImpl implements FactOriginExtractService {
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder()
.setNameFormat("factOriginExtract-pool-%d").build();
ExecutorService threadPool = new ThreadPoolExecutor(4, 8,
10L, TimeUnit.MINUTES,
new LinkedBlockingQueue<>(500), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy());
@Autowired
private IssueExtractService issueExtractService;
@Autowired
private FactOriginTopicMainDailyService factOriginTopicMainDailyService;
@Autowired
private ProjectExtractService projectExtractService;
@Autowired
private DimCustomerService dimCustomerService;
@Autowired
private GroupExtractService groupExtractService;
@Override
public void extractAll(ExtractFormDTO extractFormDTO) {
String dateId = extractFormDTO.getDateId();
String customerId = extractFormDTO.getCustomerId();
if (StringUtils.isBlank(dateId)) {
dateId = DimIdGenerator.getDateDimId(DateUtils.addDateDays(new Date(), -1));
}
List<String> customerIds = new ArrayList<>();
if (StringUtils.isNotBlank(customerId)) {
customerIds.add(customerId);
}
int pageNo = NumConstant.ONE;
int pageSize = NumConstant.ONE_HUNDRED;
customerIds = dimCustomerService.selectCustomerIdPage(pageNo, pageSize);
if (CollectionUtils.isEmpty(customerIds)) {
log.error("extractAll 获取客户Id为空");
return;
}
String finalDateId = dateId;
customerIds.forEach(cId -> {
ExtractFormDTO param = new ExtractFormDTO();
param.setCustomerId(cId);
param.setDateId(finalDateId);
submitJob(param);
});
}
private void submitJob(ExtractFormDTO param) {
threadPool.submit(() -> {
try {
groupExtractService.extractGroupData(param);
} catch (Exception e) {
log.error("抽取【小组数据】发生异常,参数:" + JSON.toJSONString(param), e);
}
});
threadPool.submit(() -> {
try {
factOriginTopicMainDailyService.topicCleaning(param);
} catch (Exception e) {
log.error("抽取【话题数据】发生异常,参数:" + JSON.toJSONString(param), e);
}
});
threadPool.submit(() -> {
try {
issueExtractService.issueExtractMain(param);
issueExtractService.issueExtractLog(param);
} catch (Exception e) {
log.error("抽取【议题数据】发生异常,参数:" + JSON.toJSONString(param), e);
}
});
threadPool.submit(() -> {
try {
projectExtractService.saveOriginProjectDaily(param);
projectExtractService.extractProjectPeriodData(param);
} catch (Exception e) {
log.error("抽取【项目数据】发生异常,参数:" + JSON.toJSONString(param), e);
}
});
}
}

145
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginProjectLogDailyServiceImpl.java

@ -21,19 +21,25 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectLogDailyDao;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao;
import com.epmet.dto.extract.FactOriginProjectLogDailyDTO;
import com.epmet.dto.extract.result.*;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity;
import com.epmet.service.evaluationindex.extract.FactOriginProjectLogDailyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.stream.Collectors;
/**
* 项目明细_日统计
@ -44,6 +50,8 @@ import java.util.Map;
@Service
public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOriginProjectLogDailyDao, FactOriginProjectLogDailyEntity> implements FactOriginProjectLogDailyService {
@Autowired
private FactOriginProjectOrgPeriodDailyDao projectOrgPeriodDailyDao;
@Override
public PageData<FactOriginProjectLogDailyDTO> page(Map<String, Object> params) {
@ -97,4 +105,135 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOr
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public List<OrgStatisticsResultDTO> getAgencyTransferCount(String customerId, String monthId, String level) {
return baseDao.selectAgencyTransferCount(customerId, monthId, level);
}
/**
* @Description 查询未被退回的项目数
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/18 2:50 下午
*/
@Override
public List<NotReturnProjectResultDTO> selectNotReturnProject(String customerId, String monthId, String actionCode, String orgType) {
return baseDao.selectNotReturnProject(customerId, monthId, actionCode, orgType);
}
/**
* @Description 查询项目评价信息
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/18 3:28 下午
*/
@Override
public List<ProjectEvaluateResultDTO> selectProjectEvaluate(String customerId, String monthId) {
return baseDao.selectProjectEvaluate(customerId, monthId);
}
@Override
public void deleteByDate(String customerId, String date) {
baseDao.deleteByDate(customerId, date);
}
/**
* @Description 网格项目自治率查询
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/18 5:25 下午
*/
@Override
public List<AutoNoMyResultDTO> selectProjectAutoNoMy(String customerId, String monthId) {
return baseDao.selectProjectAutoNoMy(customerId, monthId);
}
@Override
public List<OrgStatisticsResultDTO> getSatisfaction(String customerId, String monthId, String level) {
return baseDao.selectSatisfaction(customerId, monthId, level);
}
@Override
public List<OrgStatisticsResultDTO> getDepTransferCount(String customerId, String monthId, String level) {
return baseDao.selectDepTransferCount(customerId, monthId, level);
}
/**
* @Description 查询各项目经受了多少机关
* @param customerId
* @return
* @author wangc
* @date 2020.09.20 23:46
**/
@Override
public Map<String, Integer> getProjectHandledAgency(String customerId, String dimId, String dateType) {
Map<String, Integer> result = new HashMap<>();
List<ProjectParticipatedAgencyResultDTO> projectAgency = baseDao.selectProjectParticipatedAgency(customerId,dimId,dateType);
if(!CollectionUtils.isEmpty(projectAgency)){
Map<String,List<ProjectParticipatedAgencyResultDTO>> map
= projectAgency.stream().collect(Collectors.groupingBy(ProjectParticipatedAgencyResultDTO :: getProjectId));
map.forEach((key ,agencies) ->{
if(!CollectionUtils.isEmpty(agencies)) {
String highest = agencies.get(NumConstant.ZERO).getLevel();
for (int i = NumConstant.ZERO; i < agencies.size(); i++) {
if(StringUtils.equals(agencies.get(i).getLevel(),highest)){
if(null != result.get(agencies.get(i).getAgencyId())){
result.put(key,result.get(agencies.get(i).getAgencyId()) + NumConstant.ONE);
}else{
result.put(key,NumConstant.ONE);
}
}else break;
}
}
});
}
return result;
}
/**
* @Description 计算机关响应度
* @param customerId
* @return
* @author wangc
* @date 2020.09.21 02:16
**/
@Override
public Map<String, BigDecimal> getAgencyResponseRatio(String customerId, String dimId, String dateType) {
List<OrgResponseTimeResultDTO> gridDeptResponse = projectOrgPeriodDailyDao.selectSubOrgResponseCoefficient(customerId, dimId, dateType);
List<OrgResponseTimeResultDTO> agencyResponse = projectOrgPeriodDailyDao.selectAgencyResponseCoefficient(customerId, dimId, dateType);
Map<String,BigDecimal> consumingMap = new HashMap<>();
Map<String,BigDecimal> timeMap = new HashMap<>();
if(!CollectionUtils.isEmpty(agencyResponse)){
agencyResponse.forEach(response -> {
consumingMap.put(response.getAgencyId(),response.getResponseTime());
//注意,这里取的是去重后的项目次数,例如一个部门被项目流转了多次,项目数只算一次
//如果需要改成不去重,只需response.getProjectTotal()
timeMap.put(response.getAgencyId(),response.getDistinctProjectTotal());
});
}
if(!CollectionUtils.isEmpty(gridDeptResponse)){
gridDeptResponse.forEach(response -> {
if(null != consumingMap.get(response.getAgencyId())){
consumingMap.put(response.getAgencyId(),consumingMap.get(response.getAgencyId()).add(response.getResponseTime()));
timeMap.put(response.getAgencyId(),timeMap.get(response.getAgencyId()).add(response.getDistinctProjectTotal()));
}else{
consumingMap.put(response.getAgencyId(),response.getResponseTime());
timeMap.put(response.getAgencyId(),response.getDistinctProjectTotal());
}
});
}
Map<String,BigDecimal> ratioMap = new HashMap<>();
if(!CollectionUtils.isEmpty(consumingMap)) {
consumingMap.keySet().forEach(agencyId -> {
ratioMap.put(agencyId, consumingMap.get(agencyId).divide(timeMap.get(agencyId), NumConstant.SIX, RoundingMode.HALF_UP));
});
}
return ratioMap;
}
}

62
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginProjectMainDailyServiceImpl.java

@ -21,16 +21,21 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectMainDailyDao;
import com.epmet.dto.extract.FactOriginProjectMainDailyDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity;
import com.epmet.service.evaluationindex.extract.FactOriginProjectMainDailyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -106,4 +111,61 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO
return baseDao.getPendingList(customerId);
}
@Override
public List<OrgStatisticsResultDTO> getOverdueCount(String customerId, String monthId) {
return baseDao.selectOverdueCount(customerId, monthId);
}
/**
* @Description 网格办结项目数
* @param customerId
* @param monthId
* @param status
* @author zxc
* @date 2020/9/18 2:06 下午
*/
@Override
public List<GridProjectClosedTotalResultDTO> selectGridClosedProject(String customerId, String monthId, String status) {
return baseDao.selectGridClosedProject(customerId, monthId,status);
}
@Override
public void deleteByDate(String customerId, String date) {
baseDao.deleteByDate(customerId, date);
}
/**
* @param customerId
* @param monthId
* @return java.util.List<java.util.Map < java.lang.String, java.lang.Integer>>
* @author yinzuomei
* @description 党员提出的议题转项目数
* @Date 2020/9/18 14:11
**/
@Override
public List<Map<String, Integer>> selectShiftProjectCount(String customerId, String monthId) {
//查询项目主表fact_origin_project_main_daily,这个月内新增的项目,按话题发布人分组
/*含义评价周期内党员提出的议题转数目数
数据来源项目表
计算方法从项目表中按照用户ID和党员标识统计
对评价结果的影响正向*/
return baseDao.selectShiftProjectCount(customerId,monthId);
}
/**
* @param customerId
* @param monthId
* @param topicIdList
* @return java.lang.Integer
* @author yinzuomei
* @description 9自建群活跃度议题转项目率
* @Date 2020/9/20 22:25
**/
@Override
public Integer selectCountByPartyUser(String customerId, String monthId, List<String> topicIdList) {
if(CollectionUtils.isEmpty(topicIdList)){
return NumConstant.ZERO;
}
return baseDao.selectCountByPartyUser(customerId,monthId,topicIdList);
}
}

77
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicLogDailyServiceImpl.java

@ -17,11 +17,19 @@
package com.epmet.service.evaluationindex.extract.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginTopicLogDailyDao;
import com.epmet.dto.extract.result.PartyActiveResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicLogDailyEntity;
import com.epmet.service.evaluationindex.extract.FactOriginTopicLogDailyService;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* 话题明细_日统计
@ -29,8 +37,77 @@ import org.springframework.stereotype.Service;
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-15
*/
@DataSource(DataSourceConstant.STATS)
@Service
public class FactOriginTopicLogDailyServiceImpl extends BaseServiceImpl<FactOriginTopicLogDailyDao, FactOriginTopicLogDailyEntity> implements FactOriginTopicLogDailyService {
/**
* @param customerId
* @param monthId
* @return java.util.List<java.util.Map < java.lang.String, java.lang.Integer>>
* @author yinzuomei
* @description 查询客户下这个月内每个党员评论话题的次数
* @Date 2020/9/18 13:35
**/
@Override
public List<Map<String, Integer>> selectJoinTopicCount(String customerId, String monthId) {
//这个月内新增的话题评论,按人分组,不限制评论时的身份,以当前用户最新身份为准
return baseDao.selectJoinTopicCount(customerId,monthId);
}
/**
* @param customerId
* @param monthId
* @return java.util.List<java.util.Map < java.lang.String, java.lang.Integer>>
* @author yinzuomei
* @description 党员自建群活跃度话题数
* @Date 2020/9/18 14:33
**/
@Override
public List<Map<String, Integer>> selectGroupTopicCount(String customerId, String monthId) {
return baseDao.selectGroupTopicCount(customerId,monthId);
}
/**
* @return java.lang.Integer
* @param userId
* @param customerId
* @param monthId
* @author yinzuomei
* @description 查询当前用户在本月内评论的次数
* @Date 2020/9/20 21:45
**/
@Override
public Integer selectUserCommentCount(String userId,String customerId, String monthId) {
return baseDao.selectUserCommentCount(userId,customerId,monthId);
}
/**
* @param groupIdList
* @return java.util.List<java.lang.String>
* @author yinzuomei
* @description 组内的所有话题id
* @Date 2020/9/20 22:17
**/
@Override
public List<String> selectTopicIds(List<String> groupIdList) {
if(CollectionUtils.isEmpty(groupIdList)){
return new ArrayList<>();
}
return baseDao.selectTopicIds(groupIdList);
}
/**
* @Description 查询 话题评论党员/群众
* @param customerId
* @param monthId
* @param isParty
* @author zxc
* @date 2020/9/21 9:37 上午
*/
@Override
public List<PartyActiveResultDTO> selectPartyActiveTopic(String customerId, String monthId, Integer isParty) {
return baseDao.selectPartyActiveTopic(customerId, monthId, isParty);
}
}

47
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicMainDailyServiceImpl.java

@ -17,15 +17,19 @@
package com.epmet.service.evaluationindex.extract.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.DimObjectActionConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginTopicLogDailyDao;
import com.epmet.dao.evaluationindex.extract.FactOriginTopicMainDailyDao;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.result.CreateTopicCountResultDTO;
import com.epmet.dto.org.GridInfoDTO;
import com.epmet.dto.topic.TopicOriginInfoDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicLogDailyEntity;
@ -53,6 +57,7 @@ import java.util.stream.Collectors;
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-15
*/
@DataSource(value = DataSourceConstant.STATS)
@Slf4j
@Service
public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOriginTopicMainDailyDao, FactOriginTopicMainDailyEntity> implements FactOriginTopicMainDailyService {
@ -64,25 +69,26 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
private FactOriginTopicLogDailyDao factOriginTopicLogDailyDao;
@Autowired
private UserService userService;
/**
* @param customerId 客户id
* @param dateId yyyyMMdd
* @return void
* @author yinzuomei 数据采集话题本身
* @description fact_origin_topic_log_daily 话题明细_日统计 fact_origin_topic_main_daily 话题主表_日统计
* @Date 2020/9/15 13:40
**/
@Override
public Boolean topicCleaning(String customerId, String dateId) {
public Boolean topicCleaning(ExtractFormDTO extractFormDTO) {
String customerId = extractFormDTO.getCustomerId();
String dateId = extractFormDTO.getDateId();
List<TopicOriginInfoDTO> topicOriginInfoList = topicService.queryTopicOriginInfoList(customerId, dateId);
if (CollectionUtils.isEmpty(topicOriginInfoList)) {
log.info(String.format("customerId%s,dateId%s,doesn't have any topic operation record",customerId,dateId));
log.info(String.format("customerId%s,dateId%s,doesn't have any topic operation record", customerId, dateId));
return true;
}
Map<String,GridInfoDTO> gridMap=getGridInfoMap(customerId);
Map<String, Object> map=this.constructFactOriginData(topicOriginInfoList,gridMap);
List<FactOriginTopicMainDailyEntity> mainDailyEntityList= (List<FactOriginTopicMainDailyEntity>) map.get("main");
List<FactOriginTopicLogDailyEntity> logDailyEntityList= (List<FactOriginTopicLogDailyEntity>) map.get("log");
Map<String, GridInfoDTO> gridMap = getGridInfoMap(customerId);
Map<String, Object> map = this.constructFactOriginData(topicOriginInfoList, gridMap);
List<FactOriginTopicMainDailyEntity> mainDailyEntityList = (List<FactOriginTopicMainDailyEntity>) map.get("main");
List<FactOriginTopicLogDailyEntity> logDailyEntityList = (List<FactOriginTopicLogDailyEntity>) map.get("log");
//删除之前统计的数据
deleteFactOriginData(customerId,dateId);
//批量保存主表
@ -92,6 +98,7 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
return true;
}
private Map<String, GridInfoDTO> getGridInfoMap(String customerId) {
Map<String ,GridInfoDTO> map=new HashMap<>();
List<GridInfoDTO> list=customerGridService.queryGridInfoList(customerId);
@ -222,5 +229,29 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
}
/**
* @param customerId
* @param monthId yyyyMM
* @author yinzuomei
* @description 党员提出话题数返回每个党员这个月内提出的话题数
* @Date 2020/9/18 11:03
**/
@Override
public List<Map<String, Integer>> selectPartyCreateTopicCount(String customerId, String monthId) {
//这个月内新增的话题,按人分组,不限制发话题人的身份,也就是说以用户最新的身份为准
return baseDao.selectPartyCreateTopicCount(customerId,monthId);
}
/**
* @Description 查询网格 党员/群众 人均提出话题数
* @param customerId
* @param monthId
* @param isParty
* @author zxc
* @date 2020/9/19 1:58 下午
*/
@Override
public List<CreateTopicCountResultDTO> selectCreateTopicCount(String customerId, String monthId,Integer isParty) {
return baseDao.selectCreateTopicCount(customerId, monthId, isParty);
}
}

145
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/GroupExtractServiceImpl.java

@ -0,0 +1,145 @@
package com.epmet.service.evaluationindex.extract.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.GridHeartedFormDTO;
import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO;
import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO;
import com.epmet.dto.stats.result.GridAttributesResultDTO;
import com.epmet.service.evaluationindex.extract.GroupExtractService;
import com.epmet.service.group.GroupDataService;
import com.epmet.service.stats.DimGridService;
import com.epmet.service.user.UserService;
import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @Description 业务数据抽取 - 组相关
* @ClassName GroupExtractServiceImpl
* @Auth wangc
* @Date 2020-09-16 14:47
*/
@Service
@Slf4j
public class GroupExtractServiceImpl implements GroupExtractService {
@Autowired
private FactOriginGroupMainDailyDao groupMainDailyDao;
/**
* @Description 查询建群党员数
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/19 3:49 下午
*/
@Override
public List<PartyCreateGroupCountResultDTO> selectPartyCreateGroupCount(String customerId, String monthId) {
return groupMainDailyDao.selectPartyCreateGroupCount(customerId, monthId);
}
@Autowired
private GroupDataService groupDataService;
@Autowired
private FactOriginGroupMainDailyDao factOriginGroupMainDailyDao;
@Autowired
private UserService userService;
@Autowired
private DimGridService dimGridService;
/**
* @Description 业务抽取 - 小组祥光
* @param param
* @return
* @author wangc
* @date 2020.09.18 21:07
**/
@Override
public void extractGroupData(ExtractFormDTO param) {
int count = factOriginGroupMainDailyDao.selectIfExist(param.getCustomerId());
if(StringUtils.isBlank(param.getDateId())){
Date yesterday = DateUtils.addDateDays(new Date(), -1);
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
param.setDateId(format.format(yesterday));
}
//原生数据,如果是首次,则为全部组,如果非首次,则只有新创建以及新进人的组
//但是每个组每天都要更新一次组长的身份信息
List<FactOriginGroupMainDailyDTO> originGroupData = groupDataService.extractGroupData(
count <= NumConstant.ZERO,
param.getCustomerId(), param.getDateId());
List<ExtractGroupMemberActionRecordResultDTO> memberList = new LinkedList<>();
if (!CollectionUtils.isEmpty(originGroupData)) {
List<GridAttributesResultDTO> gridList = dimGridService.getGridAttributes(param.getCustomerId(),originGroupData.stream().map(FactOriginGroupMainDailyDTO::getGridId).distinct().collect(Collectors.toList()));
if (!CollectionUtils.isEmpty(gridList)) {
Map<String, GridAttributesResultDTO> gridMap =
gridList.stream().collect(Collectors.toMap(GridAttributesResultDTO::getGridId, Function.identity(), (key1, key2) -> key2));
if (!CollectionUtils.isEmpty(originGroupData)) {
originGroupData.forEach(group -> {
if (!CollectionUtils.isEmpty(group.getMembers())) {
group.setMemberTotal(group.getMembers().size());
group.getMembers().forEach(member -> {
DimIdGenerator.DimIdBean dateInfo = DimIdGenerator.getDimIdBean(member.getJoinDate());
member.setDateId(dateInfo.getDateId());
member.setWeekId(dateInfo.getWeekId());
member.setMonthId(dateInfo.getMonthId());
member.setQuarterId(dateInfo.getQuarterId());
member.setYearId(dateInfo.getYearId());
memberList.add(member);
});
}
GridAttributesResultDTO attr = gridMap.get(group.getGridId());
if (null != attr) {
group.setAgencyId(attr.getAgencyId());
group.setParentId(attr.getParentId());
group.setPids(attr.getPids());
}
if(null != group.getCreatedTime()){
DimIdGenerator.DimIdBean dateInfo = DimIdGenerator.getDimIdBean(group.getCreatedTime());
group.setDateId(dateInfo.getDateId());
group.setWeekId(dateInfo.getWeekId());
group.setMonthId(dateInfo.getMonthId());
group.setQuarterId(dateInfo.getQuarterId());
group.setYearId(dateInfo.getYearId());
}
});
}
if (count <= NumConstant.ZERO) {
//isFirst
factOriginGroupMainDailyDao.deleteBatchMemberByCustomerId(param.getCustomerId());
factOriginGroupMainDailyDao.insertBatchMain(originGroupData);
factOriginGroupMainDailyDao.insertBatchMembers(memberList);
} else {
factOriginGroupMainDailyDao.deleteBatchByGroupId(param.getCustomerId(),originGroupData.stream().map(FactOriginGroupMainDailyDTO :: getId).distinct().collect(Collectors.toList()));
factOriginGroupMainDailyDao.insertBatchMembers(memberList);
}
}
List<String> partyIds = userService.getPartymembersByCustomerId(param.getCustomerId());
List<GridHeartedFormDTO> heartedIds = userService.getWarmHeartedByCustomerId(param.getCustomerId());
factOriginGroupMainDailyDao.updatePartyFlag(partyIds,param.getCustomerId());
factOriginGroupMainDailyDao.updateHeartedFlag(heartedIds,param.getCustomerId());
}
}
}

113
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java

@ -1,21 +1,20 @@
package com.epmet.service.evaluationindex.extract.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.dto.form.TimeListResultDTO;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.ExtractConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginIssueLogDailyDao;
import com.epmet.dao.evaluationindex.extract.FactOriginIssueMainDailyDao;
import com.epmet.dao.stats.DimAgencyDao;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.GridIssueCountResultDTO;
import com.epmet.dto.extract.form.IssueLogDailyFormDTO;
import com.epmet.dto.extract.form.IssueMainDailyFormDTO;
import com.epmet.dto.extract.result.SatisfactionInfoResultDTO;
import com.epmet.dto.extract.result.AgencyInfoResultDTO;
import com.epmet.dto.extract.result.IssueInfoResultDTO;
import com.epmet.dto.extract.result.IssueProcessInfoResultDTO;
import com.epmet.dto.extract.result.TopicInfoResultDTO;
import com.epmet.dto.extract.result.*;
import com.epmet.service.Issue.IssueService;
import com.epmet.service.evaluationindex.extract.IssueExtractService;
import com.epmet.service.topic.TopicService;
@ -26,7 +25,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.validation.constraints.NotBlank;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -67,7 +65,8 @@ public class IssueExtractServiceImpl implements IssueExtractService {
List<IssueInfoResultDTO> listResult = issueService.selectIssueInfo(customerId, dateId);
List<IssueMainDailyFormDTO> result = new ArrayList<>();
if (CollectionUtils.isEmpty(listResult)){
throw new RenException(ExtractConstant.ISSUE_INFO);
log.warn("issueExtractMain selectIssueInfo return empty,customerId:{},dateId:{}", customerId, dateId);
return true;
}
listResult.forEach(issue -> {
IssueMainDailyFormDTO issueMainDailyFormDTO = ConvertUtils.sourceToTarget(issue, IssueMainDailyFormDTO.class);
@ -162,7 +161,8 @@ public class IssueExtractServiceImpl implements IssueExtractService {
// 1. 查询议题process
List<IssueProcessInfoResultDTO> listResult = issueService.selectIssueProcessInfo(customerId, dateId);
if (CollectionUtils.isEmpty(listResult)){
throw new RenException(ExtractConstant.ISSUE_PROCESS);
log.warn("issueExtractMain issueExtractLog return empty,customerId:{},dateId:{}", customerId, dateId);
return true;
}
listResult.forEach(issueProcess -> {
IssueLogDailyFormDTO issueLogDailyFormDTO = ConvertUtils.sourceToTarget(issueProcess, IssueLogDailyFormDTO.class);
@ -226,6 +226,31 @@ public class IssueExtractServiceImpl implements IssueExtractService {
return true;
}
/**
* @Description 查询网格议题总数网格人均议题数目
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/18 10:20 上午
*/
@Override
public List<GridIssueCountResultDTO> selectIssueTotal(String customerId, String monthId) {
return issueMainDailyDao.selectIssueTotal(customerId, monthId);
}
/**
* @Description 网格总项目数
* @param customerId
* @param monthId
* @param status
* @author zxc
* @date 2020/9/18 1:21 下午
*/
@Override
public List<GridProjectCountResultDTO> selectGridProjectCount(String customerId, String monthId, String status) {
return issueMainDailyDao.selectGridProjectCount(customerId, monthId, status);
}
/**
* @Description 议题附表删除插入
* @param customerId
@ -240,4 +265,76 @@ public class IssueExtractServiceImpl implements IssueExtractService {
issueLogDailyDao.insertIssueLogList(result);
}
/**
* @param customerId
* @param monthId
* @return java.util.List<java.util.Map < java.lang.String, java.lang.Integer>>
* @author yinzuomei
* @description 党员提出的话题转议题数
* @Date 2020/9/18 13:57
**/
@DataSource(DataSourceConstant.STATS)
@Override
public List<Map<String, Integer>> selectShiftIssueCount(String customerId, String monthId) {
//查询fact_origin_issue_main_daily 表,转议题的时间在评价周期内的,按发布话题的人分组
/*含义评价周期内党员提出的话题转为议题的数目
数据来源议题表
计算方法从议题表中按照用户ID和党员标识统计
对评价结果的影响正向*/
return issueMainDailyDao.selectShiftIssueCount(customerId,monthId);
}
/**
* @Description 查询网格 党员/群众 人均提出的议题转项目数
* @param customerId
* @param monthId
* @param isParty
* @author zxc
* @date 2020/9/19 2:26 下午
*/
@Override
public List<ShiftProjectCountResultDTO> selectShiftProjectCountPlus(String customerId, String monthId, Integer isParty) {
return issueMainDailyDao.selectShiftProjectCountPlus(customerId, monthId, isParty);
}
/**
* @param userId 用户id
* @param customerId
* @param monthId
* @return java.lang.Integer
* @author yinzuomei
* @description 查询用户在这个月内表决的总次数
* @Date 2020/9/20 21:50
**/
@Override
public Integer selectCountUserVote(String userId, String customerId, String monthId) {
return issueLogDailyDao.selectCountUserVote(userId,customerId,monthId);
}
/**
* @param topicIdList
* @return java.lang.Integer
* @author yinzuomei
* @description 查询本周期和上周期内自建群内话题转为议题的数量的总和
* @Date 2020/9/20 22:48
**/
@Override
public Integer selectIssueTotalTwoMonth(List<String> topicIdList) {
return issueMainDailyDao.selectIssueTotalTwoMonth(topicIdList);
}
/**
* @Description 查询 议题表决党员/群众
* @param customerId
* @param monthId
* @param isParty
* @author zxc
* @date 2020/9/21 9:37 上午
*/
@Override
public List<PartyActiveResultDTO> selectPartyActiveIssueVote(String customerId, String monthId, Integer isParty) {
return issueLogDailyDao.selectPartyActiveIssueVote(customerId, monthId, isParty);
}
}

177
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/ProjectExtractServiceImpl.java

@ -1,18 +1,24 @@
package com.epmet.service.evaluationindex.extract.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao;
import com.epmet.dto.ProjectDTO;
import com.epmet.dto.extract.FactOriginProjectMainDailyDTO;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.form.WorkDayFormDTO;
import com.epmet.dto.issue.IssueDTO;
import com.epmet.dto.party.PartyMemberDTO;
import com.epmet.dto.project.FinishOrgDTO;
import com.epmet.dto.project.ProcessInfoDTO;
import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO;
import com.epmet.dto.result.WorkDayResultDTO;
import com.epmet.dto.topic.ResiTopicDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity;
import com.epmet.entity.project.ProjectProcessEntity;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.service.Issue.IssueService;
@ -24,12 +30,15 @@ import com.epmet.service.project.ProjectProcessService;
import com.epmet.service.project.ProjectService;
import com.epmet.service.topic.TopicService;
import com.epmet.util.DimIdGenerator;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;
@ -57,29 +66,42 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
private ProjectProcessService projectProcessService;
@Autowired
private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient;
@Autowired
private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao;
@Override
public void saveOriginProjectDaily(String customerId, Date date) {
String dateString = null;
if (null != date) {
dateString = DateUtils.format(date);
}
public void saveOriginProjectDaily(ExtractFormDTO extractFormDTO) {
String dateString = extractFormDTO.getDateId();
String customerId = extractFormDTO.getCustomerId();
//获取已关闭项目列表
List<ProjectProcessEntity> closedList = projectProcessService.getClosedProjectList(customerId, dateString);
List<FactOriginProjectMainDailyDTO> pendingList = factOriginProjectMainDailyService.getPendingList(customerId);
List<FactOriginProjectMainDailyEntity> closeProjects =
pendingList.stream().flatMap(pending -> closedList.stream().filter(closed -> pending.getId().equals(closed.getProjectId())).map(process -> {
FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity();
entity.setId(process.getId());
entity.setProjectStatus("close");
entity.setCreatedTime(DateUtils.stringToDate(pending.getDateId(), DateUtils.DATE_PATTERN_YYYYMMDD));
entity.setUpdatedTime(process.getUpdatedTime());
return entity;
})).collect(Collectors.toList());
//更新状态
if (null != closeProjects && !closeProjects.isEmpty()) {
factOriginProjectMainDailyService.updateBatchById(closeProjects);
List<FinishOrgDTO> finishOrgList= projectProcessService.getFinishOrg(customerId, dateString);
if (null != closedList && !closedList.isEmpty()) {
List<FactOriginProjectMainDailyEntity> closeProjects =
pendingList.stream().flatMap(pending -> closedList.stream().filter(closed -> pending.getId().equals(closed.getProjectId())).map(process -> {
FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity();
entity.setId(process.getId());
entity.setProjectStatus("close");
entity.setCreatedTime(DateUtils.stringToDate(pending.getDateId(), DateUtils.DATE_PATTERN_YYYYMMDD));
entity.setUpdatedTime(process.getUpdatedTime());
return entity;
})).collect(Collectors.toList());
if (null != finishOrgList && !finishOrgList.isEmpty()) {
closeProjects.forEach(close -> finishOrgList.stream().filter(finish -> close.getId().equals(finish.getProjectId())).forEach(dto -> {
String[] orgIds = dto.getPIdPath().split(":");
if (orgIds.length > NumConstant.ONE) {
close.setFinishOrgIds(orgIds[orgIds.length - 1]);
} else {
close.setFinishOrgIds(orgIds[0]);
}
}));
}
//更新状态
if (!closeProjects.isEmpty()) {
factOriginProjectMainDailyService.updateBatchById(closeProjects);
}
}
//获取项目信息
List<ProjectDTO> projectList = projectService.getProjectInfo(customerId, dateString);
@ -132,8 +154,19 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
list.forEach(entity -> partyMemberList.stream().filter(partyMemberDTO -> partyMemberDTO.getGridId().equals(entity.getGridId()) && partyMemberDTO.getUserId().equals(entity.getTopicCreatorId())).forEach(partyMember -> {
entity.setIsParty(NumConstant.ONE_STR);
}));
list.forEach(entity -> finishOrgList.stream().filter(finish -> entity.getId().equals(finish.getProjectId())).forEach(dto -> {
String[] orgIds = dto.getPIdPath().split(":");
if (orgIds.length > NumConstant.ONE) {
entity.setFinishOrgIds(orgIds[orgIds.length - 1]);
} else {
entity.setFinishOrgIds(orgIds[0]);
}
}));
//插入数据
factOriginProjectMainDailyService.insertBatch(list);
if (!list.isEmpty()) {
factOriginProjectMainDailyService.deleteByDate(customerId, dateString);
factOriginProjectMainDailyService.insertBatch(list);
}
}
//节点发起人
@ -157,9 +190,9 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
return entity;
}).collect(Collectors.toList());
//节点接收
List<ProcessInfoDTO> processStaffList = projectProcessService.getProcessStaffByCustomer(customerId, dateString);
logList.addAll(processStaffList.stream().map(process -> {
//项目评论
List<ProcessInfoDTO> satisfactionRecordList = projectProcessService.getSatisfactionRecord(customerId, dateString);
logList.addAll(satisfactionRecordList.stream().map(process -> {
//获取日期相关维度
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(process.getCreatedTime());
FactOriginProjectLogDailyEntity entity = new FactOriginProjectLogDailyEntity();
@ -172,14 +205,19 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
entity.setProjectId(process.getProjectId());
entity.setOperationUserId(process.getStaffId());
entity.setActionCode(process.getOperation());
entity.setIsActive(NumConstant.ZERO);
entity.setIsActive(NumConstant.ONE);
entity.setOrgType("grid");
return entity;
}).collect(Collectors.toList()));
//项目评论人
List<ProcessInfoDTO> satisfactionRecordList = projectProcessService.getSatisfactionRecord(customerId, dateString);
logList.addAll(satisfactionRecordList.stream().map(process -> {
List<FactOriginProjectMainDailyDTO> projectMainList = factOriginProjectMainDailyService.getProjectByCustomer(customerId);
logList.forEach(log -> projectMainList.stream().filter(project -> log.getProjectId().equals(project.getId())).forEach(main -> {
log.setOrgId(main.getGridId());
}));
//节点接收人
List<ProcessInfoDTO> processStaffList = projectProcessService.getProcessStaffByCustomer(customerId, dateString);
logList.addAll(processStaffList.stream().map(process -> {
//获取日期相关维度
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(process.getCreatedTime());
FactOriginProjectLogDailyEntity entity = new FactOriginProjectLogDailyEntity();
@ -192,17 +230,88 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
entity.setProjectId(process.getProjectId());
entity.setOperationUserId(process.getStaffId());
entity.setActionCode(process.getOperation());
entity.setIsActive(NumConstant.ONE);
entity.setOrgType("grid");
entity.setIsActive(NumConstant.ZERO);
if (StringUtils.isNotBlank(process.getDepartmentId())) {
entity.setOrgType("department");
entity.setOrgId(process.getDepartmentId());
}
if (StringUtils.isNotBlank(process.getGridId())) {
entity.setOrgType("grid");
entity.setOrgId(process.getGridId());
}
return entity;
}).collect(Collectors.toList()));
List<FactOriginProjectMainDailyDTO> projectMainList = factOriginProjectMainDailyService.getProjectByCustomer(customerId);
logList.forEach(log -> projectMainList.stream().filter(project -> log.getProjectId().equals(project.getId())).forEach(main -> {
log.setOrgId(main.getGridId());
}));
if (!logList.isEmpty()) {
factOriginProjectLogDailyService.deleteByDate(customerId, dateString);
factOriginProjectLogDailyService.insertBatch(logList);
}
}
}
factOriginProjectLogDailyService.insertBatch(logList);
/**
* @Description 抽取项目节点历时逻辑
* @param param
* @return
* @author wangc
* @date 2020.09.17 14:05
**/
@Override
public void extractProjectPeriodData(ExtractFormDTO param) {
int trace = factOriginProjectOrgPeriodDailyDao.selectIfExisted(param.getCustomerId());
Boolean isFirst = trace <= NumConstant.ZERO ? true : false;
if(StringUtils.isBlank(param.getDateId())){
Date yesterday = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24);
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
param.setDateId(format.format(yesterday));
}
List<ProjectOrgPeriodResultDTO> extractData =
projectProcessService.getProjectPeriod(isFirst,param.getCustomerId(),param.getDateId());
List<FactOriginProjectOrgPeriodDailyEntity> formattingData = new LinkedList<>();
extractData.forEach(original -> {
FactOriginProjectOrgPeriodDailyEntity dest
= ConvertUtils.sourceToTarget(original,FactOriginProjectOrgPeriodDailyEntity.class);
if(StringUtils.isNotBlank(original.getDepartmentId())){
dest.setOrgType("dept");
dest.setPid(original.getOrgId());
dest.setPids(original.getOrgIdPath());
}else if(StringUtils.isNotBlank(original.getGridId())){
dest.setOrgType("grid");
dest.setPid(original.getOrgId());
dest.setPids(original.getOrgIdPath());
}else{
dest.setOrgType("agency");
dest.setPids("");
String[] array = original.getOrgIdPath().split(":");
if(null == array || array.length <= NumConstant.ZERO){
dest.setPid(NumConstant.ZERO_STR);
}
if(array[NumConstant.ZERO] == original.getOrgId() && array.length == NumConstant.ONE){
dest.setPid(NumConstant.ZERO_STR);
}
if(array.length > NumConstant.ONE && original.getOrgId() == array[array.length - NumConstant.ONE]){
dest.setPid(array[array.length - NumConstant.TWO]);
dest.setPids(original.getOrgIdPath().replace(original.getOrgId(),""));
}
if(StringUtils.isNotBlank(dest.getPids())){
while(dest.getPids().endsWith(":")){
dest.setPids(dest.getPids().substring(NumConstant.ZERO,dest.getPids().length() - NumConstant.ONE));
}
while(dest.getPids().startsWith(":")){
dest.setPids(dest.getPids().replaceFirst(":",""));
}
}
dest.setPids(dest.getPids().replaceAll(" ",""));
}
formattingData.add(dest);
});
if(!CollectionUtils.isEmpty(formattingData)) {
List<String> projectIds = formattingData.stream().map(FactOriginProjectOrgPeriodDailyEntity::getProjectId).distinct().collect(Collectors.toList());
if (!CollectionUtils.isEmpty(projectIds)) {
factOriginProjectOrgPeriodDailyDao.deleteByProjectId(projectIds);
factOriginProjectOrgPeriodDailyDao.insertBatch(formattingData);
}
}
}
@ -235,4 +344,6 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
}
return result;
}
}

104
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/ProjectPeriodExtractServiceImpl.java

@ -0,0 +1,104 @@
package com.epmet.service.evaluationindex.extract.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity;
import com.epmet.service.evaluationindex.extract.ProjectPeriodExtractService;
import com.epmet.service.project.ProjectProcessService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Description 业务数据抽取 - 项目节点历时
* @ClassName ProjectPeriodExtractServiceImpl
* @Auth wangc
* @Date 2020-09-17 13:52
*/
@Service
@Slf4j
public class ProjectPeriodExtractServiceImpl implements ProjectPeriodExtractService {
@Autowired
private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao;
@Autowired
private ProjectProcessService projectProcessService;
/**
* @Description 抽取项目节点历时逻辑
* @param param
* @return
* @author wangc
* @date 2020.09.17 14:05
**/
@Override
public void extractProjectPeriodData(ExtractFormDTO param) {
int trace = factOriginProjectOrgPeriodDailyDao.selectIfExisted(param.getCustomerId());
Boolean isFirst = trace <= NumConstant.ZERO ? true : false;
if(StringUtils.isBlank(param.getDateId())){
Date yesterday = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24);
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
param.setDateId(format.format(yesterday));
}
List<ProjectOrgPeriodResultDTO> extractData =
projectProcessService.getProjectPeriod(isFirst,param.getCustomerId(),param.getDateId());
List<FactOriginProjectOrgPeriodDailyEntity> formattingData = new LinkedList<>();
extractData.forEach(original -> {
FactOriginProjectOrgPeriodDailyEntity dest
= ConvertUtils.sourceToTarget(original,FactOriginProjectOrgPeriodDailyEntity.class);
if(StringUtils.isNotBlank(original.getDepartmentId())){
dest.setOrgType("dept");
dest.setPid(original.getOrgId());
dest.setPids(original.getOrgIdPath());
}else if(StringUtils.isNotBlank(original.getGridId())){
dest.setOrgType("grid");
dest.setPid(original.getOrgId());
dest.setPids(original.getOrgIdPath());
}else{
dest.setOrgType("agency");
dest.setPids("");
String[] array = original.getOrgIdPath().split(":");
if(null == array || array.length <= NumConstant.ZERO){
dest.setPid(NumConstant.ZERO_STR);
}
if(array[NumConstant.ZERO] == original.getOrgId() && array.length == NumConstant.ONE){
dest.setPid(NumConstant.ZERO_STR);
}
if(array.length > NumConstant.ONE && original.getOrgId() == array[array.length - NumConstant.ONE]){
dest.setPid(array[array.length - NumConstant.TWO]);
dest.setPids(original.getOrgIdPath().replace(original.getOrgId(),""));
}
if(StringUtils.isNotBlank(dest.getPids())){
while(dest.getPids().endsWith(":")){
dest.setPids(dest.getPids().substring(NumConstant.ZERO,dest.getPids().length() - NumConstant.ONE));
}
while(dest.getPids().startsWith(":")){
dest.setPids(dest.getPids().replaceFirst(":",""));
}
}
dest.setPids(dest.getPids().replaceAll(" ",""));
}
formattingData.add(dest);
});
if(!CollectionUtils.isEmpty(formattingData)) {
List<String> projectIds = formattingData.stream().map(FactOriginProjectOrgPeriodDailyEntity::getProjectId).distinct().collect(Collectors.toList());
if (!CollectionUtils.isEmpty(projectIds)) {
factOriginProjectOrgPeriodDailyDao.deleteByProjectId(projectIds);
factOriginProjectOrgPeriodDailyDao.insertBatch(formattingData);
}
}
}
}

22
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java

@ -0,0 +1,22 @@
package com.epmet.service.evaluationindex.indexcoll;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/20 20:29
*/
public interface FactIndexGovrnAblityOrgMonthlyService extends BaseService<FactIndexGovrnAblityOrgMonthlyEntity> {
/**
* 根据客户清空数据
* @author zhaoqifeng
* @date 2020/9/20 20:33
* @param customerId
* @param monthId
* @param type
* @return void
*/
void deleteByCustomer(String customerId, String monthId, String type);
}

22
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyService.java

@ -0,0 +1,22 @@
package com.epmet.service.evaluationindex.indexcoll;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyEntity;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/20 23:00
*/
public interface FactIndexPartyAblityOrgMonthlyService extends BaseService<FactIndexPartyAblityOrgMonthlyEntity> {
/**
* 根据客户清空数据
* @author zhaoqifeng
* @date 2020/9/20 20:33
* @param customerId
* @param monthId
* @param type
* @return void
*/
void deleteByCustomer(String customerId, String monthId, String type);
}

21
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollCommunityService.java

@ -0,0 +1,21 @@
package com.epmet.service.evaluationindex.indexcoll;
/**
* 社区相关统计
*
* @author zhaoqifeng
* @date 2020/9/18 10:33
*/
public interface IndexCollCommunityService {
/**
* 社区能力统计
*
* @author zhaoqifeng
* @date 2020/9/18 13:52
* @param customerId
* @param dateId
* @return void
*/
void saveCommunityAbility(String customerId, String dateId);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollDistrictDepartmentService.java

@ -0,0 +1,10 @@
package com.epmet.service.evaluationindex.indexcoll;
/**
* 区直部门相关统计
*
* @author zhaoqifeng
* @date 2020/9/18 10:43
*/
public interface IndexCollDistrictDepartmentService {
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollDistrictService.java

@ -0,0 +1,10 @@
package com.epmet.service.evaluationindex.indexcoll;
/**
* 全区相关统计
*
* @author zhaoqifeng
* @date 2020/9/18 10:44
*/
public interface IndexCollDistrictService {
}

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollStreetService.java

@ -0,0 +1,20 @@
package com.epmet.service.evaluationindex.indexcoll;
/**
* 街道相关统计
*
* @author zhaoqifeng
* @date 2020/9/18 10:35
*/
public interface IndexCollStreetService {
/**
* 街道治理能力统计
*
* @author zhaoqifeng
* @date 2020/9/18 13:52
* @param customerId
* @param dateId
* @return void
*/
void saveStreetAbility(String customerId, String dateId);
}

23
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityOrgMonthlyServiceImpl.java

@ -0,0 +1,23 @@
package com.epmet.service.evaluationindex.indexcoll.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyDao;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService;
import org.springframework.stereotype.Service;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/20 20:29
*/
@Service
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class FactIndexGovrnAblityOrgMonthlyServiceImpl extends BaseServiceImpl<FactIndexGovrnAblityOrgMonthlyDao, FactIndexGovrnAblityOrgMonthlyEntity> implements FactIndexGovrnAblityOrgMonthlyService {
@Override
public void deleteByCustomer(String customerId, String monthId, String type) {
baseDao.deleteByCustomer(customerId, monthId, type);
}
}

23
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityOrgMonthlyServiceImpl.java

@ -0,0 +1,23 @@
package com.epmet.service.evaluationindex.indexcoll.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyEntity;
import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService;
import org.springframework.stereotype.Service;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/20 23:01
*/
@Service
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class FactIndexPartyAblityOrgMonthlyServiceImpl extends BaseServiceImpl<FactIndexPartyAblityOrgMonthlyDao, FactIndexPartyAblityOrgMonthlyEntity> implements FactIndexPartyAblityOrgMonthlyService {
@Override
public void deleteByCustomer(String customerId, String monthId, String type) {
baseDao.deleteByCustomer(customerId, monthId, type);
}
}

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

Loading…
Cancel
Save