Browse Source

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

dev_shibei_match
wangchao 5 years ago
parent
commit
a288e76b85
  1. 2
      epmet-cloud-generator/src/main/resources/application.yml
  2. 16
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityIndexFormDTO.java
  3. 15
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityListFormDTO.java
  4. 16
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthAblityListFormDTO.java
  5. 19
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthScoreListFormDTO.java
  6. 15
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PeerComparisonFormDTO.java
  7. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/RootAgencyFormDTO.java
  8. 14
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScoreListFormDTO.java
  9. 8
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityIndexResultDTO.java
  10. 8
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PeerComparisonResultDTO.java
  11. 12
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/FactConstant.java
  12. 37
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java
  13. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java
  14. 13
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java
  15. 18
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java
  16. 28
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java
  17. 20
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java
  18. 338
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java
  19. 45
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml
  20. 8
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml
  21. 45
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml
  22. 8
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml
  23. 61
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml
  24. 35
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml
  25. 10
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml
  26. 5
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueMainDailyFormDTO.java
  27. 19
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridInfoResultDTO.java
  28. 23
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyDTO.java
  29. 5
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueInfoResultDTO.java
  30. 25
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgNameResultDTO.java
  31. 1
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridInfoDTO.java
  32. 9
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java
  33. 5
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java
  34. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java
  35. 35
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java
  36. 48
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java
  37. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java
  38. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java
  39. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySelfSubScoreDao.java
  40. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySubScoreDao.java
  41. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySelfSubScoreDao.java
  42. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySubScoreDao.java
  43. 39
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSelfSubScoreDao.java
  44. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSubScoreDao.java
  45. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java
  46. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java
  47. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
  48. 36
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java
  49. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java
  50. 32
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java
  51. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java
  52. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySubScoreEntity.java
  53. 100
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSelfSubScoreEntity.java
  54. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPioneerDataEntity.java
  55. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java
  56. 52
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java
  57. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java
  58. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java
  59. 69
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java
  60. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java
  61. 36
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java
  62. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java
  63. 41
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java
  64. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PartyGuideService.java
  65. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PioneerDataExtractService.java
  66. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractService.java
  67. 64
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java
  68. 185
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java
  69. 26
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java
  70. 297
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java
  71. 82
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java
  72. 89
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java
  73. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java
  74. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java
  75. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java
  76. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java
  77. 24
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyService.java
  78. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java
  79. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCpcBaseDataService.java
  80. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java
  81. 27
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java
  82. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataService.java
  83. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPioneerDataService.java
  84. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCpcBaseDataServiceImpl.java
  85. 34
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java
  86. 42
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java
  87. 24
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataServiceImpl.java
  88. 26
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java
  89. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java
  90. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java
  91. 24
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java
  92. 8
      epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml
  93. 77
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml
  94. 26
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  95. 45
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml
  96. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySelfSubScoreDao.xml
  97. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml
  98. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySelfSubScoreDao.xml
  99. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml
  100. 61
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSelfSubScoreDao.xml

2
epmet-cloud-generator/src/main/resources/application.yml

@ -9,7 +9,7 @@ spring:
type: com.alibaba.druid.pool.DruidDataSource
#MySQL配置
driverClassName: com.mysql.jdbc.Driver
url: jdbc:mysql://192.168.1.130:3306/epmet_evaluation_index?useUnicode=true&characterEncoding=UTF-8&useSSL=false
url: jdbc:mysql://192.168.1.130:3306/epmet_data_statistical?useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: epmet_dba
password: EpmEt-dbA-UsEr
#oracle配置

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

