Browse Source

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

dev
wangchao 5 years ago
parent
commit
6c0988c473
  1. 4
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractOriginFormDTO.java
  2. 21
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractScreenFormDTO.java
  3. 19
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenExtractFormDTO.java
  4. 90
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ActInfoResultDTO.java
  5. 22
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/JoinUserCountResultDTO.java
  6. 27
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CpcScoreResultDTO.java
  7. 10
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridInfoDTO.java
  8. 26
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/point/UserPointDTO.java
  9. 5
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinFormDTO.java
  10. 10
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java
  11. 8
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java
  12. 50
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  13. 48
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java
  14. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java
  15. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java
  16. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java
  17. 35
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java
  18. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java
  19. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java
  20. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
  21. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java
  22. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java
  23. 30
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java
  24. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java
  25. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java
  26. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java
  27. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActUserRelationDao.java
  28. 27
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/point/PointDao.java
  29. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java
  30. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java
  31. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridDailyDao.java
  32. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java
  33. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexDictEntity.java
  34. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPartyUserRankDataEntity.java
  35. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenUserJoinEntity.java
  36. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java
  37. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java
  38. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java
  39. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/CalCpcIndexService.java
  40. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java
  41. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java
  42. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginExtractService.java
  43. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java
  44. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java
  45. 31
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java
  46. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java
  47. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/GroupExtractService.java
  48. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/IssueExtractService.java
  49. 24
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectExtractService.java
  50. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectPeriodExtractService.java
  51. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java
  52. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java
  53. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java
  54. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java
  55. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java
  56. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java
  57. 28
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java
  58. 68
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java
  59. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectPeriodExtractServiceImpl.java
  60. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PartyGuideService.java
  61. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PublicPartExtractService.java
  62. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractService.java
  63. 29
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenGrassrootsGovernDataAbsorptionService.java
  64. 124
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java
  65. 264
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java
  66. 86
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java
  67. 141
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java
  68. 32
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java
  69. 119
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java
  70. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/CpcIndexCalculateService.java
  71. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java
  72. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java
  73. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java
  74. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityOrgMonthlyServiceImpl.java
  75. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java
  76. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java
  77. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataService.java
  78. 30
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyBranchDataService.java
  79. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyLinkMassesDataService.java
  80. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyUserRankDataService.java
  81. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java
  82. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java
  83. 26
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataServiceImpl.java
  84. 50
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyBranchDataServiceImpl.java
  85. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyLinkMassesDataServiceImpl.java
  86. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyUserRankDataServiceImpl.java
  87. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserTotalDataServiceImpl.java
  88. 53
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java
  89. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActInfoService.java
  90. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActUserRelationService.java
  91. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java
  92. 35
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActUserRelationServiceImpl.java
  93. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/point/UserPointService.java
  94. 46
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/point/impl/UserPointServiceImpl.java
  95. 69
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java
  96. 66
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java
  97. 34
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java
  98. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java
  99. 50
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java
  100. 26
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml

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

@ -7,11 +7,13 @@ import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* desc: 从业务数据抽取到统计库 dto
*
* @Author zxc
* @DateTime 2020/9/16 6:01 下午
*/
@Data
public class ExtractFormDTO implements Serializable {
public class ExtractOriginFormDTO implements Serializable {
private static final long serialVersionUID = -6180252151765854242L;

21
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractScreenFormDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.extract.form;
import lombok.Data;
import java.io.Serializable;
/**
* desc: 抽取大屏数据dto
*
* @author LiuJanJun
* @date 2020/9/25 2:32 下午
*/
@Data
public class ExtractScreenFormDTO implements Serializable {
private static final long serialVersionUID = 7659170440875719461L;
private String customerId;
private String monthId;
private String dateId;
}

19
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenExtractFormDTO.java

@ -0,0 +1,19 @@
package com.epmet.dto.extract.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/25 4:17 下午
*/
@Data
public class ScreenExtractFormDTO implements Serializable {
private static final long serialVersionUID = -6092830982601961936L;
private String customerId;
private String monthId;
}

90
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ActInfoResultDTO.java

@ -0,0 +1,90 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/25 3:38 下午
*/
@Data
public class ActInfoResultDTO implements Serializable {
private static final long serialVersionUID = 2322961372193392320L;
/**
* 客户ID
*/
private String customerId;
/**
* 组织IDgridId或agencyId
*/
private String orgId;
/**
* 组织类型agencygrid
*/
private String orgType;
/**
* 组织名称
*/
private String orgName;
/**
* 年度ID
*/
private String yearId;
/**
* 月度ID
*/
private String monthId;
/**
* 父级ID
*/
private String parentId;
/**
* 组织次数
*/
private Integer organizeCount;
/**
* 会议分类Id
*/
private String meetCategoryId;
/**
* 会议分类名称三会党课主题党日.....等等
*/
private String meetCategoryName;
/**
* 平均参加人数
*/
private Integer averageJoinUserCount;
/**
* 删除状态
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 更新人
*/
private String updatedBy;
}

22
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/JoinUserCountResultDTO.java

@ -0,0 +1,22 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/25 5:14 下午
*/
@Data
public class JoinUserCountResultDTO implements Serializable {
private static final long serialVersionUID = 3961393565082322770L;
private String orgId;
/**
* 参与人数
*/
private Integer joinUserCount;
}

27
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CpcScoreResultDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.indexcal;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Description 党员指标得分查询DTO
* @ClassName CpcScoreResultDTO
* @Auth wangc
* @Date 2020-09-25 16:52
*/
@Data
public class CpcScoreResultDTO implements Serializable {
private static final long serialVersionUID = -7129757727997430029L;
/**
* 用户Id
* */
private String userId;
/**
* 党员指标得分
* */
private BigDecimal score;
}

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

@ -38,4 +38,14 @@ public class GridInfoDTO implements Serializable {
* agencyId的pids
*/
private String pids;
/**
* 网格名称
* */
private String gridName;
/**
* 机关名称
* */
private String orgName;
}

26
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/point/UserPointDTO.java

@ -0,0 +1,26 @@
package com.epmet.dto.point;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 用户积分DTO
* @ClassName UserPointDTO
* @Auth wangc
* @Date 2020-09-25 15:42
*/
@Data
public class UserPointDTO implements Serializable {
private static final long serialVersionUID = 6976982699085437418L;
/**
* 用户Id
* */
private String userId;
/**
* 用户累计积分
* */
private Integer pointTotal;
}

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

@ -3,6 +3,7 @@ package com.epmet.dto.screencoll.form;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 11基层治理-公众参与 入参
@ -47,7 +48,7 @@ public class UserJoinFormDTO implements Serializable {
/**
* 人均议题
*/
private Integer avgIssue;
private BigDecimal avgIssue;
/**
* 总的参与次数
@ -57,5 +58,5 @@ public class UserJoinFormDTO implements Serializable {
/**
* 平均参与度
*/
private Integer avgJoin;
private BigDecimal avgJoin;
}

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

@ -3,8 +3,8 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.StatsFormDTO;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractIndexFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.group.form.GroupStatsFormDTO;
import com.epmet.dto.issue.form.IssueJobFromDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
@ -202,7 +202,7 @@ public interface DataStatisticalOpenFeignClient {
* @author: jianjun liu
*/
@PostMapping(value = "/data/stats/factorigin/extractall")
Result factOriginExtractAll(@RequestBody(required = false) ExtractFormDTO formDTO);
Result factOriginExtractAll(@RequestBody(required = false) ExtractOriginFormDTO formDTO);
/**
* ˚
@ -222,11 +222,11 @@ public interface DataStatisticalOpenFeignClient {
Result initAllEIDims();
/**
* @Description 抽取数据到大屏
* @param extractFormDTO
* @param extractOriginFormDTO
* @Description 抽取数据到大屏
* @author zxc
* @date 2020/9/24 10:15 上午
*/
@PostMapping(value = "/data/stats/screenextract/extractdailyall")
Result extractDailyAll(@RequestBody(required = false) ExtractFormDTO extractFormDTO);
Result extractDailyAll(@RequestBody(required = false) ExtractOriginFormDTO extractOriginFormDTO);
}

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

@ -4,8 +4,8 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.StatsFormDTO;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractIndexFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.group.form.GroupStatsFormDTO;
import com.epmet.dto.issue.form.IssueJobFromDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
@ -192,7 +192,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
* @author: jianjun liu
*/
@Override
public Result factOriginExtractAll(ExtractFormDTO formDTO) {
public Result factOriginExtractAll(ExtractOriginFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "factOriginExtractAll", formDTO);
}
@ -214,7 +214,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
}
@Override
public Result extractDailyAll(ExtractFormDTO extractFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "extractDailyAll",extractFormDTO);
public Result extractDailyAll(ExtractOriginFormDTO extractOriginFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "extractDailyAll", extractOriginFormDTO);
}
}

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

@ -16,7 +16,8 @@ import com.epmet.dao.stats.DimCustomerDao;
import com.epmet.dao.stats.DimDateDao;
import com.epmet.dao.stats.DimMonthDao;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.form.ScreenExtractFormDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
@ -35,15 +36,12 @@ import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollCommunityS
import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollStreetService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService;
import com.epmet.service.evaluationindex.extract.toscreen.PartyBaseInfoService;
import com.epmet.service.evaluationindex.extract.toscreen.ScreenCentralZoneDataAbsorptionService;
import com.epmet.service.evaluationindex.extract.toscreen.PartyGuideService;
import com.epmet.service.evaluationindex.extract.toscreen.*;
import com.epmet.service.evaluationindex.indexcal.*;
import com.epmet.service.stats.DimAgencyService;
import com.epmet.service.stats.DimCustomerPartymemberService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -105,6 +103,8 @@ public class DemoController {
private IndexCollStreetService indexCollStreetService;
@Autowired
private ScreenCentralZoneDataAbsorptionService screenCentralZoneDataAbsorptionService;
@Autowired
private GovernRankDataExtractService governRankDataExtractService;
@GetMapping("testAlarm")
public void testAlarm() {
@ -527,7 +527,7 @@ public class DemoController {
@PostMapping("inserttopicorigin")
public Result topicDataCleaning(@RequestParam("customerId") String customerId, @RequestParam("dateId")String dateId) {
if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) {
ExtractFormDTO param = new ExtractFormDTO();
ExtractOriginFormDTO param = new ExtractOriginFormDTO();
param.setDateId(dateId);
param.setCustomerId(customerId);
Boolean aBoolean = factOriginTopicMainDailyService.topicCleaning(param);
@ -538,7 +538,7 @@ public class DemoController {
List<DimDateEntity> dimDateEntityList= dimDateDao.selectList(wrapper);
for(DimCustomerEntity customerEntity:customerEntityList){
for(DimDateEntity dateEntity:dimDateEntityList) {
ExtractFormDTO param = new ExtractFormDTO();
ExtractOriginFormDTO param = new ExtractOriginFormDTO();
param.setDateId(dateEntity.getId());
param.setCustomerId(customerEntity.getId());
factOriginTopicMainDailyService.topicCleaning(param);
@ -652,8 +652,8 @@ public class DemoController {
private PartyGuideService partyGuideService;
@PostMapping("zxczxc")
public Result getZxcZxc(@RequestBody CustomerIdAndDateIdFormDTO formDTO){
partyGuideService.partyGuideExtract(formDTO.getCustomerId(),formDTO.getDateId());
public Result getZxcZxc(@RequestBody ScreenExtractFormDTO formDTO){
partyGuideService.partyGuideExtract(formDTO);
return new Result();
}
@ -662,4 +662,36 @@ public class DemoController {
screenCentralZoneDataAbsorptionService.centralZoneDataHub(param);
return new Result();
}
@PostMapping("governRank")
public Result governRank(@RequestBody CustomerIdAndDateIdFormDTO formDTO){
governRankDataExtractService.extractGridData(formDTO.getCustomerId(), formDTO.getDateId());
governRankDataExtractService.extractCommunityData(formDTO.getCustomerId(), formDTO.getDateId());
governRankDataExtractService.extractStreetData(formDTO.getCustomerId(), formDTO.getDateId());
return new Result();
}
@Autowired
private PioneerDataExtractService pioneerDataExtractService;
@PostMapping("insertScreenPioneerData")
public Result insertScreenPioneerData(@RequestParam("customerId") String customerId, @RequestParam("dateId") String dateId) {
if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) {
pioneerDataExtractService.extractGridPioneerData(customerId, dateId);
pioneerDataExtractService.extractCommunityPioneerData(customerId, dateId);
pioneerDataExtractService.extractExceptCommunityPioneerData(customerId, dateId);
} else {
QueryWrapper<DimCustomerEntity> customerEntityQueryWrapper = new QueryWrapper<>();
List<DimCustomerEntity> customerEntityList = dimCustomerDao.selectList(customerEntityQueryWrapper);
for (DimCustomerEntity customerEntity : customerEntityList) {
pioneerDataExtractService.extractGridPioneerData(customerEntity.getId(), "20200926");
pioneerDataExtractService.extractCommunityPioneerData(customerEntity.getId(), "20200926");
pioneerDataExtractService.extractExceptCommunityPioneerData(customerEntity.getId(), "20200926");
}
}
return new Result();
}
}

48
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java

@ -3,7 +3,7 @@ package com.epmet.controller;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.service.evaluationindex.extract.todata.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -38,69 +38,69 @@ public class FactOriginExtractController {
/**
* desc:抽取业务数据到统计库
*
* @param extractFormDTO 默认统计前一天
* @param extractOriginFormDTO 默认统计前一天
* @return
*/
@PostMapping("extractall")
public Result extractAll(@RequestBody ExtractFormDTO extractFormDTO) {
if (StringUtils.isNotBlank(extractFormDTO.getStartDate()) && StringUtils.isNotBlank(extractFormDTO.getEndDate())) {
List<String> daysBetween = DateUtils.getDaysBetween(extractFormDTO.getStartDate(), extractFormDTO.getEndDate());
public Result extractAll(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) {
if (StringUtils.isNotBlank(extractOriginFormDTO.getStartDate()) && StringUtils.isNotBlank(extractOriginFormDTO.getEndDate())) {
List<String> daysBetween = DateUtils.getDaysBetween(extractOriginFormDTO.getStartDate(), extractOriginFormDTO.getEndDate());
for (int i = 0; i < daysBetween.size(); i++) {
String dateDimId = daysBetween.get(i);
extractFormDTO.setDateId(dateDimId);
factOriginExtractService.extractAll(extractFormDTO);
extractOriginFormDTO.setDateId(dateDimId);
factOriginExtractService.extractAll(extractOriginFormDTO);
}
} else {
factOriginExtractService.extractAll(extractFormDTO);
factOriginExtractService.extractAll(extractOriginFormDTO);
}
return new Result();
}
/**
* @param extractFormDTO
* @param extractOriginFormDTO
* @Description 议题抽取(main)
* @author zxc
* @date 2020/9/15 2:02 下午
*/
@PostMapping("issueextractmain")
public Result issueExtractMain(@RequestBody ExtractFormDTO extractFormDTO) {
ValidatorUtils.validateEntity(extractFormDTO, ExtractFormDTO.ExtractForm.class);
issueExtractService.issueExtractMain(extractFormDTO);
public Result issueExtractMain(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) {
ValidatorUtils.validateEntity(extractOriginFormDTO, ExtractOriginFormDTO.ExtractForm.class);
issueExtractService.issueExtractMain(extractOriginFormDTO);
return new Result();
}
/**
* @param extractFormDTO
* @param extractOriginFormDTO
* @Description 议题抽取(log)
* @author zxc
* @date 2020/9/16 9:41 上午
*/
@PostMapping("issueextractlog")
public Result issueExtractLog(@RequestBody ExtractFormDTO extractFormDTO) {
ValidatorUtils.validateEntity(extractFormDTO, ExtractFormDTO.ExtractForm.class);
issueExtractService.issueExtractLog(extractFormDTO);
public Result issueExtractLog(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) {
ValidatorUtils.validateEntity(extractOriginFormDTO, ExtractOriginFormDTO.ExtractForm.class);
issueExtractService.issueExtractLog(extractOriginFormDTO);
return new Result();
}
/**
* @param extractFormDTO
* @param extractOriginFormDTO
* @return com.epmet.commons.tools.utils.Result
* @author yinzuomei
* @description 话题 (fact_origin_topic_main_daily 话题主表_日统计 fact_origin_topic_log_daily 话题明细_日统计)
* @Date 2020/9/15 13:39
**/
@PostMapping("topic")
public Result topicDataCleaning(@RequestBody ExtractFormDTO extractFormDTO) {
if (StringUtils.isNotBlank(extractFormDTO.getCustomerId()) && StringUtils.isNotBlank(extractFormDTO.getDateId())) {
factOriginTopicMainDailyService.topicCleaning(extractFormDTO);
public Result topicDataCleaning(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) {
if (StringUtils.isNotBlank(extractOriginFormDTO.getCustomerId()) && StringUtils.isNotBlank(extractOriginFormDTO.getDateId())) {
factOriginTopicMainDailyService.topicCleaning(extractOriginFormDTO);
}
return new Result();
}
@PostMapping("project")
public Result projectData(@RequestBody ExtractFormDTO extractFormDTO) {
projectExtractService.saveOriginProjectDaily(extractFormDTO);
public Result projectData(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) {
projectExtractService.saveOriginProjectDaily(extractOriginFormDTO);
return new Result();
}
@ -112,7 +112,7 @@ public class FactOriginExtractController {
* @date 2020.09.20 16:11
**/
@PostMapping("projectorgperiodcleanning")
public Result projectOrgPeriodCleaning(@RequestBody ExtractFormDTO param) {
public Result projectOrgPeriodCleaning(@RequestBody ExtractOriginFormDTO param) {
projectExtractService.extractProjectPeriodData(param);
return new Result();
}
@ -125,7 +125,7 @@ public class FactOriginExtractController {
* @date 2020.09.20 16:11
**/
@PostMapping("groupdatacleaning")
public Result groupDataCleaning(@RequestBody ExtractFormDTO param) {
public Result groupDataCleaning(@RequestBody ExtractOriginFormDTO param) {
groupExtractService.extractGroupData(param);
return new Result();
}

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

@ -1,7 +1,7 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -21,14 +21,14 @@ public class ScreenExtractDailyController {
private ScreenExtractService screenExtractService;
/**
* @Description 抽取数据到大屏
* @param extractFormDTO
* @param extractOriginFormDTO
* @Description 抽取数据到大屏
* @author zxc
* @date 2020/9/24 10:15 上午
*/
@PostMapping("extractdailyall")
public Result screenExtractDaily(@RequestBody ExtractFormDTO extractFormDTO){
screenExtractService.extractDailyAll(extractFormDTO);
public Result screenExtractDaily(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) {
screenExtractService.extractDailyAll(extractOriginFormDTO);
return new Result();
}

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

@ -72,4 +72,21 @@ public interface FactOriginIssueLogDailyDao extends BaseDao<FactOriginIssueLogDa
* @date 2020/9/21 9:37 上午
*/
List<PartyActiveResultDTO> selectPartyActiveIssueVote(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("isParty") Integer isParty);
/**
* @return int
* @param customerId
* @param gridId
* @param communityId
* @param agencyPath
* @param isParty
* @author yinzuomei
* @description 党员参与议事支持或者反对的次数
* @Date 2020/9/26 18:05
**/
int calPartyPartiIssueTotal(@Param("customerId")String customerId,
@Param("gridId")String gridId,
@Param("communityId")String communityId,
@Param("agencyPath")String agencyPath,
@Param("isParty")String isParty);
}

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

@ -115,4 +115,25 @@ public interface FactOriginProjectLogDailyDao extends BaseDao<FactOriginProjectL
**/
List<ProjectParticipatedAgencyResultDTO> selectProjectParticipatedAgency(@Param("customerId") String customerId, @Param("dimId") String dimId,
@Param("dateType")String dateType);
/**
* 网格项目响应度
* @author zhaoqifeng
* @date 2020/9/25 10:01
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectGridResponse(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 组织项目响应度
* @author zhaoqifeng
* @date 2020/9/25 10:01
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectOrgResponse(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("level")String level);
}

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

@ -134,4 +134,39 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
int getAgencyClosedProjectTotal(@Param("customerId") String customerId,
@Param("agencyPath")String agencyPath,
@Param("closedStatus")String closedStatus);
/**
* 组织自治项目数
* @author zhaoqifeng
* @date 2020/9/25 15:16
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getSelfProject(@Param("customerId") String customerId, @Param("monthId")String monthId,
@Param("level") String level);
/**
* 组织解决项目数
* @author zhaoqifeng
* @date 2020/9/25 15:16
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getResolveProject(@Param("customerId") String customerId, @Param("monthId")String monthId,
@Param("level") String level);
/**
* 网格解决项目数
* @author zhaoqifeng
* @date 2020/9/25 15:16
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridResolveProject(@Param("customerId") String customerId, @Param("monthId")String monthId);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java

@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.indexcal;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.indexcal.CpcScoreResultDTO;
import com.epmet.entity.evaluationindex.indexcal.CpcScoreEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -83,4 +84,13 @@ public interface CpcScoreDao extends BaseDao<CpcScoreEntity> {
List<CpcScoreEntity> getPartScore(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("allParentCode") String allParentCode, @Param("offset") int offset, @Param("pageSize") int pageSize);
int insertBatch(@Param("list") Collection<CpcScoreEntity> values);
/**
* @Description 查询客户下的党员指标得分
* @param customerId
* @return
* @author wangc
* @date 2020.09.25 17:13
**/
List<CpcScoreResultDTO> selectCpcScore(@Param("customerId") String customerId,@Param("monthId") String monthId);
}

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

@ -77,4 +77,16 @@ public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao<FactIndexGovr
* @return java.lang.Integer
*/
Integer deleteByCustomer(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("type") String type);
/**
* 根据客户查询组织治理能力
* @author zhaoqifeng
* @date 2020/9/25 14:02
* @param customerId
* @param monthId
* @param type
* @return java.util.List<com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity>
*/
List<FactIndexGovrnAblityOrgMonthlyEntity> selectOrgByCustomer(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("type") String type);
}

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

@ -19,6 +19,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.form.ScreenPartyBranchDataFormDTO;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO;
import com.epmet.dto.extract.result.OrgNameResultDTO;
@ -162,7 +163,9 @@ public interface ScreenCustomerAgencyDao extends BaseDao<ScreenCustomerAgencyEnt
* @author zxc
* @date 2020/9/25 10:39 上午
*/
List<ScreenPartyLinkMassesDataFormDTO> selectAllAgencyIdToPartyLinkMessage(String customerId, String monthId);
List<ScreenPartyLinkMassesDataFormDTO> selectAllAgencyIdToPartyLinkMessage(@Param("customerId") String customerId,@Param("monthId") String monthId);
List<ScreenPartyBranchDataFormDTO> selectAllAgencyIdToOrganize(@Param("customerId") String customerId,@Param("monthId") String monthId);
/**
* @Description 查询org名称机关

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

@ -19,10 +19,7 @@ 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.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.form.*;
import com.epmet.dto.extract.result.GridInfoResultDTO;
import com.epmet.dto.extract.result.OrgNameResultDTO;
import com.epmet.dto.indexcal.PageQueryGridFormDTO;
@ -152,6 +149,7 @@ public interface ScreenCustomerGridDao extends BaseDao<ScreenCustomerGridEntity>
* @date 2020/9/25 10:43 上午
*/
List<ScreenPartyLinkMassesDataFormDTO> selectAllGridIdToPartyLinkMessage(@Param("customerId") String customerId,@Param("monthId") String monthId);
List<ScreenPartyBranchDataFormDTO> selectAllGridIdToOrganize(@Param("customerId") String customerId,@Param("monthId") String monthId);
/**
* @Description 查询org名称

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

@ -75,4 +75,19 @@ public interface ScreenGovernRankDataDao extends BaseDao<ScreenGovernRankDataEnt
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity>
*/
List<ScreenGovernRankDataEntity> initGridDataList(@Param("customerId") String customerId);
/**
* 删除旧数据
* @author zhaoqifeng
* @date 2020/9/25 10:38
* @param customerId
* @param orgType
* @param deleteSize
* @param orgIds
* @return java.lang.Integer
*/
Integer deleteRankData(@Param("customerId") String customerId, @Param("orgType") String orgType, @Param("monthId") String monthId,
@Param("deleteSize") Integer deleteSize,
@Param("orgIds")List<String> orgIds);
}

30
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java

@ -65,4 +65,34 @@ public interface ScreenPartyBranchDataDao extends BaseDao<ScreenPartyBranchDataE
* @date 2020/9/25 9:16 上午
*/
void insertScreenPartyBranchData(@Param("lists") List<ScreenPartyBranchDataFormDTO> lists);
/**
* @Description 删除旧的建设情况数据
* @Param customerId
* @Param monthId
* @Param orgIds
* @author zxc
* @date 2020/9/27 9:04 上午
*/
Integer deleteOldScreenPartyBranchData(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("orgIds") List<String> orgIds);
/**
* @Description 根据orgId查询建设情况数据
* @Param customerId
* @Param monthId
* @Param orgIds
* @author zxc
* @date 2020/9/27 9:38 上午
*/
List<ScreenPartyBranchDataFormDTO> selectScreenPartyBranchDataByOrgId(@Param("customerId") String customerId, @Param("monthId") String monthId,@Param("orgIds") List<String> orgIds);
/**
* @Description 根据parentId查询建设情况数据
* @Param customerId
* @Param monthId
* @Param parentId
* @author zxc
* @date 2020/9/27 9:38 上午
*/
List<ScreenPartyBranchDataFormDTO> selectScreenPartyBranchDataByParentId(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("parentId") String parentId);
}

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java

@ -68,12 +68,11 @@ public interface ScreenPartyLinkMassesDataDao extends BaseDao<ScreenPartyLinkMas
/**
* @Description 删除旧的党员联系群众
* @param customerId
* @param monthId
* @param orgIds
* @author zxc
* @date 2020/9/22 3:28 下午
*/
Integer deleteOldPartyLinkInfo(@Param("customerId") String customerId,@Param("monthId") String monthId,@Param("orgIds") List<String> orgIds);
Integer deleteOldPartyLinkInfo(@Param("customerId") String customerId, @Param("orgIds") List<String> orgIds);
/**
* @Description 查询党员联系群众信息

18
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java

@ -45,6 +45,15 @@ public interface ScreenPartyUserRankDataDao extends BaseDao<ScreenPartyUserRankD
**/
Integer deletePartyUserRankData(@Param("customerId") String customerId);
/**
* @Description 按照客户月份删除
* @param
* @return java.lang.Integer
* @author wangc
* @date 2020.09.27 11:19
*/
Integer deleteBatchByCustomerIdAndDateId(@Param("customerId") String customerId,@Param("dateId") String dateId);
/**
* 9党建引领|基层治理-居民党员积分排行榜
* 2) 在批量新增
@ -55,4 +64,13 @@ public interface ScreenPartyUserRankDataDao extends BaseDao<ScreenPartyUserRankD
* @Date 10:52 2020-08-18
**/
void batchInsertPartyUserRankData(@Param("list") List<PartyUserRankDataFormDTO> list,@Param("customerId")String customerId);
/**
* @Description 批量插入
* @param list
* @return void
* @author wangc
* @date 2020.09.27 10:06
*/
void insertBatch(List<ScreenPartyUserRankDataEntity> list);
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java

@ -17,6 +17,7 @@
package com.epmet.dao.heart;
import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -50,4 +51,14 @@ public interface ActInfoDao{
* @Date 2020/9/21 13:55
**/
List<String> selectGridRegUserVolunteer(@Param("list") List<String> regUserIds);
/**
* @Description 查询组织次数
* @Param customerId
* @Param monthId
* @Param orgType
* @author zxc
* @date 2020/9/25 4:00 下午
*/
List<ScreenPartyBranchDataFormDTO> selectActInfo(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("orgType") String orgType,@Param("orgIds") List<String> orgIds);
}

25
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActUserRelationDao.java

@ -0,0 +1,25 @@
package com.epmet.dao.heart;
import com.epmet.dto.extract.result.JoinUserCountResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/9/25 5:21 下午
*/
@Mapper
public interface ActUserRelationDao {
/**
* @Description 查询参与人数
* @Param customerId
* @Param monthId
* @author zxc
* @date 2020/9/25 5:19 下午
*/
List<JoinUserCountResultDTO> selectJoinUserCount(@Param("customerId") String customerId,@Param("monthId") String monthId);
}

27
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/point/PointDao.java

@ -0,0 +1,27 @@
package com.epmet.dao.point;
import com.epmet.dto.point.UserPointDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 积分查询DAO
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-03-16
*/
@Mapper
public interface PointDao {
/**
* @Description 查询客户下的用户积分
* @param customerId
* @return
* @author wangc
* @date 2020.09.25 15:51
**/
List<UserPointDTO> selectUserPointByCustomerId(@Param("customerId") String customerId);
}

14
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java

@ -26,7 +26,7 @@ import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 网格议题数量(按月)
* 网格议题数量(按月)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
@ -35,21 +35,25 @@ import java.util.List;
public interface FactIssueGridMonthlyDao extends BaseDao<FactIssueGridMonthlyEntity> {
/**
* 统计网格议题各个指标月度增量
* @author zhaoqifeng
* @date 2020/6/19 10:41
*
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.stats.FactIssueGridMonthlyDTO>
* @author zhaoqifeng
* @date 2020/6/19 10:41
*/
List<FactIssueGridMonthlyDTO> selectGridMonthlyInc(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 删除
* @author zhaoqifeng
* @date 2020/6/23 14:02
*
* @param customerId
* @param monthId
* @return void
* @author zhaoqifeng
* @date 2020/6/23 14:02
*/
void deleteByCustomerId(@Param("customerId") String customerId, @Param("monthId") String monthId);
List<FactIssueGridMonthlyEntity> getIssueCount(@Param("customerId") String customerId, @Param("monthId") String monthId);
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java

@ -48,13 +48,4 @@ public interface FactParticipationUserGridDailyDao extends BaseDao<FactParticipa
* @date 2020/9/23 9:57 上午
*/
List<UserCountResultDTO> selectUserCount(String customerId, String dateId);
/**
* @Description 根据机构级别查询用户数与党员数
* @param orgLevel
* @return
* @author wangc
* @date 2020.09.24 14:59
**/
List<ScreenUserTotalDataEntity> selectUserAndPartymemberByOrgLevel(@Param("orgLevel") String orgLevel,@Param("customerId") String customerId, @Param("dateId")String dateId);
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridDailyDao.java

@ -19,6 +19,7 @@ package com.epmet.dao.stats.user;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.user.FactRegUserGridDailyDTO;
import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity;
import com.epmet.entity.stats.user.FactRegUserGridDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -38,4 +39,12 @@ public interface FactRegUserGridDailyDao extends BaseDao<FactRegUserGridDailyEnt
void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId);
/**
* @Description 根据机构级别查询用户数与党员数
* @param orgLevel
* @return
* @author wangc
* @date 2020.09.24 14:59
**/
List<ScreenUserTotalDataEntity> selectUserAndPartymemberByOrgLevel(@Param("orgLevel") String orgLevel, @Param("customerId") String customerId, @Param("dateId")String dateId);
}

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

@ -3,6 +3,7 @@ package com.epmet.dao.user;
import com.epmet.dto.extract.form.GridHeartedFormDTO;
import com.epmet.dto.extract.result.UserPartyResultDTO;
import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -121,4 +122,13 @@ public interface UserDao {
* @Date 2020/9/21 13:46
**/
List<String> selectGridRegUserIds(@Param("customerId") String customerId, @Param("gridId") String gridId);
/**
* @Description 获取客户下的网格注册居民
* @param customerId
* @return
* @author wangc
* @date 2020.09.25 13:54
**/
List<ScreenPartyUserRankDataEntity> selectRegisteredUserByCustomerId(@Param("customerId") String customerId);
}

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexDictEntity.java

@ -59,4 +59,9 @@ public class IndexDictEntity extends BaseEpmetEntity {
* 正相关positive负相关negative
*/
private String correlation;
/**
* 指标值类型 none整数integer小数: decimal;百分比percent
*/
private String valueType;
}

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPartyUserRankDataEntity.java

@ -22,6 +22,8 @@ import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* 党建引领基层治理-市民党员积分排行榜
*
@ -90,6 +92,10 @@ public class ScreenPartyUserRankDataEntity extends BaseEpmetEntity {
*/
private Integer pointTotal;
/**
* 党员指标得分
* */
private BigDecimal indexScore;
/**
* 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)
*/

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

@ -90,7 +90,7 @@ public class ScreenUserJoinEntity extends BaseEpmetEntity {
/**
* 人均议题
*/
private Integer avgIssue;
private BigDecimal avgIssue;
/**
* 人均议题较上月增长率(采集的时候后台自己计算)
@ -105,7 +105,7 @@ public class ScreenUserJoinEntity extends BaseEpmetEntity {
/**
* 平均参与度
*/
private Integer avgJoin;
private BigDecimal avgJoin;
/**
* 平均参与度较上月增长率(采集的时候后台自己计算)

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java

@ -18,7 +18,6 @@
package com.epmet.entity.stats;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -69,12 +68,12 @@ public class DimAgencyEntity extends BaseEpmetEntity {
private String allParentName;
/**
* 机关级别社区级community
街道:street,
区县级: district,
市级: city
省级:province
*/
* 机关级别社区级community
* 街道:street,
* 区县级: district,
* 市级: city
* 省级:province
*/
private String level;
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java

@ -42,7 +42,6 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
List<IndexModel> indexModelList = new ArrayList<>();
private String preWheight;
private Integer wheightSum = 0;
/**
* 假设这个是一个DAO当然有业务逻辑这个也可以是一个service当然如果不用存储这个对象没用
*/
@ -104,6 +103,17 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
}
}
//指标值类型 无:none;整数:integer;小数: decimal;百分比:percent
if (StringUtils.isNotBlank(data.getValueType())) {
if ("整数".equals(data.getValueType())) {
data.setValueType("integer");
} else if ("小数".equals(data.getValueType())) {
data.setValueType("decimal");
} else if ("百分比".equals(data.getValueType())) {
data.setValueType("percent");
}
}
IndexDictEntity entity = new IndexDictEntity();
IndexDictEntity entity2 = new IndexDictEntity();
IndexDictEntity entity3 = new IndexDictEntity();
@ -306,6 +316,7 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
entity5.setCorrelation(data.getCorrelation());
entity5.setLevel("5");
entity5.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel5Index(), false, 4));
entity.setValueType(data.getValueType());
indexDicMap.put(data.getLevel5Index(), entity5);
}
}

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java

@ -26,6 +26,11 @@ public class IndexModel {
//没有阈值:无,有就是百分数
@ExcelProperty(value = "阈值")
private String threshold;
/**
* 指标值类型 none整数integer小数: decimal;百分比percent
*/
@ExcelProperty(value = "五级指标值类型")
private String valueType;
/**
* 正相关positive负相关negative
*/

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

@ -1,5 +1,7 @@
package com.epmet.service.evaluationindex.extract.dataToIndex;
import java.util.Map;
/**
* 党员相关
*

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

@ -2,6 +2,7 @@ package com.epmet.service.evaluationindex.extract.dataToIndex.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.indexcal.CpcScoreResultDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity;
import com.epmet.service.evaluationindex.extract.dataToIndex.CalCpcIndexService;
import com.epmet.service.evaluationindex.extract.todata.*;
@ -126,7 +127,6 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
factIndexPartyAblityCpcMonthlyService.delAndSavePartyAblityCpcMonthly(customerId,monthId,indexPartyAblityCpcList);
}
/**
* @param customerId
* @param partyMemberList
@ -400,4 +400,6 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
}

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

@ -134,18 +134,18 @@ public class IndexCollCommunityServiceImpl implements IndexCollCommunityService
BigDecimal element = new BigDecimal(entity.getClosedProjectCount());
//分母,即机关参与过的项目数(去重)
Integer denominator = agencyParticipatedCount.get(entity.getAgencyId());
if (agencyParticipatedCount.get(entity.getAgencyId()) != NumConstant.ZERO) {
if (null != denominator && denominator != NumConstant.ZERO) {
//办结率
entity.setClosedProjectRatio(
element.divide(new BigDecimal(denominator), NumConstant.SIX, RoundingMode.HALF_UP)
);
}else{
entity.setClosedProjectRatio(BigDecimal.ZERO);
}
//办结效率
entity.setHandleProjectRatio(efficiencyMap.get(entity.getAgencyId()));
});
factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.COMMUNITY);
factIndexGovrnAblityOrgMonthlyService.saveList(list);

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

@ -1,6 +1,6 @@
package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
/**
* @author zhaoqifeng
@ -12,7 +12,7 @@ public interface FactOriginExtractService {
/**
* desc:抽取所有业务数据到统计库
*
* @param extractFormDTO
* @param extractOriginFormDTO
*/
void extractAll(ExtractFormDTO extractFormDTO);
void extractAll(ExtractOriginFormDTO extractOriginFormDTO);
}

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

@ -28,4 +28,16 @@ import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity;
*/
public interface FactOriginIssueLogDailyService extends BaseService<FactOriginIssueLogDailyEntity> {
/**
* @return int
* @param customerId
* @param gridId
* @param communityId
* @param agencyPath
* @param isParty
* @author yinzuomei
* @description 党员参与议事支持或者反对的次数
* @Date 2020/9/26 17:57
**/
int calPartyPartiIssueTotal(String customerId, String gridId, String communityId, String agencyPath, String isParty);
}

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

@ -197,4 +197,25 @@ public interface FactOriginProjectLogDailyService extends BaseService<FactOrigin
**/
Map<String, BigDecimal> getAgencyWorkPieceRatio(String customerId, String dimId,String dateType);
/**
* 网格项目响应度
* @author zhaoqifeng
* @date 2020/9/25 9:56
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridResponse(String customerId, String monthId);
/**
* 组织项目响应度
* @author zhaoqifeng
* @date 2020/9/25 9:56
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getOrgResponse(String customerId, String monthId, String level);
}

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

@ -185,4 +185,35 @@ public interface FactOriginProjectMainDailyService extends BaseService<FactOrigi
* @Date 2020/9/24 17:37
**/
int getAgencyClosedProjectTotal(String customerId, String agencyPath, String closedStatus);
/**
* 自治项目数
* @author zhaoqifeng
* @date 2020/9/25 15:34
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getSelfProject(String customerId, String monthId, String level);
/**
* 已解决项目数
* @author zhaoqifeng
* @date 2020/9/25 15:34
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getResolveProject(String customerId, String monthId, String level);
/**
* 网格已解决项目数
* @author zhaoqifeng
* @date 2020/9/25 15:34
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridResolveProject(String customerId, String monthId);
}

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

@ -18,7 +18,7 @@
package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.result.CreateTopicCountResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity;
@ -40,7 +40,7 @@ public interface FactOriginTopicMainDailyService extends BaseService<FactOriginT
* @description fact_origin_topic_log_daily 话题明细_日统计 fact_origin_topic_main_daily 话题主表_日统计
* @Date 2020/9/15 13:40
**/
Boolean topicCleaning(ExtractFormDTO extractFormDTO);
Boolean topicCleaning(ExtractOriginFormDTO extractOriginFormDTO);
/**
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>

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

@ -1,11 +1,10 @@
package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO;
import java.util.List;
import com.epmet.dto.extract.form.ExtractFormDTO;
/**
* @Desc 业务数据抽取 - 组相关
* @Author wangc
@ -24,11 +23,11 @@ public interface GroupExtractService {
/**
* @Description 业务抽取 - 小组数据
* @param param
* @return
* @Description 业务抽取 - 小组数据
* @author wangc
* @date 2020.09.18 21:07
**/
void extractGroupData(ExtractFormDTO param);
**/
void extractGroupData(ExtractOriginFormDTO param);
}

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

@ -1,13 +1,11 @@
package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.form.GridIssueCountResultDTO;
import com.epmet.dto.extract.result.GridProjectCountResultDTO;
import com.epmet.dto.extract.result.PartyActiveResultDTO;
import com.epmet.dto.extract.result.ShiftProjectCountResultDTO;
import java.util.List;
import java.util.List;
import java.util.Map;
@ -18,20 +16,20 @@ import java.util.Map;
public interface IssueExtractService {
/**
* @Description 议题抽取(main)
* @param extractFormDTO
* @param extractOriginFormDTO
* @Description 议题抽取(main)
* @author zxc
* @date 2020/9/15 2:02 下午
*/
Boolean issueExtractMain(ExtractFormDTO extractFormDTO);
Boolean issueExtractMain(ExtractOriginFormDTO extractOriginFormDTO);
/**
* @Description 议题抽取(log)
* @param extractFormDTO
* @Description 议题抽取(log)
* @param extractOriginFormDTO
* @author zxc
* @date 2020/9/16 9:41 上午
*/
Boolean issueExtractLog(ExtractFormDTO extractFormDTO);
Boolean issueExtractLog(ExtractOriginFormDTO extractOriginFormDTO);
/**
* @Description 查询网格议题总数网格人均议题数目

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

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

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

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

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

@ -3,7 +3,7 @@ package com.epmet.service.evaluationindex.extract.todata.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.service.evaluationindex.extract.todata.*;
import com.epmet.service.stats.DimCustomerService;
import com.epmet.util.DimIdGenerator;
@ -44,9 +44,9 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService {
@Override
public void extractAll(ExtractFormDTO extractFormDTO) {
String dateId = extractFormDTO.getDateId();
String customerId = extractFormDTO.getCustomerId();
public void extractAll(ExtractOriginFormDTO extractOriginFormDTO) {
String dateId = extractOriginFormDTO.getDateId();
String customerId = extractOriginFormDTO.getCustomerId();
if (StringUtils.isBlank(dateId)) {
dateId = DimIdGenerator.getDateDimId(DateUtils.addDateDays(new Date(), -1));
}
@ -65,7 +65,7 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService {
String finalDateId = dateId;
customerIds.forEach(cId -> {
ExtractFormDTO param = new ExtractFormDTO();
ExtractOriginFormDTO param = new ExtractOriginFormDTO();
param.setCustomerId(cId);
param.setDateId(finalDateId);
log.debug("extractAll param:{}", JSON.toJSONString(param));
@ -74,7 +74,7 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService {
}
private void submitJob(ExtractFormDTO param) {
private void submitJob(ExtractOriginFormDTO param) {
threadPool.submit(() -> {
try {
groupExtractService.extractGroupData(param);

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

@ -36,4 +36,19 @@ import org.springframework.stereotype.Service;
public class FactOriginIssueLogDailyServiceImpl extends BaseServiceImpl<FactOriginIssueLogDailyDao, FactOriginIssueLogDailyEntity> implements FactOriginIssueLogDailyService {
/**
* @param customerId
* @param gridId
* @param communityId
* @param agencyPath
* @param isParty
* @return int
* @author yinzuomei
* @description 党员参与议事支持或者反对的次数
* @Date 2020/9/26 17:57
**/
@Override
public int calPartyPartiIssueTotal(String customerId, String gridId, String communityId, String agencyPath, String isParty) {
return baseDao.calPartyPartiIssueTotal(customerId,gridId,communityId,agencyPath,isParty);
}
}

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

@ -267,5 +267,15 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOr
return efficiencyMap;
}
@Override
public List<OrgStatisticsResultDTO> getGridResponse(String customerId, String monthId) {
return baseDao.selectGridResponse(customerId, monthId);
}
@Override
public List<OrgStatisticsResultDTO> getOrgResponse(String customerId, String monthId, String level) {
return baseDao.selectOrgResponse(customerId, monthId, level);
}
}

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

@ -198,4 +198,19 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO
public int getAgencyClosedProjectTotal(String customerId, String agencyPath, String closedStatus) {
return baseDao.getAgencyClosedProjectTotal(customerId,agencyPath,closedStatus);
}
@Override
public List<OrgStatisticsResultDTO> getSelfProject(String customerId, String monthId, String level) {
return baseDao.getSelfProject(customerId, monthId, level);
}
@Override
public List<OrgStatisticsResultDTO> getResolveProject(String customerId, String monthId, String level) {
return baseDao.getResolveProject(customerId, monthId, level);
}
@Override
public List<OrgStatisticsResultDTO> getGridResolveProject(String customerId, String monthId) {
return baseDao.getGridResolveProject(customerId, monthId);
}
}

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

@ -28,7 +28,7 @@ import com.epmet.constant.DimObjectActionConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginTopicLogDailyDao;
import com.epmet.dao.evaluationindex.extract.FactOriginTopicMainDailyDao;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.result.CreateTopicCountResultDTO;
import com.epmet.dto.org.GridInfoDTO;
import com.epmet.dto.topic.TopicOriginInfoDTO;
@ -77,9 +77,9 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
* @Date 2020/9/15 13:40
**/
@Override
public Boolean topicCleaning(ExtractFormDTO extractFormDTO) {
String customerId = extractFormDTO.getCustomerId();
String dateId = extractFormDTO.getDateId();
public Boolean topicCleaning(ExtractOriginFormDTO extractOriginFormDTO) {
String customerId = extractOriginFormDTO.getCustomerId();
String dateId = extractOriginFormDTO.getDateId();
List<TopicOriginInfoDTO> topicOriginInfoList = topicService.queryTopicOriginInfoList(customerId, dateId);
if (CollectionUtils.isEmpty(topicOriginInfoList)) {
log.info(String.format("customerId%s,dateId%s,doesn't have any topic operation record", customerId, dateId));

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

@ -4,7 +4,7 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.form.GridHeartedFormDTO;
import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO;
import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO;
@ -66,17 +66,17 @@ public class GroupExtractServiceImpl implements GroupExtractService {
/**
* @Description 业务抽取 - 小组祥光
* @param param
* @return
* @Description 业务抽取 - 小组祥光
* @author wangc
* @date 2020.09.18 21:07
**/
@Override
public void extractGroupData(ExtractFormDTO param) {
public void extractGroupData(ExtractOriginFormDTO param) {
int count = factOriginGroupMainDailyDao.selectIfExist(param.getCustomerId());
if(StringUtils.isBlank(param.getDateId())){
if (StringUtils.isBlank(param.getDateId())) {
Date yesterday = DateUtils.addDateDays(new Date(), -1);
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
param.setDateId(format.format(yesterday));

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

@ -11,7 +11,7 @@ import com.epmet.constant.ExtractConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginIssueLogDailyDao;
import com.epmet.dao.evaluationindex.extract.FactOriginIssueMainDailyDao;
import com.epmet.dao.stats.DimAgencyDao;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.form.GridIssueCountResultDTO;
import com.epmet.dto.extract.form.IssueLogDailyFormDTO;
import com.epmet.dto.extract.form.IssueMainDailyFormDTO;
@ -54,19 +54,19 @@ public class IssueExtractServiceImpl implements IssueExtractService {
private FactOriginIssueLogDailyDao issueLogDailyDao;
/**
* @Description 议题抽取
* @param extractFormDTO
* @param extractOriginFormDTO
* @Description 议题抽取
* @author zxc
* @date 2020/9/15 2:02 下午
*/
@Override
public Boolean issueExtractMain(ExtractFormDTO extractFormDTO) {
String customerId = extractFormDTO.getCustomerId();
String dateId = extractFormDTO.getDateId();
public Boolean issueExtractMain(ExtractOriginFormDTO extractOriginFormDTO) {
String customerId = extractOriginFormDTO.getCustomerId();
String dateId = extractOriginFormDTO.getDateId();
// 1. 议题信息查询
List<IssueInfoResultDTO> listResult = issueService.selectIssueInfo(customerId, dateId);
List<IssueMainDailyFormDTO> result = new ArrayList<>();
if (CollectionUtils.isEmpty(listResult)){
if (CollectionUtils.isEmpty(listResult)) {
log.warn("issueExtractMain selectIssueInfo return empty,customerId:{},dateId:{}", customerId, dateId);
return true;
}
@ -151,24 +151,24 @@ public class IssueExtractServiceImpl implements IssueExtractService {
}
/**
* @Description 议题抽取(log)
* @param extractFormDTO
* @Description 议题抽取(log)
* @param extractOriginFormDTO
* @author zxc
* @date 2020/9/16 9:41 上午
*/
@Override
public Boolean issueExtractLog(ExtractFormDTO extractFormDTO) {
String customerId = extractFormDTO.getCustomerId();
String dateId = extractFormDTO.getDateId();
public Boolean issueExtractLog(ExtractOriginFormDTO extractOriginFormDTO) {
String customerId = extractOriginFormDTO.getCustomerId();
String dateId = extractOriginFormDTO.getDateId();
List<IssueLogDailyFormDTO> result = new ArrayList<>();
// 1. 查询议题process
List<IssueProcessInfoResultDTO> listResult = issueService.selectIssueProcessInfo(customerId, dateId);
if (CollectionUtils.isEmpty(listResult)){
if (CollectionUtils.isEmpty(listResult)) {
log.warn("issueExtractMain issueExtractLog return empty,customerId:{},dateId:{}", customerId, dateId);
return true;
}
Map<String, List<IssueProcessInfoResultDTO>> groupByIssue = listResult.stream().collect(Collectors.groupingBy(IssueProcessInfoResultDTO::getIssueId));
groupByIssue.forEach((issueId,process) -> {
groupByIssue.forEach((issueId, process) -> {
List<IssueProcessInfoResultDTO> descByCreateTime = process.stream().sorted(Comparator.comparing(IssueProcessInfoResultDTO::getCreateTime).reversed()).collect(Collectors.toList());
issueMainDailyDao.updateIssueStatus(issueId,descByCreateTime.get(NumConstant.ZERO).getActionCode());
});

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

@ -7,7 +7,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao;
import com.epmet.dto.ProjectDTO;
import com.epmet.dto.extract.FactOriginProjectMainDailyDTO;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.form.WorkDayFormDTO;
import com.epmet.dto.issue.IssueDTO;
import com.epmet.dto.party.PartyMemberDTO;
@ -71,20 +71,20 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
@Autowired
private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao;
@Override
public void saveOriginProjectDaily(ExtractFormDTO extractFormDTO) {
String dateString = extractFormDTO.getDateId();
String customerId = extractFormDTO.getCustomerId();
List<FactOriginProjectMainDailyEntity> list = new LinkedList<>();
//获取已关闭项目列表
List<ProjectProcessEntity> closedList = projectProcessService.getClosedProjectList(customerId, dateString);
List<FactOriginProjectMainDailyDTO> pendingList = factOriginProjectMainDailyService.getPendingList(customerId);
List<FinishOrgDTO> finishOrgList= projectProcessService.getFinishOrg(customerId, dateString);
if (null != closedList && !closedList.isEmpty()) {
List<FactOriginProjectMainDailyEntity> closeProjects =
pendingList.stream().flatMap(pending -> closedList.stream().filter(closed -> pending.getId().equals(closed.getProjectId())).map(process -> {
FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity();
entity.setId(process.getId());
@Override
public void saveOriginProjectDaily(ExtractOriginFormDTO extractOriginFormDTO) {
String dateString = extractOriginFormDTO.getDateId();
String customerId = extractOriginFormDTO.getCustomerId();
List<FactOriginProjectMainDailyEntity> list = new LinkedList<>();
//获取已关闭项目列表
List<ProjectProcessEntity> closedList = projectProcessService.getClosedProjectList(customerId, dateString);
List<FactOriginProjectMainDailyDTO> pendingList = factOriginProjectMainDailyService.getPendingList(customerId);
List<FinishOrgDTO> finishOrgList = projectProcessService.getFinishOrg(customerId, dateString);
if (null != closedList && !closedList.isEmpty()) {
List<FactOriginProjectMainDailyEntity> closeProjects =
pendingList.stream().flatMap(pending -> closedList.stream().filter(closed -> pending.getId().equals(closed.getProjectId())).map(process -> {
FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity();
entity.setId(process.getId());
entity.setProjectStatus("close");
entity.setCreatedTime(DateUtils.stringToDate(pending.getDateId(), DateUtils.DATE_PATTERN_YYYYMMDD));
entity.setUpdatedTime(process.getUpdatedTime());
@ -312,25 +312,25 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
}
}
/**
* @Description 抽取项目节点历时逻辑
* @param param
* @return
* @author wangc
* @date 2020.09.17 14:05
**/
@Override
public void extractProjectPeriodData(ExtractFormDTO param) {
int trace = factOriginProjectOrgPeriodDailyDao.selectIfExisted(param.getCustomerId());
Boolean isFirst = trace <= NumConstant.ZERO ? true : false;
if(StringUtils.isBlank(param.getDateId())){
Date yesterday = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24);
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
param.setDateId(format.format(yesterday));
}
List<ProjectOrgPeriodResultDTO> extractData =
projectProcessService.getProjectPeriod(isFirst,param.getCustomerId(),param.getDateId());
List<FactOriginProjectOrgPeriodDailyEntity> formattingData = new LinkedList<>();
/**
* @param param
* @return
* @Description 抽取项目节点历时逻辑
* @author wangc
* @date 2020.09.17 14:05
**/
@Override
public void extractProjectPeriodData(ExtractOriginFormDTO param) {
int trace = factOriginProjectOrgPeriodDailyDao.selectIfExisted(param.getCustomerId());
Boolean isFirst = trace <= NumConstant.ZERO ? true : false;
if (StringUtils.isBlank(param.getDateId())) {
Date yesterday = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24);
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
param.setDateId(format.format(yesterday));
}
List<ProjectOrgPeriodResultDTO> extractData =
projectProcessService.getProjectPeriod(isFirst, param.getCustomerId(), param.getDateId());
List<FactOriginProjectOrgPeriodDailyEntity> formattingData = new LinkedList<>();
extractData.forEach(original -> {
FactOriginProjectOrgPeriodDailyEntity dest
= ConvertUtils.sourceToTarget(original,FactOriginProjectOrgPeriodDailyEntity.class);

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

@ -4,7 +4,7 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity;
import com.epmet.service.evaluationindex.extract.todata.ProjectPeriodExtractService;
@ -37,23 +37,23 @@ public class ProjectPeriodExtractServiceImpl implements ProjectPeriodExtractServ
private ProjectProcessService projectProcessService;
/**
* @Description 抽取项目节点历时逻辑
* @param param
* @return
* @Description 抽取项目节点历时逻辑
* @author wangc
* @date 2020.09.17 14:05
**/
@Override
public void extractProjectPeriodData(ExtractFormDTO param) {
public void extractProjectPeriodData(ExtractOriginFormDTO param) {
int trace = factOriginProjectOrgPeriodDailyDao.selectIfExisted(param.getCustomerId());
Boolean isFirst = trace <= NumConstant.ZERO ? true : false;
if(StringUtils.isBlank(param.getDateId())){
if (StringUtils.isBlank(param.getDateId())) {
Date yesterday = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24);
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
param.setDateId(format.format(yesterday));
}
List<ProjectOrgPeriodResultDTO> extractData =
projectProcessService.getProjectPeriod(isFirst,param.getCustomerId(),param.getDateId());
projectProcessService.getProjectPeriod(isFirst, param.getCustomerId(), param.getDateId());
List<FactOriginProjectOrgPeriodDailyEntity> formattingData = new LinkedList<>();
extractData.forEach(original -> {
FactOriginProjectOrgPeriodDailyEntity dest

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

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

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

@ -1,5 +1,7 @@
package com.epmet.service.evaluationindex.extract.toscreen;
import com.epmet.dto.extract.form.ExtractScreenFormDTO;
/**
* @desc: 大屏 公众参与抽取服务接口
* @Author: LiuJanJun
@ -17,7 +19,7 @@ public interface PublicPartExtractService {
* @author LiuJanJun
* @date 2020/9/25 10:24 上午
*/
Boolean extractTotalDataMonthly();
Boolean extractTotalDataMonthly(ExtractScreenFormDTO formDTO);
/**
* desc: 抽取公众参与 各类总数
@ -28,5 +30,5 @@ public interface PublicPartExtractService {
* @author LiuJanJun
* @date 2020/9/25 10:24 上午
*/
Boolean extractPerTotalDataDaily();
Boolean extractPerTotalDataDaily(ExtractScreenFormDTO formDTO);
}

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

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

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

@ -0,0 +1,29 @@
package com.epmet.service.evaluationindex.extract.toscreen;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
/**
* 基层治理
* 热心市民积分 党员能力值
* 难点赌点
* */
public interface ScreenGrassrootsGovernDataAbsorptionService {
/**
* @Description 用户积分党员分值数据中转站
* @param param
* @return
* @author wangc
* @date 2020.09.25 09:53
**/
void userScoreDataHub(ScreenCentralZoneDataFormDTO param);
/**
* @Description 难点赌点数据中转站
* @param param
* @return
* @author wangc
* @date 2020.09.25 10:00
**/
void difficultyDataHub(ScreenCentralZoneDataFormDTO param);
}

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

@ -1,15 +1,21 @@
package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyDao;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity;
import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService;
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.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
@ -21,6 +27,7 @@ import java.util.List;
* @dscription
* @date 2020/9/24 14:31
*/
@Service
public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractService {
@Autowired
private ScreenGovernRankDataService screenGovernRankDataService;
@ -28,37 +35,138 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
private FactIndexGovrnAblityOrgMonthlyService factIndexGovrnAblityOrgMonthlyService;
@Autowired
private FactIndexGovrnAblityGridMonthlyService factIndexGovrnAblityGridMonthlyService;
@Autowired
private FactOriginProjectLogDailyService factOriginProjectLogDailyService;
@Autowired
private FactOriginProjectMainDailyService factOriginProjectMainDailyService;
public static void main(String[] args) {
String monthId = "202006";
System.out.println(monthId.substring(0,4));
}
@Override
public void extractGridData(String customerId, String monthId) {
List<ScreenGovernRankDataEntity> list = screenGovernRankDataService.initList(customerId, OrgTypeConstant.GRID, null);
if (CollectionUtils.isEmpty(list)) {
return;
}
list.forEach(entity -> {
entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR));
entity.setMonthId(monthId);
});
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 响应率
//解决率
list.forEach(entity -> gridList.stream().filter(gridAbility -> entity.getOrgId().equals(gridAbility.getGridId())).forEach(grid -> {
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));
if(grid.getResolveProjectCount()!= NumConstant.ZERO) {
entity.setGovernRatio(selfCount.divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP));
}
//满意率
entity.setSatisfactionRatio(grid.getSatisfactionRatio());
}));
//响应率 响应次数/流转到网格的次数
List<OrgStatisticsResultDTO> responseList = factOriginProjectLogDailyService.getGridResponse(customerId, monthId);
list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getOrgId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
//解决率 已解决项目数/办结项目数
List<OrgStatisticsResultDTO> resolveList = factOriginProjectMainDailyService.getGridResolveProject(customerId, monthId);
list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getOrgId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResolvedRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.GRID, monthId, IndexCalConstant.DELETE_SIZE, list);
}
@Override
public void extractCommunityData(String customerId, String monthId) {
List<ScreenGovernRankDataEntity> list = screenGovernRankDataService.initList(customerId, OrgTypeConstant.AGENCY, OrgTypeConstant.COMMUNITY);
if (CollectionUtils.isEmpty(list)) {
return;
}
list.forEach(entity -> {
entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR));
entity.setMonthId(monthId);
});
List<FactIndexGovrnAblityOrgMonthlyEntity> orgList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId,
OrgTypeConstant.COMMUNITY);
list.forEach(entity -> orgList.stream().filter(orgAbility -> entity.getOrgId().equals(orgAbility.getAgencyId())).forEach(org -> {
//满意率
entity.setSatisfactionRatio(org.getSatisfactionRatio());
}));
//响应率 响应次数/流转到网格的次数
List<OrgStatisticsResultDTO> responseList = factOriginProjectLogDailyService.getOrgResponse(customerId, monthId, OrgTypeConstant.COMMUNITY);
list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
//自制率 自治项目数/办结项目数
List<OrgStatisticsResultDTO> selfList = factOriginProjectMainDailyService.getSelfProject(customerId, monthId, OrgTypeConstant.COMMUNITY);
list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setGovernRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
//解决率 已解决项目数/办结项目数
List<OrgStatisticsResultDTO> resolveList = factOriginProjectMainDailyService.getResolveProject(customerId, monthId,
OrgTypeConstant.COMMUNITY);
list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResolvedRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, monthId, IndexCalConstant.DELETE_SIZE, list);
}
@Override
public void extractStreetData(String customerId, String monthId) {
List<ScreenGovernRankDataEntity> list = screenGovernRankDataService.initList(customerId, OrgTypeConstant.AGENCY, OrgTypeConstant.STREET);
if (CollectionUtils.isEmpty(list)) {
return;
}
list.forEach(entity -> {
entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR));
entity.setMonthId(monthId);
});
List<FactIndexGovrnAblityOrgMonthlyEntity> orgList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId,
OrgTypeConstant.STREET);
list.forEach(entity -> orgList.stream().filter(orgAbility -> entity.getOrgId().equals(orgAbility.getAgencyId())).forEach(org -> {
//满意率
entity.setSatisfactionRatio(org.getSatisfactionRatio());
}));
//响应率 响应次数/流转到网格的次数
List<OrgStatisticsResultDTO> responseList = factOriginProjectLogDailyService.getOrgResponse(customerId, monthId, OrgTypeConstant.STREET);
list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
//自制率 自治项目数/办结项目数
List<OrgStatisticsResultDTO> selfList = factOriginProjectMainDailyService.getSelfProject(customerId, monthId, OrgTypeConstant.STREET);
list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setGovernRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
//解决率 已解决项目数/办结项目数
List<OrgStatisticsResultDTO> resolveList = factOriginProjectMainDailyService.getResolveProject(customerId, monthId,
OrgTypeConstant.STREET);
list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResolvedRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, monthId, IndexCalConstant.DELETE_SIZE, list);
}
}

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

@ -2,8 +2,10 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.ScreenConstant;
import com.epmet.dto.extract.form.PartyBaseInfoFormDTO;
import com.epmet.dto.extract.form.ScreenExtractFormDTO;
import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.result.*;
import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService;
@ -12,6 +14,9 @@ import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService;
import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService;
import com.epmet.service.evaluationindex.screen.ScreenPartyBranchDataService;
import com.epmet.service.evaluationindex.screen.ScreenPartyLinkMassesDataService;
import com.epmet.service.heart.ActInfoService;
import com.epmet.service.heart.ActUserRelationService;
import com.epmet.service.stats.DimCustomerService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.ListUtils;
import org.springframework.beans.BeanUtils;
@ -19,7 +24,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -43,16 +50,52 @@ public class PartyGuideServiceImpl implements PartyGuideService {
private ScreenCustomerAgencyService agencyService;
@Autowired
private ScreenCustomerGridService gridService;
@Autowired
private ActInfoService actInfoService;
@Autowired
private DimCustomerService dimCustomerService;
@Autowired
private ActUserRelationService actUserRelationService;
/**
* @Description 党建引领抽取
* @param customerId
* @param monthId
* @param screenExtractFormDTO
* @author zxc
* @date 2020/9/24 5:10 下午
*/
@Override
public Boolean partyGuideExtract(String customerId, String monthId) {
public Boolean partyGuideExtract(ScreenExtractFormDTO screenExtractFormDTO) {
int pageNo = NumConstant.ONE;
int pageSize = NumConstant.ONE_HUNDRED;
List<String> customerIds = new ArrayList<>();
String customerId = screenExtractFormDTO.getCustomerId();
if (!StringUtils.isEmpty(customerId)){
customerIds.add(customerId);
}else {
customerIds = dimCustomerService.selectCustomerIdPage(pageNo, pageSize);
}
String monthId = screenExtractFormDTO.getMonthId();
if (StringUtils.isEmpty(monthId)){
monthId = LocalDate.now().toString().replace("-","").substring(NumConstant.ZERO,NumConstant.SIX);
}
if (!CollectionUtils.isEmpty(customerIds)){
String finalMonthId = monthId;
customerIds.forEach(oneCustomerId -> {
partyGuideExtractParty(oneCustomerId, finalMonthId);
partyGuideExtractOrganize(oneCustomerId,finalMonthId);
});
}
return true;
}
/**
* @Description 党员建群数群成员数
* @Param customerId
* @Param monthId
* @author zxc
* @date 2020/9/25 4:26 下午
*/
public void partyGuideExtractParty(String customerId, String monthId){
//【党员建群数,群成员数】
List<CustomerAgencyInfoResultDTO> agencyIdList = agencyService.selectAllAgencyId(customerId);
if (!CollectionUtils.isEmpty(agencyIdList)){
@ -61,34 +104,74 @@ public class PartyGuideServiceImpl implements PartyGuideService {
if (groupByLevel.containsKey(ScreenConstant.COMMUNITY)){
// 社区级别
List<CustomerAgencyInfoResultDTO> customerGridInfoList = groupByLevel.get(ScreenConstant.COMMUNITY);
disPose(customerGridInfoList,true,customerId,monthId);
disPoseParty(customerGridInfoList,true,customerId,monthId);
}
if (groupByLevel.containsKey(ScreenConstant.STREET)){
// 街道级别
List<CustomerAgencyInfoResultDTO> customerGridInfoList = groupByLevel.get(ScreenConstant.STREET);
disPose(customerGridInfoList,false,customerId,monthId);
disPoseParty(customerGridInfoList,false,customerId,monthId);
}
if (groupByLevel.containsKey(ScreenConstant.DISTRICT)){
// 区级
List<CustomerAgencyInfoResultDTO> customerGridInfoList = groupByLevel.get(ScreenConstant.DISTRICT);
disPose(customerGridInfoList,false,customerId,monthId);
disPoseParty(customerGridInfoList,false,customerId,monthId);
}
if (groupByLevel.containsKey(ScreenConstant.CITY)){
// 市级
List<CustomerAgencyInfoResultDTO> customerGridInfoList = groupByLevel.get(ScreenConstant.CITY);
disPose(customerGridInfoList,false,customerId,monthId);
disPoseParty(customerGridInfoList,false,customerId,monthId);
}
if (groupByLevel.containsKey(ScreenConstant.PROVINCE)){
// 省级
List<CustomerAgencyInfoResultDTO> customerGridInfoList = groupByLevel.get(ScreenConstant.PROVINCE);
disPose(customerGridInfoList,false,customerId,monthId);
disPoseParty(customerGridInfoList,false,customerId,monthId);
}
}
}
/**
* @Description 参与人数组织次数
* @Param customerId
* @Param monthId
* @author zxc
* @date 2020/9/25 4:26 下午
*/
public void partyGuideExtractOrganize(String customerId, String monthId){
//【参与人数,组织次数】
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);
disPoseOrganize(customerGridInfoList,true,customerId,monthId);
}
if (groupByLevel.containsKey(ScreenConstant.STREET)){
// 街道级别
List<CustomerAgencyInfoResultDTO> customerGridInfoList = groupByLevel.get(ScreenConstant.STREET);
disPoseOrganize(customerGridInfoList,false,customerId,monthId);
}
if (groupByLevel.containsKey(ScreenConstant.DISTRICT)){
// 区级
List<CustomerAgencyInfoResultDTO> customerGridInfoList = groupByLevel.get(ScreenConstant.DISTRICT);
disPoseOrganize(customerGridInfoList,false,customerId,monthId);
}
if (groupByLevel.containsKey(ScreenConstant.CITY)){
// 市级
List<CustomerAgencyInfoResultDTO> customerGridInfoList = groupByLevel.get(ScreenConstant.CITY);
disPoseOrganize(customerGridInfoList,false,customerId,monthId);
}
if (groupByLevel.containsKey(ScreenConstant.PROVINCE)){
// 省级
List<CustomerAgencyInfoResultDTO> customerGridInfoList = groupByLevel.get(ScreenConstant.PROVINCE);
disPoseOrganize(customerGridInfoList,false,customerId,monthId);
}
}
return true;
}
/**
* @Description 处理
* @Description 处理党员建群数群成员数
* @Param agencyIdList
* @Param isGrid
* @Param customerId
@ -96,7 +179,7 @@ public class PartyGuideServiceImpl implements PartyGuideService {
* @author zxc
* @date 2020/9/25 2:57 下午
*/
public void disPose(List<CustomerAgencyInfoResultDTO> agencyIdList, Boolean isGrid, String customerId, String monthId) {
public void disPoseParty(List<CustomerAgencyInfoResultDTO> agencyIdList, Boolean isGrid, String customerId, String monthId) {
List<ScreenPartyLinkMassesDataFormDTO> result = new ArrayList<>();
if (!CollectionUtils.isEmpty(agencyIdList)){
List<String> orgIds = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList());
@ -109,7 +192,7 @@ public class PartyGuideServiceImpl implements PartyGuideService {
Map<String, List<ScreenPartyLinkMassesDataFormDTO>> groupByAgency = result.stream().collect(Collectors.groupingBy(ScreenPartyLinkMassesDataFormDTO::getParentId));
groupByAgency.forEach((agencyId,gridList) -> {
ScreenPartyLinkMassesDataFormDTO form = new ScreenPartyLinkMassesDataFormDTO();
List<OrgNameResultDTO> orgNameAgencyList = agencyService.selectOrgNameAgency(result.stream().map(m -> m.getParentId()).distinct().collect(Collectors.toList()));
List<OrgNameResultDTO> orgNameAgencyList = agencyService.selectOrgNameAgency(orgIds);
if (!CollectionUtils.isEmpty(orgNameAgencyList)){
orgNameAgencyList.forEach(name -> {
if (agencyId.equals(name.getAgencyId())){
@ -177,6 +260,115 @@ public class PartyGuideServiceImpl implements PartyGuideService {
}
}
/**
* @Description 处理参与人数组织次数
* @Param agencyIdList
* @Param isGrid
* @Param customerId
* @Param monthId
* @author zxc
* @date 2020/9/25 4:28 下午
*/
public void disPoseOrganize(List<CustomerAgencyInfoResultDTO> agencyIdList, Boolean isGrid, String customerId, String monthId){
if (!CollectionUtils.isEmpty(agencyIdList)){
List<ScreenPartyBranchDataFormDTO> result = new ArrayList<>();
List<String> orgIds = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList());
if (isGrid == true){
List<JoinUserCountResultDTO> joinUserCountList = actUserRelationService.selectJoinUserCount(customerId, monthId);
agencyIdList.forEach(agency -> {
String agencyId = agency.getAgencyId();
Map<String, Object> agencyMap = agencyService.selectAllSubAgencyId(agencyId, customerId);
List<String> gridIds = (List<String>) agencyMap.get(agencyId);
orgIds.addAll(gridIds);
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataList = actInfoService.selectActInfo(customerId, monthId, ScreenConstant.GRID, gridIds);
if (!CollectionUtils.isEmpty(screenPartyBranchDataList)){
screenPartyBranchDataList.forEach(party -> {
joinUserCountList.forEach(join -> {
if (party.getOrgId().equals(join.getOrgId())){
party.setAverageJoinUserCount(join.getJoinUserCount());
party.setAverageJoinUserCount(party.getJoinUserCount() / party.getOrganizeCount());
party.setYearId(DateUtils.getYearId(monthId));
}
});
});
}
result.addAll(screenPartyBranchDataList);
});
// 社区级别的
Map<String, List<ScreenPartyBranchDataFormDTO>> groupByAgency = result.stream().collect(Collectors.groupingBy(ScreenPartyBranchDataFormDTO::getParentId));
List<OrgNameResultDTO> orgNameAgencyList = agencyService.selectOrgNameAgency(orgIds);
groupByAgency.forEach((agencyId,actList) -> {
ScreenPartyBranchDataFormDTO form = new ScreenPartyBranchDataFormDTO();
if (!CollectionUtils.isEmpty(orgNameAgencyList)){
orgNameAgencyList.forEach(name -> {
if (agencyId.equals(name.getAgencyId())){
form.setOrgName(name.getAgencyName());
form.setParentId(name.getParentId());
}
});
}
form.setOrgId(agencyId);
form.setCustomerId(customerId);
form.setOrgType(ScreenConstant.AGENCY);
form.setMonthId(monthId);
form.setYearId(DateUtils.getYearId(monthId));
form.setOrganizeCount(actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount)));
form.setJoinUserCount(actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount)));
form.setAverageJoinUserCount(form.getJoinUserCount() / form.getOrganizeCount());
result.add(form);
});
delAndInsertOrganize(result,customerId,monthId,orgIds);
}else {
List<GridInfoResultDTO> directGridIds = gridService.selectDirectGrid(orgIds);
agencyIdList.forEach(agency -> {
String agencyId = agency.getAgencyId();
List<String> disGridIds = new ArrayList<>();
directGridIds.forEach(grid -> {
if (agencyId.equals(grid.getAgencyId())){
disGridIds.add(grid.getGridId());
}
});
// 存在直属网格
if (!CollectionUtils.isEmpty(disGridIds)){
List<ScreenPartyBranchDataFormDTO> gridResult = new ArrayList<>();
List<JoinUserCountResultDTO> joinUserCountList = actUserRelationService.selectJoinUserCount(customerId, monthId);
List<OrgNameResultDTO> orgNameList = agencyService.selectOrgNameGrid(disGridIds);
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataList = actInfoService.selectActInfo(customerId, monthId, ScreenConstant.GRID, disGridIds);
if (!CollectionUtils.isEmpty(screenPartyBranchDataList)){
screenPartyBranchDataList.forEach(party -> {
orgNameList.forEach(org -> {
if (party.getOrgId().equals(org.getGridId())){
party.setOrgName(org.getGridName());
}
});
ScreenPartyBranchDataFormDTO copyParty = ConvertUtils.sourceToTarget(party, ScreenPartyBranchDataFormDTO.class);
gridResult.add(copyParty);
});
}
}
List<ScreenPartyBranchDataFormDTO> disPartyBranchDataList = partyBranchDataService.selectScreenPartyBranchDataByOrgId(customerId, monthId, disGridIds);
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataList = partyBranchDataService.selectScreenPartyBranchDataByParentId(customerId, monthId, agencyId);
screenPartyBranchDataList.addAll(disPartyBranchDataList);
if (!CollectionUtils.isEmpty(screenPartyBranchDataList)){
ScreenPartyBranchDataFormDTO form = new ScreenPartyBranchDataFormDTO();
form.setOrgId(agencyId);
form.setOrgType(ScreenConstant.AGENCY);
form.setOrgName(screenPartyBranchDataList.get(NumConstant.ZERO).getOrgName());
form.setCustomerId(customerId);
form.setMonthId(monthId);
form.setYearId(DateUtils.getYearId(monthId));
form.setParentId(screenPartyBranchDataList.get(NumConstant.ZERO).getParentId());
form.setJoinUserCount(screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount)));
form.setOrganizeCount(screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount)));
form.setAverageJoinUserCount(form.getJoinUserCount() / form.getOrganizeCount());
result.add(form);
}
});
delAndInsertOrganize(result,customerId,monthId,orgIds);
}
}
}
/**
* @Description 社区级别的处理
* @Param customerId
@ -237,7 +429,7 @@ public class PartyGuideServiceImpl implements PartyGuideService {
}
Integer delNum;
do {
delNum = linkMassesDataService.deleteOldPartyLinkInfo(customerId, monthId, orgIds);
delNum = linkMassesDataService.deleteOldPartyLinkInfo(customerId, orgIds);
}while (delNum > NumConstant.ZERO);
List<List<ScreenPartyLinkMassesDataFormDTO>> partition = ListUtils.partition(finalResult, NumConstant.ONE_HUNDRED);
partition.forEach(p -> {
@ -245,9 +437,45 @@ public class PartyGuideServiceImpl implements PartyGuideService {
});
}
/**
* @Description
* @Param result
* @Param customerId
* @Param monthId
* @Param orgIds
* @author zxc
* @date 2020/9/25 5:50 下午
*/
@Transactional(rollbackFor = Exception.class)
public void delAndInsertOrganize(List<ScreenPartyBranchDataFormDTO> result,String customerId, String monthId, List<String> orgIds){
List<ScreenPartyBranchDataFormDTO> screenPartyBranchData = agencyService.selectAllAgencyIdToOrganize(customerId, monthId);
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataList = gridService.selectAllGridIdToOrganize(customerId, monthId);
screenPartyBranchDataList.addAll(screenPartyBranchData);
List<ScreenPartyBranchDataFormDTO> finalResult = new ArrayList<>();
screenPartyBranchDataList.forEach(rl -> {
orgIds.forEach(orgId -> {
if (rl.getOrgId().equals(orgId)){
finalResult.add(rl);
}
});
});
if (!CollectionUtils.isEmpty(result)){
finalResult.forEach(fr -> {
result.forEach(r -> {
if (fr.getOrgId().equals(r.getOrgId())){
BeanUtils.copyProperties(r,fr);
}
});
});
}
Integer delNum;
do {
delNum = partyBranchDataService.deleteOldScreenPartyBranchData(customerId, monthId, orgIds);
}while (delNum > NumConstant.ZERO);
List<List<ScreenPartyBranchDataFormDTO>> partition = ListUtils.partition(finalResult, NumConstant.ONE_HUNDRED);
partition.forEach(p -> {
partyBranchDataService.insertScreenPartyBranchData(p);
});
}
// TODO 党员志愿服务【参与人数,组织次数】
}

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

@ -4,11 +4,13 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService;
import com.epmet.service.evaluationindex.extract.toscreen.PioneerDataExtractService;
import com.epmet.service.evaluationindex.screen.ScreenPioneerDataService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
@ -24,6 +26,7 @@ import java.util.List;
* @author yinzuomei@elink-cn.com
* @date 2020/9/22 11:25
*/
@Slf4j
@Service
public class PioneerDataExtractServiceImpl implements PioneerDataExtractService {
@ -35,6 +38,9 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
private FactOriginIssueMainDailyService factOriginIssueMainDailyService;
@Autowired
private FactOriginProjectMainDailyService factOriginProjectMainDailyService;
@Autowired
private FactOriginIssueLogDailyService factOriginIssueLogDailyService;
/**
* @param customerId
@ -54,11 +60,15 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
gridList.forEach(entity -> {
entity.setDataEndTime(dateId);
String gridId = entity.getOrgId();
//1、党员参与议事 todo
entity.setIssueTotal(NumConstant.ZERO);
//2、党员参与议事占比 todo
entity.setIssueRatio(BigDecimal.ZERO);
//1、党员参与议事
entity.setIssueTotal(calPartyPartiIssueTotal(customerId,gridId,null,null,NumConstant.ONE_STR));
if(entity.getIssueTotal()==0){
entity.setIssueRatio(BigDecimal.ZERO);
}else{
//2、党员参与议事占比
int issueTotal=calPartyPartiIssueTotal(customerId,gridId,null,null,null);
entity.setIssueRatio(new BigDecimal(entity.getIssueTotal()/issueTotal).setScale(NumConstant.SIX,RoundingMode.HALF_UP));
}
//3、党员发布话题:
entity.setTopicTotal(getTopicTotal(customerId, gridId, null));
@ -86,6 +96,12 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
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));
}else{
// log.info("当前网格内所有议题总数="+gridIssueTotal);
entity.setPublishIssueTotal(NumConstant.ZERO);
entity.setPublishIssueRatio(BigDecimal.ZERO);
entity.setShiftProjectTotal(NumConstant.ZERO);
entity.setShiftProjectRatio(BigDecimal.ZERO);
}
@ -102,6 +118,25 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
screenPioneerDataService.delAndSavePioneerData(customerId, "grid", IndexCalConstant.DELETE_SIZE, gridList);
}
/**
* @return int
* @param customerId
* @param gridId 网格id
* @param communityId 社区的id
* @param agencyPath 组织的pids包含自己
* @param isParty 1党员
* @author yinzuomei
* @description
* @Date 2020/9/26 17:41
**/
private int calPartyPartiIssueTotal(String customerId,
String gridId,
String communityId,
String agencyPath,
String isParty) {
return factOriginIssueLogDailyService.calPartyPartiIssueTotal(customerId,gridId,communityId,agencyPath,isParty);
}
@Override
public void extractCommunityPioneerData(String customerId, String dateId) {
//查询客户下所有的社区,初始数据值为0
@ -112,11 +147,15 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
communityList.forEach(entity -> {
entity.setDataEndTime(dateId);
String communityId = entity.getOrgId();
//1、党员参与议事 todo
entity.setIssueTotal(NumConstant.ZERO);
//2、党员参与议事占比 todo
entity.setIssueRatio(BigDecimal.ZERO);
//1、党员参与议事
entity.setIssueTotal(calPartyPartiIssueTotal(customerId,null,communityId,null,NumConstant.ONE_STR));
if(entity.getIssueTotal()==0){
entity.setIssueRatio(BigDecimal.ZERO);
}else{
//2、党员参与议事占比
int issueTotal=calPartyPartiIssueTotal(customerId,null,communityId,null,null);
entity.setIssueRatio(new BigDecimal(entity.getIssueTotal()/issueTotal).setScale(NumConstant.SIX,RoundingMode.HALF_UP));
}
//3、党员发布话题:
entity.setTopicTotal(getTopicTotal(customerId, null, communityId));
@ -144,6 +183,12 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
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));
}else{
// log.info("当前社区内所有议题总数="+communityIssueTotal);
entity.setPublishIssueTotal(NumConstant.ZERO);
entity.setPublishIssueRatio(BigDecimal.ZERO);
entity.setShiftProjectTotal(NumConstant.ZERO);
entity.setShiftProjectRatio(BigDecimal.ZERO);
}
@ -170,17 +215,20 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
}
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()));
}
//1、党员参与议事
entity.setIssueTotal(calPartyPartiIssueTotal(customerId,null,null,entity.getAgencyPath(),NumConstant.ONE_STR));
if(entity.getIssueTotal()==0){
entity.setIssueRatio(BigDecimal.ZERO);
}else{
//2、党员参与议事占比
int issueTotal=calPartyPartiIssueTotal(customerId,null,null,entity.getAgencyPath(),null);
entity.setIssueRatio(new BigDecimal(entity.getIssueTotal()/issueTotal).setScale(NumConstant.SIX,RoundingMode.HALF_UP));
}
//3、党员发布话题:
entity.setTopicTotal(getAgencyTopicTotal(customerId, entity.getAgencyPath(),NumConstant.ONE_STR));
@ -208,6 +256,12 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
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));
}else{
// log.info("当前组织内所有议题总数="+agencyIssueTotal);
entity.setPublishIssueTotal(NumConstant.ZERO);
entity.setPublishIssueRatio(BigDecimal.ZERO);
entity.setShiftProjectTotal(NumConstant.ZERO);
entity.setShiftProjectRatio(BigDecimal.ZERO);
}

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

@ -1,11 +1,34 @@
package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.dto.extract.form.ExtractScreenFormDTO;
import com.epmet.dto.extract.result.GridUserCountResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity;
import com.epmet.entity.stats.DimAgencyEntity;
import com.epmet.entity.stats.DimGridEntity;
import com.epmet.entity.stats.FactIssueGridMonthlyEntity;
import com.epmet.service.evaluationindex.extract.toscreen.PublicPartExtractService;
import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService;
import com.epmet.service.evaluationindex.screen.ScreenPublicPartiTotalDataService;
import com.epmet.service.stats.DimAgencyService;
import com.epmet.service.stats.DimGridService;
import com.epmet.service.stats.FactIssueGridMonthlyService;
import com.epmet.service.stats.user.FactRegUserGridMonthlyService;
import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* desc:公众参与抽取到大屏的接口实现类
@ -14,33 +37,129 @@ import org.springframework.stereotype.Service;
* @date: 2020/9/25 10:46 上午
* @version: 1.0
*/
@Slf4j
@Service
public class PublicPartExtractServiceImpl implements PublicPartExtractService {
@Autowired
private ScreenPublicPartiTotalDataService screenPublicPartiTotalDataService;
private DimAgencyService dimAgencyService;
@Autowired
private FactOriginProjectMainDailyService factOriginProjectMainDailyService;
private DimGridService dimGridService;
@Autowired
private ScreenCustomerAgencyService agencyService;
private FactIssueGridMonthlyService factIssueGridMonthlyService;
@Autowired
private FactRegUserGridMonthlyService factRegUserGridMonthlyService;
/**
* desc: 抽取公众参与 人均议题 总次数和平均参与度
* targetscreen_user_join
* 总参与统计周期内议题表决(虽然可以评价 但是只有表决的人可以评价 所以按表决人数算)的人数
* 百人人均议题统计周期内总的议题数/注册用户数/100
* 百人平均参与度每个议题的实际参与数/应参与数 的平均值每个议题的实际参与数/应参与数的和/被表决的议题数
* 不考虑市北人均议题统计周期内议题总数/发过议题的人数 参与度各个行为(表决)的总数/发生行为的人数
*
* @return java.lang.Boolean
* @author LiuJanJun
* @date 2020/9/25 10:24 上午
*/
@Override
public Boolean extractTotalDataMonthly() {
//agencyService.initAgencies();
public Boolean extractTotalDataMonthly(ExtractScreenFormDTO formDTO) {
if (StringUtils.isBlank(formDTO.getCustomerId()) || StringUtils.isBlank(formDTO.getMonthId())) {
log.warn("extractTotalDataMonthly param is error,param:{}", JSON.toJSONString(formDTO));
return false;
}
extractGridUserJoin(formDTO);
extractAgencyUserJoin(formDTO);
return null;
}
private void extractGridUserJoin(ExtractScreenFormDTO formDTO) {
List<DimGridEntity> orgList = dimGridService.getGridListByCustomerId(formDTO.getCustomerId());
if (CollectionUtils.isEmpty(orgList)) {
log.warn("抽取【公众参与-人均议题】,获取组织数据失败");
throw new RenException("抽取【公众参与-人均议题】,获取组织数据失败");
}
//构建组织数据
Map<String, ScreenUserJoinEntity> insertMap = new HashMap<>();
orgList.forEach(org -> buildUserJoinEntity(formDTO, org, insertMap));
//获取议题月份增量
List<FactIssueGridMonthlyEntity> issueTotal = factIssueGridMonthlyService.getIssueCount(formDTO.getCustomerId(), formDTO.getMonthId());
if (CollectionUtils.isEmpty(issueTotal)) {
log.error("抽取【公众参与-人均议题】,获取议题增量为空");
return;
}
List<GridUserCountResultDTO> userCountList = factRegUserGridMonthlyService.selectGridUserCount(formDTO.getCustomerId(), formDTO.getMonthId());
if (CollectionUtils.isEmpty(issueTotal)) {
log.error("抽取【公众参与-人均议题】,获取注册用户数为空");
return;
}
Map<String, GridUserCountResultDTO> userCountMap = userCountList.stream().collect(Collectors.toMap(GridUserCountResultDTO::getGridId, o -> o));
issueTotal.forEach(issue -> {
String gridId = issue.getGridId();
ScreenUserJoinEntity entity = insertMap.get(gridId);
entity.setJoinTotal(issue.getIssueIncr());
GridUserCountResultDTO user = userCountMap.get(gridId);
//百人人均议题:统计周期内总的议题数/(注册用户数/100)
BigDecimal avgIssueCount = new BigDecimal(issue.getIssueIncr()).divide(new BigDecimal(user.getUserCount()).divide(new BigDecimal(NumConstant.ONE_HUNDRED)));
// 需要修改字段类型
entity.setAvgIssue(avgIssueCount);
//百人平均参与度:每个议题的实际参与数/应参与数 的平均值:(每个议题的实际参与数/应参与数)的和)/被表决的议题数
entity.setAvgJoin(new BigDecimal(0));
});
}
private void extractAgencyUserJoin(ExtractScreenFormDTO formDTO) {
List<DimAgencyEntity> orgList = dimAgencyService.getAgencyListByCustomerId(formDTO.getCustomerId());
if (CollectionUtils.isEmpty(orgList)) {
log.warn("抽取【公众参与-人均议题】,获取组织数据失败");
throw new RenException("抽取【公众参与-人均议题】,获取组织数据失败");
}
//构建组织数据
Map<String, ScreenUserJoinEntity> insertMap = new HashMap<>();
orgList.forEach(org -> {
buildUserJoinEntity(formDTO, org, insertMap);
});
List<FactIssueGridMonthlyEntity> issueTotal = factIssueGridMonthlyService.getIssueCount(formDTO.getCustomerId(), formDTO.getMonthId());
}
private void buildUserJoinEntity(ExtractScreenFormDTO formDTO, Object org, Map<String, ScreenUserJoinEntity> result) {
DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(DateUtils.stringToDate(formDTO.getMonthId(), DateUtils.DATE_PATTERN_YYYYMMDD));
ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(dimIdBean, ScreenUserJoinEntity.class);
if (org instanceof DimGridEntity) {
DimGridEntity grid = (DimGridEntity) org;
entity.setCustomerId(grid.getCustomerId());
entity.setOrgType(OrgTypeConstant.GRID);
entity.setOrgId(grid.getId());
entity.setParentId(grid.getAgencyId());
entity.setOrgName(grid.getGridName());
} else if (org instanceof DimAgencyEntity) {
DimAgencyEntity agency = (DimAgencyEntity) org;
entity.setCustomerId(agency.getCustomerId());
entity.setOrgType(agency.getLevel());
entity.setOrgId(agency.getId());
entity.setParentId(agency.getPid());
entity.setOrgName(agency.getAgencyName());
}
entity.setJoinTotal(0);
entity.setJoinTotalUpRate(new BigDecimal("0"));
entity.setJoinTotalUpFlag("");
entity.setAvgIssue(new BigDecimal(0));
entity.setAvgIssueUpRate(new BigDecimal("0"));
entity.setAvgIssueUpFlag("");
entity.setAvgJoin(new BigDecimal(0));
entity.setAgvgJoinUpRate(new BigDecimal("0"));
entity.setAgvgJoinUpFlag("");
result.put(entity.getOrgId(), entity);
}
/**
* desc: 抽取公众参与 各类总数
* desc: 抽取公众参与 各类总数 累计值
* targetscreen_public_parti_total_data
*
* @return java.lang.Boolean
@ -48,7 +167,7 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService {
* @date 2020/9/25 10:24 上午
*/
@Override
public Boolean extractPerTotalDataDaily() {
public Boolean extractPerTotalDataDaily(ExtractScreenFormDTO formDTO) {
return null;
}
}

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

@ -2,7 +2,7 @@ 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.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.service.evaluationindex.extract.toscreen.PartyBaseInfoService;
import com.epmet.service.evaluationindex.extract.toscreen.PioneerDataExtractService;
import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractService;
@ -33,33 +33,33 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
private PioneerDataExtractService pioneerDataExtractService;
/**
* @Description 抽取数据到大屏
* @param extractFormDTO
* @param extractOriginFormDTO
* @Description 抽取数据到大屏
* @author zxc
* @date 2020/9/24 10:15 上午
*/
@Override
public void extractDailyAll(ExtractFormDTO extractFormDTO) {
public void extractDailyAll(ExtractOriginFormDTO extractOriginFormDTO) {
List<String> customerIds = new ArrayList<>();
if (StringUtils.isNotBlank(extractFormDTO.getCustomerId())){
customerIds.add(extractFormDTO.getCustomerId());
}else {
if (StringUtils.isNotBlank(extractOriginFormDTO.getCustomerId())) {
customerIds.add(extractOriginFormDTO.getCustomerId());
} else {
int pageNo = NumConstant.ONE;
int pageSize = NumConstant.ONE_HUNDRED;
customerIds = dimCustomerService.selectCustomerIdPage(pageNo, pageSize);
}
if (!CollectionUtils.isEmpty(customerIds)){
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());
if (StringUtils.isNotBlank(extractOriginFormDTO.getStartDate()) && StringUtils.isNotBlank(extractOriginFormDTO.getEndDate())) {
List<String> daysBetween = DateUtils.getDaysBetween(extractOriginFormDTO.getStartDate(), extractOriginFormDTO.getEndDate());
daysBetween.forEach(dateId -> {
extractDaily(customerId,dateId);
extractDaily(customerId, dateId);
});
}else if (StringUtils.isNotBlank(extractFormDTO.getDateId())){
extractDaily(customerId,extractFormDTO.getDateId());
}else {
} else if (StringUtils.isNotBlank(extractOriginFormDTO.getDateId())) {
extractDaily(customerId, extractOriginFormDTO.getDateId());
} else {
String dateId = LocalDate.now().minusDays(NumConstant.ONE).toString().replace("-", "");
extractDaily(customerId,dateId);
extractDaily(customerId, dateId);
}
});
}
@ -74,7 +74,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
* @date 2020/9/24 10:16 上午
*/
public void extractDaily(String customerId,String dateId){
partyBaseInfoService.statsPartyMemberBaseInfoToScreen(customerId,dateId);
// partyBaseInfoService.statsPartyMemberBaseInfoToScreen(customerId,dateId);
pioneerDataExtractService.extractGridPioneerData(customerId,dateId);
pioneerDataExtractService.extractCommunityPioneerData(customerId,dateId);
pioneerDataExtractService.extractExceptCommunityPioneerData(customerId,dateId);

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

@ -0,0 +1,119 @@
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.org.GridInfoDTO;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity;
import com.epmet.service.evaluationindex.extract.toscreen.ScreenGrassrootsGovernDataAbsorptionService;
import com.epmet.service.evaluationindex.indexcal.CpcIndexCalculateService;
import com.epmet.service.evaluationindex.screen.ScreenPartyUserRankDataService;
import com.epmet.service.org.CustomerGridService;
import com.epmet.service.point.UserPointService;
import com.epmet.service.user.UserService;
import lombok.extern.slf4j.Slf4j;
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.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Description 基层治理数据
* @ClassName ScreenGrassrootsGovernDataAbsorptionServiceImpl
* @Auth wangc
* @Date 2020-09-25 09:48
*/
@Service
@Slf4j
public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGrassrootsGovernDataAbsorptionService {
@Autowired
private UserService userService;
@Autowired
private CustomerGridService customerGridService;
@Autowired
private UserPointService userPointService;
@Autowired
private CpcIndexCalculateService cpcIndexCalculateService;
@Autowired
private ScreenPartyUserRankDataService screenPartyUserRankDataService;
/**
* @Description 用户积分党员分值数据中转站
* @param param
* @return
* @author wangc
* @date 2020.09.25 09:53
**/
@Override
public void userScoreDataHub(ScreenCentralZoneDataFormDTO param) {
//1.查询出客户下的网格注册用户
List<ScreenPartyUserRankDataEntity> registeredUsers = userService.getRegisteredUserList(param.getCustomerId());
//2.查询出客户下网格的相关信息
List<GridInfoDTO> gridList = customerGridService.queryGridInfoList(param.getCustomerId());
Map<String,GridInfoDTO> gridMap = new HashMap<>();
gridList.forEach(grid -> {gridMap.put(grid.getGridId(),grid);});
//3.查询出客户下用户的累计积分(累计值,没有时间概念,否则需要查询积分明细计算出评价周期末的得分)
Map<String,Integer> pointMap = userPointService.getUserPointMap(param.getCustomerId());
//4.查询出客户下党员的分值
String dateId = param.getDateId();
if(StringUtils.isEmpty(dateId)){
//如果没有传月份,则使用当前时间的上一个月
dateId = DateUtils.getBeforeNMonth(NumConstant.ONE);
}else{
String dateType = DateUtils.identifyTimeDimension(dateId);
if(StringUtils.isEmpty(dateType) || !org.apache.commons.lang3.StringUtils.equalsAny(dateType,"date","month")){
dateId = DateUtils.getBeforeNMonth(NumConstant.ONE);
}else if(org.apache.commons.lang3.StringUtils.equals(dateType,"date")){
dateId = dateId.substring(NumConstant.ZERO,dateId.length() - NumConstant.TWO);
}
}
final String finalDateId = dateId;
Map<String, BigDecimal> scoreMap = cpcIndexCalculateService.getCpcScore(param.getCustomerId(),dateId);
//5.整合数据
if(!CollectionUtils.isEmpty(registeredUsers)){
registeredUsers.forEach(user -> {
GridInfoDTO gridInfo = gridMap.get(user.getGridId());
if(null != gridInfo){
user.setGridName(gridInfo.getGridName());
user.setOrgId(gridInfo.getAgencyId());
user.setOrgName(gridInfo.getOrgName());
user.setAllParentIds(gridInfo.getPids());
}
Integer point = pointMap.get(user.getUserId());
BigDecimal score = scoreMap.get(user.getUserId());
user.setPointTotal(null == point ? NumConstant.ZERO : point);
user.setIndexScore(null == score ? new BigDecimal(NumConstant.ZERO) : score);
user.setDataEndTime(finalDateId);
});
}
//6.存入数据库
screenPartyUserRankDataService.dataClean(registeredUsers,param.getCustomerId(),dateId);
}
/**
* @Description 难点赌点数据中转站
* @param param
* @return
* @author wangc
* @date 2020.09.25 10:00
**/
@Override
public void difficultyDataHub(ScreenCentralZoneDataFormDTO param) {
}
}

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

@ -2,6 +2,9 @@ package com.epmet.service.evaluationindex.indexcal;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import java.math.BigDecimal;
import java.util.Map;
/**
* 党员指标计算service
*
@ -15,4 +18,14 @@ public interface CpcIndexCalculateService {
* @return
*/
Boolean cpcIndexCalculate(CalculateCommonFormDTO formDTO);
/**
* @Description 获取党员指标得分
* @param customerId
* @param monthId
* @return
* @author wangc
* @date 2020.09.25 16:48
**/
Map<String, BigDecimal> getCpcScore(String customerId, String monthId);
}

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

@ -12,6 +12,7 @@ import com.epmet.dao.evaluationindex.indexcal.CpcScoreDao;
import com.epmet.dao.evaluationindex.indexcal.CpcSubScoreDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyDao;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.indexcal.CpcScoreResultDTO;
import com.epmet.entity.evaluationindex.indexcal.CpcScoreEntity;
import com.epmet.entity.evaluationindex.indexcal.CpcSubScoreEntity;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity;
@ -66,6 +67,24 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
return true;
}
/**
* @Description 获取党员指标得分
* @param customerId
* @param monthId
* @return
* @author wangc
* @date 2020.09.25 16:48
**/
@Override
public Map<String, BigDecimal> getCpcScore(String customerId, String monthId) {
List<CpcScoreResultDTO> scores = cpcScoreDao.selectCpcScore(customerId,monthId);
Map<String,BigDecimal> map = new HashMap<>();
if(!CollectionUtils.isEmpty(scores)){
scores.forEach(score -> {map.put(score.getUserId(),score.getScore());});
}
return map;
}
/**
* desc: 计算总分
*

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

@ -49,4 +49,15 @@ public interface FactIndexGovrnAblityOrgMonthlyService extends BaseService<FactI
* @return void
*/
void saveList(List<FactIndexGovrnAblityOrgMonthlyEntity> list);
/**
* 根据客户查询组织治理能力
* @author zhaoqifeng
* @date 2020/9/25 13:56
* @param customerId
* @param monthId
* @param type
* @return java.util.List<com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity>
*/
List<FactIndexGovrnAblityOrgMonthlyEntity> getOrgByCustomer(String customerId, String monthId, String type);
}

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

@ -1,9 +1,12 @@
package com.epmet.service.evaluationindex.indexcoll.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyService;
import org.springframework.stereotype.Service;
import java.util.List;
@ -12,6 +15,8 @@ import java.util.List;
* @dscription
* @date 2020/9/24 14:36
*/
@Service
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class FactIndexGovrnAblityGridMonthlyServiceImpl extends BaseServiceImpl<FactIndexGovrnAblityGridMonthlyDao, FactIndexGovrnAblityGridMonthlyEntity> implements FactIndexGovrnAblityGridMonthlyService {
@Override
public List<FactIndexGovrnAblityGridMonthlyEntity> getGridByCustomer(String customerId, String monthId) {

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

@ -46,4 +46,9 @@ public class FactIndexGovrnAblityOrgMonthlyServiceImpl extends BaseServiceImpl<F
public void saveList(List<FactIndexGovrnAblityOrgMonthlyEntity> list) {
insertBatch(list);
}
@Override
public List<FactIndexGovrnAblityOrgMonthlyEntity> getOrgByCustomer(String customerId, String monthId, String type) {
return baseDao.selectOrgByCustomer(customerId, monthId, type);
}
}

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

@ -18,6 +18,7 @@
package com.epmet.service.evaluationindex.screen;
import com.epmet.dto.extract.form.PartyBaseInfoFormDTO;
import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO;
@ -86,7 +87,9 @@ public interface ScreenCustomerAgencyService{
* @author zxc
* @date 2020/9/25 10:39 上午
*/
List<ScreenPartyLinkMassesDataFormDTO> selectAllAgencyIdToPartyLinkMessage(String customerId, String dateId);
List<ScreenPartyLinkMassesDataFormDTO> selectAllAgencyIdToPartyLinkMessage(String customerId, String monthId);
List<ScreenPartyBranchDataFormDTO> selectAllAgencyIdToOrganize(String customerId, String monthId);
/**
* @Description 查询org名称网格

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

@ -19,10 +19,7 @@ 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.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.form.*;
import com.epmet.dto.extract.result.GridInfoResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity;
import com.epmet.entity.org.CustomerGridEntity;
@ -59,6 +56,7 @@ public interface ScreenCustomerGridService extends BaseService<ScreenCustomerGri
* @date 2020/9/25 10:43 上午
*/
List<ScreenPartyLinkMassesDataFormDTO> selectAllGridIdToPartyLinkMessage(String customerId, String monthId);
List<ScreenPartyBranchDataFormDTO> selectAllGridIdToOrganize(String customerId, String monthId);
/**
* @Description 查询机关的直属网格

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

@ -32,12 +32,27 @@ import java.util.List;
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>
* @author zhaoqifeng
* @date 2020/9/24 14:41
*/
List<ScreenGovernRankDataEntity> initList(String customerId, String orgType, String agencyLevel);
/**
* 保存抽取结果
*
* @param customerId
* @param orgType
* @param monthId
* @param deleteSize
* @param entityList
* @return void
* @author zhaoqifeng
* @date 2020/9/25 10:32
*/
void delAndSaveRankData(String customerId, String orgType, String monthId, Integer deleteSize, List<ScreenGovernRankDataEntity> entityList);
}

30
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyBranchDataService.java

@ -39,4 +39,34 @@ public interface ScreenPartyBranchDataService extends BaseService<ScreenPartyBra
*/
void insertScreenPartyBranchData(List<ScreenPartyBranchDataFormDTO> lists);
/**
* @Description 删除旧的建设情况数据
* @Param customerId
* @Param monthId
* @Param orgIds
* @author zxc
* @date 2020/9/27 9:04 上午
*/
Integer deleteOldScreenPartyBranchData(String customerId, String monthId, List<String> orgIds);
/**
* @Description 根据orgId查询建设情况数据
* @Param customerId
* @Param monthId
* @Param orgIds
* @author zxc
* @date 2020/9/27 9:38 上午
*/
List<ScreenPartyBranchDataFormDTO> selectScreenPartyBranchDataByOrgId(String customerId, String monthId, List<String> orgIds);
/**
* @Description 根据parentId查询建设情况数据
* @Param customerId
* @Param monthId
* @Param parentId
* @author zxc
* @date 2020/9/27 9:38 上午
*/
List<ScreenPartyBranchDataFormDTO> selectScreenPartyBranchDataByParentId(String customerId, String monthId, String parentId);
}

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyLinkMassesDataService.java

@ -42,12 +42,11 @@ public interface ScreenPartyLinkMassesDataService extends BaseService<ScreenPart
/**
* @Description 删除旧的党员联系群众
* @param customerId
* @param monthId
* @param orgIds
* @author zxc
* @date 2020/9/22 3:28 下午
*/
Integer deleteOldPartyLinkInfo(String customerId, String monthId, List<String> orgIds);
Integer deleteOldPartyLinkInfo(String customerId, List<String> orgIds);
/**
* @Description 查询党员联系群众信息

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

@ -20,6 +20,8 @@ package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity;
import java.util.List;
/**
* 党建引领基层治理-市民党员积分排行榜
*
@ -28,4 +30,15 @@ import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity;
*/
public interface ScreenPartyUserRankDataService extends BaseService<ScreenPartyUserRankDataEntity> {
/**
* @Description 用户参与排行数据清洗
* @param dataList
* @param customerId
* @return
* @author wangc
* @date 2020.09.27 09:44
**/
void dataClean(List<ScreenPartyUserRankDataEntity> dataList,String customerId,String dateId);
}

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

@ -26,6 +26,7 @@ import com.epmet.constant.ScreenConstant;
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.form.ScreenPartyBranchDataFormDTO;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO;
import com.epmet.dto.extract.result.OrgNameResultDTO;
@ -172,6 +173,11 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ
return screenCustomerAgencyDao.selectAllAgencyIdToPartyLinkMessage(customerId, monthId);
}
@Override
public List<ScreenPartyBranchDataFormDTO> selectAllAgencyIdToOrganize(String customerId, String monthId) {
return screenCustomerAgencyDao.selectAllAgencyIdToOrganize(customerId, monthId);
}
/**
* @Description 查询org名称
* @param gridIds

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

@ -24,10 +24,7 @@ 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.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.form.*;
import com.epmet.dto.extract.result.GridInfoResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity;
import com.epmet.entity.org.CustomerGridEntity;
@ -122,6 +119,11 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl<ScreenCustome
return screenCustomerGridDao.selectAllGridIdToPartyLinkMessage(customerId, monthId);
}
@Override
public List<ScreenPartyBranchDataFormDTO> selectAllGridIdToOrganize(String customerId, String monthId) {
return screenCustomerGridDao.selectAllGridIdToOrganize(customerId, monthId);
}
/**
* @Description 查询机关的直属网格
* @param agencyIds

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

@ -18,13 +18,19 @@
package com.epmet.service.evaluationindex.screen.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.constant.OrgTypeConstant;
import com.epmet.dao.evaluationindex.screen.ScreenGovernRankDataDao;
import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity;
import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity;
import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
@ -37,6 +43,7 @@ import java.util.List;
*/
@Service
@Slf4j
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class ScreenGovernRankDataServiceImpl extends BaseServiceImpl<ScreenGovernRankDataDao, ScreenGovernRankDataEntity> implements ScreenGovernRankDataService {
@ -58,4 +65,23 @@ public class ScreenGovernRankDataServiceImpl extends BaseServiceImpl<ScreenGover
}
return list;
}
@Transactional(rollbackFor = Exception.class)
@Override
public void delAndSaveRankData(String customerId, String orgType, String monthId, Integer deleteSize,
List<ScreenGovernRankDataEntity> entityList) {
if (CollectionUtils.isEmpty(entityList)) {
return;
}
List<String> orgIds = new ArrayList<>();
for (ScreenGovernRankDataEntity entity : entityList) {
orgIds.add(entity.getOrgId());
}
int deleteNum;
do {
deleteNum = baseDao.deleteRankData(customerId, orgType, monthId, deleteSize, orgIds);
} while (deleteNum != NumConstant.ZERO);
insertBatch(entityList);
}
}

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

@ -18,7 +18,10 @@
package com.epmet.service.evaluationindex.screen.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.screen.ScreenPartyBranchDataDao;
import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenPartyBranchDataEntity;
@ -26,6 +29,7 @@ import com.epmet.service.evaluationindex.screen.ScreenPartyBranchDataService;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
/**
@ -35,6 +39,7 @@ import java.util.List;
* @since v1.0.0 2020-09-22
*/
@Service
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class ScreenPartyBranchDataServiceImpl extends BaseServiceImpl<ScreenPartyBranchDataDao, ScreenPartyBranchDataEntity> implements ScreenPartyBranchDataService {
/**
@ -49,4 +54,49 @@ public class ScreenPartyBranchDataServiceImpl extends BaseServiceImpl<ScreenPart
baseDao.insertScreenPartyBranchData(lists);
}
}
/**
* @Description 删除旧的建设情况数据
* @Param customerId
* @Param monthId
* @Param orgIds
* @author zxc
* @date 2020/9/27 9:04 上午
*/
@Override
public Integer deleteOldScreenPartyBranchData(String customerId, String monthId, List<String> orgIds) {
if (!CollectionUtils.isEmpty(orgIds)){
return baseDao.deleteOldScreenPartyBranchData(customerId, monthId, orgIds);
}
return NumConstant.ZERO;
}
/**
* @Description 根据orgId查询建设情况数据
* @Param customerId
* @Param monthId
* @Param orgIds
* @author zxc
* @date 2020/9/27 9:38 上午
*/
@Override
public List<ScreenPartyBranchDataFormDTO> selectScreenPartyBranchDataByOrgId(String customerId, String monthId, List<String> orgIds) {
if (!CollectionUtils.isEmpty(orgIds)){
return baseDao.selectScreenPartyBranchDataByOrgId(customerId, monthId, orgIds);
}
return new ArrayList<>();
}
/**
* @Description 根据parentId查询建设情况数据
* @Param customerId
* @Param monthId
* @Param parentId
* @author zxc
* @date 2020/9/27 9:38 上午
*/
@Override
public List<ScreenPartyBranchDataFormDTO> selectScreenPartyBranchDataByParentId(String customerId, String monthId, String parentId) {
return baseDao.selectScreenPartyBranchDataByParentId(customerId, monthId, parentId);
}
}

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

@ -57,14 +57,13 @@ public class ScreenPartyLinkMassesDataServiceImpl extends BaseServiceImpl<Screen
/**
* @Description 删除旧的党员联系群众
* @param customerId
* @param monthId
* @param orgIds
* @author zxc
* @date 2020/9/22 3:28 下午
*/
@Override
public Integer deleteOldPartyLinkInfo(String customerId, String monthId, List<String> orgIds) {
return baseDao.deleteOldPartyLinkInfo(customerId, monthId, orgIds);
public Integer deleteOldPartyLinkInfo(String customerId, List<String> orgIds) {
return baseDao.deleteOldPartyLinkInfo(customerId, orgIds);
}
/**

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

@ -19,11 +19,15 @@ package com.epmet.service.evaluationindex.screen.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.dao.evaluationindex.screen.ScreenPartyUserRankDataDao;
import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity;
import com.epmet.service.evaluationindex.screen.ScreenPartyUserRankDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 党建引领基层治理-市民党员积分排行榜
*
@ -33,5 +37,23 @@ import org.springframework.stereotype.Service;
@Service
public class ScreenPartyUserRankDataServiceImpl extends BaseServiceImpl<ScreenPartyUserRankDataDao, ScreenPartyUserRankDataEntity> implements ScreenPartyUserRankDataService {
@Autowired
ScreenPartyUserRankDataDao screenPartyUserRankDataDao;
/**
* @Description 用户参与排行数据清洗
* @param dataList
* @param customerId
* @return
* @author wangc
* @date 2020.09.27 09:44
**/
@Override
public void dataClean(List<ScreenPartyUserRankDataEntity> dataList, String customerId, String dateId) {
int affectedRows;
do{
affectedRows = baseDao.deleteBatchByCustomerIdAndDateId(customerId,dateId);
}while (affectedRows > NumConstant.ZERO);
baseDao.insertBatch(dataList);
}
}

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

@ -18,13 +18,16 @@
package com.epmet.service.evaluationindex.screen.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.screen.ScreenUserTotalDataDao;
import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity;
import com.epmet.service.evaluationindex.screen.ScreenUserTotalDataService;
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.List;
@ -36,6 +39,7 @@ import java.util.List;
* @since v1.0.0 2020-09-22
*/
@Service
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class ScreenUserTotalDataServiceImpl extends BaseServiceImpl<ScreenUserTotalDataDao, ScreenUserTotalDataEntity> implements ScreenUserTotalDataService {
/**
@ -46,11 +50,12 @@ public class ScreenUserTotalDataServiceImpl extends BaseServiceImpl<ScreenUserTo
* @date 2020.09.24 17:59
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void dataClean(List<ScreenUserTotalDataEntity> list,String customerId) {
int deleteNum;
do {
deleteNum = baseDao.deleteUserTotalData(customerId);
} while (deleteNum <= NumConstant.ZERO);
} while (deleteNum > NumConstant.ZERO);
if(!CollectionUtils.isEmpty(list)){
baseDao.insertBatch(list);

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

@ -413,15 +413,35 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService {
* @Author zhangyong
* @Date 15:38 2020-08-21
**/
private BigDecimal calculateGrowthRateNumber(Integer old, Integer now){
if (NumConstant.ZERO == old){
private BigDecimal calculateGrowthRateNumber(Integer old, Integer now) {
if (NumConstant.ZERO == old) {
return new BigDecimal(now * NumConstant.ONE_HUNDRED);
}
BigDecimal bignum1 = new BigDecimal((now - old) * NumConstant.ONE_HUNDRED);
BigDecimal bignum2 = bignum1.divide(new BigDecimal(old),2,BigDecimal.ROUND_HALF_UP);
BigDecimal bignum2 = bignum1.divide(new BigDecimal(old), 2, BigDecimal.ROUND_HALF_UP);
return bignum2;
}
/**
* 计算 本月数值 相较于 上月数值的增长率
*
* @param old 上月数值
* @param now 本月数值
* @return java.math.BigDecimal
* @Author zhangyong
* @Date 15:38 2020-08-21
**/
private BigDecimal calculateGrowthRateNumber(BigDecimal old, BigDecimal now) {
BigDecimal oneHundred = new BigDecimal(NumConstant.ONE_HUNDRED);
if (old.compareTo(new BigDecimal(NumConstant.ZERO)) == NumConstant.ZERO) {
return now.multiply(oneHundred);
}
BigDecimal bignum1 = now.subtract(old).multiply(oneHundred);
BigDecimal bignum2 = bignum1.divide(old, 2, BigDecimal.ROUND_HALF_UP);
return bignum2;
}
/**
* 计算 本月数值 相较于 上月数值的增长率 得出标识
*
@ -431,10 +451,29 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService {
* @Author zhangyong
* @Date 15:38 2020-08-21
**/
private String calculateGrowthRateFlag(Integer old, Integer now){
if (old > now){
private String calculateGrowthRateFlag(Integer old, Integer now) {
if (old > now) {
return CompareConstant.DECR_STR;
} else if (old < now) {
return CompareConstant.INCR_STR;
} else {
return CompareConstant.EQ_STR;
}
}
/**
* 计算 本月数值 相较于 上月数值的增长率 得出标识
*
* @param old 上月数值
* @param now 本月数值
* @return java.util.String
* @Author zhangyong
* @Date 15:38 2020-08-21
**/
private String calculateGrowthRateFlag(BigDecimal old, BigDecimal now) {
if (old.compareTo(now) == 1) {
return CompareConstant.DECR_STR;
} else if (old < now){
} else if (old.compareTo(now) == -1) {
return CompareConstant.INCR_STR;
} else {
return CompareConstant.EQ_STR;
@ -448,7 +487,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService {
if (formDTO.getIsFirst()) {
int deleteNum;
do {
deleteNum = screenPioneerDataDao.deletePioneerDataByCustomerId(customerId,IndexCalConstant.DELETE_SIZE);
deleteNum = screenPioneerDataDao.deletePioneerDataByCustomerId(customerId, IndexCalConstant.DELETE_SIZE);
} while (deleteNum != NumConstant.ZERO);
}
if (!CollectionUtils.isEmpty(formDTO.getDataList())) {

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActInfoService.java

@ -1,5 +1,7 @@
package com.epmet.service.heart;
import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO;
import java.util.List;
import java.util.Map;
@ -28,4 +30,14 @@ public interface ActInfoService {
* @Date 2020/9/21 16:43
**/
Map<String, Integer> calActivityCountMap(String customerId, String monthId);
/**
* @Description 查询组织次数
* @Param customerId
* @Param monthId
* @Param orgType
* @author zxc
* @date 2020/9/25 4:00 下午
*/
List<ScreenPartyBranchDataFormDTO> selectActInfo(String customerId, String monthId, String orgType, List<String> orgIds);
}

22
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActUserRelationService.java

@ -0,0 +1,22 @@
package com.epmet.service.heart;
import com.epmet.dto.extract.result.JoinUserCountResultDTO;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/9/25 5:17 下午
*/
public interface ActUserRelationService {
/**
* @Description 查询参与人数
* @Param customerId
* @Param monthId
* @author zxc
* @date 2020/9/25 5:19 下午
*/
List<JoinUserCountResultDTO> selectJoinUserCount(String customerId,String monthId);
}

19
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java

@ -3,11 +3,14 @@ package com.epmet.service.heart.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.heart.ActInfoDao;
import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO;
import com.epmet.service.heart.ActInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -58,4 +61,20 @@ public class ActInfoServiceImpl implements ActInfoService {
}
return resultMap;
}
/**
* @Description 查询组织次数
* @Param customerId
* @Param monthId
* @Param orgType
* @author zxc
* @date 2020/9/25 4:00 下午
*/
@Override
public List<ScreenPartyBranchDataFormDTO> selectActInfo(String customerId, String monthId, String orgType, List<String> orgIds) {
if (!CollectionUtils.isEmpty(orgIds)){
return baseDao.selectActInfo(customerId, monthId, orgType, orgIds);
}
return new ArrayList<>();
}
}

35
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActUserRelationServiceImpl.java

@ -0,0 +1,35 @@
package com.epmet.service.heart.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.heart.ActUserRelationDao;
import com.epmet.dto.extract.result.JoinUserCountResultDTO;
import com.epmet.service.heart.ActUserRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/9/25 5:17 下午
*/
@Service
@DataSource(DataSourceConstant.EPMET_HEART)
public class ActUserRelationServiceImpl implements ActUserRelationService {
@Autowired
private ActUserRelationDao actUserRelationDao;
/**
* @Description 查询参与人数
* @Param customerId
* @Param monthId
* @author zxc
* @date 2020/9/25 5:19 下午
*/
@Override
public List<JoinUserCountResultDTO> selectJoinUserCount(String customerId, String monthId) {
return actUserRelationDao.selectJoinUserCount(customerId, monthId);
}
}

18
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/point/UserPointService.java

@ -0,0 +1,18 @@
package com.epmet.service.point;
import java.util.Map;
/**
* 用户积分库
* */
public interface UserPointService {
/**
* @Description 根据客户Id查询用户积分Map
* @param customerId
* @return
* @author wangc
* @date 2020.09.25 16:00
**/
Map<String,Integer> getUserPointMap(String customerId);
}

46
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/point/impl/UserPointServiceImpl.java

@ -0,0 +1,46 @@
package com.epmet.service.point.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.point.PointDao;
import com.epmet.dto.point.UserPointDTO;
import com.epmet.service.point.UserPointService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Description
* @ClassName UserPointServiceImpl
* @Auth wangc
* @Date 2020-09-25 15:54
*/
@Service
@Slf4j
@DataSource(DataSourceConstant.EPMET_POINT)
public class UserPointServiceImpl implements UserPointService {
@Autowired
private PointDao pointDao;
/**
* @Description 根据客户Id查询用户积分Map
* @param customerId
* @return
* @author wangc
* @date 2020.09.25 16:00
**/
@Override
public Map<String, Integer> getUserPointMap(String customerId) {
List<UserPointDTO> points = pointDao.selectUserPointByCustomerId(customerId);
Map<String,Integer> map = new HashMap<>();
if(!CollectionUtils.isEmpty(points)){
points.forEach(point -> {map.put(point.getUserId(),point.getPointTotal());});
}
return map;
}
}

69
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java

@ -18,12 +18,10 @@
package com.epmet.service.stats;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.stats.FactIssueGridMonthlyDTO;
import com.epmet.entity.stats.FactIssueGridMonthlyEntity;
import java.util.List;
import java.util.Map;
/**
* 网格议题数量(按月)
@ -32,57 +30,6 @@ import java.util.Map;
* @since v1.0.0 2020-06-17
*/
public interface FactIssueGridMonthlyService extends BaseService<FactIssueGridMonthlyEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<FactIssueGridMonthlyDTO>
* @author generator
* @date 2020-06-17
*/
PageData<FactIssueGridMonthlyDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<FactIssueGridMonthlyDTO>
* @author generator
* @date 2020-06-17
*/
List<FactIssueGridMonthlyDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return FactIssueGridMonthlyDTO
* @author generator
* @date 2020-06-17
*/
FactIssueGridMonthlyDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-06-17
*/
void save(FactIssueGridMonthlyDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-06-17
*/
void update(FactIssueGridMonthlyDTO dto);
/**
* 批量删除
*
@ -115,10 +62,22 @@ public interface FactIssueGridMonthlyService extends BaseService<FactIssueGridMo
/**
* 批量保存
* @author zhaoqifeng
* @date 2020/6/23 14:07
*
* @param list
* @return void
* @author zhaoqifeng
* @date 2020/6/23 14:07
*/
void saveList(List<FactIssueGridMonthlyEntity> list);
/**
* desc: 获取该客户下某月的 议题数量
*
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.entity.stats.FactIssueGridMonthlyEntity>
* @author LiuJanJun
* @date 2020/9/25 5:00 下午
*/
List<FactIssueGridMonthlyEntity> getIssueCount(String customerId, String monthId);
}

66
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java

@ -17,25 +17,18 @@
package com.epmet.service.stats.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.stats.FactIssueGridMonthlyDao;
import com.epmet.dto.stats.FactIssueGridMonthlyDTO;
import com.epmet.entity.stats.FactIssueGridMonthlyEntity;
import com.epmet.service.stats.FactIssueGridMonthlyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 网格议题数量(按月)
@ -47,51 +40,6 @@ import java.util.Map;
@DataSource(DataSourceConstant.STATS)
public class FactIssueGridMonthlyServiceImpl extends BaseServiceImpl<FactIssueGridMonthlyDao, FactIssueGridMonthlyEntity> implements FactIssueGridMonthlyService {
@Override
public PageData<FactIssueGridMonthlyDTO> page(Map<String, Object> params) {
IPage<FactIssueGridMonthlyEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, FactIssueGridMonthlyDTO.class);
}
@Override
public List<FactIssueGridMonthlyDTO> list(Map<String, Object> params) {
List<FactIssueGridMonthlyEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, FactIssueGridMonthlyDTO.class);
}
private QueryWrapper<FactIssueGridMonthlyEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<FactIssueGridMonthlyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public FactIssueGridMonthlyDTO get(String id) {
FactIssueGridMonthlyEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, FactIssueGridMonthlyDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(FactIssueGridMonthlyDTO dto) {
FactIssueGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueGridMonthlyEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(FactIssueGridMonthlyDTO dto) {
FactIssueGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueGridMonthlyEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
@ -116,4 +64,18 @@ public class FactIssueGridMonthlyServiceImpl extends BaseServiceImpl<FactIssueGr
insertBatch(list);
}
/**
* desc: 获取该客户下某月的 议题数量
*
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.entity.stats.FactIssueGridMonthlyEntity>
* @author LiuJanJun
* @date 2020/9/25 5:00 下午
*/
@Override
public List<FactIssueGridMonthlyEntity> getIssueCount(String customerId, String monthId) {
return baseDao.getIssueCount(customerId, monthId);
}
}

34
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java

@ -5,12 +5,11 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.stats.*;
import com.epmet.dao.stats.topic.FactTopicTotalAgencyDailyDao;
import com.epmet.dao.stats.topic.FactTopicTotalGridDailyDao;
import com.epmet.dao.stats.user.FactParticipationUserGridDailyDao;
import com.epmet.dao.stats.user.FactRegUserGridDailyDao;
import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity;
import com.epmet.service.stats.ScreenCentralZoneDataExtractService;
import lombok.extern.slf4j.Slf4j;
@ -35,7 +34,7 @@ import java.util.stream.Collectors;
public class ScreenCentralZoneDataExtractServiceImpl implements ScreenCentralZoneDataExtractService {
@Autowired
private FactParticipationUserGridDailyDao factParticipationUserGridDailyDao;
private FactRegUserGridDailyDao factRegUserGridDailyDao;
@Autowired
private FactGroupGridDailyDao factGroupGridDailyDao;
@Autowired
@ -63,20 +62,22 @@ public class ScreenCentralZoneDataExtractServiceImpl implements ScreenCentralZon
//1.查询用户与党员数据,判断dimId是否为昨天,如果根据这个dimId没有查询出结果,则取前天的数据
//如果还是查不出数据,继续向下执行,这部分数据设置默认值
//注册用户数
List<ScreenUserTotalDataEntity> result =
factParticipationUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId);
factRegUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId);
if(CollectionUtils.isEmpty(result)){
if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){
result = factParticipationUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO));
result = factRegUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO));
}
if(null == result) result = new LinkedList<>();
}
List<ScreenUserTotalDataEntity> gridUserResult =
factParticipationUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_GRID,customerId,dimId);
factRegUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_GRID,customerId,dimId);
if(CollectionUtils.isEmpty(gridUserResult)){
if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){
gridUserResult = factParticipationUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_GRID,customerId,DateUtils.getBeforeNDay(NumConstant.TWO));
gridUserResult = factRegUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_GRID,customerId,DateUtils.getBeforeNDay(NumConstant.TWO));
}
}
if(!CollectionUtils.isEmpty(gridUserResult)){
@ -145,15 +146,22 @@ public class ScreenCentralZoneDataExtractServiceImpl implements ScreenCentralZon
gridProject = factAgencyProjectDailyDao.selectProjectCountByOrgLevel(ORG_LEVEL_GRID,customerId,DateUtils.getBeforeNDay(NumConstant.TWO));
}
}
Map<String,Integer> projectMap = agencyProject.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getIssueTotal));
projectMap.putAll(gridProject.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getIssueTotal)));
Map<String,Integer> projectMap = agencyProject.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getProjectTotal));
projectMap.putAll(gridProject.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getProjectTotal)));
result.forEach(o -> {
String orgId = o.getOrgId();
o.setGroupTotal(groupMap.get(orgId));
o.setTopicTotal(topicMap.get(orgId));
o.setIssueTotal(issueMap.get(orgId));
o.setProjectTotal(projectMap.get(orgId));
Integer count = groupMap.get(orgId);
o.setGroupTotal(null == count ? NumConstant.ZERO : count);
count = topicMap.get(orgId);
o.setTopicTotal(null == count ? NumConstant.ZERO : count);
count = issueMap.get(orgId);
o.setIssueTotal(null == count ? NumConstant.ZERO : count);
count = projectMap.get(orgId);
o.setProjectTotal(null == count ? NumConstant.ZERO : count);
o.setDataEndTime(dimId);
});

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java