@ -3,7 +3,6 @@ package com.epmet.evaluationindex.screen.dto.form;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
@ -15,19 +14,24 @@ import java.io.Serializable;
public class AblityIndexFormDTO implements Serializable {
private static final long serialVersionUID = -2880432640584616651L;
/**
* 查询月份的前12个月对应的monthId
* 组织或网格Id
*/
private String startMonthId;
@NotBlank(message = "组织或网格ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String orgId;
/**
* 组织Id
*/
@NotBlank(message = "客户ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String customerId;
/**
* 组织Id
* 组织或网格类型
*/
@NotBlank(message = "组织ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String agencyId;
@NotBlank(message = "组织或网格类型不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String orgType;
/**
* 查询月份的前12个月对应的monthId
*/
private String startMonthId;
/**
* 月份Id格式202009
*/

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

@ -14,15 +14,21 @@ import java.io.Serializable;
public class AblityListFormDTO implements Serializable {
private static final long serialVersionUID = -2880432640584616651L;
/**
* 组织Id
* 客户Id
*/
@NotBlank(message = "客户ID不能为空",groups = {AblityListFormDTO.AddUserInternalGroup.class})
private String customerId;
/**
* 组织Id
* 组织或网格Id
*/
@NotBlank(message = "组织ID不能为空",groups = {AblityListFormDTO.AddUserInternalGroup.class})
private String agencyId;
@NotBlank(message = "组织或网格ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String orgId;
/**
* 组织或网格类型
*/
@NotBlank(message = "组织或网格类型不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String orgType;
public interface AddUserInternalGroup {}
/**
* 月份Id格式202009
*/
@ -37,6 +43,5 @@ public class AblityListFormDTO implements Serializable {
* 所有有权重的指标code拼接的字符串 冒号隔开
*/
private String allParentIndexCode;
public interface AddUserInternalGroup {}
}

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

@ -14,15 +14,21 @@ import java.io.Serializable;
public class MonthAblityListFormDTO implements Serializable {
private static final long serialVersionUID = -2880432640584616651L;
/**
* 组织Id
* 客户Id
*/
@NotBlank(message = "客户ID不能为空",groups = {MonthAblityListFormDTO.AddUserInternalGroup.class})
private String customerId;
/**
* 组织Id
* 组织或网格Id
*/
@NotBlank(message = "组织ID不能为空",groups = {MonthAblityListFormDTO.AddUserInternalGroup.class})
private String agencyId;
@NotBlank(message = "组织或网格ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String orgId;
/**
* 组织或网格类型
*/
@NotBlank(message = "组织或网格类型不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String orgType;
public interface AddUserInternalGroup {}
/**
* 月份Id格式202009
*/
@ -37,7 +43,5 @@ public class MonthAblityListFormDTO implements Serializable {
* 查询月份的前12个月对应的monthId
*/
private String startMonthId;
public interface AddUserInternalGroup {}
}

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

@ -13,21 +13,34 @@ import java.io.Serializable;
@Data
public class MonthScoreListFormDTO implements Serializable {
private static final long serialVersionUID = -2880432640584616651L;
/**
* 组织或网格Id
*/
@NotBlank(message = "组织或网格ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String orgId;
/**
* 组织Id
*/
@NotBlank(message = "客户ID不能为空",groups = {MonthScoreListFormDTO.AddUserInternalGroup.class})
private String customerId;
/**
* 组织Id
* 组织或网格类型
*/
@NotBlank(message = "组织ID不能为空",groups = {MonthScoreListFormDTO.AddUserInternalGroup.class})
private String agencyId;
@NotBlank(message = "组织或网格类型不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String orgType;
/**
* 类型党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli
*/
private String indexCode;
/**
* 月份Id格式202009
*/
@NotBlank(message = "月份ID不能为空",groups = {MonthScoreListFormDTO.AddUserInternalGroup.class})
private String monthId;
/**
* 查询月份的前12个月对应的monthId
*/
private String startMonthId;
public interface AddUserInternalGroup {}
}

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

@ -15,15 +15,21 @@ import java.io.Serializable;
public class PeerComparisonFormDTO implements Serializable {
private static final long serialVersionUID = -2880432640584616651L;
/**
* 组织Id
* 客户Id
*/
@NotBlank(message = "客户ID不能为空",groups = {PeerComparisonFormDTO.AddUserInternalGroup.class})
private String customerId;
/**
* 组织Id
* 组织或网格Id
*/
@NotBlank(message = "组织ID不能为空",groups = {PeerComparisonFormDTO.AddUserInternalGroup.class})
private String agencyId;
@NotBlank(message = "组织或网格ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String orgId;
/**
* 组织或网格类型
*/
@NotBlank(message = "组织或网格类型不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String orgType;
public interface AddUserInternalGroup {}
/**
* 类型党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli
*/
@ -34,6 +40,5 @@ public class PeerComparisonFormDTO implements Serializable {
*/
@Min(value = 1, message = "查询条数必须大于0", groups = {PeerComparisonFormDTO.AddUserInternalGroup.class })
private Integer pageSize;
public interface AddUserInternalGroup {}
}

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

@ -3,7 +3,6 @@ package com.epmet.evaluationindex.screen.dto.form;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
@ -14,12 +13,12 @@ import java.io.Serializable;
@Data
public class RootAgencyFormDTO implements Serializable {
private static final long serialVersionUID = -2880432640584616651L;
public interface AddUserInternalGroup {}
/**
* 组织Id
*/
@NotBlank(message = "组织ID不能为空",groups = {RootAgencyFormDTO.AddUserInternalGroup.class})
private String agencyId;
public interface AddUserInternalGroup {}
}

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

@ -13,16 +13,22 @@ import java.io.Serializable;
@Data
public class ScoreListFormDTO implements Serializable {
private static final long serialVersionUID = -2880432640584616651L;
/**
* 组织或网格Id
*/
@NotBlank(message = "组织或网格ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String orgId;
/**
* 组织Id
*/
@NotBlank(message = "客户ID不能为空",groups = {ScoreListFormDTO.AddUserInternalGroup.class})
private String customerId;
/**
* 组织Id
* 组织或网格类型
*/
@NotBlank(message = "组织ID不能为空",groups = {ScoreListFormDTO.AddUserInternalGroup.class})
private String agencyId;
@NotBlank(message = "组织或网格类型不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String orgType;
public interface AddUserInternalGroup {}
/**
* 月份Id格式202009
*/
@ -33,6 +39,4 @@ public class ScoreListFormDTO implements Serializable {
*/
private String indexCode;
public interface AddUserInternalGroup {}
}

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

@ -29,14 +29,6 @@ public class AblityIndexResultDTO implements Serializable {
* 能力总分
*/
private Double indexTotal;
/**
* 本级能力分
*/
private Double agencyScore;
/**
* 下级能力分
*/
private Double subAgencyScore;
/**
* 横坐标202009
*/

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

@ -14,13 +14,13 @@ public class PeerComparisonResultDTO implements Serializable {
private static final long serialVersionUID = 3860268744336541373L;
/**
* 组织Id
* 组织或网格Id
*/
private String agencyId;
private String orgId;
/**
* 组织名称
* 组织或网格名称
*/
private String agencyName;
private String orgName;
/**
* 能力分值(保留一位小数)
*/

12
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/FactConstant.java

@ -5,6 +5,14 @@ package com.epmet.datareport.constant;
* @dscription 数据
*/
public interface FactConstant {
/**
* 组织类型
*/
String AGENCY = "agency";
/**
* 网格类型
*/
String GRID = "grid";
/**
* 能力指标
*/
@ -33,4 +41,8 @@ public interface FactConstant {
* 社区相关
*/
String SHE_QU_XIANG_GUAN = "shequxiangguan";
/**
* 网格相关
*/
String WANG_GE_XIANG_GUAN = "wanggexiangguan";
}

37
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java

@ -1,5 +1,6 @@
package com.epmet.datareport.controller.fact;
import com.epmet.commons.extappauth.annotation.InternalAppRequestAuth;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
@ -17,6 +18,7 @@ import java.util.List;
/**
* 数据改版api
*
* @author sun
*/
@RestController
@ -28,77 +30,84 @@ public class FactIndexController {
/**
* @param tokenDTO
* @Description 能力指数
* @Description 能力指数
* @author sun
*/
@InternalAppRequestAuth
@PostMapping("index/ablityindex")
public Result<List<AblityIndexResultDTO>> ablityIndex(@LoginUser TokenDto tokenDTO, @RequestBody AblityIndexFormDTO formDTO){
public Result<List<AblityIndexResultDTO>> ablityIndex(@LoginUser TokenDto tokenDTO, @RequestBody AblityIndexFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, AblityIndexFormDTO.AddUserInternalGroup.class);
return new Result<List<AblityIndexResultDTO>>().ok(factIndexService.ablityIndex(formDTO));
}
/**
* @param tokenDTO
* @Description 按月份查询各项能力分数
* @Description 按月份查询各项能力分数
* @author sun
*/
@InternalAppRequestAuth
@PostMapping("index/scorelist")
public Result<List<ScoreListResultDTO>> scoreList(@LoginUser TokenDto tokenDTO, @RequestBody ScoreListFormDTO formDTO){
public Result<List<ScoreListResultDTO>> scoreList(@LoginUser TokenDto tokenDTO, @RequestBody ScoreListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ScoreListFormDTO.AddUserInternalGroup.class);
return new Result<List<ScoreListResultDTO>>().ok(factIndexService.scoreList(formDTO));
}
/**
* @param tokenDTO
* @Description 按月份查询各项能力最近12个月得分
* @Description 按月份查询各项能力最近12个月得分
* @author sun
*/
@InternalAppRequestAuth
@PostMapping("index/monthscorelist")
public Result<List<MonthScoreListResultDTO>> monthScoreList(@LoginUser TokenDto tokenDTO, @RequestBody MonthScoreListFormDTO formDTO){
public Result<List<MonthScoreListResultDTO>> monthScoreList(@LoginUser TokenDto tokenDTO, @RequestBody MonthScoreListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, MonthScoreListFormDTO.AddUserInternalGroup.class);
return new Result<List<MonthScoreListResultDTO>>().ok(factIndexService.monthScoreList(formDTO));
}
/**
* @param tokenDTO
* @Description 按月查询各项指标数据
* @Description 按月查询各项指标数据
* @author sun
*/
@InternalAppRequestAuth
@PostMapping("index/ablitylist")
public Result<List<AblityListResultDTO>> ablityList(@LoginUser TokenDto tokenDTO, @RequestBody AblityListFormDTO formDTO){
public Result<List<AblityListResultDTO>> ablityList(@LoginUser TokenDto tokenDTO, @RequestBody AblityListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, AblityListFormDTO.AddUserInternalGroup.class);
return new Result<List<AblityListResultDTO>>().ok(factIndexService.ablityList(formDTO));
}
/**
* @param tokenDTO
* @Description 按月查询各项指标最近12个月数据
* @Description 按月查询各项指标最近12个月数据
* @author sun
*/
@InternalAppRequestAuth
@PostMapping("index/monthablitylist")
public Result<List<MonthAblityListResultDTO>> monthAblityList(@LoginUser TokenDto tokenDTO, @RequestBody MonthAblityListFormDTO formDTO){
public Result<List<MonthAblityListResultDTO>> monthAblityList(@LoginUser TokenDto tokenDTO, @RequestBody MonthAblityListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, MonthAblityListFormDTO.AddUserInternalGroup.class);
return new Result<List<MonthAblityListResultDTO>>().ok(factIndexService.monthAblityList(formDTO));
}
/**
* @param tokenDTO
* @Description 同级对比各项数据查询
* @Description 同级对比各项数据查询
* @author sun
*/
@InternalAppRequestAuth
@PostMapping("index/peercomparison")
public Result<List<PeerComparisonResultDTO>> peerComparison(@LoginUser TokenDto tokenDTO, @RequestBody PeerComparisonFormDTO formDTO){
public Result<List<PeerComparisonResultDTO>> peerComparison(@LoginUser TokenDto tokenDTO, @RequestBody PeerComparisonFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, PeerComparisonFormDTO.AddUserInternalGroup.class);
return new Result<List<PeerComparisonResultDTO>>().ok(factIndexService.peerComparison(formDTO));
}
/**
* @param tokenDTO
* @Description 是否根组织
* @Description 是否根组织
* @author sun
*/
@InternalAppRequestAuth
@PostMapping("index/rootagency")
public Result<RootAgencyResultDTO> rootAgency(@LoginUser TokenDto tokenDTO, @RequestBody RootAgencyFormDTO formDTO){
public Result<RootAgencyResultDTO> rootAgency(@LoginUser TokenDto tokenDTO, @RequestBody RootAgencyFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, RootAgencyFormDTO.AddUserInternalGroup.class);
return new Result<RootAgencyResultDTO>().ok(factIndexService.rootAgency(formDTO));
}

2
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java

@ -80,7 +80,7 @@ public interface ScreenIndexDataMonthlyDao{
/**
* @param formDTO
* @Description 同级对比--根据组织Id的上级组织Id查询同级组织对应类型的得分排名查询最近一个月数据
* @Description 同级对比--根据组织或网格Id的上级组织Id查询同级组织或网格对应类型的得分排名查询最近一个月数据
* @author sun
*/
List<PeerComparisonResultDTO> selectScoreList(PeerComparisonFormDTO formDTO);

13
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java

@ -18,8 +18,10 @@
package com.epmet.datareport.dao.fact;
import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO;
import com.epmet.evaluationindex.screen.dto.form.MonthScoreListFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScoreListFormDTO;
import com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO;
import com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO;
import org.apache.ibatis.annotations.Mapper;
@ -34,17 +36,24 @@ import java.util.LinkedList;
@Mapper
public interface FactIndexAgencyScoreDao {
/**
* @param formDTO
* @Description 分别查询区县乡镇街道过去12个月党建能力治理能力服务能力每月总分本级得分下级得分数据
* @author sun
*/
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> selectAblityIndex(AblityIndexFormDTO formDTO);
/**
* @param formDTO
* @Description 分别查询当前组织某一月份党建能力治理能力服务能力对应的总分本级分下级分
* @author sun
*/
ScoreListResultDTO selectScore(ScoreListFormDTO formDTO);
ScoreListResultDTO selectScoreList(ScoreListFormDTO formDTO);
/**
* @param formDTO
* @Description 分别查询区县乡镇街道过去12个月党建能力治理能力服务能力每月总分本级得分下级得分数据
* @author sun
*/
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> selectAblityIndex(AblityIndexFormDTO formDTO);
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> selectMonthScoreList(MonthScoreListFormDTO formDTO);
}

18
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java

@ -18,7 +18,11 @@
package com.epmet.datareport.dao.fact;
import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO;
import com.epmet.evaluationindex.screen.dto.form.MonthScoreListFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScoreListFormDTO;
import com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO;
import com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO;
import org.apache.ibatis.annotations.Mapper;
import java.util.LinkedList;
@ -38,4 +42,18 @@ public interface FactIndexCommunityScoreDao {
* @author sun
*/
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> selectCommunityAblityIndex(AblityIndexFormDTO formDTO);
/**
* @param formDTO
* @Description 分别查询社区级组织某一月份党建能力治理能力服务能力对应的总分本级分下级分
* @author sun
*/
ScoreListResultDTO selectCommunityScoreList(ScoreListFormDTO formDTO);
/**
* @param formDTO
* @Description 分别查询社区过去12个月党建能力治理能力服务能力每月总分本级得分下级得分数据
* @author sun
*/
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> selectCommunityMonthScoreList(MonthScoreListFormDTO formDTO);
}

28
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java

@ -17,8 +17,16 @@
package com.epmet.datareport.dao.fact;
import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO;
import com.epmet.evaluationindex.screen.dto.form.MonthScoreListFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScoreListFormDTO;
import com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO;
import com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO;
import org.apache.ibatis.annotations.Mapper;
import java.util.LinkedList;
/**
* 网格相关分值记录表
*
@ -28,4 +36,24 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface FactIndexGridScoreDao {
/**
* @param formDTO
* @Description 分别查网格过去12个月党建能力治理能力服务能力每月总分本级得分下级得分数据
* @author sun
*/
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> selectGridAblityIndex(AblityIndexFormDTO formDTO);
/**
* @param formDTO
* @Description 分别查网格某一月份党建能力治理能力服务能力对应的总分本级分下级分
* @author sun
*/
ScoreListResultDTO selectGridScoreList(ScoreListFormDTO formDTO);
/**
* @param formDTO
* @Description 分别查网格过去12个月党建能力治理能力服务能力每月总分本级得分下级得分数据
* @author sun
*/
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> selectGridMonthScoreList(MonthScoreListFormDTO formDTO);
}

20
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java

@ -17,8 +17,15 @@
package com.epmet.datareport.dao.fact;
import com.epmet.evaluationindex.screen.dto.form.AblityListFormDTO;
import com.epmet.evaluationindex.screen.dto.form.MonthAblityListFormDTO;
import com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO;
import com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO;
import org.apache.ibatis.annotations.Mapper;
import java.util.LinkedList;
import java.util.List;
/**
* 网格相关分值记录表
*
@ -28,4 +35,17 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface FactIndexGridSubScoreDao {
/**
* @param formDTO
* @Description 查询网格某月份某项能力对应的各项指标
* @author sun
*/
List<AblityListResultDTO> selectGridAblityList(AblityListFormDTO formDTO);
/**
* @param formDTO
* @Description 查询网格层级某项能力对应的一项指标过去12个月份数据
* @author sun
*/
LinkedList<MonthAblityListResultDTO> selectGridMonthAblityList(MonthAblityListFormDTO formDTO);
}

338
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java

@ -7,16 +7,14 @@ import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.constant.FactConstant;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataMonthlyDao;
import com.epmet.datareport.dao.fact.FactIndexAgencyScoreDao;
import com.epmet.datareport.dao.fact.FactIndexAgencySubScoreDao;
import com.epmet.datareport.dao.fact.FactIndexCommunityScoreDao;
import com.epmet.datareport.dao.fact.FactIndexCommunitySubScoreDao;
import com.epmet.datareport.dao.fact.*;
import com.epmet.datareport.service.fact.FactIndexService;
import com.epmet.evaluationindex.screen.dto.form.*;
import com.epmet.evaluationindex.screen.dto.result.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@ -45,6 +43,10 @@ public class FactIndexServiceImpl implements FactIndexService {
private FactIndexCommunityScoreDao factIndexCommunityScoreDao;
@Autowired
private FactIndexCommunitySubScoreDao factIndexCommunitySubScoreDao;
@Autowired
private FactIndexGridScoreDao factIndexGridScoreDao;
@Autowired
private FactIndexGridSubScoreDao factIndexGridSubScoreDao;
/**
* @param formDTO
@ -53,76 +55,91 @@ public class FactIndexServiceImpl implements FactIndexService {
*/
@Override
public List<AblityIndexResultDTO> ablityIndex(AblityIndexFormDTO formDTO) {
LinkedList<AblityIndexResultDTO> resultDTO = new LinkedList<>();
LinkedList<AblityIndexResultDTO> resultList = new LinkedList<>();
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> djList = null;
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> zlList = null;
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> fwList = null;
//分别查询过去12个月党建能力、治理能力、服务能力各自总分乘权重后的分值,每个月份三个分值的加和就是当月的能力指数的分值 fact_index_agency_score 按月份升序
//1.计算所查月份前12个月的monthId
formDTO.setStartMonthId(getDate(formDTO.getMonthId()));
//2.根据组织Id查询组织信息
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getAgencyId());
if (null == agency) {
throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getAgencyId()));
}
//1.根据组织级别判断查询哪类数据表
//区县级、乡镇街道级
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) {
//2-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据(不想写union)
formDTO.setIndexCode(FactConstant.DJNL);
djList = factIndexAgencyScoreDao.selectAblityIndex(formDTO);
//2-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.ZLNL);
zlList = factIndexAgencyScoreDao.selectAblityIndex(formDTO);
//2-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.FWNL);
fwList = factIndexAgencyScoreDao.selectAblityIndex(formDTO);
//2.根据类型判断是查询组织数据还是网格数据
//组织层级数据
if (FactConstant.AGENCY.equals(formDTO.getOrgType())) {
//3.根据组织Id查询组织信息
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId());
if (null == agency) {
throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId()));
}
//4.根据组织级别判断查询哪类数据表
//区县级、乡镇街道级
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) {
//4-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据(不想写union)
formDTO.setIndexCode(FactConstant.DJNL);
djList = factIndexAgencyScoreDao.selectAblityIndex(formDTO);
//4-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.ZLNL);
zlList = factIndexAgencyScoreDao.selectAblityIndex(formDTO);
//4-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.FWNL);
fwList = factIndexAgencyScoreDao.selectAblityIndex(formDTO);
//社区级
} else if ("community".equals(agency.getLevel())) {
//2-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据
//社区级
} else if ("community".equals(agency.getLevel())) {
//4-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.DJNL);
djList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO);
//4-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.ZLNL);
zlList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO);
//4-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.FWNL);
fwList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO);
} else {
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId()));
}
//网格层级数据
} else if (FactConstant.GRID.equals(formDTO.getOrgType())) {
//5.查询过去12个月网格层级各项能力对应的各项得分数据
//5-1.查询网格过去12个月党建能力每月总分、本级得分、下级得分数据(不想写union)
formDTO.setIndexCode(FactConstant.DJNL);
djList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO);
//2-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据
djList = factIndexGridScoreDao.selectGridAblityIndex(formDTO);
//5-2.查询网格过去12个月治理能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.ZLNL);
zlList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO);
//2-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据
zlList = factIndexGridScoreDao.selectGridAblityIndex(formDTO);
//5-3.查询网格过去12个月服务能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.FWNL);
fwList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO);
fwList = factIndexGridScoreDao.selectGridAblityIndex(formDTO);
} else {
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getAgencyId()));
throw new RenException(String.format("能力指数查询,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType()));
}
//3.遍历计算每个月能力指数
//6.遍历计算每个月能力指数
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> nlList = new LinkedList<>();
for (int i = 0; i < djList.size(); i++) {
AblityIndexResultDTO.ScoreListResultDTO nldto = new AblityIndexResultDTO.ScoreListResultDTO();
nldto.setIndexTotal(djList.get(i).getIndexTotal() + zlList.get(i).getIndexTotal() + fwList.get(i).getIndexTotal());
nldto.setAgencyScore(djList.get(i).getAgencyScore() + zlList.get(i).getAgencyScore() + fwList.get(i).getAgencyScore());
nldto.setSubAgencyScore(djList.get(i).getSubAgencyScore() + zlList.get(i).getSubAgencyScore() + fwList.get(i).getSubAgencyScore());
double num1 = new BigDecimal((djList.get(i).getIndexTotal() + zlList.get(i).getIndexTotal() + fwList.get(i).getIndexTotal())).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue();
nldto.setIndexTotal(num1);
nldto.setMonthId(djList.get(i).getMonthId());
nlList.add(nldto);
}
//5.封装数据并返回
AblityIndexResultDTO nl = new AblityIndexResultDTO();
nl.setIndexCode(FactConstant.NLZB);
nl.setScoreList(djList);
resultDTO.add(nl);
nl.setScoreList(nlList);
if(null != nlList){resultList.add(nl);}
AblityIndexResultDTO dj = new AblityIndexResultDTO();
dj.setIndexCode(FactConstant.DJNL);
dj.setScoreList(djList);
resultDTO.add(dj);
if(null != djList){resultList.add(dj);}
AblityIndexResultDTO zl = new AblityIndexResultDTO();
zl.setIndexCode(FactConstant.ZLNL);
zl.setScoreList(djList);
resultDTO.add(zl);
zl.setScoreList(zlList);
if(null != zlList){resultList.add(zl);}
AblityIndexResultDTO fw = new AblityIndexResultDTO();
fw.setIndexCode(FactConstant.FWNL);
fw.setScoreList(djList);
resultDTO.add(fw);
fw.setScoreList(fwList);
if(null != fwList){resultList.add(fw);}
return resultDTO;
return resultList;
}
/**
@ -132,13 +149,65 @@ public class FactIndexServiceImpl implements FactIndexService {
*/
@Override
public List<ScoreListResultDTO> scoreList(ScoreListFormDTO formDTO) {
//1.查询当前组织某一月份党建能力对应的总分、本级分、下级分
formDTO.setIndexCode(FactConstant.DJNL);
ScoreListResultDTO dj = factIndexAgencyScoreDao.selectScore(formDTO);
//2.查询当前组织某一月份治理能力对应的总分、本级分、下级分
//3.查询当前组织某一月份服务能力对应的总分、本级分、下级分
LinkedList<ScoreListResultDTO> resultList = new LinkedList<>();
ScoreListResultDTO dj = new ScoreListResultDTO();
ScoreListResultDTO zl = new ScoreListResultDTO();
ScoreListResultDTO fw = new ScoreListResultDTO();
//1.根据类型判断是查询组织数据还是网格数据
//组织层级数据
if (FactConstant.AGENCY.equals(formDTO.getOrgType())) {
//2.根据组织Id查询组织信息
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId());
if (null == agency) {
throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId()));
}
//3.根据组织级别判断查询哪类数据表
//区县级、乡镇街道级
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) {
//3-1.查询当前组织某一月份党建能力对应的总分、本级分、下级分
formDTO.setIndexCode(FactConstant.DJNL);
dj = factIndexAgencyScoreDao.selectScoreList(formDTO);
//3-2.查询当前组织某一月份治理能力对应的总分、本级分、下级分
formDTO.setIndexCode(FactConstant.ZLNL);
zl = factIndexAgencyScoreDao.selectScoreList(formDTO);
//3-3.查询当前组织某一月份服务能力对应的总分、本级分、下级分
formDTO.setIndexCode(FactConstant.FWNL);
fw = factIndexAgencyScoreDao.selectScoreList(formDTO);
//社区级
} else if ("community".equals(agency.getLevel())) {
//3-1.查询当前组织某一月份党建能力对应的总分、本级分、下级分
formDTO.setIndexCode(FactConstant.DJNL);
dj = factIndexCommunityScoreDao.selectCommunityScoreList(formDTO);
//3-2.查询当前组织某一月份治理能力对应的总分、本级分、下级分
formDTO.setIndexCode(FactConstant.ZLNL);
zl = factIndexCommunityScoreDao.selectCommunityScoreList(formDTO);
//3-3.查询当前组织某一月份服务能力对应的总分、本级分、下级分
formDTO.setIndexCode(FactConstant.FWNL);
fw = factIndexCommunityScoreDao.selectCommunityScoreList(formDTO);
} else {
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId()));
}
return null;
//4.网格层级数据
} else if (FactConstant.GRID.equals(formDTO.getOrgType())) {
//4-1.查询当前组织某一月份党建能力对应的总分、本级分、下级分
formDTO.setIndexCode(FactConstant.DJNL);
dj = factIndexGridScoreDao.selectGridScoreList(formDTO);
//4-2.查询当前组织某一月份治理能力对应的总分、本级分、下级分
formDTO.setIndexCode(FactConstant.ZLNL);
zl = factIndexGridScoreDao.selectGridScoreList(formDTO);
//4-3.查询当前组织某一月份服务能力对应的总分、本级分、下级分
formDTO.setIndexCode(FactConstant.FWNL);
fw = factIndexGridScoreDao.selectGridScoreList(formDTO);
} else {
throw new RenException(String.format("按月份查询各项能力分数,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType()));
}
//5.封装数据并返回
if(null != dj){resultList.add(dj);}
if(null != zl){resultList.add(zl);}
if(null != fw){resultList.add(fw);}
return resultList;
}
/**
@ -148,7 +217,78 @@ public class FactIndexServiceImpl implements FactIndexService {
*/
@Override
public List<MonthScoreListResultDTO> monthScoreList(MonthScoreListFormDTO formDTO) {
return null;
LinkedList<MonthScoreListResultDTO> resultList = new LinkedList<>();
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> djList = new LinkedList<>();
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> zlList = new LinkedList<>();
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> fwList = new LinkedList<>();
//1.计算所查月份前12个月的monthId
formDTO.setStartMonthId(getDate(formDTO.getMonthId()));
//2.根据类型判断是查询组织数据还是网格数据
//组织层级数据
if (FactConstant.AGENCY.equals(formDTO.getOrgType())) {
//3.根据组织Id查询组织信息
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId());
if (null == agency) {
throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId()));
}
//4.根据组织级别判断查询哪类数据表
//区县级、乡镇街道级
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) {
//4-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.DJNL);
djList = factIndexAgencyScoreDao.selectMonthScoreList(formDTO);
//4-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.ZLNL);
zlList = factIndexAgencyScoreDao.selectMonthScoreList(formDTO);
//4-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.FWNL);
fwList = factIndexAgencyScoreDao.selectMonthScoreList(formDTO);
//社区级
} else if ("community".equals(agency.getLevel())) {
//4-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.DJNL);
djList = factIndexCommunityScoreDao.selectCommunityMonthScoreList(formDTO);
//4-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.ZLNL);
zlList = factIndexCommunityScoreDao.selectCommunityMonthScoreList(formDTO);
//4-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.FWNL);
fwList = factIndexCommunityScoreDao.selectCommunityMonthScoreList(formDTO);
} else {
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId()));
}
//网格层级数据
} else if (FactConstant.GRID.equals(formDTO.getOrgType())) {
//5.查询过去12个月网格层级各项能力对应的各项得分数据
//5-1.查询网格过去12个月党建能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.DJNL);
djList = factIndexGridScoreDao.selectGridMonthScoreList(formDTO);
//5-2.查询网格过去12个月治理能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.ZLNL);
zlList = factIndexGridScoreDao.selectGridMonthScoreList(formDTO);
//5-3.查询网格过去12个月服务能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.FWNL);
fwList = factIndexGridScoreDao.selectGridMonthScoreList(formDTO);
} else {
throw new RenException(String.format("能力指数查询,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType()));
}
//5.封装数据并返回
MonthScoreListResultDTO dj = new MonthScoreListResultDTO();
dj.setIndexCode(FactConstant.DJNL);
dj.setScoreList(djList);
if(null != djList){resultList.add(dj);}
MonthScoreListResultDTO zl = new MonthScoreListResultDTO();
zl.setIndexCode(FactConstant.ZLNL);
zl.setScoreList(zlList);
if(null != zlList){resultList.add(zl);}
MonthScoreListResultDTO fw = new MonthScoreListResultDTO();
fw.setIndexCode(FactConstant.FWNL);
fw.setScoreList(fwList);
if(null != fwList){resultList.add(fw);}
return resultList;
}
/**
@ -159,30 +299,41 @@ public class FactIndexServiceImpl implements FactIndexService {
@Override
public List<AblityListResultDTO> ablityList(AblityListFormDTO formDTO) {
List<AblityListResultDTO> resultList = new ArrayList<>();
//按月份查询当前组织各项指标数据 fact_index_agency_sub_score
//1.根据组织Id查询组织信息
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getAgencyId());
if (null == agency) {
throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getAgencyId()));
}
//2.根据组织级别拼接查询条件,判断查询不同数据表
//区县级、乡镇街道级
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) {
if ("district".equals(agency.getLevel())) {
formDTO.setAllParentIndexCode(FactConstant.QUAN_QU_XIANG_GUAN + ":" + formDTO.getIndexCode());
} else {
formDTO.setAllParentIndexCode(FactConstant.JIE_DAO_XIANG_GUAN + ":" + formDTO.getIndexCode());
//1.根据类型判断是查询组织数据还是网格数据
//组织层级数据
if (FactConstant.AGENCY.equals(formDTO.getOrgType())) {
//2.根据组织Id查询组织信息
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId());
if (null == agency) {
throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId()));
}
resultList = factIndexAgencySubScoreDao.selectAblityList(formDTO);
//3.根据组织级别拼接查询条件,判断查询不同数据表
//区县级、乡镇街道级
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) {
if ("district".equals(agency.getLevel())) {
formDTO.setAllParentIndexCode(FactConstant.QUAN_QU_XIANG_GUAN + ":" + formDTO.getIndexCode());
} else {
formDTO.setAllParentIndexCode(FactConstant.JIE_DAO_XIANG_GUAN + ":" + formDTO.getIndexCode());
}
resultList = factIndexAgencySubScoreDao.selectAblityList(formDTO);
//社区级
} else if ("community".equals(agency.getLevel())) {
formDTO.setAllParentIndexCode(FactConstant.SHE_QU_XIANG_GUAN + ":" + formDTO.getIndexCode());
resultList = factIndexCommunitySubScoreDao.selectCommunityAblityList(formDTO);
//社区级
} else if ("community".equals(agency.getLevel())) {
formDTO.setAllParentIndexCode(FactConstant.SHE_QU_XIANG_GUAN + ":" + formDTO.getIndexCode());
resultList = factIndexCommunitySubScoreDao.selectCommunityAblityList(formDTO);
} else {
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId()));
}
//网格层级数据
} else if (FactConstant.GRID.equals(formDTO.getOrgType())) {
//4.查询网格层级各项能力对应指标数据
formDTO.setAllParentIndexCode(FactConstant.WANG_GE_XIANG_GUAN + ":" + formDTO.getIndexCode());
resultList = factIndexGridSubScoreDao.selectGridAblityList(formDTO);
} else {
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getAgencyId()));
throw new RenException(String.format("按月查询各项指标数据,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType()));
}
//3.调用方法判断各项指标是数字指标还是百分比指标 //TODO
//4.调用方法判断各项指标是数字指标还是百分比指标 //TODO 记得value值保留一位小数 是数的保留零位小数 是百分比的保留一位小数
return resultList;
}
@ -196,24 +347,33 @@ public class FactIndexServiceImpl implements FactIndexService {
LinkedList<MonthAblityListResultDTO> resultList = new LinkedList<>();
//1.计算所查月份前12个月的monthId
formDTO.setStartMonthId(getDate(formDTO.getMonthId()));
//2.根据组织Id查询组织信息
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getAgencyId());
if (null == agency) {
throw new RenException(String.format("查询到组织信息失败,组织Id:%s", formDTO.getAgencyId()));
}
//3.根据组织级别拼接查询条件,判断查询不同数据表
//区县级、乡镇街道级
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) {
resultList = factIndexAgencySubScoreDao.selectMonthAblityList(formDTO);
//社区级
} else if ("community".equals(agency.getLevel())) {
resultList = factIndexCommunitySubScoreDao.selectCommunityMonthAblityList(formDTO);
//2.根据类型判断是查询组织数据还是网格数据
//组织层级数据
if (FactConstant.AGENCY.equals(formDTO.getOrgType())) {
//3.根据组织Id查询组织信息
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId());
if (null == agency) {
throw new RenException(String.format("查询到组织信息失败,组织Id:%s", formDTO.getOrgId()));
}
//4.根据组织级别拼接查询条件,判断查询不同数据表
//区县级、乡镇街道级
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) {
resultList = factIndexAgencySubScoreDao.selectMonthAblityList(formDTO);
//社区级
} else if ("community".equals(agency.getLevel())) {
resultList = factIndexCommunitySubScoreDao.selectCommunityMonthAblityList(formDTO);
} else {
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId()));
}
//网格层级数据
} else if (FactConstant.GRID.equals(formDTO.getOrgType())) {
//5.查询网格层级某项能力对应的一项指标过去12个月份数据
resultList = factIndexGridSubScoreDao.selectGridMonthAblityList(formDTO);
} else {
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getAgencyId()));
throw new RenException(String.format("按月查询各项指标最近12个月数据,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType()));
}
//3.调用方法判断各项指标是数字指标还是百分比指标//TODO
//6.调用方法判断各项指标是数字指标还是百分比指标//TODO 记得value值保留一位小数 是数的保留零位小数 是百分比的保留一位小数
return resultList;
}
@ -243,7 +403,7 @@ public class FactIndexServiceImpl implements FactIndexService {
*/
@Override
public List<PeerComparisonResultDTO> peerComparison(PeerComparisonFormDTO formDTO) {
//1.根据组织Id的上级组织Id查询同级组织对应类型的得分排名(查询最近一个月数据)
//1.根据组织或网格Id的上级组织Id查询同级组织或网格对应类型的得分排名(查询最近一个月数据)
List<PeerComparisonResultDTO> resultList = screenIndexDataMonthlyDao.selectScoreList(formDTO);
return resultList;
}

45
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml

@ -3,16 +3,49 @@
<mapper namespace="com.epmet.datareport.dao.fact.FactIndexAgencyScoreDao">
<select id="selectScore" resultType="com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO">
<select id="selectAblityIndex" resultType="com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO$ScoreListResultDTO">
SELECT
fact.month_id AS "monthId",
ROUND(fact.score, 1) AS "indexTotal"
FROM
fact_index_agency_score fact
WHERE
fact.del_flag = '0'
AND fact.customer_id = #{customerId}
AND fact.agency_id = #{orgId}
AND fact.month_id &gt; #{startMonthId}
AND fact.month_id &lt;= #{monthId}
AND fact.index_code = #{indexCode}
ORDER BY
fact.month_id ASC
</select>
<select id="selectScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO">
SELECT
#{indexCode} AS "indexCode",
ROUND(fact.score, 1) AS "indexTotal",
ROUND(self.self_score, 1) AS "agencyScore",
ROUND(self.sub_score, 1) AS "subAgencyScore"
FROM
fact_index_agency_score fact
INNER JOIN fact_index_agency_self_sub_score self ON fact.agency_id = self.agency_id
AND fact.month_id = self.month_id
AND fact.index_code = self.parent_index_code
WHERE
fact.del_flag = '0'
AND self.del_flag = '0'
AND fact.customer_id = #{customerId}
AND fact.agency_id = #{orgId}
AND fact.month_id = #{monthId}
AND fact.index_code = #{indexCode}
</select>
<select id="selectAblityIndex" resultType="com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO$ScoreListResultDTO">
<select id="selectMonthScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO$ScoreListResultDTO">
SELECT
fact.month_id AS "monthId",
ROUND(fact.score * fact.weight, 1) AS "indexTotal",
ROUND(self.self_score * self.self_weight,1) AS "agencyScore",
ROUND(self.sub_score * self.sub_weight,1) AS "subAgencyScore"
ROUND(fact.score, 1) AS "indexTotal",
ROUND(self.self_score, 1) AS "agencyScore",
ROUND(self.sub_score, 1) AS "subAgencyScore"
FROM
fact_index_agency_score fact
INNER JOIN fact_index_agency_self_sub_score self ON fact.agency_id = self.agency_id
@ -22,7 +55,7 @@
fact.del_flag = '0'
AND self.del_flag = '0'
AND fact.customer_id = #{customerId}
AND fact.agency_id = #{agencyId}
AND fact.agency_id = #{orgId}
AND fact.month_id &gt; #{startMonthId}
AND fact.month_id &lt;= #{monthId}
AND fact.index_code = #{indexCode}

8
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml

@ -6,7 +6,7 @@
<select id="selectAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO">
SELECT
fact.index_code AS "key",
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value",
IF(fact.origin_value='',0,IFNULL(ROUND(fact.origin_value,1),0)) AS "value",
dict.index_name AS "name"
FROM
fact_index_agency_sub_score fact
@ -16,14 +16,14 @@
AND dict.del_flag = '0'
AND fact.all_parent_index_code = #{allParentIndexCode}
AND customer_id = #{customerId}
AND agency_id = #{agencyId}
AND agency_id = #{orgId}
AND month_id = #{monthId}
</select>
<select id="selectMonthAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO">
SELECT
fact.month_id AS "monthId",
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "ablity"
IF(fact.origin_value='',0,IFNULL(ROUND(fact.origin_value,1),0)) AS "ablity"
FROM
fact_index_agency_sub_score fact
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code
@ -31,7 +31,7 @@
fact.del_flag = '0'
AND dict.del_flag = '0'
AND customer_id = #{customerId}
AND agency_id = #{agencyId}
AND agency_id = #{orgId}
AND month_id &lt;= #{monthId}
AND month_id &gt; #{startMonthId}
AND fact.index_code = #{key}

45
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml

@ -6,9 +6,46 @@
<select id="selectCommunityAblityIndex" resultType="com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO$ScoreListResultDTO">
SELECT
fact.month_id AS "monthId",
ROUND(fact.score * fact.weight, 1) AS "indexTotal",
ROUND(self.self_score * self.self_weight,1) AS "agencyScore",
ROUND(self.sub_score * self.sub_weight,1) AS "subAgencyScore"
ROUND(fact.score, 1) AS "indexTotal"
FROM
fact_index_community_score fact
WHERE
fact.del_flag = '0'
AND fact.customer_id = #{customerId}
AND fact.agency_id = #{orgId}
AND fact.month_id &gt; #{startMonthId}
AND fact.month_id &lt;= #{monthId}
AND fact.index_code = #{indexCode}
ORDER BY
fact.month_id ASC
</select>
<select id="selectCommunityScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO">
SELECT
#{indexCode} AS "indexCode",
ROUND(fact.score, 1) AS "indexTotal",
ROUND(self.self_score, 1) AS "agencyScore",
ROUND(self.sub_score, 1) AS "subAgencyScore"
FROM
fact_index_community_score fact
INNER JOIN fact_index_community_self_sub_score self ON fact.agency_id = self.agency_id
AND fact.month_id = self.month_id
AND fact.index_code = self.parent_index_code
WHERE
fact.del_flag = '0'
AND self.del_flag = '0'
AND fact.customer_id = #{customerId}
AND fact.agency_id = #{orgId}
AND fact.month_id = #{monthId}
AND fact.index_code = #{indexCode}
</select>
<select id="selectCommunityMonthScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO$ScoreListResultDTO">
SELECT
fact.month_id AS "monthId",
ROUND(fact.score, 1) AS "indexTotal",
ROUND(self.self_score, 1) AS "agencyScore",
ROUND(self.sub_score, 1) AS "subAgencyScore"
FROM
fact_index_community_score fact
INNER JOIN fact_index_community_self_sub_score self ON fact.agency_id = self.agency_id
@ -18,7 +55,7 @@
fact.del_flag = '0'
AND self.del_flag = '0'
AND fact.customer_id = #{customerId}
AND fact.agency_id = #{agencyId}
AND fact.agency_id = #{orgId}
AND fact.month_id &gt; #{startMonthId}
AND fact.month_id &lt;= #{monthId}
AND fact.index_code = #{indexCode}

8
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml

@ -6,7 +6,7 @@
<select id="selectCommunityAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO">
SELECT
fact.index_code AS "key",
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value",
IF(fact.origin_value='',0,IFNULL(ROUND(fact.origin_value,1),0)) AS "value",
dict.index_name AS "name"
FROM
fact_index_community_sub_score fact
@ -16,14 +16,14 @@
AND dict.del_flag = '0'
AND fact.all_parent_index_code = #{allParentIndexCode}
AND customer_id = #{customerId}
AND agency_id = #{agencyId}
AND agency_id = #{orgId}
AND month_id = #{monthId}
</select>
<select id="selectCommunityMonthAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO">
SELECT
fact.month_id AS "monthId",
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "ablity"
IF(fact.origin_value='',0,IFNULL(ROUND(fact.origin_value,1),0)) AS "ablity"
FROM
fact_index_community_sub_score fact
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code
@ -31,7 +31,7 @@
fact.del_flag = '0'
AND dict.del_flag = '0'
AND customer_id = #{customerId}
AND agency_id = #{agencyId}
AND agency_id = #{orgId}
AND month_id &lt;= #{monthId}
AND month_id &gt; #{startMonthId}
AND fact.index_code = #{key}

61
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml

@ -3,5 +3,66 @@
<mapper namespace="com.epmet.datareport.dao.fact.FactIndexGridScoreDao">
<select id="selectGridAblityIndex" resultType="com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO$ScoreListResultDTO">
SELECT
fact.month_id AS "monthId",
ROUND(fact.score, 1) AS "indexTotal"
FROM
fact_index_grid_score fact
WHERE
fact.del_flag = '0'
AND fact.customer_id = #{customerId}
AND fact.grid_id = #{orgId}
AND fact.month_id &gt; #{startMonthId}
AND fact.month_id &lt;= #{monthId}
AND fact.index_code = #{indexCode}
ORDER BY
fact.month_id ASC
</select>
<select id="selectGridScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO">
SELECT
#{indexCode} AS "indexCode",
ROUND(fact.score, 1) AS "indexTotal",
ROUND(self.self_score, 1) AS "agencyScore",
ROUND(self.sub_score, 1) AS "subAgencyScore"
FROM
fact_index_grid_score fact
INNER JOIN fact_index_grid_self_sub_score self ON fact.grid_id = self.grid_id
AND fact.agency_id = self.agency_id
AND fact.month_id = self.month_id
AND fact.index_code = self.parent_index_code
WHERE
fact.del_flag = '0'
AND self.del_flag = '0'
AND fact.customer_id = #{customerId}
AND fact.grid_id = #{orgId}
AND fact.month_id = #{monthId}
AND fact.index_code = #{indexCode}
</select>
<select id="selectGridMonthScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO$ScoreListResultDTO">
SELECT
fact.month_id AS "monthId",
ROUND(fact.score, 1) AS "indexTotal",
ROUND(self.self_score, 1) AS "agencyScore",
ROUND(self.sub_score, 1) AS "subAgencyScore"
FROM
fact_index_grid_score fact
INNER JOIN fact_index_grid_self_sub_score self ON fact.grid_id = self.grid_id
AND fact.agency_id = self.agency_id
AND fact.month_id = self.month_id
AND fact.index_code = self.parent_index_code
WHERE
fact.del_flag = '0'
AND self.del_flag = '0'
AND fact.customer_id = #{customerId}
AND fact.grid_id = #{orgId}
AND fact.month_id &gt; #{startMonthId}
AND fact.month_id &lt;= #{monthId}
AND fact.index_code = #{indexCode}
ORDER BY
fact.month_id ASC
</select>
</mapper>

35
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml

@ -3,5 +3,40 @@
<mapper namespace="com.epmet.datareport.dao.fact.FactIndexGridSubScoreDao">
<select id="selectGridAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO">
SELECT
fact.index_code AS "key",
IF(fact.origin_value='',0,IFNULL(ROUND(fact.origin_value,1),0)) AS "value",
dict.index_name AS "name"
FROM
fact_index_grid_sub_score fact
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code
WHERE
fact.del_flag = '0'
AND dict.del_flag = '0'
AND fact.all_parent_index_code = #{allParentIndexCode}
AND customer_id = #{customerId}
AND grid_id = #{orgId}
AND month_id = #{monthId}
</select>
<select id="selectGridMonthAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO">
SELECT
fact.month_id AS "monthId",
IF(fact.origin_value='',0,IFNULL(ROUND(fact.origin_value,1),0)) AS "ablity"
FROM
fact_index_grid_sub_score fact
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code
WHERE
fact.del_flag = '0'
AND dict.del_flag = '0'
AND customer_id = #{customerId}
AND grid_id = #{orgId}
AND month_id &lt;= #{monthId}
AND month_id &gt; #{startMonthId}
AND fact.index_code = #{key}
ORDER BY
fact.month_id ASC
</select>
</mapper>

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

@ -110,8 +110,8 @@
<select id="selectScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.PeerComparisonResultDTO">
SELECT
org_id AS "agencyId",
org_name AS "agencyName",
org_id AS "orgId",
org_name AS "orgName",
<if test="indexCode != null and indexCode != '' and indexCode == 'dangjiannengli'">
round((party_dev_ablity * party_dev_weight),1) AS "score"
</if>
@ -125,7 +125,7 @@
screen_index_data_monthly
WHERE
del_flag = '0'
AND org_type = 'agency'
AND org_type = #{orgType}
AND customer_id = #{customerId}
AND parent_id = (
select
@ -134,9 +134,9 @@
screen_index_data_monthly
where
del_flag = '0'
and org_type = 'agency'
and org_type = #{orgType}
and customer_id = #{customerId}
and org_id = #{agencyId}
and org_id = #{orgId}
order by
created_time desc
limit 1

5
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueMainDailyFormDTO.java

@ -91,6 +91,11 @@ public class IssueMainDailyFormDTO implements Serializable {
*/
private String issueStatus;
/**
* 关闭状态
*/
private String resolveType;
/**
* 创建话题用户身份标识
*/

19
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridInfoResultDTO.java

@ -0,0 +1,19 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/24 2:59 下午
*/
@Data
public class GridInfoResultDTO implements Serializable {
private static final long serialVersionUID = -8146474744340303247L;
private String agencyId;
private String gridId;
}

23
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyDTO.java

@ -0,0 +1,23 @@
package com.epmet.dto.extract.result;
import com.epmet.dto.extract.form.PartyBaseInfoFormDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/9/24 2:45 下午
*/
@Data
@AllArgsConstructor
public class GridPartyDTO implements Serializable {
private static final long serialVersionUID = -6699064424253966688L;
private List<String> orgIds;
private List<PartyBaseInfoFormDTO> result;
}

5
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueInfoResultDTO.java

@ -47,4 +47,9 @@ public class IssueInfoResultDTO implements Serializable {
* 用户ID
*/
private String userId;
/**
* 关闭状态
*/
private String resolveType;
}

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

@ -0,0 +1,25 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/24 1:23 下午
*/
@Data
public class OrgNameResultDTO implements Serializable {
private static final long serialVersionUID = -4815327768546033428L;
private String gridId;
private String agencyId;
private String gridName;
private String agencyName;
private String parentId;
}

1
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridInfoDTO.java

@ -35,6 +35,7 @@ public class GridInfoDTO implements Serializable {
/**
* 所有上级组织ID,英文:隔开
* agencyId的pids
*/
private String pids;
}

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

@ -220,4 +220,13 @@ public interface DataStatisticalOpenFeignClient {
*/
@PostMapping("/data/stats/eidim/init-all")
Result initAllEIDims();
/**
* @Description 抽取数据到大屏
* @param extractFormDTO
* @author zxc
* @date 2020/9/24 10:15 上午
*/
@PostMapping(value = "/data/stats/screenextract/extractdailyall")
Result extractDailyAll(@RequestBody(required = false) ExtractFormDTO extractFormDTO);
}

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

@ -212,4 +212,9 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
public Result initAllEIDims() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "initAllEIDims");
}
@Override
public Result extractDailyAll(ExtractFormDTO extractFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "extractDailyAll",extractFormDTO);
}
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java