@ -3,6 +3,7 @@ package com.epmet.service.user;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.extract.form.GridHeartedFormDTO;
import com.epmet.dto.stats.user.result.UserStatisticalData;
import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity;
import com.epmet.util.DimIdGenerator;
import org.apache.ibatis.annotations.Param;
@ -65,4 +66,13 @@ public interface UserService {
* @Date 2020/9/21 16:44
**/
List<String> getGridRegUserIds(String customerId, String gridId);
/**
* @Description 获取客户下的网格注册居民
* @param customerId
* @return
* @author wangc
* @date 2020.09.25 13:54
**/
List<ScreenPartyUserRankDataEntity> getRegisteredUserList(String customerId);
}

50
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java

@ -11,6 +11,7 @@ import com.epmet.dto.extract.result.UserPartyResultDTO;
import com.epmet.dto.stats.user.*;
import com.epmet.dto.stats.user.result.UserStatisticalData;
import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity;
import com.epmet.service.user.UserService;
import com.epmet.util.DimIdGenerator;
import com.epmet.util.ModuleConstant;
@ -23,7 +24,6 @@ import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
@ -357,10 +357,6 @@ public class UserServiceImpl implements UserService {
dataPacket.setPartiAgencyDailyList(list);
}
FactRegUserAgencyMonthlyDTO regAgencyM = new FactRegUserAgencyMonthlyDTO();
regAgencyM.setCustomerId(customerId);
regAgencyM.setAgencyId(agencyId);
@ -695,32 +691,9 @@ public class UserServiceImpl implements UserService {
}
}
public static void main(String[] args) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
//calendar.set(Calendar.DAY_OF_MONTH, 1);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
System.out.println(format.format(calendar.getTime()));
calendar.setTime(calendar.getTime());
calendar.add(Calendar.DATE, -1);
System.out.println(calendar.getTime());
System.out.println(format.format(calendar.getTime()));
System.out.println(format2.format(calendar.getTime()));
}
/**
* @return java.util.List<java.lang.String>
* @param customerId
@ -735,4 +708,25 @@ public class UserServiceImpl implements UserService {
return userDao.selectGridRegUserIds(customerId,gridId);
}
/**
* @Description 获取客户下的网格注册居民
* @param customerId
* @return
* @author wangc
* @date 2020.09.25 13:54
**/
@Override
public List<ScreenPartyUserRankDataEntity> getRegisteredUserList(String customerId) {
List<ScreenPartyUserRankDataEntity> userList = userDao.selectRegisteredUserByCustomerId(customerId);
List<String> partyList = userDao.selectPartymembersByCustomerId(customerId);
if(!CollectionUtils.isEmpty(userList)){
userList.forEach(user -> {
if(partyList.contains(user.getUserId())){
user.setPartyFlag(NumConstant.ONE);
}
});
}
return userList;
}
}

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

@ -93,4 +93,30 @@
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
</select>
<!-- 党员参与议事:支持或者反对的次数 -->
<select id="calPartyPartiIssueTotal" parameterType="map" resultType="int">
SELECT
COUNT(1)AS TOTAL
FROM
fact_origin_issue_log_daily M
WHERE
M.DEL_FLAG = '0'
AND M.ACTION_CODE LIKE 'vote_%'
<if test='null != customerId and "" != customerId'>
AND M.CUSTOMER_ID=#{customerId}
</if>
<if test='null != gridId and "" != gridId'>
AND M.GRID_ID=#{gridId}
</if>
<if test='null != communityId and "" != communityId'>
AND M.AGENCY_ID=#{communityId}
</if>
<if test='null != agencyPath and "" != agencyPath'>
AND M.PIDS LIKE CONCAT(#{agencyPath},'%')
</if>
<if test='null != isParty and "" != isParty'>
and M.IS_PARTY=#{isParty}
</if>
</select>
</mapper>

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

Loading…
Cancel
Save