@ -53,4 +53,13 @@ public interface ProjectConstant {
*/
String STATS_FAILED_PREFIX = "统计数据执行失败:%s 客户ID:%s,统计日期:%s";
/**
* 自身
*/
String ZI_SHEN = "zishen";
/**
* 下级
*/
String XIA_JI = "xiaji";
}

35
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java

@ -0,0 +1,35 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractService;
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 zxc
* @DateTime 2020/9/24 9:42 上午
*/
@RestController
@RequestMapping("screenextract")
public class ScreenExtractDailyController {
@Autowired
private ScreenExtractService screenExtractService;
/**
* @Description 抽取数据到大屏
* @param extractFormDTO
* @author zxc
* @date 2020/9/24 10:15 上午
*/
@PostMapping("extractdailyall")
public Result screenExtractDaily(@RequestBody ExtractFormDTO extractFormDTO){
screenExtractService.extractDailyAll(extractFormDTO);
return new Result();
}
}

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

@ -123,30 +123,64 @@ public interface FactOriginIssueMainDailyDao extends BaseDao<FactOriginIssueMain
/**
* @return int
* @param customerId
* @param partyMemberUserIds
* @author yinzuomei
* @description 根据党员ids, 查询党员发布议题数
* @description 查询党员发布议题数
* @Date 2020/9/23 15:13
**/
int getParyPublishIssueTotal(@Param("customerId") String customerId, @Param("list")List<String> partyMemberUserIds);
int getParyPublishIssueTotal(@Param("customerId") String customerId,
@Param("gridId")String gridId,
@Param("agencyId")String agencyId);
/**
* @param customerId
* @param gridId
* @return int
* @author yinzuomei
* @description 具体某个网格的议题总数
* @description 具体某个网格/社区下的议题总数
* @Date 2020/9/23 15:23
**/
int getGridIssueTotalByGrid(@Param("customerId") String customerId, @Param("gridId") String gridId);
int getGridOrCommunityIssueTotal(@Param("customerId") String customerId, @Param("gridId") String gridId,@Param("communityId") String communityId);
/**
* @return int
* @param customerId
* @param gridId
* @param communityId
* @author yinzuomei
* @description 网格内议题转项目数
* @description 网格社区内议题转项目数
* @Date 2020/9/23 15:45
**/
int getShiftProjectTotalByGrid(@Param("customerId") String customerId, @Param("gridId") String gridId);
int getGridOrCommunityShiftProjectTotal(@Param("customerId") String customerId, @Param("gridId") String gridId,@Param("communityId") String communityId);
/**
* @return java.lang.Integer
* @param customerId
* @param agencyPath
* @author yinzuomei
* @description 组织内 党员发布议题
* @Date 2020/9/24 16:23
**/
Integer getAgencyParyPublishIssueTotal(@Param("customerId")String customerId,
@Param("agencyPath")String agencyPath);
/**
* @return int
* @param customerId
* @param agencyPath
* @author yinzuomei
* @description 组织内所有议题总数
* @Date 2020/9/24 16:26
**/
int getAgencyIssueTotal(@Param("customerId")String customerId,
@Param("agencyPath")String agencyPath);
/**
* @return java.lang.Integer
* @param customerId
* @param agencyPath
* @author yinzuomei
* @description 组织下议题转项目数
* @Date 2020/9/24 17:05
**/
Integer getAgencyShiftProjectTotal(@Param("customerId")String customerId,
@Param("agencyPath")String agencyPath);
}

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

@ -111,10 +111,27 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
* @return java.lang.Integer
* @param customerId
* @param gridId
* @param communityId
* @param closedStatus
* @author yinzuomei
* @description 具体某个网格内的项目
* @description 具体某个网格或者社区内的项目
* @Date 2020/9/23 18:18
**/
Integer getGridClosedProjectTotal(@Param("customerId")String customerId, @Param("gridId") String gridId, @Param("closedStatus") String closedStatus);
Integer getGridOrCommunityClosedProjectTotal(@Param("customerId")String customerId,
@Param("gridId") String gridId,
@Param("communityId") String communityId,
@Param("closedStatus") String closedStatus);
/**
* @return int
* @param customerId
* @param agencyPath
* @param closedStatus
* @author yinzuomei
* @description 组织下已解决项目 or 已结案项目总数
* @Date 2020/9/24 17:38
**/
int getAgencyClosedProjectTotal(@Param("customerId") String customerId,
@Param("agencyPath")String agencyPath,
@Param("closedStatus")String closedStatus);
}

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

@ -19,7 +19,6 @@ package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.CreateTopicCountResultDTO;
import com.epmet.dto.topic.TopicOriginInfoDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -80,29 +79,41 @@ public interface FactOriginTopicMainDailyDao extends BaseDao<FactOriginTopicMain
/**
* @return int
* @param customerId
* @param partyMemberUserIds
* @author yinzuomei
* @description 党员提出的话题总数
* @Date 2020/9/23 13:46
**/
int selectPublishedByPartyTopicCount(@Param("customerId") String customerId, @Param("list") List<String> partyMemberUserIds);
int selectPublishedByPartyTopicCount(@Param("customerId") String customerId,
@Param("gridId")String gridId,
@Param("agencyId")String agencyId);
/**
* @return int
* @param customerId
* @param gridId
* @return int
* @author yinzuomei
* @description 具体某个网格的话题数
* @Date 2020/9/23 14:23
**/
int selectGridTopicTotalByGrid(@Param("customerId")String customerId, @Param("gridId")String gridId);
int selectGridOrCommunityTopicTotal(@Param("customerId") String customerId, @Param("gridId") String gridId, @Param("agencyId") String agencyId);
/**
* @return void
* @param list
* @author yinzuomei
* @description 更新话题主表的TOPIC_STATUS , CLOSED_STATUS
* @Date 2020/9/23 17:59
**/
void updateFactOriginTopicMain(@Param("list") List<TopicOriginInfoDTO> list);
void updateFactOriginTopicMain(@Param("topicId")String topicId,@Param("topicStatus")String topicStatus,@Param("closedStatus")String closedStatus);
/**
* @return java.lang.Integer
* @param customerId
* @param agencyPath
* @author yinzuomei
* @description
* @Date 2020/9/24 15:53
**/
Integer getAgencyPartyTopicTotal(@Param("customerId") String customerId,
@Param("agencyPath")String agencyPath,
@Param("createTopicUserIsParty") String createTopicUserIsParty);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySelfSubScoreDao.java

@ -35,5 +35,5 @@ public interface AgencySelfSubScoreDao extends BaseDao<AgencySelfSubScoreEntity>
int insertBatch(@Param("list") List<AgencySelfSubScoreEntity> list);
int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("parentIndexCode") String parentIndexCode);
int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("dataType") String dataType, @Param("parentIndexCode") String parentIndexCode);
}

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySubScoreDao.java

@ -52,5 +52,6 @@ public interface AgencySubScoreDao extends BaseDao<AgencyScoreEntity> {
*/
Integer deleteOldRecord(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("dataType") String dataType, @Param("delNum") Integer delNum);
List<AgencySubScoreEntity> selectSubListByPath(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("levelIndexPath") String levelIndexPath);
List<AgencySubScoreEntity> selectSubListByPath(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("dataType") String dataType, @Param("allIndexCodePath") String allIndexCodePath);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySelfSubScoreDao.java

@ -33,7 +33,7 @@ import java.util.List;
@Mapper
public interface CommunitySelfSubScoreDao extends BaseDao<CommunitySelfSubScoreEntity> {
int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode);
int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("parentIndexCode") String parentIndexCode);
int insertBatch(@Param("list") List<CommunitySelfSubScoreEntity> communitySelfSubScoreEntities);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySubScoreDao.java

@ -52,5 +52,5 @@ public interface CommunitySubScoreDao extends BaseDao<FactIndexCommunitySubScore
Integer deleteOldRecord(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("delNum") Integer delNum);
List<FactIndexCommunitySubScoreEntity> selectSubListByPath(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("levelIndexPath") String levelIndexPath);
List<FactIndexCommunitySubScoreEntity> selectSubListByPath(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("allIndexCodePath") String allIndexCodePath);
}

39
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSelfSubScoreDao.java

@ -0,0 +1,39 @@
/**
* 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.indexcal;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.evaluationindex.indexcal.DeptSelfSubScoreEntity;
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-21
*/
@Mapper
public interface DeptSelfSubScoreDao extends BaseDao<DeptSelfSubScoreEntity> {
int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("parentIndexCode") String parentIndexCode);
int insertBatch(@Param("list") List<DeptSelfSubScoreEntity> deptSelfSubScoreEntities);
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSubScoreDao.java

@ -22,7 +22,6 @@ import com.epmet.entity.evaluationindex.indexcal.DeptSubScoreEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import javax.annotation.security.PermitAll;
import java.util.List;
/**
@ -54,7 +53,9 @@ public interface DeptSubScoreDao extends BaseDao<DeptSubScoreEntity> {
* @Date 2020/9/10 12:28
**/
int deleteBatches(@Param("customerId") String customerId,
@Param("monthId") String monthId,
@Param("allParentIndexCode") String allParentIndexCode,
@Param("deleteSize") Integer deleteSize);
@Param("monthId") String monthId,
@Param("allParentIndexCode") String allParentIndexCode,
@Param("deleteSize") Integer deleteSize);
List<DeptSubScoreEntity> selectSubListByPath(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("allIndexCodePath") String allIndexCodePath);
}

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

@ -104,21 +104,6 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao<FactIndexGov
**/
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
@ -135,4 +120,14 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao<FactIndexGov
* @date 2020/9/19 4:31 下午
*/
Integer deleteOldGovernAbilityRecord(@Param("customerId")String customerId,@Param("monthId")String monthId);
/**
* 查询客户下网格治理能力
* @author zhaoqifeng
* @date 2020/9/24 15:26
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity>
*/
List<FactIndexGovrnAblityGridMonthlyEntity> selectGridByCustomer(@Param("customerId")String customerId, @Param("monthId")String monthId);
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java

@ -85,4 +85,12 @@ public interface ScreenCpcBaseDataDao extends BaseDao<ScreenCpcBaseDataEntity> {
* @date 2020/9/23 2:01 下午
*/
List<PartyInfoResultDTO> selectPartyInfo(@Param("customerId") String customerId,@Param("dateId") String dateId, String agencyId);
/**
* @Description 查询党员信息直属网格的
* @param gridIds
* @author zxc
* @date 2020/9/24 3:23 下午
*/
List<PartyInfoResultDTO> selectDirectGridPartyInfo(@Param("gridIds") List<String> gridIds,@Param("customerId") String customerId,@Param("dateId") String dateId);
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java

@ -20,6 +20,7 @@ package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.form.PartyBaseInfoFormDTO;
import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO;
import com.epmet.dto.extract.result.OrgNameResultDTO;
import com.epmet.dto.screen.result.TreeResultDTO;
import com.epmet.dto.screencoll.form.CustomerAgencyFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity;
@ -152,4 +153,12 @@ public interface ScreenCustomerAgencyDao extends BaseDao<ScreenCustomerAgencyEnt
* @date 2020/9/23 3:10 下午
*/
List<PartyBaseInfoFormDTO> selectAllAgencyIdToParty(@Param("customerId")String customerId,@Param("dateId")String dateId);
/**
* @Description 查询org名称机关
* @param agencyIds
* @author zxc
* @date 2020/9/24 1:27 下午
*/
List<OrgNameResultDTO> selectOrgNameAgency(@Param("agencyIds") List<String> agencyIds);
}

36
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java

@ -19,7 +19,11 @@ package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO;
import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO;
import com.epmet.dto.extract.form.PartyBaseInfoFormDTO;
import com.epmet.dto.extract.result.GridInfoResultDTO;
import com.epmet.dto.extract.result.OrgNameResultDTO;
import com.epmet.dto.indexcal.PageQueryGridFormDTO;
import com.epmet.dto.screencoll.form.CustomerGridFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity;
@ -138,4 +142,36 @@ public interface ScreenCustomerGridDao extends BaseDao<ScreenCustomerGridEntity>
* @date 2020/9/23 3:10 下午
*/
List<PartyBaseInfoFormDTO> selectAllGridIdToParty(String customerId, String dateId);
/**
* @Description 查询org名称
* @param gridIds
* @author zxc
* @date 2020/9/24 1:27 下午
*/
List<OrgNameResultDTO> selectOrgName(@Param("gridIds") List<String> gridIds);
/**
* @Description 查询机关的直属网格
* @param agencyIds
* @author zxc
* @date 2020/9/24 2:33 下午
*/
List<GridInfoResultDTO> selectDirectGrid(@Param("agencyIds") List<String> agencyIds);
/**
* @Description 查询全部网格信息
* @param customerId
* @author zxc
* @date 2020/9/19 10:50 上午
*/
List<PartyAbilityGridMonthlyFormDTO> selectAllGridInfoToParty(String customerId);
/**
* @Description 查询全部网格信息
* @param customerId
* @author zxc
* @date 2020/9/18 10:47 上午
*/
List<GovernAbilityGridMonthlyFormDTO> selectAllGridInfo(@Param("customerId") String customerId);
}

19
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java

@ -56,4 +56,23 @@ public interface ScreenGovernRankDataDao extends BaseDao<ScreenGovernRankDataEnt
* @Date 10:52 2020-08-18
**/
void batchInsertGovernRankData(@Param("list") List<GovernRankDataFormDTO> list, @Param("customerId")String customerId);
/**
* 组织级别初始化数据
* @author zhaoqifeng
* @date 2020/9/24 14:52
* @param customerId
* @param level
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity>
*/
List<ScreenGovernRankDataEntity> initAgencyDataList(@Param("customerId") String customerId, @Param("level") String level);
/**
* 网格级别初始化数据
* @author zhaoqifeng
* @date 2020/9/24 14:52
* @param customerId
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity>
*/
List<ScreenGovernRankDataEntity> initGridDataList(@Param("customerId") String customerId);
}

32
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java

@ -43,10 +43,24 @@ public interface ScreenPioneerDataDao extends BaseDao<ScreenPioneerDataEntity> {
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
Integer deletePioneerDataByCustomerId(@Param("customerId") String customerId,
@Param("deleteSize") Integer deleteSize);
/**
* @return java.lang.Integer
* @param customerId
* @param orgType
* @param deleteSize
* @param orgIds
* @author yinzuomei
* @description 产品客户采集用删除方法
* @Date 2020/9/24 14:59
**/
Integer deletePioneerData(@Param("customerId") String customerId,
@Param("orgType") String orgType,
@Param("dataEndTime")String dataEndTime,
@Param("deleteSize") Integer deleteSize);
@Param("deleteSize") Integer deleteSize,
@Param("orgIds")List<String> orgIds);
/**
* 10党建引领-先锋模范数据
@ -71,12 +85,20 @@ public interface ScreenPioneerDataDao extends BaseDao<ScreenPioneerDataEntity> {
/**
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity>
* @param customerId
* @param agencyLevel
* @author yinzuomei
* @description 初始化好orgType="agency"的插入对象
* @description 初始化好社区, orgType="agency"的插入对象
* @Date 2020/9/22 15:03
**/
List<ScreenPioneerDataEntity> initAgencyPioneerDataList(@Param("customerId")String customerId, @Param("agencyLevel")String agencyLevel);
List<ScreenPioneerDataEntity> initCommunityPioneerDataList(@Param("customerId")String customerId);
/**
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity>
* @param customerId
* @author yinzuomei
* @description 初始化好非社区的, orgType="agency"的插入对象
* @Date 2020/9/24 13:45
**/
List<ScreenPioneerDataEntity> initExceptCommunityPioneerDataList(@Param("customerId")String customerId);
/**
* @return void

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

@ -76,8 +76,28 @@ public interface DimCustomerPartymemberDao extends BaseDao<DimCustomerPartymembe
* @param customerId
* @param gridId
* @author yinzuomei
* @description
* @description 网格内注册的党员
* @Date 2020/9/23 14:20
**/
List<String> selectGridPartyMemberUserIds(@Param("customerId") String customerId, @Param("gridId")String gridId);
/**
* @return java.util.List<java.lang.String>
* @param customerId
* @param communityId
* @author yinzuomei
* @description 社区内注册的党员
* @Date 2020/9/24 10:22
**/
List<String> selectCommunityPartyMemberUserIds(@Param("customerId") String customerId, @Param("communityId")String communityId);
/**
* @return java.util.List<java.lang.String>
* @param customerId
* @param pids
* @author yinzuomei
* @description 根据pids查询党员
* @Date 2020/9/24 14:31
**/
List<String> selectPartyMemberUserIdsByPids(@Param("customerId") String customerId, @Param("pids")String pids);
}

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySubScoreEntity.java

@ -96,4 +96,9 @@ public class AgencySubScoreEntity extends BaseEpmetEntity {
* 权重同一组权重总和=1
*/
private BigDecimal weight;
/**
* 所有指标code拼接的字符串 冒号隔开
*/
private String allParentIndexCode;
}

100
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSelfSubScoreEntity.java

@ -0,0 +1,100 @@
/**
* 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.indexcal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* 区直部门相关 自身/下级分数表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-23
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("fact_index_dept_self_sub_score")
public class DeptSelfSubScoreEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 部门id
*/
private String deptId;
/**
* 组织id
*/
private String agencyId;
/**
* 年度ID: yyyy
*/
private String yearId;
/**
* 季度id: yyyyQ1yyyyQ2yyyyQ3yyyyQ4
*/
private String quarterId;
/**
* 月维度Id: yyyyMM
*/
private String monthId;
/**
* 自身指标得分
*/
private BigDecimal selfScore;
/**
* 下级指标得分
*/
private BigDecimal subScore;
/**
* 党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli
*/
private String parentIndexCode;
/**
* 所有指标code拼接的字符串 冒号隔开
*/
private String allParentIndexCode;
/**
* 自身指标权重
*/
private BigDecimal selfWeight;
/**
* 下级指标权重
*/
private BigDecimal subWeight;
}

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPioneerDataEntity.java

@ -117,4 +117,11 @@ public class ScreenPioneerDataEntity extends BaseEpmetEntity {
*/
private String dataEndTime;
/**
*
*/
private String pid;
private String agencyPids;
private String agencyPath;
}

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

@ -15,6 +15,7 @@ import com.epmet.service.evaluationindex.extract.todata.*;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyService;
import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService;
import com.epmet.service.heart.ActInfoService;
import com.epmet.service.partymember.PartyMemberService;
import com.epmet.service.stats.FactArticlePublishedGridDailyService;
@ -74,6 +75,8 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
private UserService userService;
@Autowired
private PartyMemberService partyMemberService;
@Autowired
private ScreenCustomerGridService gridService;
/**
* @Description 计算网格指标党建能力
@ -84,7 +87,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
*/
@Override
public Boolean calGridIndexPartyAbility(String customerId, String monthId) {
List<PartyAbilityGridMonthlyFormDTO> result = governAbilityDao.selectAllGridInfoToParty(customerId);
List<PartyAbilityGridMonthlyFormDTO> result = gridService.selectAllGridInfoToParty(customerId);
if (CollectionUtils.isEmpty(result)){
log.warn(String.format(ExtractConstant.CUSTOMER_INFO_NULL,customerId));
return true;
@ -239,7 +242,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
@Override
public Boolean calGridIndexGovernAbility(String customerId, String monthId) {
List<GovernAbilityGridMonthlyFormDTO> result = governAbilityDao.selectAllGridInfo(customerId);
List<GovernAbilityGridMonthlyFormDTO> result = gridService.selectAllGridInfo(customerId);
if (CollectionUtils.isEmpty(result)){
log.warn(String.format(ExtractConstant.CUSTOMER_INFO_NULL,customerId));
return true;

52
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java

@ -20,8 +20,6 @@ package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity;
import java.util.List;
/**
* 议题主表
*
@ -33,29 +31,59 @@ public interface FactOriginIssueMainDailyService extends BaseService<FactOriginI
/**
* @return int
* @param customerId
* @param partyMemberUserIds
* @author yinzuomei
* @description 根据党员ids,查询党员发布议题数
* @Date 2020/9/23 15:11
**/
int getParyPublishIssueTotal(String customerId, List<String> partyMemberUserIds);
int getParyPublishIssueTotal(String customerId,String gridId,String agencyId);
/**
* @return int
* @return java.lang.Integer
* @param customerId
* @param gridId
* @author yinzuomei
* @description 具体某个网格的议题总数
* @Date 2020/9/23 15:22
* @description 网格内议题转项目数
* @Date 2020/9/23 15:39
**/
Integer getGridOrCommunityShiftProjectTotal(String customerId, String gridId,String communityId);
/**
* @return int
* @param customerId
* @param communityId
* @author yinzuomei
* @description 某个网格内或者社区内议题总数
* @Date 2020/9/24 10:45
**/
int getGridIssueTotalByGrid(String customerId, String gridId);
int getGridOrCommunityIssueTotal(String customerId, String gridId,String communityId);
/**
* @return java.lang.Integer
* @param customerId
* @param gridId
* @param agencyPath
* @author yinzuomei
* @description 网格内议题转项目数
* @Date 2020/9/23 15:39
* @description 组织内 党员发布议题
* @Date 2020/9/24 16:23
**/
Integer getAgencyParyPublishIssueTotal(String customerId, String agencyPath);
/**
* @return int
* @param customerId
* @param agencyPath
* @author yinzuomei
* @description 组织内所有议题总数
* @Date 2020/9/24 16:26
**/
int getAgencyIssueTotal(String customerId, String agencyPath);
/**
* @return java.lang.Integer
* @param customerId
* @param agencyPath
* @author yinzuomei
* @description 组织下议题转项目数
* @Date 2020/9/24 17:04
**/
Integer getShiftProjectTotalByGrid(String customerId, String gridId);
Integer getAgencyShiftProjectTotal(String customerId, String agencyPath);
}

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

@ -173,5 +173,16 @@ public interface FactOriginProjectMainDailyService extends BaseService<FactOrigi
* @description 具体某个网格内的项目
* @Date 2020/9/23 18:17
**/
Integer getGridClosedProjectTotal(String customerId, String gridId, String closedStatus);
Integer getGridOrCommunityClosedProjectTotal(String customerId, String gridId, String communityId,String closedStatus);
/**
* @return int
* @param customerId
* @param agencyPath
* @param closedStatus
* @author yinzuomei
* @description 组织下已解决项目 or 已结案项目总数
* @Date 2020/9/24 17:37
**/
int getAgencyClosedProjectTotal(String customerId, String agencyPath, String closedStatus);
}

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

@ -65,19 +65,29 @@ public interface FactOriginTopicMainDailyService extends BaseService<FactOriginT
/**
* @return int
* @param customerId
* @param partyMemberUserIds 党员用户id
* @author yinzuomei
* @description 党员提出的话题总数
* @Date 2020/9/23 13:36
**/
int calPublishedByPartyTopicCount(String customerId,List<String> partyMemberUserIds);
int calPublishedByPartyTopicCount(String customerId,String gridId,String agencyId);
/**
* @return int
* @param customerId
* @param gridId
* @author yinzuomei
* @description 具体某个网格的话题数
* @description 具体某个网格或者社区的话题数
* @Date 2020/9/23 14:22
**/
int calGridTopicTotalByGrid(String customerId, String gridId);
int calGridOrCommunityTopicTotal(String customerId, String gridId,String communityId);
/**
* @return java.lang.Integer
* @param customerId
* @param agencyPath
* @param createTopicUserIsParty 1是党员
* @author yinzuomei
* @description 在当前组织下话题总数createTopicUserIsParty=1时查询党员发布的话题总数
* @Date 2020/9/24 15:49
**/
Integer getAgencyPartyTopicTotal(String customerId, String agencyPath,String createTopicUserIsParty);
}

69
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java

@ -19,16 +19,12 @@ package com.epmet.service.evaluationindex.extract.todata.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.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginIssueMainDailyDao;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.List;
/**
* 议题主表
@ -44,43 +40,78 @@ public class FactOriginIssueMainDailyServiceImpl extends BaseServiceImpl<FactOri
/**
* @param customerId
* @param partyMemberUserIds
* @return int
* @author yinzuomei
* @description 根据党员ids, 查询党员发布议题数
* @Date 2020/9/23 15:11
**/
@Override
public int getParyPublishIssueTotal(String customerId, List<String> partyMemberUserIds) {
if(CollectionUtils.isEmpty(partyMemberUserIds)){
return NumConstant.ZERO;
}
return baseDao.getParyPublishIssueTotal(customerId,partyMemberUserIds);
public int getParyPublishIssueTotal(String customerId,String gridId,String agencyId) {
return baseDao.getParyPublishIssueTotal(customerId,gridId,agencyId);
}
/**
* @param customerId
* @param gridId
* @return java.lang.Integer
* @author yinzuomei
* @description 网格内议题转项目数
* @Date 2020/9/23 15:39
**/
@Override
public Integer getGridOrCommunityShiftProjectTotal(String customerId, String gridId,String communityId) {
return baseDao.getGridOrCommunityShiftProjectTotal(customerId,gridId,communityId);
}
/**
* @param customerId
* @param communityId
* @return int
* @author yinzuomei
* @description 具体某个网格的议题总数
* @Date 2020/9/23 15:22
* @description 网格内或者社区内议题总数
* @Date 2020/9/24 10:45
**/
@Override
public int getGridIssueTotalByGrid(String customerId, String gridId) {
return baseDao.getGridIssueTotalByGrid(customerId,gridId);
public int getGridOrCommunityIssueTotal(String customerId, String gridId,String communityId) {
return baseDao.getGridOrCommunityIssueTotal(customerId,gridId,communityId);
}
/**
* @param customerId
* @param gridId
* @param agencyPath
* @return java.lang.Integer
* @author yinzuomei
* @description 网格内议题转项目数
* @Date 2020/9/23 15:39
* @description 组织内 党员发布议题
* @Date 2020/9/24 16:23
**/
@Override
public Integer getAgencyParyPublishIssueTotal(String customerId, String agencyPath) {
return baseDao.getAgencyParyPublishIssueTotal(customerId,agencyPath);
}
/**
* @param customerId
* @param agencyPath
* @return int
* @author yinzuomei
* @description 组织内所有议题总数
* @Date 2020/9/24 16:26
**/
@Override
public int getAgencyIssueTotal(String customerId, String agencyPath) {
return baseDao.getAgencyIssueTotal(customerId,agencyPath);
}
/**
* @param customerId
* @param agencyPath
* @return java.lang.Integer
* @author yinzuomei
* @description 组织下议题转项目数
* @Date 2020/9/24 17:04
**/
@Override
public Integer getShiftProjectTotalByGrid(String customerId, String gridId) {
return baseDao.getShiftProjectTotalByGrid(customerId,gridId);
public Integer getAgencyShiftProjectTotal(String customerId, String agencyPath) {
return baseDao.getAgencyShiftProjectTotal(customerId,agencyPath);
}
}

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

@ -181,7 +181,21 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO
* @Date 2020/9/23 18:17
**/
@Override
public Integer getGridClosedProjectTotal(String customerId, String gridId, String closedStatus) {
return baseDao.getGridClosedProjectTotal(customerId,gridId,closedStatus);
public Integer getGridOrCommunityClosedProjectTotal(String customerId, String gridId,String communityId, String closedStatus) {
return baseDao.getGridOrCommunityClosedProjectTotal(customerId,gridId,communityId,closedStatus);
}
/**
* @param customerId
* @param agencyPath
* @param closedStatus
* @return int
* @author yinzuomei
* @description 组织下已解决项目 or 已结案项目总数
* @Date 2020/9/24 17:37
**/
@Override
public int getAgencyClosedProjectTotal(String customerId, String agencyPath, String closedStatus) {
return baseDao.getAgencyClosedProjectTotal(customerId,agencyPath,closedStatus);
}
}

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

@ -108,10 +108,10 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
* @Date 2020/9/23 17:47
**/
private void updateFactOriginTopicMain(List<TopicOriginInfoDTO> updateTopicOriginInfoList) {
//批量更新
List<List<TopicOriginInfoDTO>> partition = ListUtils.partition(updateTopicOriginInfoList, IndexCalConstant.INSERT_SIZE);
partition.forEach(list -> {
baseDao.updateFactOriginTopicMain(list);
updateTopicOriginInfoList.forEach(topicOriginInfoDTO -> {
baseDao.updateFactOriginTopicMain(topicOriginInfoDTO.getTopicId(),
topicOriginInfoDTO.getTopicStatus(),
topicOriginInfoDTO.getClosedStatus());
});
}
@ -277,18 +277,14 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
/**
* @param customerId
* @param partyMemberUserIds
* @return int
* @author yinzuomei
* @description 党员提出的话题总数
* @Date 2020/9/23 13:36
**/
@Override
public int calPublishedByPartyTopicCount(String customerId,List<String> partyMemberUserIds) {
if(CollectionUtils.isEmpty(partyMemberUserIds)){
return NumConstant.ZERO;
}
return baseDao.selectPublishedByPartyTopicCount(customerId,partyMemberUserIds);
public int calPublishedByPartyTopicCount(String customerId,String gridId,String agencyId) {
return baseDao.selectPublishedByPartyTopicCount(customerId,gridId,agencyId);
}
/**
@ -296,11 +292,25 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
* @param gridId
* @return int
* @author yinzuomei
* @description 具体某个网格的话题数
* @description 具体某个网格或者社区的话题数
* @Date 2020/9/23 14:22
**/
@Override
public int calGridTopicTotalByGrid(String customerId, String gridId) {
return baseDao.selectGridTopicTotalByGrid(customerId,gridId);
public int calGridOrCommunityTopicTotal(String customerId, String gridId,String communityId) {
return baseDao.selectGridOrCommunityTopicTotal(customerId,gridId,communityId);
}
/**
* @param customerId
* @param agencyPath
* @return java.lang.Integer
* @author yinzuomei
* @description 在当前组织下话题总数createTopicUserIsParty=1时查询党员发布的话题总数
* @Date 2020/9/24 15:49
**/
@Override
public Integer getAgencyPartyTopicTotal(String customerId, String agencyPath,String createTopicUserIsParty) {
return baseDao.getAgencyPartyTopicTotal(customerId,agencyPath,createTopicUserIsParty);
}
}

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

@ -128,7 +128,7 @@ public class IssueExtractServiceImpl implements IssueExtractService {
agencyInfoList.forEach(pid -> {
if (r.getAgencyId().equals(pid.getAgencyId())){
r.setPid(pid.getPid());
r.setPids(pid.getPids());
r.setPids(pid.getPids().concat(":").concat(pid.getPid()));
}
});
});

41
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java

@ -0,0 +1,41 @@
package com.epmet.service.evaluationindex.extract.toscreen;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/24 14:28
*/
public interface GovernRankDataExtractService {
/**
* 网格治理能力
*
* @param customerId
* @param monthId
* @return void
* @author zhaoqifeng
* @date 2020/9/24 15:16
*/
void extractGridData(String customerId, String monthId);
/**
* 社区治理能力
*
* @param customerId
* @param monthId
* @return void
* @author zhaoqifeng
* @date 2020/9/24 15:17
*/
void extractCommunityData(String customerId, String monthId);
/**
* 街道治理能力
*
* @param customerId
* @param monthId
* @return void
* @author zhaoqifeng
* @date 2020/9/24 15:17
*/
void extractStreetData(String customerId, String monthId);
}

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

@ -0,0 +1,18 @@
package com.epmet.service.evaluationindex.extract.toscreen;
/**
* @Author zxc
* @DateTime 2020/9/24 5:05 下午
*/
public interface PartyGuideService {
/**
* @Description 党建引领抽取
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/24 5:10 下午
*/
Boolean partyGuideExtract(String customerId,String dateId);
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PioneerDataExtractService.java

@ -26,11 +26,5 @@ public interface PioneerDataExtractService {
// 社区、街道、区县、市级别、省级
void extractCommunityPioneerData(String customerId, String dateId);
void extractStreetPioneerData(String customerId, String dateId);
void extractDistrictPioneerData(String customerId, String dateId);
void extractCityPioneerData(String customerId, String dateId);
void extractProvincePioneerData(String customerId, String dateId);
void extractExceptCommunityPioneerData(String customerId, String dateId);
}

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

@ -0,0 +1,19 @@
package com.epmet.service.evaluationindex.extract.toscreen;
import com.epmet.dto.extract.form.ExtractFormDTO;
/**
* @Author zxc
* @DateTime 2020/9/24 9:57 上午
*/
public interface ScreenExtractService {
/**
* @Description 抽取数据到大屏
* @param extractFormDTO
* @author zxc
* @date 2020/9/24 10:15 上午
*/
void extractDailyAll(ExtractFormDTO extractFormDTO);
}

64
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java

@ -0,0 +1,64 @@
package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyDao;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity;
import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity;
import com.epmet.service.evaluationindex.extract.toscreen.GovernRankDataExtractService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService;
import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/24 14:31
*/
public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractService {
@Autowired
private ScreenGovernRankDataService screenGovernRankDataService;
@Autowired
private FactIndexGovrnAblityOrgMonthlyService factIndexGovrnAblityOrgMonthlyService;
@Autowired
private FactIndexGovrnAblityGridMonthlyService factIndexGovrnAblityGridMonthlyService;
@Override
public void extractGridData(String customerId, String monthId) {
List<ScreenGovernRankDataEntity> list = screenGovernRankDataService.initList(customerId, OrgTypeConstant.GRID, null);
if (CollectionUtils.isEmpty(list)) {
return;
}
List<FactIndexGovrnAblityGridMonthlyEntity> gridList = factIndexGovrnAblityGridMonthlyService.getGridByCustomer(customerId, monthId);
list.forEach(entity -> gridList.stream().filter(gridAblity -> entity.getOrgId().equals(gridAblity.getGridId())).forEach(grid -> {
BigDecimal total = new BigDecimal(grid.getProjectTotal());
entity.setYearId(grid.getYearId());
entity.setMonthId(grid.getMonthId());
//TODO 响应率
//解决率
BigDecimal resolveCount = new BigDecimal(grid.getResolveProjectCount());
entity.setResolvedRatio(resolveCount.divide(total, NumConstant.SIX, RoundingMode.HALF_UP));
//自治率
BigDecimal selfCount = new BigDecimal(grid.getSelfSolveProjectCount());
entity.setGovernRatio(selfCount.divide(total, NumConstant.SIX, RoundingMode.HALF_UP));
//满意率
entity.setSatisfactionRatio(grid.getSatisfactionRatio());
}));
}
@Override
public void extractCommunityData(String customerId, String monthId) {
}
@Override
public void extractStreetData(String customerId, String monthId) {
}
}

185
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java

@ -2,10 +2,7 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.dto.extract.form.PartyBaseInfoFormDTO;
import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO;
import com.epmet.dto.extract.result.PartyInfoResultDTO;
import com.epmet.dto.extract.result.PartyMemberInfoResultDTO;
import com.epmet.dto.extract.result.UserCountResultDTO;
import com.epmet.dto.extract.result.*;
import com.epmet.service.evaluationindex.extract.toscreen.PartyBaseInfoService;
import com.epmet.service.evaluationindex.screen.ScreenCpcBaseDataService;
import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService;
@ -63,24 +60,30 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
public Boolean statsPartyMemberBaseInfoToScreen(String customerId, String dateId) {
List<CustomerAgencyInfoResultDTO> agencyIdList = agencyService.selectAllAgencyId(customerId);
if (!CollectionUtils.isEmpty(agencyIdList)){
// 根据组织级别分组
Map<String, List<CustomerAgencyInfoResultDTO>> groupByLevel = agencyIdList.stream().collect(Collectors.groupingBy(CustomerAgencyInfoResultDTO::getLevel));
if (groupByLevel.containsKey(ScreenConstant.COMMUNITY)){
// 社区级别
List<CustomerAgencyInfoResultDTO> customerGridInfoList = groupByLevel.get(ScreenConstant.COMMUNITY);
disPose(customerGridInfoList,true,customerId,dateId);
}
if (groupByLevel.containsKey(ScreenConstant.STREET)){
// 街道级别
List<CustomerAgencyInfoResultDTO> customerGridInfoList = groupByLevel.get(ScreenConstant.STREET);
disPose(customerGridInfoList,false,customerId,dateId);
}
if (groupByLevel.containsKey(ScreenConstant.DISTRICT)){
// 区级
List<CustomerAgencyInfoResultDTO> customerGridInfoList = groupByLevel.get(ScreenConstant.DISTRICT);
disPose(customerGridInfoList,false,customerId,dateId);
}
if (groupByLevel.containsKey(ScreenConstant.CITY)){
// 市级
List<CustomerAgencyInfoResultDTO> customerGridInfoList = groupByLevel.get(ScreenConstant.CITY);
disPose(customerGridInfoList,false,customerId,dateId);
}
if (groupByLevel.containsKey(ScreenConstant.PROVINCE)){
// 省级
List<CustomerAgencyInfoResultDTO> customerGridInfoList = groupByLevel.get(ScreenConstant.PROVINCE);
disPose(customerGridInfoList,false,customerId,dateId);
}
@ -96,60 +99,34 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
*/
public void disPose(List<CustomerAgencyInfoResultDTO> agencyIdList, Boolean isGrid, String customerId, String dateId){
if (!CollectionUtils.isEmpty(agencyIdList)){
// 网格ID或机关Id
List<String> orgIds = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList());
List<PartyBaseInfoFormDTO> result = new ArrayList<>();
if (isGrid == true){
// 是 community 级别,子级为gridId
List<UserCountResultDTO> userCountList = userGridDailyService.selectUserCount(customerId, dateId);
agencyIdList.forEach(agency -> {
// 1. 处理社区下的所有网格中的党员信息
String agencyId = agency.getAgencyId();
Map<String, Object> agencyMap = agencyService.selectAllSubAgencyId(agencyId, customerId);
List<String> gridIds = (List<String>) agencyMap.get(agencyId);
orgIds.addAll(gridIds);
List<PartyMemberInfoResultDTO> partyMemberInfoList = partyMemberService.selectPartyMemberInfo(customerId, gridIds);
if (!CollectionUtils.isEmpty(partyMemberInfoList)){
// 为每个人赋值年龄
partyMemberInfoList.forEach(party -> {
party.setAge(getAge(party.getBirthday()));
});
Map<String, List<PartyMemberInfoResultDTO>> groupByGridId = partyMemberInfoList.stream().collect(Collectors.groupingBy(PartyMemberInfoResultDTO::getGridId));
groupByGridId.forEach((gridId,partyInfos) -> {
PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO();
form.setOrgType(ScreenConstant.GRID);
form.setOrgId(gridId);
form.setOrgName(partyInfos.get(NumConstant.ZERO).getGridName());
form.setAgeLevel1(disposeAge(partyInfos,NumConstant.TWENTY,false));
form.setAgeLevel2(disposeAgeArea(partyInfos,NumConstant.TWENTY,NumConstant.THIRTY));
form.setAgeLevel3(disposeAgeArea(partyInfos,NumConstant.THIRTY_ONE,NumConstant.FORTY));
form.setAgeLevel4(disposeAgeArea(partyInfos,NumConstant.FORTY_ONE,NumConstant.FIFTY));
form.setAgeLevel5(disposeAgeArea(partyInfos,NumConstant.FIFTY_ONE,NumConstant.SIXTY));
form.setAgeLevel6(disposeAge(partyInfos,NumConstant.SIXTY,true));
form.setCustomerId(customerId);
form.setDataEndTime(dateId);
form.setParentId(partyInfos.get(NumConstant.ZERO).getAgencyId());
if (!CollectionUtils.isEmpty(userCountList)){
userCountList.forEach(user -> {
if (gridId.equals(user.getOrgId())){
form.setResiTotal(user.getResiTotal());
form.setRegisterUserCount(user.getRegisterUserCount());
form.setPartyMemberCount(user.getPartyMemberCount());
}
});
}
result.add(form);
});
}
GridPartyDTO gridPartyDTO = gridParty(customerId, dateId, agency);
result.addAll(gridPartyDTO.getResult());
orgIds.addAll(gridPartyDTO.getOrgIds());
});
// 2. 处理社区级别的党员信息
// 2. 处理社区级别的党员信息(因为网格级别的已算出,社区级别直接累加)
Map<String, List<PartyBaseInfoFormDTO>> groupByAgency = result.stream().collect(Collectors.groupingBy(PartyBaseInfoFormDTO::getParentId));
List<OrgNameResultDTO> orgNameAgencyList = agencyService.selectOrgNameAgency(result.stream().map(m -> m.getParentId()).distinct().collect(Collectors.toList()));
groupByAgency.forEach((commAgencyId,party) -> {
PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO();
form.setOrgName(party.get(NumConstant.ZERO).getOrgName());
if (!CollectionUtils.isEmpty(orgNameAgencyList)){
orgNameAgencyList.forEach(name -> {
if (commAgencyId.equals(name.getAgencyId())){
form.setOrgName(name.getAgencyName());
form.setParentId(name.getParentId());
}
});
}
form.setOrgId(commAgencyId);
form.setCustomerId(customerId);
form.setDataEndTime(dateId);
form.setOrgType(ScreenConstant.AGENCY);
form.setParentId(party.get(NumConstant.ZERO).getParentId());
form.setAgeLevel1(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel1)));
form.setAgeLevel2(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel2)));
form.setAgeLevel3(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel3)));
@ -163,9 +140,67 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
});
delAndInsert(result,customerId,dateId,orgIds);
}else {
// 级别为 street,district,city,province
List<String> agencyIds = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList());
List<GridInfoResultDTO> directGridIds = gridService.selectDirectGrid(agencyIds);
List<UserCountResultDTO> userCountList = userGridDailyService.selectUserCount(customerId, dateId);
agencyIdList.forEach(agency -> {
String agencyId = agency.getAgencyId();
List<String> dGridId = new ArrayList<>();
directGridIds.forEach(grid -> {
if (agencyId.equals(grid.getAgencyId())){
dGridId.add(grid.getGridId());
}
});
// 不为空 存在直属网格
if (!CollectionUtils.isEmpty(dGridId)){
List<PartyBaseInfoFormDTO> disGrid = new ArrayList<>();
List<PartyMemberInfoResultDTO> partyMemberInfoList = partyMemberService.selectPartyMemberInfo(customerId, dGridId);
List<OrgNameResultDTO> orgNameList = agencyService.selectOrgNameGrid(partyMemberInfoList.stream().map(m -> m.getGridId()).collect(Collectors.toList()));
if (!CollectionUtils.isEmpty(partyMemberInfoList)){
// 为每个人赋值年龄
partyMemberInfoList.forEach(party -> {
party.setAge(getAge(party.getBirthday()));
orgNameList.forEach(orgName -> {
if (party.getGridId().equals(orgName.getGridId())){
party.setGridName(orgName.getGridName());
party.setAgencyName(orgName.getAgencyName());
}
});
});
Map<String, List<PartyMemberInfoResultDTO>> groupByGridId = partyMemberInfoList.stream().collect(Collectors.groupingBy(PartyMemberInfoResultDTO::getGridId));
groupByGridId.forEach((gridId,partyInfos) -> {
PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO();
form.setOrgType(ScreenConstant.GRID);
form.setOrgId(gridId);
form.setOrgName(partyInfos.get(NumConstant.ZERO).getGridName());
form.setAgeLevel1(disposeAge(partyInfos,NumConstant.TWENTY,false));
form.setAgeLevel2(disposeAgeArea(partyInfos,NumConstant.TWENTY,NumConstant.THIRTY));
form.setAgeLevel3(disposeAgeArea(partyInfos,NumConstant.THIRTY_ONE,NumConstant.FORTY));
form.setAgeLevel4(disposeAgeArea(partyInfos,NumConstant.FORTY_ONE,NumConstant.FIFTY));
form.setAgeLevel5(disposeAgeArea(partyInfos,NumConstant.FIFTY_ONE,NumConstant.SIXTY));
form.setAgeLevel6(disposeAge(partyInfos,NumConstant.SIXTY,true));
form.setCustomerId(customerId);
form.setDataEndTime(dateId);
form.setParentId(partyInfos.get(NumConstant.ZERO).getAgencyId());
if (!CollectionUtils.isEmpty(userCountList)){
userCountList.forEach(user -> {
if (gridId.equals(user.getOrgId())){
form.setResiTotal(user.getResiTotal());
form.setRegisterUserCount(user.getRegisterUserCount());
form.setPartyMemberCount(user.getPartyMemberCount());
}
});
}
disGrid.add(form);
});
}
delAndInsert(disGrid,customerId,dateId,dGridId);
}
// 查询下级机关的党员信息,直接累加 【包括直属网格】
List<PartyInfoResultDTO> directGridList = cpcBaseDataService.selectDirectGridPartyInfo(dGridId, customerId, dateId);
List<PartyInfoResultDTO> partyInfoList = cpcBaseDataService.selectPartyInfo(customerId, dateId, agencyId);
partyInfoList.addAll(directGridList);
if (!CollectionUtils.isEmpty(partyInfoList)){
PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO();
form.setOrgName(partyInfoList.get(NumConstant.ZERO).getOrgName());
@ -207,6 +242,7 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
int birthDayMonth = birth.getMonthValue();
int birthDayOfMonth = birth.getDayOfMonth();
int age = nowYear - birthDayYear;
// 当前月小于出生年的月份 或者 当前月等于出生年的月 并且 当前日小于出生年的日,就是不满一岁
if (nowMonth < birthDayMonth || (nowMonth == birthDayMonth && nowDayOfMonth < birthDayOfMonth)) {
age--;
}
@ -223,6 +259,7 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
*/
public Integer disposeAgeArea(List<PartyMemberInfoResultDTO> partyMemberInfoList, Integer startAge,Integer endAge ){
if (!CollectionUtils.isEmpty(partyMemberInfoList)){
// 计算大于多少岁并小于多少岁的人
List<PartyMemberInfoResultDTO> collect = partyMemberInfoList.stream().filter(p -> p.getAge() >= startAge).filter(p -> p.getAge() <= endAge).collect(Collectors.toList());
return collect.size();
}
@ -241,8 +278,10 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
if (!CollectionUtils.isEmpty(partyMemberInfoList)){
List<PartyMemberInfoResultDTO> collect = new ArrayList<>();
if (isGreater == true){
// 大于
collect = partyMemberInfoList.stream().filter(p -> p.getAge() > age).collect(Collectors.toList());
}else {
// 小于
collect = partyMemberInfoList.stream().filter(p -> p.getAge() < age).collect(Collectors.toList());
}
return collect.size();
@ -260,10 +299,13 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
*/
@Transactional(rollbackFor = Exception.class)
public void delAndInsert(List<PartyBaseInfoFormDTO> result, String customerId, String dateId, List<String> orgIds){
// 查询客户下所有的agency
List<PartyBaseInfoFormDTO> partyBaseInfoList = agencyService.selectAllAgencyIdToParty(customerId,dateId);
// 查询客户下所有的grid
List<PartyBaseInfoFormDTO> resultList = gridService.selectAllGridIdToParty(customerId, dateId);
resultList.addAll(partyBaseInfoList);
List<PartyBaseInfoFormDTO> finalResult = new ArrayList<>();
// 因为是根据级别来删除,插入,所以把需要操作的orgIds单独出来
resultList.forEach(rl -> {
orgIds.forEach(orgId -> {
if (rl.getOrgId().equals(orgId)){
@ -289,4 +331,57 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService {
cpcBaseDataService.insertPartyBaseInfo(p);
});
}
public GridPartyDTO gridParty(String customerId,String dateId,CustomerAgencyInfoResultDTO agency){
List<PartyBaseInfoFormDTO> result = new ArrayList<>();
List<String> orgIds = new ArrayList<>();
List<UserCountResultDTO> userCountList = userGridDailyService.selectUserCount(customerId, dateId);
// 1. 处理社区下的所有网格中的党员信息
String agencyId = agency.getAgencyId();
// 获取下级所有agencyId【根据agencyMap中的level判断下级orgId是否是gridId】(此处直接作为gridId)
Map<String, Object> agencyMap = agencyService.selectAllSubAgencyId(agencyId, customerId);
List<String> gridIds = (List<String>) agencyMap.get(agencyId);
orgIds.addAll(gridIds);
List<PartyMemberInfoResultDTO> partyMemberInfoList = partyMemberService.selectPartyMemberInfo(customerId, gridIds);
List<OrgNameResultDTO> orgNameList = agencyService.selectOrgNameGrid(partyMemberInfoList.stream().map(m -> m.getGridId()).collect(Collectors.toList()));
if (!CollectionUtils.isEmpty(partyMemberInfoList)){
// 为每个人赋值年龄
partyMemberInfoList.forEach(party -> {
party.setAge(getAge(party.getBirthday()));
orgNameList.forEach(orgName -> {
if (party.getGridId().equals(orgName.getGridId())){
party.setGridName(orgName.getGridName());
party.setAgencyName(orgName.getAgencyName());
}
});
});
Map<String, List<PartyMemberInfoResultDTO>> groupByGridId = partyMemberInfoList.stream().collect(Collectors.groupingBy(PartyMemberInfoResultDTO::getGridId));
groupByGridId.forEach((gridId,partyInfos) -> {
PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO();
form.setOrgType(ScreenConstant.GRID);
form.setOrgId(gridId);
form.setOrgName(partyInfos.get(NumConstant.ZERO).getGridName());
form.setAgeLevel1(disposeAge(partyInfos,NumConstant.TWENTY,false));
form.setAgeLevel2(disposeAgeArea(partyInfos,NumConstant.TWENTY,NumConstant.THIRTY));
form.setAgeLevel3(disposeAgeArea(partyInfos,NumConstant.THIRTY_ONE,NumConstant.FORTY));
form.setAgeLevel4(disposeAgeArea(partyInfos,NumConstant.FORTY_ONE,NumConstant.FIFTY));
form.setAgeLevel5(disposeAgeArea(partyInfos,NumConstant.FIFTY_ONE,NumConstant.SIXTY));
form.setAgeLevel6(disposeAge(partyInfos,NumConstant.SIXTY,true));
form.setCustomerId(customerId);
form.setDataEndTime(dateId);
form.setParentId(partyInfos.get(NumConstant.ZERO).getAgencyId());
if (!CollectionUtils.isEmpty(userCountList)){
userCountList.forEach(user -> {
if (gridId.equals(user.getOrgId())){
form.setResiTotal(user.getResiTotal());
form.setRegisterUserCount(user.getRegisterUserCount());
form.setPartyMemberCount(user.getPartyMemberCount());
}
});
}
result.add(form);
});
}
return new GridPartyDTO(orgIds, result);
}
}

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

@ -0,0 +1,26 @@
package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.service.evaluationindex.extract.toscreen.PartyGuideService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* @Author zxc
* @DateTime 2020/9/24 5:06 下午
*/
@Service
@Slf4j
public class PartyGuideServiceImpl implements PartyGuideService {
/**
* @Description 党建引领抽取
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/24 5:10 下午
*/
@Override
public Boolean partyGuideExtract(String customerId, String dateId) {
return null;
}
}

297
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java

@ -9,9 +9,10 @@ import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDai
import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService;
import com.epmet.service.evaluationindex.extract.toscreen.PioneerDataExtractService;
import com.epmet.service.evaluationindex.screen.ScreenPioneerDataService;
import com.epmet.service.stats.DimCustomerPartymemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
@ -23,6 +24,7 @@ import java.util.List;
* @author yinzuomei@elink-cn.com
* @date 2020/9/22 11:25
*/
@Service
public class PioneerDataExtractServiceImpl implements PioneerDataExtractService {
@Autowired
@ -30,8 +32,6 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
@Autowired
private FactOriginTopicMainDailyService factOriginTopicMainDailyService;
@Autowired
private DimCustomerPartymemberService dimCustomerPartymemberService;
@Autowired
private FactOriginIssueMainDailyService factOriginIssueMainDailyService;
@Autowired
private FactOriginProjectMainDailyService factOriginProjectMainDailyService;
@ -47,7 +47,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
@Override
public void extractGridPioneerData(String customerId, String dateId) {
//查询客户下所有的网格,初始数据值为0
List<ScreenPioneerDataEntity> gridList = screenPioneerDataService.initPioneerDataList(customerId, "grid", StrConstant.EPMETY_STR);
List<ScreenPioneerDataEntity> gridList = screenPioneerDataService.initPioneerDataList(customerId, "grid");
if (CollectionUtils.isEmpty(gridList)) {
return;
}
@ -60,26 +60,22 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
entity.setIssueRatio(BigDecimal.ZERO);
//网格内的党员集合
List<String> partyMemberUserIds = dimCustomerPartymemberService.getPartyMemberUserIds(customerId, gridId);
//3、党员发布话题:
entity.setTopicTotal(getTopicTotal(customerId, partyMemberUserIds));
entity.setTopicTotal(getTopicTotal(customerId, gridId, null));
//4、党员发布话题占比: 网格内注册党员发布的话题总数占 网格内话题总数的 比率
if (entity.getTopicTotal() == NumConstant.ZERO) {
entity.setTopicRatio(BigDecimal.ZERO);
} else {
//当前网格内所有话题总数
int gridTopicTotal = getGridTopicTotal(customerId, gridId);
int gridTopicTotal = getGridOrCommunityTopicTotal(customerId, gridId, null);
entity.setTopicRatio(gridTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getTopicTotal() / gridTopicTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
//当前网格内所有议题总数
int gridIssueTotal = getGridIssueTotal(customerId, gridId);
int gridIssueTotal = getGridOrCommunityIssueTotal(customerId, gridId, null);
if (gridIssueTotal != NumConstant.ZERO) {
//5、党员发布议题
entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, partyMemberUserIds));
entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, gridId, null));
//6、党员发布议题占比 : 占网格内所有议题的比率
if (entity.getPublishIssueTotal() == NumConstant.ZERO) {
entity.setPublishIssueRatio(BigDecimal.ZERO);
@ -87,128 +83,239 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
entity.setPublishIssueRatio(gridIssueTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getPublishIssueTotal() / gridIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
//7、议题转项目数
entity.setShiftProjectTotal(getGridShiftProjectTotal(customerId, gridId));
entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, gridId, null));
//8、议题转项目占比 : 占网格内议题总数的比率
entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / gridIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
// 9、已解决项目
entity.setResolvedProjectTotal(getGridClosedProjectTotal(customerId,gridId,"resolved"));
if(entity.getResolvedProjectTotal()==NumConstant.ZERO){
entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, gridId, null, "resolved"));
if (entity.getResolvedProjectTotal() == NumConstant.ZERO) {
entity.setResolvedProjectRatio(BigDecimal.ZERO);
} else {
// 10、占总结项目
int closedProjectTotal = getGridOrCommunityClosedProjectTotal(customerId, gridId, null, null);
entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
});
screenPioneerDataService.delAndSavePioneerData(customerId, "grid", IndexCalConstant.DELETE_SIZE, gridList);
}
@Override
public void extractCommunityPioneerData(String customerId, String dateId) {
//查询客户下所有的社区,初始数据值为0
List<ScreenPioneerDataEntity> communityList = screenPioneerDataService.initPioneerDataList(customerId, "community");
if (CollectionUtils.isEmpty(communityList)) {
return;
}
communityList.forEach(entity -> {
entity.setDataEndTime(dateId);
String communityId = entity.getOrgId();
//1、党员参与议事 todo
entity.setIssueTotal(NumConstant.ZERO);
//2、党员参与议事占比 todo
entity.setIssueRatio(BigDecimal.ZERO);
//3、党员发布话题:
entity.setTopicTotal(getTopicTotal(customerId, null, communityId));
//4、党员发布话题占比: 社区内注册党员发布的话题总数占 社区内话题总数的 比率
if (entity.getTopicTotal() == NumConstant.ZERO) {
entity.setTopicRatio(BigDecimal.ZERO);
} else {
//当前社区内所有话题总数
int communityTopicTotal = getGridOrCommunityTopicTotal(customerId, null, communityId);
entity.setTopicRatio(communityTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getTopicTotal() / communityTopicTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
//当前社区内所有议题总数
int communityIssueTotal = getGridOrCommunityIssueTotal(customerId, null, communityId);
if (communityIssueTotal != NumConstant.ZERO) {
//5、党员发布议题
entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, null, communityId));
//6、党员发布议题占比 : 占社区内所有议题的比率
if (entity.getPublishIssueTotal() == NumConstant.ZERO) {
entity.setPublishIssueRatio(BigDecimal.ZERO);
}
entity.setPublishIssueRatio(communityIssueTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getPublishIssueTotal() / communityIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
//7、议题转项目数
entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, null, communityId));
//8、议题转项目占比 : 占社区内议题总数的比率
entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / communityIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
// 9、已解决项目
entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, null, communityId, "resolved"));
if (entity.getResolvedProjectTotal() == NumConstant.ZERO) {
entity.setResolvedProjectRatio(BigDecimal.ZERO);
} else {
// 10、占总结项目
int closedProjectTotal = getGridOrCommunityClosedProjectTotal(customerId, null, communityId, null);
entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
});
screenPioneerDataService.delAndSavePioneerData(customerId, "agency", IndexCalConstant.DELETE_SIZE, communityList);
}
@Override
public void extractExceptCommunityPioneerData(String customerId, String dateId) {
//查询客户下所有的组织(社区除外),初始数据值为0
List<ScreenPioneerDataEntity> agencyList = screenPioneerDataService.initPioneerDataList(customerId, "agency");
if (CollectionUtils.isEmpty(agencyList)) {
return;
}
agencyList.forEach(entity -> {
entity.setDataEndTime(dateId);
String agencyId = entity.getOrgId();
//1、党员参与议事 todo
entity.setIssueTotal(NumConstant.ZERO);
//2、党员参与议事占比 todo
entity.setIssueRatio(BigDecimal.ZERO);
if (StringUtils.isEmpty(entity.getPid()) || NumConstant.ZERO_STR.equals(entity.getPid())) {
entity.setAgencyPath(entity.getOrgId());
} else {
entity.setAgencyPath(entity.getAgencyPids().concat(StrConstant.COLON).concat(entity.getOrgId()));
}
//3、党员发布话题:
entity.setTopicTotal(getAgencyTopicTotal(customerId, entity.getAgencyPath(),NumConstant.ONE_STR));
//4、党员发布话题占比: 组织内注册党员发布的话题总数占 组织内话题总数的 比率
if (entity.getTopicTotal() == NumConstant.ZERO) {
entity.setTopicRatio(BigDecimal.ZERO);
} else {
//当前组织内所有话题总数
int agencyTopicTotal = getAgencyTopicTotal(customerId, entity.getAgencyPath(),null);
entity.setTopicRatio(agencyTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getTopicTotal() / agencyTopicTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
//当前组织内所有议题总数
int agencyIssueTotal = getAgencyIssueTotal(customerId, entity.getAgencyPath());
if (agencyIssueTotal != NumConstant.ZERO) {
//5、党员发布议题
entity.setPublishIssueTotal(getAgencyParyPublishIssueTotal(customerId, entity.getAgencyPath()));
//6、党员发布议题占比 : 占社区内所有议题的比率
if (entity.getPublishIssueTotal() == NumConstant.ZERO) {
entity.setPublishIssueRatio(BigDecimal.ZERO);
}
entity.setPublishIssueRatio(agencyIssueTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getPublishIssueTotal() / agencyIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
//7、议题转项目数
entity.setShiftProjectTotal(getAgencyShiftProjectTotal(customerId, entity.getAgencyPath()));
//8、议题转项目占比 : 占网格内议题总数的比率
entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / agencyIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
// 9、已解决项目
entity.setResolvedProjectTotal(getAgencyClosedProjectTotal(customerId, entity.getAgencyPath(), "resolved"));
if (entity.getResolvedProjectTotal() == NumConstant.ZERO) {
entity.setResolvedProjectRatio(BigDecimal.ZERO);
}else{
} else {
// 10、占总结项目
int closedProjectTotal=getGridClosedProjectTotal(customerId,gridId,null);
entity.setResolvedProjectRatio(closedProjectTotal==NumConstant.ZERO?BigDecimal.ZERO:new BigDecimal(entity.getResolvedProjectTotal()/closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
int closedProjectTotal = getAgencyClosedProjectTotal(customerId, entity.getAgencyPath(), null);
entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
});
screenPioneerDataService.delAndSavePioneerData(customerId, "grid", dateId, IndexCalConstant.DELETE_SIZE, gridList);
screenPioneerDataService.delAndSavePioneerData(customerId, "agency", IndexCalConstant.DELETE_SIZE, agencyList);
}
//组织下:已解决项目 or 已结案项目总数
private int getAgencyClosedProjectTotal(String customerId, String agencyPath, String closedStatus) {
return factOriginProjectMainDailyService.getAgencyClosedProjectTotal(customerId,agencyPath,closedStatus);
}
//组织下:议题转项目数
private Integer getAgencyShiftProjectTotal(String customerId, String agencyPath) {
return factOriginIssueMainDailyService.getAgencyShiftProjectTotal(customerId,agencyPath);
}
//组织内: 党员发布议题
private Integer getAgencyParyPublishIssueTotal(String customerId, String agencyPath) {
return factOriginIssueMainDailyService.getAgencyParyPublishIssueTotal(customerId,agencyPath);
}
//组织内:所有议题总数
private int getAgencyIssueTotal(String customerId, String agencyPath) {
return factOriginIssueMainDailyService.getAgencyIssueTotal(customerId,agencyPath);
}
//在当前组织下,话题总数(createTopicUserIsParty=1时查询党员发布的话题总数)
private Integer getAgencyTopicTotal(String customerId, String agencyPath,String createTopicUserIsParty) {
return factOriginTopicMainDailyService.getAgencyPartyTopicTotal(customerId,agencyPath,createTopicUserIsParty);
}
/**
* @return java.lang.Integer
* @param customerId
* @param gridId
* @param customerId 客户id
* @param gridId 网格id
* @param communityId 社区的agencyId
* @param closedStatus 结案状态已解决 resolved未解决 unresolved
* @author yinzuomei
* @description 网格内已解决项目
* @Date 2020/9/23 16:24
* @description 网格或者社区下: 已解决项目
**/
private Integer getGridClosedProjectTotal(String customerId, String gridId,String closedStatus) {
return factOriginProjectMainDailyService.getGridClosedProjectTotal(customerId,gridId,closedStatus);
private Integer getGridOrCommunityClosedProjectTotal(String customerId, String gridId, String communityId, String closedStatus) {
return factOriginProjectMainDailyService.getGridOrCommunityClosedProjectTotal(customerId, gridId, communityId, closedStatus);
}
/**
* @param customerId
* @param partyMemberUserIds
* @return int
* @author yinzuomei
* @description 党员发布的话题总数
* @Date 2020/9/23 13:44
* @param customerId 客户id
* @param gridId 网格id
* @param agencyId 社区的agencyId
* @description 网格或者社区下: 党员发布的话题总数
**/
private int getTopicTotal(String customerId, List<String> partyMemberUserIds) {
if (CollectionUtils.isEmpty(partyMemberUserIds)) {
//如果网格内没有党员,直接返回0
return NumConstant.ZERO;
}
return factOriginTopicMainDailyService.calPublishedByPartyTopicCount(customerId, partyMemberUserIds);
private int getTopicTotal(String customerId, String gridId, String agencyId) {
return factOriginTopicMainDailyService.calPublishedByPartyTopicCount(customerId, gridId, agencyId);
}
/**
* @param customerId
* @param gridId
* @return int
* @author yinzuomei
* @description 当前网格内发布的话题总数
* @Date 2020/9/23 14:18
* @param customerId 客户id
* @param gridId 网格id
* @param communityId 社区的agencyId
* @description 网格或者社区下 话题总数
**/
private int getGridTopicTotal(String customerId, String gridId) {
return factOriginTopicMainDailyService.calGridTopicTotalByGrid(customerId, gridId);
private int getGridOrCommunityTopicTotal(String customerId, String gridId, String communityId) {
return factOriginTopicMainDailyService.calGridOrCommunityTopicTotal(customerId, gridId, communityId);
}
/**
* @param customerId
* @param partyMemberUserIds
* @return java.lang.Integer
* @author yinzuomei
* @description 党员发布的议题总数
* @Date 2020/9/23 14:39
* @return int
* @param customerId 客户id
* @param gridId 网格id
* @param agencyId 社区的agencyId
* @description 网格或者社区下: 党员发布的议题总数
**/
private int getParyPublishIssueTotal(String customerId, List<String> partyMemberUserIds) {
if (CollectionUtils.isEmpty(partyMemberUserIds)) {
return NumConstant.ZERO;
}
return factOriginIssueMainDailyService.getParyPublishIssueTotal(customerId, partyMemberUserIds);
private int getParyPublishIssueTotal(String customerId, String gridId, String agencyId) {
return factOriginIssueMainDailyService.getParyPublishIssueTotal(customerId, gridId, agencyId);
}
/**
* @param customerId
* @param gridId
* @return int
* @author yinzuomei
* @description 当前网格内所有议题总数
* @Date 2020/9/23 15:21
* @param customerId 客户id
* @param gridId 网格id
* @param communityId 社区的agencyId
* @description 网格或者社区下 议题总数
**/
private int getGridIssueTotal(String customerId, String gridId) {
return factOriginIssueMainDailyService.getGridIssueTotalByGrid(customerId, gridId);
private int getGridOrCommunityIssueTotal(String customerId, String gridId, String communityId) {
return factOriginIssueMainDailyService.getGridOrCommunityIssueTotal(customerId, gridId, communityId);
}
/**
* @param customerId
* @param gridId
* @return java.lang.Integer
* @author yinzuomei
* @description 网格内议题转项目数
* @Date 2020/9/23 15:38
* @param customerId 客户id
* @param gridId 网格id
* @param communityId 社区的agencyId
* @description 网格或者社区下: 议题转项目数
**/
private Integer getGridShiftProjectTotal(String customerId, String gridId) {
return factOriginIssueMainDailyService.getShiftProjectTotalByGrid(customerId, gridId);
}
@Override
public void extractCommunityPioneerData(String customerId, String dateId) {
private Integer getGridOrCommunityShiftProjectTotal(String customerId, String gridId, String communityId) {
return factOriginIssueMainDailyService.getGridOrCommunityShiftProjectTotal(customerId, gridId, communityId);
}
@Override
public void extractStreetPioneerData(String customerId, String dateId) {
}
@Override
public void extractDistrictPioneerData(String customerId, String dateId) {
}
@Override
public void extractCityPioneerData(String customerId, String dateId) {
}
@Override
public void extractProvincePioneerData(String customerId, String dateId) {
}
}

82
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java

@ -0,0 +1,82 @@
package com.epmet.service.evaluationindex.extract.toscreen.impl;
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.toscreen.PartyBaseInfoService;
import com.epmet.service.evaluationindex.extract.toscreen.PioneerDataExtractService;
import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractService;
import com.epmet.service.stats.DimCustomerService;
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.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/9/24 9:57 上午
*/
@Service
@Slf4j
public class ScreenExtractServiceImpl implements ScreenExtractService {
@Autowired
private DimCustomerService dimCustomerService;
@Autowired
private PartyBaseInfoService partyBaseInfoService;
@Autowired
private PioneerDataExtractService pioneerDataExtractService;
/**
* @Description 抽取数据到大屏
* @param extractFormDTO
* @author zxc
* @date 2020/9/24 10:15 上午
*/
@Override
public void extractDailyAll(ExtractFormDTO extractFormDTO) {
List<String> customerIds = new ArrayList<>();
if (StringUtils.isNotBlank(extractFormDTO.getCustomerId())){
customerIds.add(extractFormDTO.getCustomerId());
}else {
int pageNo = NumConstant.ONE;
int pageSize = NumConstant.ONE_HUNDRED;
customerIds = dimCustomerService.selectCustomerIdPage(pageNo, pageSize);
}
if (!CollectionUtils.isEmpty(customerIds)){
customerIds.forEach(customerId -> {
if (StringUtils.isNotBlank(extractFormDTO.getStartDate()) && StringUtils.isNotBlank(extractFormDTO.getEndDate())){
List<String> daysBetween = DateUtils.getDaysBetween(extractFormDTO.getStartDate(), extractFormDTO.getEndDate());
daysBetween.forEach(dateId -> {
extractDaily(customerId,dateId);
});
}else if (StringUtils.isNotBlank(extractFormDTO.getDateId())){
extractDaily(customerId,extractFormDTO.getDateId());
}else {
String dateId = LocalDate.now().minusDays(NumConstant.ONE).toString().replace("-", "");
extractDaily(customerId,dateId);
}
});
}
}
/**
* @Description 按天计算
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/24 10:16 上午
*/
public void extractDaily(String customerId,String dateId){
partyBaseInfoService.statsPartyMemberBaseInfoToScreen(customerId,dateId);
pioneerDataExtractService.extractGridPioneerData(customerId,dateId);
pioneerDataExtractService.extractCommunityPioneerData(customerId,dateId);
pioneerDataExtractService.extractExceptCommunityPioneerData(customerId,dateId);
}
}

89
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java

@ -26,14 +26,18 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.constant.ProjectConstant;
import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao;
import com.epmet.dao.evaluationindex.indexcal.DeptSelfSubScoreDao;
import com.epmet.dao.evaluationindex.indexcal.DeptSubScoreDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyDao;
import com.epmet.dao.evaluationindex.screen.IndexGroupDetailDao;
import com.epmet.dao.evaluationindex.screen.ScreenCustomerDeptDao;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.indexcal.DeotScore;
import com.epmet.dto.indexcal.DeptScoreDetailDTO;
import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity;
import com.epmet.entity.evaluationindex.indexcal.DeptSelfSubScoreEntity;
import com.epmet.entity.evaluationindex.indexcal.DeptSubScoreEntity;
import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity;
@ -59,10 +63,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -91,6 +92,10 @@ public class DeptScoreServiceImpl extends BaseServiceImpl<DeptScoreDao, DeptScor
private DeptScoreDao deptScoreDao;
@Autowired
private DeptSubScoreDao deptSubScoreDao;
@Autowired
private IndexGroupDetailDao indexGroupDetailDao;
@Autowired
private DeptSelfSubScoreDao deptSelfSubScoreDao;
/**
* @param formDTO
@ -105,15 +110,87 @@ public class DeptScoreServiceImpl extends BaseServiceImpl<DeptScoreDao, DeptScor
calculateZhiLiNengLiScore(formDTO);
//2、区直部门 总分计算
calculateDeptTotalScore(formDTO);
//计算自身和下级
calculateSelfSubScore(formDTO);
return true;
}
private void calculateSelfSubScore(CalculateCommonFormDTO formDTO) {
//todo 指标添加缓存
List<IndexGroupDetailEntity> indexList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(),
IndexCodeEnum.QU_ZHI_BU_MEN.getCode());
if (CollectionUtils.isEmpty(indexList)) {
log.error("calculateSelfSubScore customerId:{} have not any indexGroupDetail", formDTO.getCustomerId());
throw new RenException("客户【网格相关】指标权重信息不存在");
}
indexList.forEach(index -> {
String levelIndexPath = index.getAllParentIndexCode().concat(StrConstant.COLON).concat(index.getIndexCode());
//获取出指标之间的关系
List<IndexGroupDetailEntity> selfSubIndexList = indexGroupDetailDao.selectSelfSubIndex(formDTO.getCustomerId(), levelIndexPath);
if (CollectionUtils.isEmpty(selfSubIndexList)) {
log.error("calculateSelfSubScore indexGroupDetailDao.selectSelfSubIndex return empty,customerId:{}", formDTO.getCustomerId());
return;
}
//获取该能力下的分数
List<DeptSubScoreEntity> subScore = deptSubScoreDao.selectSubListByPath(formDTO.getCustomerId(), formDTO.getMonthId(), levelIndexPath);
if (CollectionUtils.isEmpty(subScore)) {
log.error("calculateSelfSubScore communitySubScoreDao.selectSubListByPath return empty,customerId:{} ", formDTO.getCustomerId());
return;
}
Map<String, Set<String>> selfSubParentMap = new HashMap<>();
selfSubParentMap.put(ProjectConstant.ZI_SHEN, new HashSet<>());
selfSubParentMap.put(ProjectConstant.XIA_JI, new HashSet<>());
selfSubIndexList.forEach(o -> {
//找出自身 和下级的指标
if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) {
selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode());
} else {
selfSubParentMap.get(ProjectConstant.ZI_SHEN).add(o.getIndexCode());
}
});
Map<String, DeptSelfSubScoreEntity> insertMap = new HashMap<>();
subScore.forEach(score -> {
String key = score.getAgencyId().concat(index.getIndexCode());
DeptSelfSubScoreEntity scoreEntity = insertMap.get(key);
if (scoreEntity == null) {
scoreEntity = ConvertUtils.sourceToTarget(score, DeptSelfSubScoreEntity.class);
insertMap.put(key, scoreEntity);
scoreEntity.setSelfScore(new BigDecimal(0));
scoreEntity.setSubScore(new BigDecimal(0));
scoreEntity.setParentIndexCode(index.getIndexCode());
scoreEntity.setSelfWeight(new BigDecimal(0));
scoreEntity.setSubWeight(new BigDecimal(0));
}
BigDecimal partScore = score.getScore().multiply(score.getWeight());
if (selfSubParentMap.get(ProjectConstant.XIA_JI).contains(score.getIndexCode())) {
scoreEntity.setSubScore(scoreEntity.getSubScore().add(partScore));
scoreEntity.setSubWeight(scoreEntity.getSubWeight().add(score.getWeight()));
} else {
scoreEntity.setSelfScore(scoreEntity.getSelfScore().add(partScore));
scoreEntity.setSelfWeight(scoreEntity.getSelfWeight().add(score.getWeight()));
}
log.debug("=====key" + key + ",grid:{},originScore:{},weight:{},finalScore:{},total", score.getAgencyId(), score.getScore(), score.getWeight(), partScore);
});
deleteAndInsertSelfSubScore(formDTO, index.getIndexCode(), insertMap);
});
}
@Transactional(rollbackFor = Exception.class)
public void deleteAndInsertSelfSubScore(CalculateCommonFormDTO formDTO, String indexCode, Map<String, DeptSelfSubScoreEntity> insertMap) {
int effectRow = 0;
do {
deptSelfSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode);
} while (effectRow > 0);
deptSelfSubScoreDao.insertBatch(new ArrayList<>(insertMap.values()));
}
/**
* @return void
* @param formDTO
* @return void
* @author yinzuomei
* @description 区直部门-党建能力分值计算
* @Date 2020/9/10 17:21
* @Date 2020/9/10 17:21
**/
private void calculateZhiLiNengLiScore(CalculateCommonFormDTO formDTO) {
//获取区直部门的治理能力下,五级指标权重

14
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java

@ -9,6 +9,7 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.constant.ProjectConstant;
import com.epmet.dao.evaluationindex.indexcal.CpcScoreDao;
import com.epmet.dao.evaluationindex.indexcal.GridScoreDao;
import com.epmet.dao.evaluationindex.indexcal.GridSelfSubScoreDao;
@ -126,14 +127,14 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
return;
}
Map<String, Set<String>> selfSubParentMap = new HashMap<>();
selfSubParentMap.put("zishen", new HashSet<>());
selfSubParentMap.put("xiaji", new HashSet<>());
selfSubParentMap.put(ProjectConstant.ZI_SHEN, new HashSet<>());
selfSubParentMap.put(ProjectConstant.XIA_JI, new HashSet<>());
selfSubIndexList.forEach(o -> {
//找出自身 和下级的指标
if (o.getAllIndexCodePath().indexOf("xiaji") > -1) {
selfSubParentMap.get("xiaji").add(o.getIndexCode());
if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) {
selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode());
} else {
selfSubParentMap.get("zishen").add(o.getIndexCode());
selfSubParentMap.get(ProjectConstant.ZI_SHEN).add(o.getIndexCode());
}
});
Map<String, GridSelfSubScoreEntity> insertMap = new HashMap<>();
@ -151,8 +152,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
scoreEntity.setSubWeight(new BigDecimal(0));
}
BigDecimal partScore = score.getScore().multiply(score.getWeight());
BigDecimal partWeight = score.getScore().multiply(score.getWeight());
if (selfSubParentMap.get("xiaji").contains(score.getIndexCode())) {
if (selfSubParentMap.get(ProjectConstant.XIA_JI).contains(score.getIndexCode())) {
scoreEntity.setSubScore(scoreEntity.getSubScore().add(partScore));
scoreEntity.setSubWeight(scoreEntity.getSubWeight().add(score.getWeight()));
} else {

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java

@ -10,6 +10,7 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.constant.ProjectConstant;
import com.epmet.dao.evaluationindex.indexcal.CommunityScoreDao;
import com.epmet.dao.evaluationindex.indexcal.CommunitySelfSubScoreDao;
import com.epmet.dao.evaluationindex.indexcal.CommunitySubScoreDao;
@ -135,14 +136,14 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
return;
}
Map<String, Set<String>> selfSubParentMap = new HashMap<>();
selfSubParentMap.put("zishen", new HashSet<>());
selfSubParentMap.put("xiaji", new HashSet<>());
selfSubParentMap.put(ProjectConstant.ZI_SHEN, new HashSet<>());
selfSubParentMap.put(ProjectConstant.XIA_JI, new HashSet<>());
selfSubIndexList.forEach(o -> {
//找出自身 和下级的指标
if (o.getAllIndexCodePath().indexOf("xiaji") > -1) {
selfSubParentMap.get("xiaji").add(o.getIndexCode());
if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) {
selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode());
} else {
selfSubParentMap.get("zishen").add(o.getIndexCode());
selfSubParentMap.get(ProjectConstant.ZI_SHEN).add(o.getIndexCode());
}
});
Map<String, CommunitySelfSubScoreEntity> insertMap = new HashMap<>();
@ -159,7 +160,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
scoreEntity.setSubWeight(new BigDecimal(0));
}
BigDecimal partScore = score.getScore().multiply(score.getWeight());
if (selfSubParentMap.get("xiaji").contains(score.getIndexCode())) {
if (selfSubParentMap.get(ProjectConstant.XIA_JI).contains(score.getIndexCode())) {
scoreEntity.setSubScore(scoreEntity.getSubScore().add(partScore));
scoreEntity.setSubWeight(scoreEntity.getSubWeight().add(score.getWeight()));
} else {

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

@ -10,6 +10,8 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.constant.ProjectConstant;
import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao;
import com.epmet.dao.evaluationindex.indexcal.AgencySelfSubScoreDao;
import com.epmet.dao.evaluationindex.indexcal.AgencySubScoreDao;
@ -112,7 +114,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
private void calculateSelfSubScore(CalculateCommonFormDTO formDTO) {
//todo 指标添加缓存
List<IndexGroupDetailEntity> indexList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(),
IndexCodeEnum.QU_ZHI_BU_MEN.getCode());
IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode());
if (CollectionUtils.isEmpty(indexList)) {
log.error("calculateSelfSubScore customerId:{} have not any indexGroupDetail", formDTO.getCustomerId());
throw new RenException("客户【网格相关】指标权重信息不存在");
@ -126,20 +128,20 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
return;
}
//获取该能力下的分数
List<AgencySubScoreEntity> subScore = agencySubScoreDao.selectSubListByPath(formDTO.getCustomerId(), formDTO.getMonthId(), levelIndexPath);
List<AgencySubScoreEntity> subScore = agencySubScoreDao.selectSubListByPath(formDTO.getCustomerId(), formDTO.getMonthId(), OrgTypeConstant.DISTRICT, levelIndexPath);
if (CollectionUtils.isEmpty(subScore)) {
log.error("calculateSelfSubScore communitySubScoreDao.selectSubListByPath return empty,customerId:{} ", formDTO.getCustomerId());
return;
}
Map<String, Set<String>> selfSubParentMap = new HashMap<>();
selfSubParentMap.put("zishen", new HashSet<>());
selfSubParentMap.put("xiaji", new HashSet<>());
selfSubParentMap.put(ProjectConstant.ZI_SHEN, new HashSet<>());
selfSubParentMap.put(ProjectConstant.XIA_JI, new HashSet<>());
selfSubIndexList.forEach(o -> {
//找出自身 和下级的指标
if (o.getAllIndexCodePath().indexOf("xiaji") > -1) {
selfSubParentMap.get("xiaji").add(o.getIndexCode());
if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) {
selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode());
} else {
selfSubParentMap.get("zishen").add(o.getIndexCode());
selfSubParentMap.get(ProjectConstant.ZI_SHEN).add(o.getIndexCode());
}
});
Map<String, AgencySelfSubScoreEntity> insertMap = new HashMap<>();
@ -156,7 +158,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
scoreEntity.setSubWeight(new BigDecimal(0));
}
BigDecimal partScore = score.getScore().multiply(score.getWeight());
if (selfSubParentMap.get("xiaji").contains(score.getIndexCode())) {
if (selfSubParentMap.get(ProjectConstant.XIA_JI).contains(score.getIndexCode())) {
scoreEntity.setSubScore(scoreEntity.getSubScore().add(partScore));
scoreEntity.setSubWeight(scoreEntity.getSubWeight().add(score.getWeight()));
} else {
@ -173,7 +175,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
public void deleteAndInsertSelfSubScore(CalculateCommonFormDTO formDTO, String indexCode, Map<String, AgencySelfSubScoreEntity> insertMap) {
int effectRow = 0;
do {
agencySelfSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode);
agencySelfSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), OrgTypeConstant.DISTRICT, indexCode);
} while (effectRow > 0);
agencySelfSubScoreDao.insertBatch(new ArrayList<>(insertMap.values()));

18
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java

@ -10,6 +10,8 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.constant.ProjectConstant;
import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao;
import com.epmet.dao.evaluationindex.indexcal.AgencySelfSubScoreDao;
import com.epmet.dao.evaluationindex.indexcal.AgencySubScoreDao;
@ -129,20 +131,20 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
return;
}
//获取该能力下的分数
List<AgencySubScoreEntity> subScore = agencySubScoreDao.selectSubListByPath(formDTO.getCustomerId(), formDTO.getMonthId(), levelIndexPath);
List<AgencySubScoreEntity> subScore = agencySubScoreDao.selectSubListByPath(formDTO.getCustomerId(), formDTO.getMonthId(), OrgTypeConstant.STREET, levelIndexPath);
if (CollectionUtils.isEmpty(subScore)) {
log.error("calculateSelfSubScore communitySubScoreDao.selectSubListByPath return empty,customerId:{} ", formDTO.getCustomerId());
return;
}
Map<String, Set<String>> selfSubParentMap = new HashMap<>();
selfSubParentMap.put("zishen", new HashSet<>());
selfSubParentMap.put("xiaji", new HashSet<>());
selfSubParentMap.put(ProjectConstant.ZI_SHEN, new HashSet<>());
selfSubParentMap.put(ProjectConstant.XIA_JI, new HashSet<>());
selfSubIndexList.forEach(o -> {
//找出自身 和下级的指标
if (o.getAllIndexCodePath().indexOf("xiaji") > -1) {
selfSubParentMap.get("xiaji").add(o.getIndexCode());
if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) {
selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode());
} else {
selfSubParentMap.get("zishen").add(o.getIndexCode());
selfSubParentMap.get(ProjectConstant.ZI_SHEN).add(o.getIndexCode());
}
});
Map<String, AgencySelfSubScoreEntity> insertMap = new HashMap<>();
@ -159,7 +161,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
scoreEntity.setSubWeight(new BigDecimal(0));
}
BigDecimal partScore = score.getScore().multiply(score.getWeight());
if (selfSubParentMap.get("xiaji").contains(score.getIndexCode())) {
if (selfSubParentMap.get(ProjectConstant.XIA_JI).contains(score.getIndexCode())) {
scoreEntity.setSubScore(scoreEntity.getSubScore().add(partScore));
scoreEntity.setSubWeight(scoreEntity.getSubWeight().add(score.getWeight()));
} else {
@ -176,7 +178,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
public void deleteAndInsertSelfSubScore(CalculateCommonFormDTO formDTO, String indexCode, Map<String, AgencySelfSubScoreEntity> insertMap) {
int effectRow = 0;
do {
agencySelfSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode);
agencySelfSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), OrgTypeConstant.STREET, indexCode);
} while (effectRow > 0);
agencySelfSubScoreDao.insertBatch(new ArrayList<>(insertMap.values()));

24
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyService.java

@ -0,0 +1,24 @@
package com.epmet.service.evaluationindex.indexcoll;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/24 14:34
*/
public interface FactIndexGovrnAblityGridMonthlyService extends BaseService<FactIndexGovrnAblityGridMonthlyEntity> {
/**
* 查询客户下网格治理能力
*
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity>
* @author zhaoqifeng
* @date 2020/9/24 15:41
*/
List<FactIndexGovrnAblityGridMonthlyEntity> getGridByCustomer(String customerId, String monthId);
}

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

@ -0,0 +1,20 @@
package com.epmet.service.evaluationindex.indexcoll.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyService;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/24 14:36
*/
public class FactIndexGovrnAblityGridMonthlyServiceImpl extends BaseServiceImpl<FactIndexGovrnAblityGridMonthlyDao, FactIndexGovrnAblityGridMonthlyEntity> implements FactIndexGovrnAblityGridMonthlyService {
@Override
public List<FactIndexGovrnAblityGridMonthlyEntity> getGridByCustomer(String customerId, String monthId) {
return baseDao.selectGridByCustomer(customerId, monthId);
}
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCpcBaseDataService.java

@ -60,4 +60,12 @@ public interface ScreenCpcBaseDataService extends BaseService<ScreenCpcBaseDataE
*/
List<PartyInfoResultDTO> selectPartyInfo(String customerId, String dateId,String agencyId);
/**
* @Description 查询党员信息直属网格的
* @param gridIds
* @author zxc
* @date 2020/9/24 3:23 下午
*/
List<PartyInfoResultDTO> selectDirectGridPartyInfo(List<String> gridIds,String customerId,String dateId);
}

18
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java

@ -21,6 +21,8 @@ import com.epmet.dto.extract.form.PartyBaseInfoFormDTO;
import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO;
import java.util.List;
import com.epmet.dto.extract.result.OrgNameResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity;
import com.epmet.entity.org.CustomerAgencyEntity;
@ -75,4 +77,20 @@ public interface ScreenCustomerAgencyService{
* @date 2020/9/23 3:10 下午
*/
List<PartyBaseInfoFormDTO> selectAllAgencyIdToParty(String customerId,String dateId);
/**
* @Description 查询org名称网格
* @param gridIds
* @author zxc
* @date 2020/9/24 1:27 下午
*/
List<OrgNameResultDTO> selectOrgNameGrid(List<String> gridIds);
/**
* @Description 查询org名称机关
* @param agencyIds
* @author zxc
* @date 2020/9/24 1:27 下午
*/
List<OrgNameResultDTO> selectOrgNameAgency(List<String> agencyIds);
}

27
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java

@ -19,7 +19,10 @@ package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO;
import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO;
import com.epmet.dto.extract.form.PartyBaseInfoFormDTO;
import com.epmet.dto.extract.result.GridInfoResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity;
import com.epmet.entity.org.CustomerGridEntity;
@ -46,4 +49,28 @@ public interface ScreenCustomerGridService extends BaseService<ScreenCustomerGri
* @date 2020/9/23 3:10 下午
*/
List<PartyBaseInfoFormDTO> selectAllGridIdToParty(String customerId, String dateId);
/**
* @Description 查询机关的直属网格
* @param agencyIds
* @author zxc
* @date 2020/9/24 2:33 下午
*/
List<GridInfoResultDTO> selectDirectGrid(List<String> agencyIds);
/**
* @Description 查询全部网格信息
* @param customerId
* @author zxc
* @date 2020/9/19 10:50 上午
*/
List<PartyAbilityGridMonthlyFormDTO> selectAllGridInfoToParty(String customerId);
/**
* @Description 查询全部网格信息
* @param customerId
* @author zxc
* @date 2020/9/18 10:47 上午
*/
List<GovernAbilityGridMonthlyFormDTO> selectAllGridInfo(String customerId);
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataService.java

@ -21,6 +21,8 @@ package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity;
import java.util.List;
/**
* 基层治理-治理能力排行数据(按月统计)
*
@ -28,5 +30,14 @@ import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity;
* @since v1.0.0 2020-09-22
*/
public interface ScreenGovernRankDataService extends BaseService<ScreenGovernRankDataEntity> {
/**
* 构造screen_govern_rank_data 初始数据先赋值为0
* @author zhaoqifeng
* @date 2020/9/24 14:41
* @param customerId
* @param orgType
* @param agencyLevel
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity>
*/
List<ScreenGovernRankDataEntity> initList(String customerId, String orgType, String agencyLevel);
}

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPioneerDataService.java

@ -34,23 +34,21 @@ public interface ScreenPioneerDataService extends BaseService<ScreenPioneerDataE
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity>
* @param customerId
* @param orgType grid,agency
* @param agencyLevel : 机关级别社区级community 街道:street,区县级: district,市级: city 省级:province
* @author yinzuomei
* @description 构造screen_pioneer_data 初始数据先赋值为0
* @Date 2020/9/22 14:41
**/
List<ScreenPioneerDataEntity> initPioneerDataList(String customerId, String orgType,String agencyLevel);
List<ScreenPioneerDataEntity> initPioneerDataList(String customerId, String orgType);
/**
* @return void
* @param customerId
* @param orgType grid, agency
* @param dataEndTime
* @param deleteSize
* @param entityList 待插入的数据
* @author yinzuomei
* @description 保存抽取结果
* @Date 2020/9/22 15:54
**/
void delAndSavePioneerData(String customerId, String orgType, String dataEndTime, Integer deleteSize, List<ScreenPioneerDataEntity> entityList);
void delAndSavePioneerData(String customerId, String orgType, Integer deleteSize, List<ScreenPioneerDataEntity> entityList);
}

16
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCpcBaseDataServiceImpl.java

@ -26,7 +26,9 @@ import com.epmet.dto.extract.result.PartyInfoResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCpcBaseDataEntity;
import com.epmet.service.evaluationindex.screen.ScreenCpcBaseDataService;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
@ -71,4 +73,18 @@ public class ScreenCpcBaseDataServiceImpl extends BaseServiceImpl<ScreenCpcBaseD
public List<PartyInfoResultDTO> selectPartyInfo(String customerId, String dateId, String agencyId) {
return baseDao.selectPartyInfo(customerId, dateId, agencyId);
}
/**
* @Description 查询党员信息直属网格的
* @param gridIds
* @author zxc
* @date 2020/9/24 3:23 下午
*/
@Override
public List<PartyInfoResultDTO> selectDirectGridPartyInfo(List<String> gridIds,String customerId,String dateId) {
if (!CollectionUtils.isEmpty(gridIds)){
return baseDao.selectDirectGridPartyInfo(gridIds, customerId, dateId);
}
return new ArrayList<>();
}
}

34
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java

@ -17,13 +17,16 @@
package com.epmet.service.evaluationindex.screen.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.OrgSourceTypeConstant;
import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao;
import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao;
import com.epmet.dto.extract.form.PartyBaseInfoFormDTO;
import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO;
import com.epmet.dto.extract.result.OrgNameResultDTO;
import com.epmet.dto.screen.result.TreeResultDTO;
import com.epmet.constant.ScreenConstant;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity;
@ -50,6 +53,7 @@ import java.util.stream.Collectors;
*/
@Service
@Slf4j
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyService {
@Autowired
@ -159,6 +163,34 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ
return screenCustomerAgencyDao.selectAllAgencyIdToParty(customerId,dateId);
}
/**
* @Description 查询org名称
* @param gridIds
* @author zxc
* @date 2020/9/24 1:27 下午
*/
@Override
public List<OrgNameResultDTO> selectOrgNameGrid(List<String> gridIds) {
if (!CollectionUtils.isEmpty(gridIds)){
return screenCustomerGridDao.selectOrgName(gridIds);
}
return new ArrayList<>();
}
/**
* @Description 查询org名称机关
* @param agencyIds
* @author zxc
* @date 2020/9/24 1:27 下午
*/
@Override
public List<OrgNameResultDTO> selectOrgNameAgency(List<String> agencyIds) {
if (!CollectionUtils.isEmpty(agencyIds)){
return screenCustomerAgencyDao.selectOrgNameAgency(agencyIds);
}
return new ArrayList<>();
}
private void updateAgency(ScreenCustomerAgencyEntity exists) {
screenCustomerAgencyDao.updateById(exists);
}
@ -193,4 +225,6 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ
public List<CustomerAgencyInfoResultDTO> selectAllAgencyId(String customerId) {
return screenCustomerAgencyDao.selectAllAgencyId(customerId);
}
}

42
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java

@ -24,14 +24,20 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.OrgSourceTypeConstant;
import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao;
import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO;
import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO;
import com.epmet.dto.extract.form.PartyBaseInfoFormDTO;
import com.epmet.dto.extract.result.GridInfoResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity;
import com.epmet.entity.org.CustomerGridEntity;
import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService;
import org.apache.ibatis.annotations.Param;
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.ArrayList;
import java.util.Date;
import java.util.List;
@ -102,4 +108,40 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl<ScreenCustome
public List<PartyBaseInfoFormDTO> selectAllGridIdToParty(String customerId, String dateId) {
return screenCustomerGridDao.selectAllGridIdToParty(customerId, dateId);
}
/**
* @Description 查询机关的直属网格
* @param agencyIds
* @author zxc
* @date 2020/9/24 2:33 下午
*/
@Override
public List<GridInfoResultDTO> selectDirectGrid(List<String> agencyIds) {
if (!CollectionUtils.isEmpty(agencyIds)){
return screenCustomerGridDao.selectDirectGrid(agencyIds);
}
return new ArrayList<>();
}
/**
* @Description 查询全部网格信息
* @param customerId
* @author zxc
* @date 2020/9/19 10:50 上午
*/
@Override
public List<PartyAbilityGridMonthlyFormDTO> selectAllGridInfoToParty(String customerId) {
return screenCustomerGridDao.selectAllGridInfoToParty(customerId);
}
/**
* @Description 查询全部网格信息
* @param customerId
* @author zxc
* @date 2020/9/18 10:47 上午
*/
@Override
public List<GovernAbilityGridMonthlyFormDTO> selectAllGridInfo(String customerId) {
return screenCustomerGridDao.selectAllGridInfo(customerId);
}
}

24
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataServiceImpl.java

@ -19,11 +19,16 @@ package com.epmet.service.evaluationindex.screen.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.dao.evaluationindex.screen.ScreenGovernRankDataDao;
import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity;
import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* 基层治理-治理能力排行数据(按月统计)
*
@ -31,7 +36,26 @@ import org.springframework.stereotype.Service;
* @since v1.0.0 2020-09-22
*/
@Service
@Slf4j
public class ScreenGovernRankDataServiceImpl extends BaseServiceImpl<ScreenGovernRankDataDao, ScreenGovernRankDataEntity> implements ScreenGovernRankDataService {
@Override
public List<ScreenGovernRankDataEntity> initList(String customerId, String orgType, String agencyLevel) {
List<ScreenGovernRankDataEntity> list = new ArrayList<>();
switch (orgType) {
case OrgTypeConstant.AGENCY:
log.info("组织级别统计");
list = baseDao.initAgencyDataList(customerId, agencyLevel);
break;
case OrgTypeConstant.GRID:
log.info("网格级别统计");
list = baseDao.initGridDataList(customerId);
break;
default:
log.info("部门级别统计");
break;
}
return list;
}
}

26
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java

@ -27,6 +27,7 @@ import com.epmet.dao.evaluationindex.screen.ScreenPioneerDataDao;
import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity;
import com.epmet.service.evaluationindex.screen.ScreenPioneerDataService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -47,8 +48,7 @@ public class ScreenPioneerDataServiceImpl extends BaseServiceImpl<ScreenPioneerD
/**
* @param customerId
* @param orgType grid,agency
* @param agencyLevel : 机关级别社区级community 街道:street,区县级: district,市级: city 省级:province
* @param orgType grid,agency 机关级别社区级community 街道:street,区县级: district,市级: city 省级:province
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity>
* @author yinzuomei
* @description 构造screen_pioneer_data 初始数据先赋值为0
@ -56,12 +56,16 @@ public class ScreenPioneerDataServiceImpl extends BaseServiceImpl<ScreenPioneerD
**/
@DataSource(DataSourceConstant.EVALUATION_INDEX)
@Override
public List<ScreenPioneerDataEntity> initPioneerDataList(String customerId, String orgType, String agencyLevel) {
public List<ScreenPioneerDataEntity> initPioneerDataList(String customerId, String orgType) {
List<ScreenPioneerDataEntity> list = new ArrayList<>();
if ("grid".equals(orgType)) {
//按网格构造
list = baseDao.initGridPioneerDataList(customerId);
} else if ("agency".equals(orgType)) {
list = baseDao.initAgencyPioneerDataList(customerId, agencyLevel);
} else if ("community".equals(orgType)) {
//按社构造
list = baseDao.initCommunityPioneerDataList(customerId);
}else if("agency".equals(orgType)){
list = baseDao.initExceptCommunityPioneerDataList(customerId);
}
return list;
}
@ -70,7 +74,6 @@ public class ScreenPioneerDataServiceImpl extends BaseServiceImpl<ScreenPioneerD
/**
* @param customerId
* @param orgType grid, agency
* @param dataEndTime
* @param deleteSize
* @param entityList 待插入的数据
* @return void
@ -81,10 +84,17 @@ public class ScreenPioneerDataServiceImpl extends BaseServiceImpl<ScreenPioneerD
@Transactional(rollbackFor = Exception.class)
@DataSource(DataSourceConstant.EVALUATION_INDEX)
@Override
public void delAndSavePioneerData(String customerId, String orgType, String dataEndTime, Integer deleteSize, List<ScreenPioneerDataEntity> entityList) {
public void delAndSavePioneerData(String customerId, String orgType, Integer deleteSize, List<ScreenPioneerDataEntity> entityList) {
if(CollectionUtils.isEmpty(entityList)){
return;
}
List<String> orgIds=new ArrayList<>();
for(ScreenPioneerDataEntity entity:entityList){
orgIds.add(entity.getOrgId());
}
int deleteNum;
do {
deleteNum = baseDao.deletePioneerData(customerId, orgType, dataEndTime, deleteSize);
deleteNum = baseDao.deletePioneerData(customerId, orgType, deleteSize,orgIds);
} while (deleteNum != NumConstant.ZERO);
List<List<ScreenPioneerDataEntity>> partition = ListUtils.partition(entityList, IndexCalConstant.INSERT_SIZE);

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java

@ -448,7 +448,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService {
if (formDTO.getIsFirst()) {
int deleteNum;
do {
deleteNum = screenPioneerDataDao.deletePioneerData(customerId,null,null, IndexCalConstant.DELETE_SIZE);
deleteNum = screenPioneerDataDao.deletePioneerDataByCustomerId(customerId,IndexCalConstant.DELETE_SIZE);
} while (deleteNum != NumConstant.ZERO);
}
if (!CollectionUtils.isEmpty(formDTO.getDataList())) {

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java

@ -124,10 +124,11 @@ public interface DimCustomerPartymemberService extends BaseService<DimCustomerPa
/**
* @return java.util.List<java.lang.String>
* @param customerId
* @param gridId
* @author yinzuomei
* @description 查询在本网格注册的党员id
* @param orgId 网格id 或者社区id
* @type grid,community
* @author yinzuomei 暂时这个方法没用
* @description 查询在本网格或者社区注册 或者 组织下 的党员id
* @Date 2020/9/23 14:18
**/
List<String> getPartyMemberUserIds(String customerId, String gridId);
List<String> getPartyMemberUserIds(String customerId, String type,String orgId);
}

24
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java

@ -49,6 +49,7 @@ 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;
@ -185,7 +186,10 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl<DimCustom
*/
@Override
public List<PartyMemberInfoResultDTO> selectPartyMemberInfo(String customerId, List<String> gridIds) {
return baseDao.selectPartyMemberInfo(customerId, gridIds);
if (!CollectionUtils.isEmpty(gridIds)){
return baseDao.selectPartyMemberInfo(customerId, gridIds);
}
return new ArrayList<>();
}
/**
@ -205,18 +209,26 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl<DimCustom
}
/**
* @param customerId
* @param gridId
* @param orgId : 可能是gridId, 也可能是communityId, 也有可能是 pids
* @param type : grid,community
* @return java.util.List<java.lang.String>
* @author yinzuomei
* @description 查询在本网格注册的党员id
* @description 查询在本网格注册的党员id或者社区下的党员 或者组织下的
* @Date 2020/9/23 14:18
**/
@DataSource(value = DataSourceConstant.STATS)
@Override
public List<String> getPartyMemberUserIds(String customerId, String gridId) {
return baseDao.selectGridPartyMemberUserIds(customerId,gridId);
public List<String> getPartyMemberUserIds(String customerId, String type, String orgId) {
List<String> partyMemberUserIds = new ArrayList<>();
if ("grid".equals(type)) {
partyMemberUserIds = baseDao.selectGridPartyMemberUserIds(customerId, orgId);
} else if ("community".equals(type)) {
partyMemberUserIds = baseDao.selectCommunityPartyMemberUserIds(customerId, orgId);
} else if("agency".equals(type)){
partyMemberUserIds = baseDao.selectPartyMemberUserIdsByPids(customerId, orgId);
}
return partyMemberUserIds;
}
}

8
epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml

@ -189,7 +189,7 @@ thread:
queueCapacity: @thread.pool.queue-capacity@
keepAlive: @thread.pool.keep-alive@
#dingTalk:
# robot:
# webHook: @dingTalk.robot.webHook@
# secret: @dingTalk.robot.secret@
dingTalk:
robot:
webHook: @dingTalk.robot.webHook@
secret: @dingTalk.robot.secret@

77
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml

@ -22,6 +22,7 @@
PIDS,
AGENCY_ID,
ISSUE_STATUS,
RESOLVE_TYPE,
TOPIC_USER_IS_PARTY,
DEL_FLAG,
REVISION,
@ -48,6 +49,7 @@
#{item.pids},
#{item.agencyId},
#{item.issueStatus},
#{item.resolveType},
#{item.topicUserIsParty},
#{item.delFlag},
#{item.revision},
@ -176,7 +178,7 @@
GROUP BY GRID_ID
</select>
<!-- 根据党员ids, 查询党员发布议题数 -->
<!-- 查询党员发布议题数 -->
<select id="getParyPublishIssueTotal" parameterType="map" resultType="java.lang.Integer">
SELECT
count( ID ) AS total
@ -185,13 +187,64 @@
WHERE
t1.DEL_FLAG = '0'
AND t1.CUSTOMER_ID = #{customerId}
AND
<foreach collection="list" item="userId" separator="or" open="(" close=")">
t1.CREATE_TOPIC_USER_ID=#{userId}
</foreach>
AND t1.TOPIC_USER_IS_PARTY='1'
<if test='null != gridId and ""!=gridId'>
and t1.GRID_ID=#{gridId}
</if>
<if test='null != agencyId and ""!=agencyId'>
and t1.AGENCY_ID=#{agencyId}
</if>
</select>
<!-- 具体某个网格的议题总数 -->
<select id="getGridIssueTotalByGrid" parameterType="map" resultType="java.lang.Integer">
<!-- 具体某个网格、社区下的议题总数 -->
<select id="getGridOrCommunityIssueTotal" parameterType="map" resultType="java.lang.Integer">
SELECT
count( ID ) AS total
FROM
fact_origin_issue_main_daily t1
WHERE
t1.DEL_FLAG = '0'
AND t1.CUSTOMER_ID = #{customerId}
<if test='null != gridId and ""!=gridId'>
and t1.GRID_ID=#{gridId}
</if>
<if test='null != communityId and ""!=communityId'>
and t1.AGENCY_ID=#{communityId}
</if>
</select>
<!-- 网格或者社区内议题转项目数 -->
<select id="getGridOrCommunityShiftProjectTotal" parameterType="map" resultType="java.lang.Integer">
SELECT
count( ID ) AS total
FROM
fact_origin_issue_main_daily t1
WHERE
t1.DEL_FLAG = '0'
AND t1.CUSTOMER_ID = #{customerId}
AND T1.ISSUE_STATUS='shift_project'
<if test='null != gridId and ""!=gridId'>
and t1.GRID_ID=#{gridId}
</if>
<if test='null != communityId and ""!=communityId'>
and t1.AGENCY_ID=#{communityId}
</if>
</select>
<!-- 组织内: 党员发布议题 -->
<select id="getAgencyParyPublishIssueTotal" parameterType="map" resultType="java.lang.Integer">
SELECT
count( ID ) AS total
FROM
fact_origin_issue_main_daily t1
WHERE
t1.DEL_FLAG = '0'
AND t1.TOPIC_USER_IS_PARTY='1'
AND t1.CUSTOMER_ID = #{customerId}
and t1.PIDS LIKE CONCAT(#{agencyPath},'%')
</select>
<!-- 组织内:所有议题总数 -->
<select id="getAgencyIssueTotal" parameterType="map" resultType="int">
SELECT
count( ID ) AS total
FROM
@ -199,19 +252,19 @@
WHERE
t1.DEL_FLAG = '0'
AND t1.CUSTOMER_ID = #{customerId}
and t1.GRID_ID=#{gridId}
and t1.PIDS LIKE CONCAT(#{agencyPath},'%')
</select>
<!-- 网格内议题转项目数 -->
<select id="getShiftProjectTotalByGrid" parameterType="map" resultType="java.lang.Integer">
<!-- 组织下:议题转项目数 -->
<select id="getAgencyShiftProjectTotal" parameterType="map" resultType="java.lang.Integer">
SELECT
count( ID ) AS total
FROM
fact_origin_issue_main_daily t1
WHERE
t1.DEL_FLAG = '0'
AND t1.ISSUE_STATUS = 'shift_project'
AND t1.CUSTOMER_ID = #{customerId}
and t1.GRID_ID=#{gridId}
AND T1.ISSUE_STATUS='shift_project'
and t1.PIDS LIKE CONCAT(#{agencyPath},'%')
</select>
</mapper>

26
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml

@ -144,8 +144,8 @@
</foreach>
</select>
<!-- 具体某个网格内的项目 -->
<select id="getGridClosedProjectTotal" parameterType="map" resultType="java.lang.Integer">
<!-- 具体某个网格或者社区内的项目 -->
<select id="getGridOrCommunityClosedProjectTotal" parameterType="map" resultType="java.lang.Integer">
SELECT
COUNT( 1 ) AS TOTAL
FROM
@ -153,7 +153,27 @@
WHERE
T1.DEL_FLAG = '0'
AND T1.CUSTOMER_ID = #{customerId}
and t1.GRID_ID=#{gridId}
<if test='null != gridId and "" != gridId'>
and t1.GRID_ID=#{gridId}
</if>
<if test='null != communityId and "" != communityId'>
and t1.AGENCY_ID=#{communityId}
</if>
<if test='null != closedStatus and "" != closedStatus'>
and t1.CLOSED_STATUS=#{closedStatus}
</if>
</select>
<!-- 组织下:已解决项目 or 已结案项目总数 -->
<select id="getAgencyClosedProjectTotal" parameterType="map" resultType="int">
SELECT
COUNT( 1 ) AS TOTAL
FROM
fact_origin_project_main_daily T1
WHERE
T1.DEL_FLAG = '0'
AND T1.CUSTOMER_ID = #{customerId}
and t1.PIDS LIKE CONCAT(#{agencyPath},'%')
<if test='null != closedStatus and "" != closedStatus'>
and t1.CLOSED_STATUS=#{closedStatus}
</if>

45
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml

@ -106,13 +106,16 @@
WHERE
T1.DEL_FLAG = '0'
AND T1.CUSTOMER_ID = #{customerId}
AND
<foreach collection="list" item="userId" separator="or" open="(" close=")">
T1.CREATE_TOPIC_USER_ID=#{userId}
</foreach>
AND m.CREATE_TOPIC_USER_IS_PARTY='1'
<if test='null != gridId and "" !=gridId'>
AND T1.GRID_ID=#{gridId}
</if>
<if test='null != agencyId and "" !=agencyId'>
AND T1.AGENCY_ID=#{agencyId}
</if>
</select>
<!-- 具体某个网格的话题数 -->
<select id="selectGridTopicTotalByGrid" parameterType="map" resultType="java.lang.Integer">
<!-- 具体某个网格、社区下的话题数 -->
<select id="selectGridOrCommunityTopicTotal" parameterType="map" resultType="java.lang.Integer">
SELECT
count(T1.ID) AS TOTAL
FROM
@ -120,16 +123,34 @@
WHERE
T1.DEL_FLAG = '0'
AND T1.CUSTOMER_ID = #{customerId}
AND T1.GRID_ID=#{gridId}
<if test='null != gridId and "" !=gridId'>
AND T1.GRID_ID=#{gridId}
</if>
<if test='null != agencyId and "" !=agencyId'>
AND T1.AGENCY_ID=#{agencyId}
</if>
</select>
<update id="updateFactOriginTopicMain" parameterType="map">
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
update fact_origin_topic_main_daily
set TOPIC_STATUS=#{item.topicStatus},
CLOSED_STATUS=#{item.closedStatus},
set TOPIC_STATUS=#{topicStatus},
CLOSED_STATUS=#{closedStatus},
UPDATED_TIME=NOW()
where id = ${item.topicId}
</foreach>
where id = #{topicId}
</update>
<!-- 在当前组织下,发布的话题总数,也可以单独筛选党员 -->
<select id="getAgencyPartyTopicTotal" parameterType="map" resultType="java.lang.Integer">
SELECT
count( 1 ) AS total
FROM
fact_origin_topic_main_daily m
WHERE
m.DEL_FLAG = '0'
<if test='null !=createTopicUserIsParty and ""!=createTopicUserIsParty'>
AND m.CREATE_TOPIC_USER_IS_PARTY = #{createTopicUserIsParty}
</if>
AND m.CUSTOMER_ID = #{customerId}
AND m.PIDS LIKE CONCAT(#{agencyPath},'%')
</select>
</mapper>

1
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySelfSubScoreDao.xml

@ -6,6 +6,7 @@
<delete id="deleteByMonthId">
delete from fact_index_agency_self_sub_score
where CUSTOMER_ID = #{customerId,jdbcType=VARCHAR}
and DATA_TYPE = #{dataType,jdbcType=VARCHAR}
and MONTH_ID = #{monthId,jdbcType=VARCHAR}
and PARENT_INDEX_CODE = #{parentIndexCode,jdbcType=VARCHAR}
limit 1000

1
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml

@ -54,6 +54,7 @@
fact_index_agency_sub_score
WHERE
DEL_FLAG = '0'
AND data_type = #{dataType}
AND CUSTOMER_ID = #{customerId}
AND ALL_PARENT_INDEX_CODE = #{allIndexCodePath,jdbcType=VARCHAR}
</select>

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySelfSubScoreDao.xml

@ -12,7 +12,7 @@
</delete>
<insert id="insertBatch">
INSERT INTO `fact_index_grid_self_sub_score` (
INSERT INTO `fact_index_community_self_sub_score` (
`ID`,
`CUSTOMER_ID`,
`AGENCY_ID`,

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml

@ -50,7 +50,7 @@
ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, ORIGIN_VALUE, SCORE, INDEX_CODE,ALL_PARENT_INDEX_CODE,
WEIGHT
FROM
fact_index_grid_sub_score
fact_index_community_sub_score
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}

61
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSelfSubScoreDao.xml

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.evaluationindex.indexcal.DeptSelfSubScoreDao">
<delete id="deleteByMonthId">
delete from fact_index_dept_self_sub_score
where CUSTOMER_ID = #{customerId,jdbcType=VARCHAR}
AND MONTH_ID = #{monthId,jdbcType=VARCHAR}
AND PARENT_INDEX_CODE = #{parentIndexCode,jdbcType=VARCHAR}
limit 1000
</delete>
<insert id="insertBatch">
INSERT INTO `fact_index_dept_self_sub_score` (
`ID`,
`CUSTOMER_ID`,
`AGENCY_ID`,
`DEPT_ID`,
`QUARTER_ID`,
`YEAR_ID`,
`MONTH_ID`,
`SELF_SCORE`,
`SUB_SCORE`,
`PARENT_INDEX_CODE`,
`ALL_PARENT_INDEX_CODE`,
`SELF_WEIGHT`,
`SUB_WEIGHT`,
`DEL_FLAG`,
`REVISION`,
`CREATED_BY`,
`CREATED_TIME`,
`UPDATED_BY`,
`UPDATED_TIME`
)
VALUES
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{item.customerId},
#{item.agencyId},
#{item.deptId},
#{item.quarterId},
#{item.yearId},
#{item.monthId},
#{item.selfScore},
#{item.subScore},
#{item.parentIndexCode},
#{item.allParentIndexCode},
#{item.selfWeight},
#{item.subWeight},
0,
0,
'APP_USER',
now(),
'APP_USER',
now()
)
</foreach>
</insert>
</mapper>

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

Loading…
Cancel
Save