Browse Source

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

dev_shibei_match
zxc 5 years ago
parent
commit
bd3358c9a8
  1. 7
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiProfileResultDTO.java
  2. 4
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml
  3. 4
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractScreenFormDTO.java
  4. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridGroupUserCountResultDTO.java
  5. 9
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridUserCountResultDTO.java
  6. 3
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueVoteUserCountResultDTO.java
  7. 3
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgStatisticsResultDTO.java
  8. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectStatusConstant.java
  9. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java
  10. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  11. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java
  12. 27
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java
  13. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java
  14. 23
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java
  15. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java
  16. 35
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java
  17. 23
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java
  18. 34
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenOrgRankDataDao.java
  19. 30
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java
  20. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyMonthlyDao.java
  21. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java
  22. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java
  23. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java
  24. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java
  25. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java
  26. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java
  27. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java
  28. 24
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java
  29. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java
  30. 32
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java
  31. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java
  32. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java
  33. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java
  34. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java
  35. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java
  36. 24
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java
  37. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java
  38. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java
  39. 41
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/OrgRankExtractService.java
  40. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractService.java
  41. 182
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java
  42. 260
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankExtractServiceImpl.java
  43. 218
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java
  44. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java
  45. 116
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java
  46. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartiTotalDataExtractServiceImpl.java
  47. 56
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java
  48. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java
  49. 29
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenOrgRankDataService.java
  50. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserJoinService.java
  51. 47
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenOrgRankDataServiceImpl.java
  52. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java
  53. 157
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java
  54. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java
  55. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java
  56. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java
  57. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java
  58. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserAgencyMonthlyService.java
  59. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridMonthlyService.java
  60. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserAgencyMonthlyServiceImpl.java
  61. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridMonthlyServiceImpl.java
  62. 32
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml
  63. 35
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml
  64. 24
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml
  65. 68
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml
  66. 121
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  67. 24
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml
  68. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml
  69. 57
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenOrgRankDataDao.xml
  70. 5
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml
  71. 4
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml
  72. 6
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActUserRelation.xml
  73. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml
  74. 9
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml
  75. 28
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyMonthlyDao.xml
  76. 14
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml

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

@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Description 3公众参与概况返参DTO
@ -24,7 +25,7 @@ public class PublicPartiProfileResultDTO implements Serializable {
* */
private String monthTrend = "";
private Integer averageIssue = NumConstant.ZERO;
private BigDecimal averageIssue = new BigDecimal(NumConstant.ZERO);
/**
* 较上月百分比
@ -38,8 +39,8 @@ public class PublicPartiProfileResultDTO implements Serializable {
/**
* 平均参与度
* */
private Integer averageJoin = NumConstant.ZERO;
*/
private BigDecimal averageJoin = new BigDecimal(NumConstant.ZERO);
private String joinCompareLatestMonth = "";

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

@ -7,10 +7,10 @@
<select id="selectUserJoinData" resultType="com.epmet.evaluationindex.screen.dto.result.UserJoinIndicatorGrowthRateResultDTO">
SELECT
JOIN_TOTAL AS total,
AVG_JOIN AS averageJoin,
ROUND( AVG_JOIN, 1 ) AS averageJoin,
JOIN_TOTAL_UP_RATE AS monthIncr,
JOIN_TOTAL_UP_FLAG AS monthTrend,
AVG_ISSUE AS averageIssue,
ROUND(AVG_ISSUE,1) AS averageIssue,
AVG_ISSUE_UP_RATE AS issueCompareLatestMonth,
AVG_ISSUE_UP_FLAG AS issueCompareLatestTrend,
AGVG_JOIN_UP_RATE AS joinCompareLatestMonth,

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

@ -17,5 +17,9 @@ public class ExtractScreenFormDTO implements Serializable {
private String customerId;
private String monthId;
private String dateId;
private String startMonth;
private String endMonth;
private String startDate;
private String endDate;
}

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridGroupUserCountResultDTO.java

@ -20,7 +20,7 @@ public class GridGroupUserCountResultDTO implements Serializable {
*/
private String customerId;
private String gridId;
private String orgId;
private Integer memberCount;
/**

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

@ -25,7 +25,12 @@ public class GridUserCountResultDTO implements Serializable {
private Integer partyCount = NumConstant.ZERO;
/**
* 网格ID
* 网格ID 或组织Id
*/
private String gridId;
private String orgId;
/**
* 用户总数
*/
private Integer regTotal;
}

3
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueVoteUserCountResultDTO.java

@ -15,8 +15,7 @@ public class IssueVoteUserCountResultDTO implements Serializable {
private static final long serialVersionUID = -4729061928990808187L;
private String gridId;
private String issueId;
private String orgId;
private Integer voteCount;
private Integer issueCount;
/**

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

@ -3,6 +3,7 @@ package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @author zhaoqifeng
@ -17,5 +18,5 @@ public class OrgStatisticsResultDTO implements Serializable {
private String orgId;
private Integer count;
private Integer sum;
private String ratio;
private BigDecimal ratio;
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectStatusConstant.java

@ -7,4 +7,12 @@ package com.epmet.constant;
* @date 2020/9/16 10:14
*/
public interface DimObjectStatusConstant {
/**
* 已解决
*/
String RESOLVED="resolved";
/**
* 无需解决
*/
String UNRESOLVED="unresolved";
}

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

@ -62,4 +62,6 @@ public interface ProjectConstant {
* 下级
*/
String XIA_JI = "xiaji";
String GRID_ID = "GRID_ID";
String AGENCY_ID = "AGENCY_ID";
}

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

@ -105,6 +105,8 @@ public class DemoController {
private ScreenCentralZoneDataAbsorptionService screenCentralZoneDataAbsorptionService;
@Autowired
private GovernRankDataExtractService governRankDataExtractService;
@Autowired
private OrgRankExtractService orgRankExtractService;
@GetMapping("testAlarm")
public void testAlarm() {
@ -699,5 +701,12 @@ public class DemoController {
return new Result();
}
@PostMapping("orgRank")
public Result orgRank(@RequestBody CustomerIdAndDateIdFormDTO formDTO){
orgRankExtractService.extractGridData(formDTO.getCustomerId(), formDTO.getDateId());
orgRankExtractService.extractCommunityData(formDTO.getCustomerId(), formDTO.getDateId());
orgRankExtractService.extractStreetData(formDTO.getCustomerId(), formDTO.getDateId());
return new Result();
}
}

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

@ -2,6 +2,7 @@ package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.form.ExtractScreenFormDTO;
import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -32,4 +33,16 @@ public class ScreenExtractDailyController {
return new Result();
}
/**
* @param formDTO
* @Description 抽取数据到大屏
* @author zxc
* @date 2020/9/24 10:15 上午
*/
@PostMapping("extractmonthlyyall")
public Result screenExtractMonthly(@RequestBody ExtractScreenFormDTO formDTO) {
screenExtractService.extractMonthlyAll(formDTO);
return new Result();
}
}

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

@ -18,6 +18,9 @@
package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.extract.form.GridHeartedFormDTO;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
@ -153,9 +156,31 @@ public interface FactOriginGroupMainDailyDao extends BaseDao<FactOriginGroupMain
* desc: 获取所有网格的组中成员人数 去重
*
* @param customerId
* @param groupField
* @return java.util.List<com.epmet.dto.extract.result.GridGroupUserCountResultDTO>
* @author LiuJanJun
* @date 2020/9/27 2:31 下午
*/
List<GridGroupUserCountResultDTO> selectDistinctGroupMemberCount(@Param("customerId") String customerId);
List<GridGroupUserCountResultDTO> selectDistinctGroupMemberCount(@Param("customerId") String customerId, @Param("groupField") String groupField);
/**
* 获取网格内小组数量
* @author zhaoqifeng
* @date 2020/9/27 14:37
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectGridGroupCount(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 获取组织内网格数量
* @author zhaoqifeng
* @date 2020/9/27 14:37
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectOrgGroupCount(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("level") String level);
}

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

@ -85,11 +85,11 @@ public interface FactOriginIssueLogDailyDao extends BaseDao<FactOriginIssueLogDa
* @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);
int calPartyPartiIssueTotal(@Param("customerId") String customerId,
@Param("gridId") String gridId,
@Param("communityId") String communityId,
@Param("agencyPath") String agencyPath,
@Param("isParty") String isParty);
/**
* @param gridId 网格id
@ -108,9 +108,11 @@ public interface FactOriginIssueLogDailyDao extends BaseDao<FactOriginIssueLogDa
*
* @param customerId
* @param monthId
* @param pids
* @param groupField
* @return java.util.List<com.epmet.dto.extract.IssueVoteUserCountResultDTO>
* @author LiuJanJun
* @date 2020/9/27 1:58 下午
*/
List<IssueVoteUserCountResultDTO> getVoteCount(@Param("customerId") String customerId, @Param("monthId") String monthId);
List<IssueVoteUserCountResultDTO> getVoteCount(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("groupField") String groupField);
}

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

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.form.GridIssueCountResultDTO;
import com.epmet.dto.extract.form.IssueMainDailyFormDTO;
import com.epmet.dto.extract.result.GridProjectCountResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.ShiftProjectCountResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity;
import org.apache.ibatis.annotations.Mapper;
@ -183,4 +184,26 @@ public interface FactOriginIssueMainDailyDao extends BaseDao<FactOriginIssueMain
**/
Integer getAgencyShiftProjectTotal(@Param("customerId")String customerId,
@Param("agencyPath")String agencyPath);
/**
* 网格内议题总数
* @author zhaoqifeng
* @date 2020/9/27 14:59
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectGridIssueCount(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 组织内议题总数
* @author zhaoqifeng
* @date 2020/9/27 14:59
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectOrgIssueCount(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("level") String level);
}

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

@ -136,4 +136,26 @@ public interface FactOriginProjectLogDailyDao extends BaseDao<FactOriginProjectL
* @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);
/**
* 网格满意率
* @author zhaoqifeng
* @date 2020/9/27 15:52
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectGridSatisfaction(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 组织满意率
* @author zhaoqifeng
* @date 2020/9/27 15:52
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectOrgSatisfaction(@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

@ -22,6 +22,7 @@ import com.epmet.dto.extract.FactOriginProjectMainDailyDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -84,7 +85,6 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
* @return void
*/
void deleteByDate(@Param("customerId") String customerId, @Param("date") String date);
void deleteByDate(@Param("date") String date);
/**
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>
@ -169,4 +169,37 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridResolveProject(@Param("customerId") String customerId, @Param("monthId")String monthId);
/**
* @Description 查询难点赌点的基本信息要排除之前已经结案过的项目
* @param customerId
* @param list
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity>
* @author wangc
* @date 2020.09.28 10:19
*/
List<ScreenDifficultyDataEntity> selectDifficultyBaseInfo(@Param("customerId")String customerId,@Param("list")List<String> list);
/**
* 网格解决项目数
* @author zhaoqifeng
* @date 2020/9/25 15:16
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridProjectCount(@Param("customerId") String customerId, @Param("monthId")String monthId);
/**
* 组织解决项目数
* @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> getOrgProjectCount(@Param("customerId") String customerId, @Param("monthId")String monthId,
@Param("level") String level);
}

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

@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.CreateTopicCountResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -116,4 +117,26 @@ public interface FactOriginTopicMainDailyDao extends BaseDao<FactOriginTopicMain
Integer getAgencyPartyTopicTotal(@Param("customerId") String customerId,
@Param("agencyPath")String agencyPath,
@Param("createTopicUserIsParty") String createTopicUserIsParty);
/**
* 网格内话题总数
* @author zhaoqifeng
* @date 2020/9/27 14:59
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectGridTopicCount(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 组织内话题总数
* @author zhaoqifeng
* @date 2020/9/27 14:59
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectOrgTopicCount(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("level") String level);
}

34
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenOrgRankDataDao.java

@ -56,4 +56,38 @@ public interface ScreenOrgRankDataDao extends BaseDao<ScreenOrgRankDataEntity> {
* @Date 10:52 2020-08-18
**/
void batchInsertOrgRankData(@Param("list") List<OrgRankDataFormDTO> list, @Param("customerId")String customerId);
/**
* 初始化组织数据
* @author zhaoqifeng
* @date 2020/9/27 10:14
* @param customerId
* @param level
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity>
*/
List<ScreenOrgRankDataEntity> initAgencyDataList(@Param("customerId") String customerId, @Param("level") String level);
/**
* 初始化网格数据
* @author zhaoqifeng
* @date 2020/9/27 10:14
* @param customerId
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity>
*/
List<ScreenOrgRankDataEntity> initGridDataList(@Param("customerId") String customerId);
/**
* 删除旧数据
* @author zhaoqifeng
* @date 2020/9/27 10:27
* @param customerId
* @param orgType
* @param monthId
* @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/stats/FactIssueAgencyMonthlyDao.java

@ -42,14 +42,26 @@ public interface FactIssueAgencyMonthlyDao extends BaseDao<FactIssueAgencyMonthl
* @return java.util.List<com.epmet.dto.stats.FactIssueAgencyMonthlyDTO>
*/
List<FactIssueAgencyMonthlyDTO> selectAgencyMonthlyInc(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 删除
* @author zhaoqifeng
* @date 2020/6/23 14:02
* @param customerId
* @param monthId
* @return void
*/
void deleteByCustomerId(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 删除
*
* @param customerId
* @param monthId
* @return void
* @author zhaoqifeng
* @date 2020/6/23 14:02
*/
void deleteByCustomerId(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* desc: 获取各机关某月议题增量和议题总数
*
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.entity.stats.FactIssueAgencyMonthlyEntity>
* @author LiuJanJun
* @date 2020/9/27 3:33 下午
*/
List<FactIssueAgencyMonthlyEntity> getIssueIncCountAndTotalByMonthId(String customerId, String monthId);
}

18
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyMonthlyDao.java

@ -18,6 +18,7 @@
package com.epmet.dao.stats.user;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.GridUserCountResultDTO;
import com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO;
import com.epmet.entity.stats.user.FactRegUserAgencyMonthlyEntity;
import org.apache.ibatis.annotations.Mapper;
@ -36,5 +37,20 @@ public interface FactRegUserAgencyMonthlyDao extends BaseDao<FactRegUserAgencyMo
void insertBatch(@Param("list") List<FactRegUserAgencyMonthlyDTO> list);
void deleteByParams(@Param("monthId")String monthId,@Param("customerId")String customerId);
void deleteByParams(@Param("monthId") String monthId, @Param("customerId") String customerId);
List<GridUserCountResultDTO> selectAgencyUserCount(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 查询机关下各用户数量
* @author zhaoqifeng
* @date 2020/9/27 16:39
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO>
*/
List<FactRegUserAgencyMonthlyDTO> selectOrgUserCountByCustomer(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("level") String level);
}

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

@ -48,4 +48,14 @@ public interface FactRegUserGridMonthlyDao extends BaseDao<FactRegUserGridMonthl
*/
List<GridUserCountResultDTO> selectGridUserCount(String customerId, String monthId);
/**
* 查询网格下各用户数量
* @author zhaoqifeng
* @date 2020/9/27 13:59
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO>
*/
List<FactRegUserGridMonthlyDTO> selectGridUserCountByCustomer(@Param("customerId") String customerId, @Param("monthId") String monthId);
}

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

@ -2,7 +2,6 @@ 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.*;
@ -57,7 +56,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
//1、构造初始值
List<FactIndexPartyAblityCpcMonthlyEntity> indexPartyAblityCpcList = dimCustomerPartymemberService.selectPartyMemberList(customerId);
if (CollectionUtils.isEmpty(indexPartyAblityCpcList)) {
log.info("dim_customer_partymember do not any records");
log.info("dim_customer_partymember do not any records customerId="+customerId);
return;
}
String quarterId= DateUtils.getQuarterId(monthId);
@ -75,11 +74,11 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
//可以先查询出每个党员的 自建群
Map<String, List<String>> userCreatedGroups = queryUserCreatedGroups(customerId, indexPartyAblityCpcList);
//6、党员自建群群众人数 (todo 和monthId无关??)
//6、党员自建群群众人数 :和评价周期无关
Map<String, Integer> groupUserCountMap = calgroupUserCount(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups);
//7、党员自建群活跃群众人数
Map<String, Integer> groupActiveUserCountMap = calGroupActiveUserCount(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups);
//8、党员自建群活跃度——话题数 (todo 校验sql正确性)
//8、党员自建群活跃度——话题数:从话题表中统计党员自建群i的话题总数;对所有自建群话题数累加。
Map<String, Integer> groupTopicCountMap = calGroupTopicCount(customerId, monthId);
//9、自建群活跃度——议题转项目率
Map<String, BigDecimal> topicToIssueRatioMap = caltopicToIssueRatio(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups);

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

@ -145,7 +145,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
// 1. 网格群众用户数 , 网格党员用户数
if (!CollectionUtils.isEmpty(gridUserCountList)){
gridUserCountList.forEach(count -> {
if (r.getGridId().equals(count.getGridId())){
if (r.getGridId().equals(count.getOrgId())) {
r.setUserCount(count.getUserCount());
r.setPartyCount(count.getPartyCount());
}

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

@ -26,6 +26,7 @@ import java.math.RoundingMode;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
/**
@ -143,7 +144,8 @@ public class IndexCollCommunityServiceImpl implements IndexCollCommunityService
entity.setClosedProjectRatio(BigDecimal.ZERO);
}
//办结效率
entity.setHandleProjectRatio(efficiencyMap.get(entity.getAgencyId()));
entity.setHandleProjectRatio(Optional.ofNullable(efficiencyMap.get(entity.getAgencyId())).orElse(BigDecimal.ZERO));
});
factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.COMMUNITY);

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

@ -26,6 +26,7 @@ import java.math.RoundingMode;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
/**
@ -125,14 +126,16 @@ public class IndexCollStreetServiceImpl implements IndexCollStreetService {
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()));
entity.setHandleProjectRatio(Optional.ofNullable(efficiencyMap.get(entity.getAgencyId())).orElse(BigDecimal.ZERO));
});
factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.STREET);

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

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.result.GridGroupUserCountResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity;
@ -78,9 +79,31 @@ public interface FactOriginGroupMainDailyService extends BaseService<FactOriginG
* desc: 获取客户下每个网格小组内的 去重人数
*
* @param customerId
* @param groupField
* @return java.util.List<com.epmet.entity.evaluationindex.extract.GridGroupUserCountResultDTO>
* @author LiuJanJun
* @date 2020/9/27 2:24 下午
*/
List<GridGroupUserCountResultDTO> selectDistinctGroupMemberCount(String customerId);
List<GridGroupUserCountResultDTO> selectDistinctGroupMemberCount(String customerId, String groupField);
/**
* 获取网格内小组数量
* @author zhaoqifeng
* @date 2020/9/27 14:35
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridGroupCount(String customerId, String monthId);
/**
* 获取组织内小组数量
* @author zhaoqifeng
* @date 2020/9/27 14:35
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getOrgGroupCount(String customerId, String monthId, String level);
}

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

@ -59,9 +59,10 @@ public interface FactOriginIssueLogDailyService extends BaseService<FactOriginIs
*
* @param customerId
* @param monthId
* @param groupField
* @return java.util.List<com.epmet.dto.extract.FactOriginIssueLogDailyEntity>
* @author LiuJanJun
* @date 2020/9/27 1:58 下午
*/
List<IssueVoteUserCountResultDTO> getVoteCount(String customerId, String monthId);
List<IssueVoteUserCountResultDTO> getVoteCount(String customerId, String monthId, String groupField);
}

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

@ -18,8 +18,11 @@
package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity;
import java.util.List;
/**
* 议题主表
*
@ -86,4 +89,25 @@ public interface FactOriginIssueMainDailyService extends BaseService<FactOriginI
* @Date 2020/9/24 17:04
**/
Integer getAgencyShiftProjectTotal(String customerId, String agencyPath);
/**
* 网格内议题数
* @author zhaoqifeng
* @date 2020/9/27 15:11
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridIssueCount(String customerId, String monthId);
/**
* 组织内议题数
* @author zhaoqifeng
* @date 2020/9/27 15:11
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getOrgIssueCount(String customerId, String monthId, String level);
}

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

@ -218,4 +218,25 @@ public interface FactOriginProjectLogDailyService extends BaseService<FactOrigin
*/
List<OrgStatisticsResultDTO> getOrgResponse(String customerId, String monthId, String level);
/**
* 网格满意率
* @author zhaoqifeng
* @date 2020/9/27 16:06
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridSatisfaction(String customerId, String monthId);
/**
* 组织满意率
* @author zhaoqifeng
* @date 2020/9/27 16:06
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getOrgSatisfaction(String customerId, String monthId, String level);
}

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

@ -23,6 +23,7 @@ import com.epmet.dto.extract.FactOriginProjectMainDailyDTO;
import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import java.util.List;
import java.util.Map;
@ -216,4 +217,35 @@ public interface FactOriginProjectMainDailyService extends BaseService<FactOrigi
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridResolveProject(String customerId, String monthId);
/**
* 网格项目数
* @author zhaoqifeng
* @date 2020/9/27 15:18
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridProjectCount(String customerId, String monthId);
/**
* 组织项目数
* @author zhaoqifeng
* @date 2020/9/27 15:19
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getOrgProjectCount(String customerId, String monthId, String level);
/**
* @Description 查询难点赌点基础信息
* @param customerId
* @param list
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity>
* @author wangc
* @date 2020.09.28 10:23
*/
List<ScreenDifficultyDataEntity> getDifficultyBaseInfo(String customerId , List<String> list);
}

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

@ -20,6 +20,7 @@ package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.result.CreateTopicCountResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity;
import java.util.List;
@ -90,4 +91,25 @@ public interface FactOriginTopicMainDailyService extends BaseService<FactOriginT
* @Date 2020/9/24 15:49
**/
Integer getAgencyPartyTopicTotal(String customerId, String agencyPath,String createTopicUserIsParty);
/**
* 网格内话题数
* @author zhaoqifeng
* @date 2020/9/27 15:05
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridTopicCount(String customerId, String monthId);
/**
* 组织内话题数
* @author zhaoqifeng
* @date 2020/9/27 15:05
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getOrgTopicCount(String customerId, String monthId, String level);
}

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

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.GridGroupUserCountResultDTO;
import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity;
@ -116,8 +117,18 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl<FactOri
}
@Override
public List<GridGroupUserCountResultDTO> selectDistinctGroupMemberCount(String customerId) {
return baseDao.selectDistinctGroupMemberCount(customerId);
public List<GridGroupUserCountResultDTO> selectDistinctGroupMemberCount(String customerId, String groupField) {
return baseDao.selectDistinctGroupMemberCount(customerId, groupField);
}
@Override
public List<OrgStatisticsResultDTO> getGridGroupCount(String customerId, String monthId) {
return baseDao.selectGridGroupCount(customerId, monthId);
}
@Override
public List<OrgStatisticsResultDTO> getOrgGroupCount(String customerId, String monthId, String level) {
return baseDao.selectOrgGroupCount(customerId, monthId, level);
}
}

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

@ -97,7 +97,7 @@ public class FactOriginIssueLogDailyServiceImpl extends BaseServiceImpl<FactOrig
@Override
public List<IssueVoteUserCountResultDTO> getVoteCount(String customerId, String monthId) {
return baseDao.getVoteCount(customerId, monthId);
public List<IssueVoteUserCountResultDTO> getVoteCount(String customerId, String monthId, String groupField) {
return baseDao.getVoteCount(customerId, monthId, groupField);
}
}

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

@ -21,11 +21,14 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginIssueMainDailyDao;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 议题主表
*
@ -114,4 +117,14 @@ public class FactOriginIssueMainDailyServiceImpl extends BaseServiceImpl<FactOri
public Integer getAgencyShiftProjectTotal(String customerId, String agencyPath) {
return baseDao.getAgencyShiftProjectTotal(customerId,agencyPath);
}
@Override
public List<OrgStatisticsResultDTO> getGridIssueCount(String customerId, String monthId) {
return baseDao.selectGridIssueCount(customerId, monthId);
}
@Override
public List<OrgStatisticsResultDTO> getOrgIssueCount(String customerId, String monthId, String level) {
return baseDao.selectOrgIssueCount(customerId, monthId, level);
}
}

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

@ -277,5 +277,15 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOr
return baseDao.selectOrgResponse(customerId, monthId, level);
}
@Override
public List<OrgStatisticsResultDTO> getGridSatisfaction(String customerId, String monthId) {
return baseDao.selectGridSatisfaction(customerId, monthId);
}
@Override
public List<OrgStatisticsResultDTO> getOrgSatisfaction(String customerId, String monthId, String level) {
return baseDao.selectOrgSatisfaction(customerId, monthId, level);
}
}

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

@ -31,6 +31,7 @@ import com.epmet.dto.extract.FactOriginProjectMainDailyDTO;
import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
@ -213,4 +214,27 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO
public List<OrgStatisticsResultDTO> getGridResolveProject(String customerId, String monthId) {
return baseDao.getGridResolveProject(customerId, monthId);
}
@Override
public List<OrgStatisticsResultDTO> getGridProjectCount(String customerId, String monthId) {
return baseDao.getGridProjectCount(customerId, monthId);
}
@Override
public List<OrgStatisticsResultDTO> getOrgProjectCount(String customerId, String monthId, String level) {
return baseDao.getOrgProjectCount(customerId, monthId, level);
}
/**
* @Description 查询难点赌点基础信息
* @param customerId
* @param list
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity>
* @author wangc
* @date 2020.09.28 10:23
*/
@Override
public List<ScreenDifficultyDataEntity> getDifficultyBaseInfo(String customerId, List<String> list) {
return null;
}
}

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

@ -30,6 +30,7 @@ import com.epmet.dao.evaluationindex.extract.FactOriginTopicLogDailyDao;
import com.epmet.dao.evaluationindex.extract.FactOriginTopicMainDailyDao;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.result.CreateTopicCountResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.org.GridInfoDTO;
import com.epmet.dto.topic.TopicOriginInfoDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicLogDailyEntity;
@ -313,4 +314,14 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
return baseDao.getAgencyPartyTopicTotal(customerId,agencyPath,createTopicUserIsParty);
}
@Override
public List<OrgStatisticsResultDTO> getGridTopicCount(String customerId, String monthId) {
return baseDao.selectGridTopicCount(customerId, monthId);
}
@Override
public List<OrgStatisticsResultDTO> getOrgTopicCount(String customerId, String monthId, String level) {
return baseDao.selectOrgTopicCount(customerId, monthId, level);
}
}

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

@ -1,6 +1,7 @@
package com.epmet.service.evaluationindex.extract.todata.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
@ -101,6 +102,11 @@ public class GroupExtractServiceImpl implements GroupExtractService {
group.setAgencyId(attr.getAgencyId());
group.setParentId(attr.getParentId());
group.setPids(attr.getPids());
if(StringUtils.isBlank(group.getPids().trim()) || NumConstant.ZERO_STR.equals(group.getPids().trim())){
group.setPids(group.getAgencyId());
}else{
group.setPids(group.getPids().concat(StrConstant.COLON).concat(group.getAgencyId()));
}
}
if(null != group.getCreatedTime()){
DimIdGenerator.DimIdBean dateInfo = DimIdGenerator.getDimIdBean(group.getCreatedTime());
@ -124,6 +130,11 @@ public class GroupExtractServiceImpl implements GroupExtractService {
member.setAgencyId(attr.getAgencyId());
member.setParentId(attr.getParentId());
member.setPids(attr.getPids());
if(StringUtils.isBlank(member.getPids().trim()) || NumConstant.ZERO_STR.equals(member.getPids().trim())){
member.setPids(member.getAgencyId());
}else{
member.setPids(member.getPids().concat(StrConstant.COLON).concat(member.getAgencyId()));
}
}
memberList.add(member);
});

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

@ -0,0 +1,41 @@
package com.epmet.service.evaluationindex.extract.toscreen;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/27 9:37
*/
public interface OrgRankExtractService {
/**
* 网格先进排行
*
* @param customerId
* @param monthId
* @return void
* @author zhaoqifeng
* @date 2020/9/24 15:16
*/
void extractGridData(String customerId, String monthId);
/**
* 社区先进排行
*
* @param customerId
* @param monthId
* @return void
* @author zhaoqifeng
* @date 2020/9/24 15:17
*/
void extractCommunityData(String customerId, String monthId);
/**
* 街道先进排行
*
* @param customerId
* @param monthId
* @return void
* @author zhaoqifeng
* @date 2020/9/24 15:17
*/
void extractStreetData(String customerId, String monthId);
}

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

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

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

@ -50,38 +50,57 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (CollectionUtils.isEmpty(list)) {
return;
}
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
list.forEach(entity -> {
entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR));
entity.setMonthId(monthId);
});
//满意率 满意和非常满意占比
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getGridSatisfaction(customerId, monthId);
if (!CollectionUtils.isEmpty(satisfactionList)) {
list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//自治率
List<FactIndexGovrnAblityGridMonthlyEntity> gridList = factIndexGovrnAblityGridMonthlyService.getGridByCustomer(customerId, monthId);
list.forEach(entity -> gridList.stream().filter(gridAbility -> entity.getOrgId().equals(gridAbility.getGridId())).forEach(grid -> {
BigDecimal resolveCount = new BigDecimal(grid.getResolveProjectCount());
//自治率
BigDecimal selfCount = new BigDecimal(grid.getSelfSolveProjectCount());
if(grid.getResolveProjectCount()!= NumConstant.ZERO) {
entity.setGovernRatio(selfCount.divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP));
}
//满意率
entity.setSatisfactionRatio(grid.getSatisfactionRatio());
}));
if (!CollectionUtils.isEmpty(gridList)) {
list.forEach(entity -> gridList.stream().filter(gridAbility -> entity.getOrgId().equals(gridAbility.getGridId())).forEach(grid -> {
BigDecimal resolveCount = new BigDecimal(grid.getResolveProjectCount());
BigDecimal selfCount = new BigDecimal(grid.getSelfSolveProjectCount());
if (grid.getResolveProjectCount() != NumConstant.ZERO) {
entity.setGovernRatio(selfCount.multiply(hundred).divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//响应率 响应次数/流转到网格的次数
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));
}));
if (!CollectionUtils.isEmpty(responseList)) {
list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.multiply(hundred).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));
}));
if (!CollectionUtils.isEmpty(resolveList)) {
list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.GRID, monthId, IndexCalConstant.DELETE_SIZE, list);
}
@ -92,39 +111,58 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (CollectionUtils.isEmpty(list)) {
return;
}
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
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> satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(satisfactionList)) {
list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//响应率 响应次数/流转到网格的次数
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));
}));
if (!CollectionUtils.isEmpty(responseList)) {
list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.multiply(hundred).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));
}));
if (!CollectionUtils.isEmpty(selfList)) {
list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setGovernRatio(count.multiply(hundred).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));
}));
if (!CollectionUtils.isEmpty(resolveList)) {
list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, monthId, IndexCalConstant.DELETE_SIZE, list);
}
@ -134,39 +172,57 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (CollectionUtils.isEmpty(list)) {
return;
}
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
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> satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(satisfactionList)) {
list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//响应率 响应次数/流转到网格的次数
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));
}));
if (!CollectionUtils.isEmpty(responseList)) {
list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.multiply(hundred).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));
}));
if (!CollectionUtils.isEmpty(selfList)) {
list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setGovernRatio(count.multiply(hundred).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));
}));
if (!CollectionUtils.isEmpty(resolveList)) {
list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, monthId, IndexCalConstant.DELETE_SIZE, list);
}
}

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

@ -0,0 +1,260 @@
package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO;
import com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity;
import com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity;
import com.epmet.service.evaluationindex.extract.todata.*;
import com.epmet.service.evaluationindex.extract.toscreen.OrgRankExtractService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService;
import com.epmet.service.evaluationindex.screen.ScreenOrgRankDataService;
import com.epmet.service.stats.user.FactRegUserAgencyMonthlyService;
import com.epmet.service.stats.user.FactRegUserGridMonthlyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/27 9:37
*/
@Service
@Slf4j
public class OrgRankExtractServiceImpl implements OrgRankExtractService {
@Autowired
private ScreenOrgRankDataService screenOrgRankDataService;
@Autowired
private FactRegUserGridMonthlyService factRegUserGridMonthlyService;
@Autowired
private FactOriginGroupMainDailyService factOriginGroupMainDailyService;
@Autowired
private FactOriginTopicMainDailyService factOriginTopicMainDailyService;
@Autowired
private FactOriginIssueMainDailyService factOriginIssueMainDailyService;
@Autowired
private FactOriginProjectMainDailyService factOriginProjectMainDailyService;
@Autowired
private FactIndexGovrnAblityGridMonthlyService factIndexGovrnAblityGridMonthlyService;
@Autowired
private FactOriginProjectLogDailyService factOriginProjectLogDailyService;
@Autowired
private FactRegUserAgencyMonthlyService factRegUserAgencyMonthlyService;
@Autowired
private FactIndexGovrnAblityOrgMonthlyService factIndexGovrnAblityOrgMonthlyService;
@Override
public void extractGridData(String customerId, String monthId) {
List<ScreenOrgRankDataEntity> list = screenOrgRankDataService.initList(customerId, OrgTypeConstant.GRID, null);
if (CollectionUtils.isEmpty(list)) {
return;
}
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
list.forEach(entity -> {
entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR));
entity.setMonthId(monthId);
});
//党员数
List<FactRegUserGridMonthlyDTO> partyMemberList = factRegUserGridMonthlyService.getGridUserCountByCustomer(customerId, monthId);
if (!CollectionUtils.isEmpty(partyMemberList)) {
list.forEach(entity -> partyMemberList.stream().filter(item -> item.getGridId().equals(entity.getOrgId())).forEach(dto -> {
entity.setPartyTotal(dto.getPartymemberTotal());
}));
}
//小组数
List<OrgStatisticsResultDTO> groupList = factOriginGroupMainDailyService.getGridGroupCount(customerId, monthId);
if (!CollectionUtils.isEmpty(groupList)) {
list.forEach(entity -> groupList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
entity.setGroupTotal(dto.getCount());
}));
}
//话题数
List<OrgStatisticsResultDTO> topicList = factOriginTopicMainDailyService.getGridTopicCount(customerId, monthId);
if (!CollectionUtils.isEmpty(topicList)) {
list.forEach(entity -> topicList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
entity.setTopicTotal(dto.getCount());
}));
}
//议题数
List<OrgStatisticsResultDTO> issueList = factOriginIssueMainDailyService.getGridIssueCount(customerId, monthId);
if (!CollectionUtils.isEmpty(issueList)) {
list.forEach(entity -> issueList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
entity.setIssueTotal(dto.getCount());
}));
}
//项目数
List<OrgStatisticsResultDTO> projectList = factOriginProjectMainDailyService.getGridProjectCount(customerId, monthId);
if (!CollectionUtils.isEmpty(projectList)) {
list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
entity.setProjectTotal(dto.getCount());
}));
}
//结案率 结案数/项目数
List<FactIndexGovrnAblityGridMonthlyEntity> abilityList = factIndexGovrnAblityGridMonthlyService.getGridByCustomer(customerId, monthId);
if (!CollectionUtils.isEmpty(abilityList)) {
list.forEach(entity -> abilityList.stream().filter(item -> item.getGridId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getProjectTotal() != NumConstant.ZERO) {
BigDecimal total = new BigDecimal(dto.getProjectTotal());
BigDecimal closed = new BigDecimal(dto.getResolveProjectCount());
entity.setCloseProjectRatio(closed.multiply(hundred).divide(total, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//满意率 满意和非常满意占比
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getGridSatisfaction(customerId, monthId);
if (!CollectionUtils.isEmpty(satisfactionList)) {
list.forEach(entity -> satisfactionList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
}
@Override
public void extractCommunityData(String customerId, String monthId) {
List<ScreenOrgRankDataEntity> list = screenOrgRankDataService.initList(customerId, OrgTypeConstant.AGENCY, OrgTypeConstant.COMMUNITY);
if (CollectionUtils.isEmpty(list)) {
return;
}
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
list.forEach(entity -> {
entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR));
entity.setMonthId(monthId);
});
//党员数
List<FactRegUserAgencyMonthlyDTO> partyMemberList = factRegUserAgencyMonthlyService.getOrgUserCountByCustomer(customerId, monthId,
OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(partyMemberList)) {
list.forEach(entity -> partyMemberList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setPartyTotal(dto.getPartymemberTotal());
}));
}
//小组数
List<OrgStatisticsResultDTO> groupList = factOriginGroupMainDailyService.getOrgGroupCount(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(groupList)) {
list.forEach(entity -> groupList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setGroupTotal(dto.getCount());
}));
}
//话题数
List<OrgStatisticsResultDTO> topicList = factOriginTopicMainDailyService.getOrgTopicCount(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(topicList)) {
list.forEach(entity -> topicList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setTopicTotal(dto.getCount());
}));
}
//议题数
List<OrgStatisticsResultDTO> issueList = factOriginIssueMainDailyService.getOrgIssueCount(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(issueList)) {
list.forEach(entity -> issueList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setIssueTotal(dto.getCount());
}));
}
//项目数
List<OrgStatisticsResultDTO> projectList = factOriginProjectMainDailyService.getOrgProjectCount(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(projectList)) {
list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
entity.setProjectTotal(dto.getCount());
}));
}
//结案率 结案数/项目数
List<FactIndexGovrnAblityOrgMonthlyEntity> abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(abilityList)) {
list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setCloseProjectRatio(dto.getClosedProjectRatio());
}));
}
//满意率 满意和非常满意占比
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(satisfactionList)) {
list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
}
@Override
public void extractStreetData(String customerId, String monthId) {
List<ScreenOrgRankDataEntity> list = screenOrgRankDataService.initList(customerId, OrgTypeConstant.AGENCY, OrgTypeConstant.STREET);
if (CollectionUtils.isEmpty(list)) {
return;
}
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
list.forEach(entity -> {
entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR));
entity.setMonthId(monthId);
});
//党员数
List<FactRegUserAgencyMonthlyDTO> partyMemberList = factRegUserAgencyMonthlyService.getOrgUserCountByCustomer(customerId, monthId,
OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(partyMemberList)) {
list.forEach(entity -> partyMemberList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setPartyTotal(dto.getPartymemberTotal());
}));
}
//小组数
List<OrgStatisticsResultDTO> groupList = factOriginGroupMainDailyService.getOrgGroupCount(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(groupList)) {
list.forEach(entity -> groupList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setGroupTotal(dto.getCount());
}));
}
//话题数
List<OrgStatisticsResultDTO> topicList = factOriginTopicMainDailyService.getOrgTopicCount(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(topicList)) {
list.forEach(entity -> topicList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setTopicTotal(dto.getCount());
}));
}
//议题数
List<OrgStatisticsResultDTO> issueList = factOriginIssueMainDailyService.getOrgIssueCount(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(issueList)) {
list.forEach(entity -> issueList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setIssueTotal(dto.getCount());
}));
}
//项目数
List<OrgStatisticsResultDTO> projectList = factOriginProjectMainDailyService.getOrgProjectCount(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(projectList)) {
list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
entity.setProjectTotal(dto.getCount());
}));
}
//结案率 结案数/项目数
List<FactIndexGovrnAblityOrgMonthlyEntity> abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(abilityList)) {
list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setCloseProjectRatio(dto.getClosedProjectRatio());
}));
}
//满意率 满意和非常满意占比
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(satisfactionList)) {
list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
}
}

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

@ -1,8 +1,8 @@
package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.alibaba.fastjson.JSON;
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.ScreenExtractFormDTO;
import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO;
@ -271,67 +271,78 @@ public class PartyGuideServiceImpl implements PartyGuideService {
*/
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());
List<JoinUserCountResultDTO> joinUserCountByAgencyList = actUserRelationService.selectJoinUserCount(customerId, monthId, ScreenConstant.AGENCY);
List<String> orgIds = new ArrayList<>();
List<String> orgIdsAgency = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList());
orgIds.addAll(orgIdsAgency);
orgIdsAgency.forEach(orgId -> {
Map<String, Object> agencyMap = agencyService.selectAllSubAgencyId(orgId, customerId);
List<String> gridIds = (List<String>) agencyMap.get(orgId);
orgIds.addAll(gridIds);
});
List<GridInfoResultDTO> directGridIds = gridService.selectDirectGrid(orgIdsAgency);
if (isGrid == false){
orgIds.addAll(directGridIds.stream().map(m -> m.getGridId()).collect(Collectors.toList()));
}
List<JoinUserCountResultDTO> joinUserCountList = actUserRelationService.selectJoinUserCount(customerId, monthId, null);
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataByAgencyList = actInfoService.selectActInfo(customerId, monthId, ScreenConstant.AGENCY, orgIds);
List<ScreenPartyBranchDataFormDTO> screenPartyBranchData = agencyService.selectAllAgencyIdToOrganize(customerId, monthId);
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataListAgencyAll = gridService.selectAllGridIdToOrganize(customerId, monthId);
screenPartyBranchDataListAgencyAll.addAll(screenPartyBranchData);
List<ScreenPartyBranchDataFormDTO> finalResult = new ArrayList<>();
screenPartyBranchDataListAgencyAll.forEach(rl -> {
orgIds.forEach(orgId -> {
if (rl.getOrgId().equals(orgId)){
finalResult.add(rl);
}
});
});
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataList = actInfoService.selectActInfo(customerId, monthId, null, orgIds);
if (isGrid == true){
List<JoinUserCountResultDTO> joinUserCountList = actUserRelationService.selectJoinUserCount(customerId, monthId, ScreenConstant.GRID);
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.getOrganizeCount()==NumConstant.ZERO ? NumConstant.ZERO : party.getJoinUserCount() / party.getOrganizeCount());
party.setYearId(DateUtils.getYearId(monthId));
}
});
finalResult.forEach(fl -> {
screenPartyBranchDataList.forEach(sp -> {
if (fl.getOrgId().equals(sp.getOrgId())){
fl.setOrganizeCount(sp.getOrganizeCount());
}
});
}
result.addAll(screenPartyBranchDataList);
joinUserCountList.forEach(join -> {
if (fl.getOrgId().equals(join.getOrgId())){
fl.setJoinUserCount(join.getJoinUserCount());
}
});
fl.setAverageJoinUserCount(fl.getOrganizeCount()==NumConstant.ZERO ? NumConstant.ZERO : fl.getJoinUserCount() / fl.getOrganizeCount());
});
});
// 社区级别的
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());
}
Map<String, List<ScreenPartyBranchDataFormDTO>> groupByType = finalResult.stream().collect(Collectors.groupingBy(ScreenPartyBranchDataFormDTO::getOrgType));
groupByType.forEach((orgType,list) -> {
if (orgType.equals(ScreenConstant.GRID)){
Map<String, List<ScreenPartyBranchDataFormDTO>> groupByAgency = finalResult.stream().collect(Collectors.groupingBy(ScreenPartyBranchDataFormDTO::getParentId));
groupByAgency.forEach((agencyId,actList) -> {
finalResult.forEach(fl -> {
if (fl.getOrgId().equals(agencyId)){
fl.setOrganizeCount(actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount)));
fl.setJoinUserCount(actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount)));
screenPartyBranchDataByAgencyList.forEach(organize -> {
if (organize.getOrgId().equals(agencyId)){
fl.setOrganizeCount(calAdd(organize.getOrganizeCount(),actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount))));
}
});
joinUserCountList.forEach(join -> {
if (join.getOrgId().equals(agencyId)){
fl.setJoinUserCount(calAdd(join.getJoinUserCount(),actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount))));
}
});
fl.setAverageJoinUserCount(fl.getOrganizeCount()==NumConstant.ZERO?NumConstant.ZERO : (fl.getJoinUserCount() / fl.getOrganizeCount()));
}
});
});
}
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)));
screenPartyBranchDataByAgencyList.forEach(organize -> {
if (organize.getOrgId().equals(agencyId)){
form.setOrganizeCount(calAdd(organize.getOrganizeCount(),actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount))));
}
});
joinUserCountByAgencyList.forEach(join -> {
if (join.getOrgId().equals(agencyId)){
form.setJoinUserCount(calAdd(join.getJoinUserCount(),actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount))));
}
});
form.setAverageJoinUserCount(form.getOrganizeCount()==NumConstant.ZERO?NumConstant.ZERO : (form.getJoinUserCount() / form.getOrganizeCount()));
result.add(form);
});
delAndInsertOrganize(result,customerId,monthId,orgIds);
delOrganize(customerId,monthId,orgIds);
insertOrganize(finalResult);
}else {
List<GridInfoResultDTO> directGridIds = gridService.selectDirectGrid(orgIds);
agencyIdList.forEach(agency -> {
String agencyId = agency.getAgencyId();
List<String> disGridIds = new ArrayList<>();
@ -343,52 +354,45 @@ public class PartyGuideServiceImpl implements PartyGuideService {
// 存在直属网格
if (!CollectionUtils.isEmpty(disGridIds)){
orgIds.addAll(disGridIds);
List<ScreenPartyBranchDataFormDTO> gridResult = new ArrayList<>();
List<JoinUserCountResultDTO> joinUserCountList = actUserRelationService.selectJoinUserCount(customerId, monthId, ScreenConstant.GRID);
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataList = actInfoService.selectActInfo(customerId, monthId, ScreenConstant.GRID, disGridIds);
if (!CollectionUtils.isEmpty(screenPartyBranchDataList)){
screenPartyBranchDataList.forEach(party -> {
joinUserCountList.forEach(join -> {
if (party.getOrgId().equals(join.getOrgId())){
party.setAverageJoinUserCount(join.getJoinUserCount());
party.setAverageJoinUserCount(party.getOrganizeCount()==NumConstant.ZERO ? NumConstant.ZERO : party.getJoinUserCount() / party.getOrganizeCount());
party.setYearId(DateUtils.getYearId(monthId));
}
});
ScreenPartyBranchDataFormDTO copyParty = ConvertUtils.sourceToTarget(party, ScreenPartyBranchDataFormDTO.class);
gridResult.add(copyParty);
finalResult.forEach(r -> {
screenPartyBranchDataList.forEach(party ->{
if (r.getOrgId().equals(party.getOrgId())){
r.setOrganizeCount(party.getOrganizeCount());
}
});
}
joinUserCountList.forEach(join -> {
if (r.getOrgId().equals(join.getOrgId())){
r.setJoinUserCount(join.getJoinUserCount());
}
});
r.setAverageJoinUserCount(r.getOrganizeCount()==NumConstant.ZERO ? NumConstant.ZERO : r.getJoinUserCount() / r.getOrganizeCount());
});
}
delOrganize(customerId,monthId,orgIds);
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)));
screenPartyBranchDataByAgencyList.forEach(organize -> {
if (organize.getOrgId().equals(agencyId)){
form.setOrganizeCount(calAdd(organize.getOrganizeCount(),screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount))));
}
});
joinUserCountByAgencyList.forEach(join -> {
if (join.getOrgId().equals(agencyId)){
form.setJoinUserCount(calAdd(join.getJoinUserCount(),screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount))));
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataByParentList = partyBranchDataService.selectScreenPartyBranchDataByParentId(customerId, monthId, agencyId);
screenPartyBranchDataByParentList.addAll(disPartyBranchDataList);
if (!CollectionUtils.isEmpty(screenPartyBranchDataByParentList)){
finalResult.forEach(form -> {
if (form.getOrgId().equals(agencyId)) {
form.setJoinUserCount(screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount)));
form.setOrganizeCount(screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount)));
screenPartyBranchDataByParentList.forEach(organize -> {
if (organize.getOrgId().equals(agencyId)) {
form.setOrganizeCount(calAdd(organize.getOrganizeCount(), screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount))));
}
});
joinUserCountList.forEach(join -> {
if (join.getOrgId().equals(agencyId)) {
form.setJoinUserCount(calAdd(join.getJoinUserCount(), screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount))));
}
});
form.setAverageJoinUserCount(form.getOrganizeCount() == NumConstant.ZERO ? NumConstant.ZERO : (form.getJoinUserCount() / form.getOrganizeCount()));
}
});
form.setAverageJoinUserCount(form.getOrganizeCount()==NumConstant.ZERO?NumConstant.ZERO : (form.getJoinUserCount() / form.getOrganizeCount()));
result.add(form);
}
});
delAndInsertOrganize(result,customerId,monthId,orgIds);
insertOrganize(finalResult);
}
}
}
@ -478,35 +482,19 @@ public class PartyGuideServiceImpl implements PartyGuideService {
* @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);
}
});
public void insertOrganize(List<ScreenPartyBranchDataFormDTO> result){
List<List<ScreenPartyBranchDataFormDTO>> partition = ListUtils.partition(result, NumConstant.ONE_HUNDRED);
partition.forEach(p -> {
partyBranchDataService.insertScreenPartyBranchData(p);
});
if (!CollectionUtils.isEmpty(result)){
finalResult.forEach(fr -> {
result.forEach(r -> {
if (fr.getOrgId().equals(r.getOrgId())){
BeanUtils.copyProperties(r,fr);
}
});
});
}
}
@Transactional(rollbackFor = Exception.class)
public void delOrganize(String customerId, String monthId, List<String> orgIds){
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);
});
}
}

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

@ -2,6 +2,7 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.constant.DimObjectStatusConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity;
@ -61,6 +62,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
gridList.forEach(entity -> {
entity.setDataEndTime(dateId);
String gridId = entity.getOrgId();
//何为参与: 议题的表决行为次数总计
//1、党员参与议事
entity.setIssueTotal(calPartyPartiIssueTotal(customerId,gridId,null,null,NumConstant.ONE_STR));
if(entity.getIssueTotal()==0){
@ -107,7 +109,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
// 9、已解决项目
entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, gridId, null, "resolved"));
entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, gridId, null, DimObjectStatusConstant.RESOLVED));
if (entity.getResolvedProjectTotal() == NumConstant.ZERO) {
entity.setResolvedProjectRatio(BigDecimal.ZERO);
} else {
@ -116,7 +118,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
});
screenPioneerDataService.delAndSavePioneerData(customerId, "grid", IndexCalConstant.DELETE_SIZE, gridList);
screenPioneerDataService.delAndSavePioneerData(customerId, OrgTypeConstant.GRID, IndexCalConstant.DELETE_SIZE, gridList);
}
/**
@ -194,7 +196,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
// 9、已解决项目
entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, null, communityId, "resolved"));
entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, null, communityId, DimObjectStatusConstant.RESOLVED));
if (entity.getResolvedProjectTotal() == NumConstant.ZERO) {
entity.setResolvedProjectRatio(BigDecimal.ZERO);
} else {
@ -203,7 +205,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
});
screenPioneerDataService.delAndSavePioneerData(customerId, "agency", IndexCalConstant.DELETE_SIZE, communityList);
screenPioneerDataService.delAndSavePioneerData(customerId, OrgTypeConstant.AGENCY, IndexCalConstant.DELETE_SIZE, communityList);
}
@ -267,7 +269,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
// 9、已解决项目
entity.setResolvedProjectTotal(getAgencyClosedProjectTotal(customerId, entity.getAgencyPath(), "resolved"));
entity.setResolvedProjectTotal(getAgencyClosedProjectTotal(customerId, entity.getAgencyPath(), DimObjectStatusConstant.RESOLVED));
if (entity.getResolvedProjectTotal() == NumConstant.ZERO) {
entity.setResolvedProjectRatio(BigDecimal.ZERO);
} else {
@ -276,7 +278,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
});
screenPioneerDataService.delAndSavePioneerData(customerId, "agency", IndexCalConstant.DELETE_SIZE, agencyList);
screenPioneerDataService.delAndSavePioneerData(customerId, OrgTypeConstant.AGENCY, IndexCalConstant.DELETE_SIZE, agencyList);
}

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

@ -6,6 +6,7 @@ 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.constant.ProjectConstant;
import com.epmet.dto.extract.form.ExtractScreenFormDTO;
import com.epmet.dto.extract.result.GridGroupUserCountResultDTO;
import com.epmet.dto.extract.result.GridUserCountResultDTO;
@ -13,25 +14,28 @@ import com.epmet.dto.extract.result.IssueVoteUserCountResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity;
import com.epmet.entity.stats.DimAgencyEntity;
import com.epmet.entity.stats.DimGridEntity;
import com.epmet.entity.stats.FactIssueAgencyMonthlyEntity;
import com.epmet.entity.stats.FactIssueGridMonthlyEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService;
import com.epmet.service.evaluationindex.extract.toscreen.PublicPartExtractService;
import com.epmet.service.evaluationindex.screen.ScreenUserJoinService;
import com.epmet.service.stats.DimAgencyService;
import com.epmet.service.stats.DimGridService;
import com.epmet.service.stats.FactIssueAgencyMonthlyService;
import com.epmet.service.stats.FactIssueGridMonthlyService;
import com.epmet.service.stats.user.FactRegUserAgencyMonthlyService;
import com.epmet.service.stats.user.FactRegUserGridMonthlyService;
import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.ListUtils;
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.*;
import java.util.stream.Collectors;
/**
@ -53,9 +57,15 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService {
@Autowired
private FactRegUserGridMonthlyService factRegUserGridMonthlyService;
@Autowired
private FactIssueAgencyMonthlyService factIssueAgencyMonthlyService;
@Autowired
private FactRegUserAgencyMonthlyService factRegUserAgencyMonthlyService;
@Autowired
private FactOriginIssueLogDailyService factOriginIssueLogDailyService;
@Autowired
private FactOriginGroupMainDailyService factOriginGroupMainDailyService;
@Autowired
private ScreenUserJoinService screenUserJoinService;
/**
@ -64,9 +74,7 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService {
* 总参与统计周期内议题表决(虽然可以评价 但是只有表决的人可以评价 所以按表决人数算)的人数
* 百人人均议题统计周期内总的议题数/注册用户数/100
* 百人平均参与度每个议题的实际参与数/应参与数 的平均值每个议题的实际参与数/应参与数的和/被表决的议题数 来源 获取issue_vote_statistical_daily中 monthId的数据
* <p>
* <p>
* <p>
*
* 不考虑市北人均议题统计周期内议题总数/发过议题的人数 参与度各个行为(表决)的总数/发生行为的人数
*
* @return java.lang.Boolean
@ -94,7 +102,7 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService {
Map<String, ScreenUserJoinEntity> insertMap = new HashMap<>();
orgList.forEach(org -> buildUserJoinEntity(formDTO, org, insertMap));
//获取议题月份增量
List<FactIssueGridMonthlyEntity> issueTotal = factIssueGridMonthlyService.getIssueCount(formDTO.getCustomerId(), formDTO.getMonthId());
List<FactIssueGridMonthlyEntity> issueTotal = factIssueGridMonthlyService.getIssueIncCountAndTotalByMonthId(formDTO.getCustomerId(), formDTO.getMonthId());
if (CollectionUtils.isEmpty(issueTotal)) {
log.error("抽取【公众参与-人均议题】,获取议题增量为空");
return;
@ -104,35 +112,40 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService {
log.error("抽取【公众参与-人均议题】,获取注册用户数为空");
return;
}
Map<String, GridUserCountResultDTO> userCountMap = userCountList.stream().collect(Collectors.toMap(GridUserCountResultDTO::getGridId, o -> o));
Map<String, GridUserCountResultDTO> userCountMap = userCountList.stream().collect(Collectors.toMap(GridUserCountResultDTO::getOrgId, 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);
log.debug("issue:{}", JSON.toJSONString(issue));
log.debug("user:{}", JSON.toJSONString(user));
if (!user.getRegTotal().equals(0)) {
BigDecimal avgIssueCount = new BigDecimal(issue.getIssueIncr()).divide(new BigDecimal(user.getRegTotal())
.divide(new BigDecimal(NumConstant.ONE_HUNDRED)), 4, BigDecimal.ROUND_HALF_UP);
entity.setAvgIssue(avgIssueCount);
}
});
//获取该月 表决的人数
List<IssueVoteUserCountResultDTO> voteCountList = factOriginIssueLogDailyService.getVoteCount(formDTO.getCustomerId(), formDTO.getMonthId());
List<IssueVoteUserCountResultDTO> voteCountList = factOriginIssueLogDailyService.getVoteCount(formDTO.getCustomerId(), formDTO.getMonthId(), ProjectConstant.GRID_ID);
Map<String, Integer> gridMemberCount = new HashMap<>();
if (!CollectionUtils.isEmpty(issueTotal)) {
//获取每个网格的应表决人数
List<GridGroupUserCountResultDTO> memberCountList = factOriginGroupMainDailyService.selectDistinctGroupMemberCount(formDTO.getCustomerId());
List<GridGroupUserCountResultDTO> memberCountList = factOriginGroupMainDailyService.selectDistinctGroupMemberCount(formDTO.getCustomerId(), ProjectConstant.AGENCY_ID);
if (CollectionUtils.isEmpty(memberCountList)) {
log.error("抽取【公众参与-人均议题】,获取应表决人数为空");
return;
}
gridMemberCount = memberCountList.stream().collect(Collectors.toMap(GridGroupUserCountResultDTO::getGridId, o -> o.getMemberCount()));
gridMemberCount = memberCountList.stream().collect(Collectors.toMap(GridGroupUserCountResultDTO::getOrgId, o -> o.getMemberCount()));
}
//百人平均参与度:每个议题的实际参与数/应参与数 的平均值:(每个议题的实际参与数/应参与数)的和)/被表决的议题数
//遍历实际参与人数
Map<String, List<IssueVoteUserCountResultDTO>> voteMap = voteCountList.stream().collect(Collectors.groupingBy(IssueVoteUserCountResultDTO::getGridId));
Map<String, List<IssueVoteUserCountResultDTO>> voteMap = voteCountList.stream().collect(Collectors.groupingBy(IssueVoteUserCountResultDTO::getOrgId));
for (Map.Entry<String, List<IssueVoteUserCountResultDTO>> entry : voteMap.entrySet()) {
String gridId = entry.getKey();
ScreenUserJoinEntity entity = insertMap.get(gridId);
@ -144,10 +157,15 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService {
if (memberCount == null) {
memberCount = 0;
}
bigDecimal = bigDecimal.add(new BigDecimal(vote.getVoteCount() / memberCount));
if (memberCount != 0) {
bigDecimal = bigDecimal.add(new BigDecimal(vote.getVoteCount() / (memberCount * 1.0)));
}
}
if (votedByIssueCount.intValue() != 0) {
entity.setAvgJoin(bigDecimal.divide(votedByIssueCount, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)));
}
entity.setAvgJoin(bigDecimal.divide(votedByIssueCount).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)));
}
screenUserJoinService.deleteAndInsertBatch(formDTO, new ArrayList<>(insertMap.values()));
}
private void extractAgencyUserJoin(ExtractScreenFormDTO formDTO) {
@ -158,14 +176,72 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService {
}
//构建组织数据
Map<String, ScreenUserJoinEntity> insertMap = new HashMap<>();
orgList.forEach(org -> {
buildUserJoinEntity(formDTO, org, insertMap);
orgList.forEach(org -> buildUserJoinEntity(formDTO, org, insertMap));
List<FactIssueAgencyMonthlyEntity> issueTotal = factIssueAgencyMonthlyService.getIssueIncCountAndTotalByMonthId(formDTO.getCustomerId(), formDTO.getMonthId());
List<GridUserCountResultDTO> userCountList = factRegUserAgencyMonthlyService.selectAgencyUserCount(formDTO.getCustomerId(), formDTO.getMonthId());
if (CollectionUtils.isEmpty(issueTotal)) {
log.error("抽取【公众参与-人均议题】,获取注册用户数为空");
return;
}
Map<String, GridUserCountResultDTO> userCountMap = userCountList.stream().collect(Collectors.toMap(GridUserCountResultDTO::getOrgId, o -> o));
Set<String> agencyIdSet = new HashSet<>();
issueTotal.forEach(issue -> {
String agencyId = issue.getAgencyId();
agencyIdSet.add(agencyId);
ScreenUserJoinEntity entity = insertMap.get(agencyId);
entity.setJoinTotal(issue.getIssueIncr());
GridUserCountResultDTO user = userCountMap.get(agencyId);
//百人人均议题:统计周期内总的议题数/(注册用户数/100)
if (!user.getRegTotal().equals(0)) {
BigDecimal avgIssueCount = new BigDecimal(issue.getIssueIncr()).divide(new BigDecimal(user.getRegTotal())
.divide(new BigDecimal(NumConstant.ONE_HUNDRED)), 4, BigDecimal.ROUND_HALF_UP);
entity.setAvgIssue(avgIssueCount);
}
});
List<List<String>> partition = ListUtils.partition(new ArrayList<>(agencyIdSet), NumConstant.THIRTY);
partition.forEach(list -> {
//获取该月 表决的人数
List<IssueVoteUserCountResultDTO> voteCountList = factOriginIssueLogDailyService.getVoteCount(formDTO.getCustomerId(), formDTO.getMonthId(), ProjectConstant.AGENCY_ID);
Map<String, Integer> orgMemberCount = new HashMap<>();
if (!CollectionUtils.isEmpty(issueTotal)) {
//获取每个网格的应表决人数
List<GridGroupUserCountResultDTO> memberCountList = factOriginGroupMainDailyService.selectDistinctGroupMemberCount(formDTO.getCustomerId(), ProjectConstant.AGENCY_ID);
if (CollectionUtils.isEmpty(memberCountList)) {
log.error("抽取【公众参与-人均议题】,获取应表决人数为空");
return;
}
orgMemberCount = memberCountList.stream().collect(Collectors.toMap(GridGroupUserCountResultDTO::getOrgId, o -> o.getMemberCount()));
}
//百人平均参与度:每个议题的实际参与数/应参与数 的平均值:(每个议题的实际参与数/应参与数)的和)/被表决的议题数
//遍历实际参与人数
Map<String, List<IssueVoteUserCountResultDTO>> voteMap = voteCountList.stream().collect(Collectors.groupingBy(IssueVoteUserCountResultDTO::getOrgId));
for (Map.Entry<String, List<IssueVoteUserCountResultDTO>> entry : voteMap.entrySet()) {
String orgId = entry.getKey();
ScreenUserJoinEntity entity = insertMap.get(orgId);
List<IssueVoteUserCountResultDTO> issueList = entry.getValue();
BigDecimal bigDecimal = new BigDecimal(0);
BigDecimal votedByIssueCount = new BigDecimal(issueList.get(0).getIssueCount());
for (IssueVoteUserCountResultDTO vote : issueList) {
Integer memberCount = orgMemberCount.get(orgId);
if (memberCount == null) {
memberCount = 0;
}
bigDecimal = bigDecimal.add(new BigDecimal(vote.getVoteCount() / (memberCount * 1.0)));
}
if (votedByIssueCount.intValue() != 0) {
entity.setAvgJoin(bigDecimal.divide(votedByIssueCount, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)));
}
}
});
List<FactIssueGridMonthlyEntity> issueTotal = factIssueGridMonthlyService.getIssueCount(formDTO.getCustomerId(), formDTO.getMonthId());
screenUserJoinService.deleteAndInsertBatch(formDTO, new ArrayList<>(insertMap.values()));
}
private void buildUserJoinEntity(ExtractScreenFormDTO formDTO, Object org, Map<String, ScreenUserJoinEntity> result) {
DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(DateUtils.stringToDate(formDTO.getMonthId(), DateUtils.DATE_PATTERN_YYYYMMDD));
DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(DateUtils.stringToDate(formDTO.getMonthId(), DateUtils.DATE_PATTERN_YYYYMM));
ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(dimIdBean, ScreenUserJoinEntity.class);
if (org instanceof DimGridEntity) {
DimGridEntity grid = (DimGridEntity) org;

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

@ -1,5 +1,6 @@
package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.entity.evaluationindex.screen.ScreenPublicPartiTotalDataEntity;
import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService;
@ -41,21 +42,13 @@ public class PublicPartiTotalDataExtractServiceImpl implements PublicPartiTotalD
public void extractPublicPartiTotalData(String customerId, String dateId) {
List<ScreenUserTotalDataEntity> userTotalDataEntityList = screenUserTotalDataService.selectList(customerId);
if (CollectionUtils.isEmpty(userTotalDataEntityList)) {
log.warn("screen_user_total_data dosen't have any record ");
log.warn("screen_user_total_data dosen't have any record customerId="+customerId);
return;
}
List<ScreenPublicPartiTotalDataEntity> list = new ArrayList<>();
for (ScreenUserTotalDataEntity totalData : userTotalDataEntityList) {
ScreenPublicPartiTotalDataEntity entity = new ScreenPublicPartiTotalDataEntity();
entity.setCustomerId(customerId);
entity.setOrgType(totalData.getOrgType());
entity.setOrgId(totalData.getOrgId());
entity.setParentId(totalData.getParentId());
entity.setOrgName(totalData.getOrgName());
ScreenPublicPartiTotalDataEntity entity = ConvertUtils.sourceToTarget(totalData,ScreenPublicPartiTotalDataEntity.class);
entity.setDataEndTime(dateId);
entity.setTopicTotal(totalData.getTopicTotal());
entity.setIssueTotal(totalData.getIssueTotal());
entity.setProjectTotal(totalData.getProjectTotal());
entity.setRegUserTotal(totalData.getUserTotal());
//参与人数参与人数: 议题的表决行为的用户数去重的累计值
int joinUserTotal=factOriginIssueLogDailyService.queryJoinUserTotal(customerId,totalData.getOrgType(),totalData.getOrgId());

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

@ -3,8 +3,10 @@ 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.ExtractOriginFormDTO;
import com.epmet.dto.extract.form.ExtractScreenFormDTO;
import com.epmet.service.evaluationindex.extract.toscreen.PartyBaseInfoService;
import com.epmet.service.evaluationindex.extract.toscreen.PioneerDataExtractService;
import com.epmet.service.evaluationindex.extract.toscreen.PublicPartExtractService;
import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractService;
import com.epmet.service.stats.DimCustomerService;
import lombok.extern.slf4j.Slf4j;
@ -31,6 +33,8 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
private PartyBaseInfoService partyBaseInfoService;
@Autowired
private PioneerDataExtractService pioneerDataExtractService;
@Autowired
private PublicPartExtractService publicPartExtractService;
/**
* @param extractOriginFormDTO
@ -66,17 +70,59 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
}
@Override
public void extractMonthlyAll(ExtractScreenFormDTO formDTO) {
List<String> customerIds = new ArrayList<>();
if (StringUtils.isNotBlank(formDTO.getCustomerId())) {
customerIds.add(formDTO.getCustomerId());
} else {
int pageNo = NumConstant.ONE;
int pageSize = NumConstant.ONE_HUNDRED;
customerIds = dimCustomerService.selectCustomerIdPage(pageNo, pageSize);
}
if (!CollectionUtils.isEmpty(customerIds)) {
customerIds.forEach(customerId -> {
if (StringUtils.isNotBlank(formDTO.getStartMonth()) && StringUtils.isNotBlank(formDTO.getEndMonth())) {
List<String> daysBetween = DateUtils.getMonthBetween(formDTO.getStartDate(), formDTO.getEndDate());
daysBetween.forEach(monthId -> {
extractMonthly(customerId, monthId);
});
} else if (StringUtils.isNotBlank(formDTO.getMonthId())) {
extractMonthly(customerId, formDTO.getMonthId());
} else {
String dateId = LocalDate.now().minusDays(NumConstant.ONE).toString().replace("-", "");
extractMonthly(customerId, dateId);
}
});
}
}
/**
* @Description 按天计算
* @param customerId
* @param dateId
* @Description 按天计算
* @author zxc
* @date 2020/9/24 10:16 上午
*/
public void extractDaily(String customerId,String dateId){
public void extractDaily(String customerId, String dateId) {
// partyBaseInfoService.statsPartyMemberBaseInfoToScreen(customerId,dateId);
pioneerDataExtractService.extractGridPioneerData(customerId,dateId);
pioneerDataExtractService.extractCommunityPioneerData(customerId,dateId);
pioneerDataExtractService.extractExceptCommunityPioneerData(customerId,dateId);
pioneerDataExtractService.extractGridPioneerData(customerId, dateId);
pioneerDataExtractService.extractCommunityPioneerData(customerId, dateId);
pioneerDataExtractService.extractExceptCommunityPioneerData(customerId, dateId);
}
/**
* @Description 按月计算
* @author zxc
* @date 2020/9/24 10:16 上午
*/
public void extractMonthly(String customerId, String monthId) {
ExtractScreenFormDTO formDTO = new ExtractScreenFormDTO();
formDTO.setCustomerId(customerId);
formDTO.setMonthId(monthId);
publicPartExtractService.extractTotalDataMonthly(formDTO);
}
}

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

@ -1,9 +1,11 @@
package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
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.ScreenDifficultyDataEntity;
import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity;
import com.epmet.service.evaluationindex.extract.toscreen.ScreenGrassrootsGovernDataAbsorptionService;
import com.epmet.service.evaluationindex.indexcal.CpcIndexCalculateService;
@ -88,7 +90,8 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
user.setGridName(gridInfo.getGridName());
user.setOrgId(gridInfo.getAgencyId());
user.setOrgName(gridInfo.getOrgName());
user.setAllParentIds(gridInfo.getPids());
//原始数据Pid使用英文:隔开,大屏数据要求按照英文,隔开
user.setAllParentIds(gridInfo.getPids().replaceAll(StrConstant.COLON,StrConstant.COMMA));
}
Integer point = pointMap.get(user.getUserId());
BigDecimal score = scoreMap.get(user.getUserId());
@ -114,6 +117,6 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
**/
@Override
public void difficultyDataHub(ScreenCentralZoneDataFormDTO param) {
ScreenDifficultyDataEntity entity = new ScreenDifficultyDataEntity();
}
}

29
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenOrgRankDataService.java

@ -20,6 +20,8 @@ package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity;
import java.util.List;
/**
* 党建引领-组织先进排行榜
*
@ -27,4 +29,31 @@ import com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity;
* @since v1.0.0 2020-09-22
*/
public interface ScreenOrgRankDataService extends BaseService<ScreenOrgRankDataEntity> {
/**
* 构造screen_govern_rank_data 初始数据先赋值为0
*
* @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<ScreenOrgRankDataEntity> 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<ScreenOrgRankDataEntity> entityList);
}

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

@ -19,8 +19,11 @@ package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.form.ExtractScreenFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity;
import java.util.List;
/**
* 基层治理-公众参与
*
@ -28,4 +31,14 @@ import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity;
* @since v1.0.0 2020-09-22
*/
public interface ScreenUserJoinService extends BaseService<ScreenUserJoinEntity> {
/**
* desc: 删除并插入某月的数据
*
* @param formDTO
* @param list
* @return java.lang.Boolean
* @author LiuJanJun
* @date 2020/9/27 4:40 下午
*/
Boolean deleteAndInsertBatch(ExtractScreenFormDTO formDTO, List<ScreenUserJoinEntity> list);
}

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

@ -18,12 +18,21 @@
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.ScreenOrgRankDataDao;
import com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity;
import com.epmet.service.evaluationindex.screen.ScreenOrgRankDataService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* 党建引领-组织先进排行榜
*
@ -31,7 +40,45 @@ import org.springframework.stereotype.Service;
* @since v1.0.0 2020-09-22
*/
@Service
@Slf4j
public class ScreenOrgRankDataServiceImpl extends BaseServiceImpl<ScreenOrgRankDataDao, ScreenOrgRankDataEntity> implements ScreenOrgRankDataService {
@Override
@DataSource(DataSourceConstant.STATS)
public List<ScreenOrgRankDataEntity> initList(String customerId, String orgType, String agencyLevel) {
List<ScreenOrgRankDataEntity> list = new ArrayList<>();
switch (orgType) {
case OrgTypeConstant.AGENCY:
log.info("组织级别统计");
list = baseDao.initAgencyDataList(customerId, agencyLevel);
break;
case OrgTypeConstant.GRID:
log.info("网格级别统计");
list = baseDao.initGridDataList(customerId);
break;
default:
log.info("部门级别统计");
break;
}
return list;
}
@Override
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public void delAndSaveRankData(String customerId, String orgType, String monthId, Integer deleteSize, List<ScreenOrgRankDataEntity> entityList) {
if (CollectionUtils.isEmpty(entityList)) {
return;
}
List<String> orgIds = new ArrayList<>();
for (ScreenOrgRankDataEntity entity : entityList) {
orgIds.add(entity.getOrgId());
}
int deleteNum;
do {
deleteNum = baseDao.deleteRankData(customerId, orgType, monthId, deleteSize, orgIds);
} while (deleteNum != NumConstant.ZERO);
insertBatch(entityList);
}
}

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

@ -23,6 +23,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.dao.evaluationindex.screen.ScreenPioneerDataDao;
import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity;
import com.epmet.service.evaluationindex.screen.ScreenPioneerDataService;
@ -58,13 +59,13 @@ public class ScreenPioneerDataServiceImpl extends BaseServiceImpl<ScreenPioneerD
@Override
public List<ScreenPioneerDataEntity> initPioneerDataList(String customerId, String orgType) {
List<ScreenPioneerDataEntity> list = new ArrayList<>();
if ("grid".equals(orgType)) {
if (OrgTypeConstant.GRID.equals(orgType)) {
//按网格构造
list = baseDao.initGridPioneerDataList(customerId);
} else if ("community".equals(orgType)) {
} else if (OrgTypeConstant.COMMUNITY.equals(orgType)) {
//按社构造
list = baseDao.initCommunityPioneerDataList(customerId);
}else if("agency".equals(orgType)){
}else if(OrgTypeConstant.AGENCY.equals(orgType)){
list = baseDao.initExceptCommunityPioneerDataList(customerId);
}
return list;

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

@ -18,11 +18,27 @@
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.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.CompareConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.screen.ScreenUserJoinDao;
import com.epmet.dto.extract.form.ExtractScreenFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity;
import com.epmet.service.evaluationindex.screen.ScreenUserJoinService;
import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
/**
* 基层治理-公众参与
@ -30,8 +46,149 @@ import org.springframework.stereotype.Service;
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-22
*/
@Slf4j
@Service
public class ScreenUserJoinServiceImpl extends BaseServiceImpl<ScreenUserJoinDao, ScreenUserJoinEntity> implements ScreenUserJoinService {
@Override
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
@Transactional(rollbackFor = Exception.class)
public Boolean deleteAndInsertBatch(ExtractScreenFormDTO formDTO, List<ScreenUserJoinEntity> list) {
if (formDTO == null || StringUtils.isBlank(formDTO.getCustomerId()) || StringUtils.isBlank(formDTO.getMonthId()) || CollectionUtils.isEmpty(list)) {
log.error("deleteAndInsertBatch param is error");
return false;
}
int deleteNum;
do {
deleteNum = baseDao.deleteUserJoin(formDTO.getCustomerId(), formDTO.getMonthId());
} while (deleteNum != NumConstant.ZERO);
String[] orgIds = new String[list.size()];
for (int i = NumConstant.ZERO; i < list.size(); i++) {
orgIds[i] = list.get(i).getOrgId();
}
DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(DateUtils.addDateMonths(DateUtils.stringToDate(formDTO.getMonthId(), DateUtils.DATE_PATTERN_YYYYMM), -1));
// 获取上个月的基本数据
List<ScreenUserJoinEntity> lastMonthJoinList = baseDao.selectLastMonthScreenUserJoinList(formDTO.getCustomerId(),
dimIdBean.getYearId(),
dimIdBean.getMonthId(),
orgIds);
// 定义本月待添加数据的集合
List<ScreenUserJoinEntity> curMonthJoinEntityList = new ArrayList<>();
// 增加率计算
if (null != lastMonthJoinList && lastMonthJoinList.size() > NumConstant.ZERO) {
// 存在上个月的数据 (本月-上月)/上月 *100
for (int i = NumConstant.ZERO; i < list.size(); i++) {
for (int j = NumConstant.ZERO; j < lastMonthJoinList.size(); j++) {
if (list.get(i).getOrgId().equals(lastMonthJoinList.get(j).getOrgId())) {
ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(list.get(i), ScreenUserJoinEntity.class);
entity.setJoinTotalUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getJoinTotal(), list.get(j).getJoinTotal()));
entity.setJoinTotalUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getJoinTotal(), list.get(j).getJoinTotal()));
entity.setAvgIssueUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getAvgIssue(), list.get(j).getAvgIssue()));
entity.setAvgIssueUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getAvgIssue(), list.get(j).getAvgIssue()));
entity.setAgvgJoinUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getAvgJoin(), list.get(j).getAvgJoin()));
entity.setAgvgJoinUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getAvgJoin(), list.get(j).getAvgJoin()));
curMonthJoinEntityList.add(entity);
}
}
}
} else {
// 计算增长率后的 待新增数据
BigDecimal zero = new BigDecimal(NumConstant.ZERO);
// 不存在上个月的数据
for (int i = NumConstant.ZERO; i < list.size(); i++) {
ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(list.get(i), ScreenUserJoinEntity.class);
entity.setJoinTotalUpRate(zero);
entity.setJoinTotalUpFlag("");
entity.setAvgIssueUpRate(zero);
entity.setAvgIssueUpFlag("");
entity.setAgvgJoinUpRate(zero);
entity.setAgvgJoinUpFlag("");
curMonthJoinEntityList.add(entity);
}
}
this.insertBatch(list, NumConstant.ONE_HUNDRED);
return true;
}
/**
* 计算 本月数值 相较于 上月数值的增长率
*
* @param old 上月数值
* @param now 本月数值
* @return java.math.BigDecimal
* @Author zhangyong
* @Date 15:38 2020-08-21
**/
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);
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;
}
/**
* 计算 本月数值 相较于 上月数值的增长率 得出标识
*
* @param old 上月数值
* @param now 本月数值
* @return java.util.String
* @Author zhangyong
* @Date 15:38 2020-08-21
**/
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.compareTo(now) == -1) {
return CompareConstant.INCR_STR;
} else {
return CompareConstant.EQ_STR;
}
}
}

16
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java

@ -115,10 +115,22 @@ public interface FactIssueAgencyMonthlyService extends BaseService<FactIssueAgen
/**
* 批量保存
* @author zhaoqifeng
* @date 2020/6/23 14:07
*
* @param list
* @return void
* @author zhaoqifeng
* @date 2020/6/23 14:07
*/
void saveList(List<FactIssueAgencyMonthlyEntity> list);
/**
* desc: 获取某月议题总数
*
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.entity.stats.FactIssueGridMonthlyEntity>
* @author LiuJanJun
* @date 2020/9/27 3:30 下午
*/
List<FactIssueAgencyMonthlyEntity> getIssueIncCountAndTotalByMonthId(String customerId, String monthId);
}

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

@ -79,5 +79,5 @@ public interface FactIssueGridMonthlyService extends BaseService<FactIssueGridMo
* @author LiuJanJun
* @date 2020/9/25 5:00 下午
*/
List<FactIssueGridMonthlyEntity> getIssueCount(String customerId, String monthId);
List<FactIssueGridMonthlyEntity> getIssueIncCountAndTotalByMonthId(String customerId, String monthId);
}

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java

@ -117,4 +117,9 @@ public class FactIssueAgencyMonthlyServiceImpl extends BaseServiceImpl<FactIssue
insertBatch(list);
}
@Override
public List<FactIssueAgencyMonthlyEntity> getIssueIncCountAndTotalByMonthId(String customerId, String monthId) {
return baseDao.getIssueIncCountAndTotalByMonthId(customerId, monthId);
}
}

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

@ -74,7 +74,7 @@ public class FactIssueGridMonthlyServiceImpl extends BaseServiceImpl<FactIssueGr
* @date 2020/9/25 5:00 下午
*/
@Override
public List<FactIssueGridMonthlyEntity> getIssueCount(String customerId, String monthId) {
public List<FactIssueGridMonthlyEntity> getIssueIncCountAndTotalByMonthId(String customerId, String monthId) {
return baseDao.getIssueCount(customerId, monthId);
}

25
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserAgencyMonthlyService.java

@ -19,10 +19,10 @@ package com.epmet.service.stats.user;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.extract.result.GridUserCountResultDTO;
import com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO;
import com.epmet.entity.stats.user.FactRegUserAgencyMonthlyEntity;
import java.util.List;
import java.util.Map;
@ -93,4 +93,27 @@ public interface FactRegUserAgencyMonthlyService extends BaseService<FactRegUser
* @date 2020-06-17
*/
void delete(String[] ids);
/**
* desc: 获取用户注册用户数 某月增量
*
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.GridUserCountResultDTO>
* @author LiuJanJun
* @date 2020/9/27 3:45 下午
*/
List<GridUserCountResultDTO> selectAgencyUserCount(String customerId, String monthId);
/**
* 查询机关下各用户数量
*
* @author zhaoqifeng
* @date 2020/9/27 14:02
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO>
*/
List<FactRegUserAgencyMonthlyDTO> getOrgUserCountByCustomer(String customerId, String monthId, String level);
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridMonthlyService.java

@ -103,4 +103,15 @@ public interface FactRegUserGridMonthlyService extends BaseService<FactRegUserGr
* @date 2020/9/19 11:10 上午
*/
List<GridUserCountResultDTO> selectGridUserCount(String customerId,String monthId);
/**
* 查询网格下各用户数量
*
* @author zhaoqifeng
* @date 2020/9/27 14:02
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO>
*/
List<FactRegUserGridMonthlyDTO> getGridUserCountByCustomer(String customerId, String monthId);
}

14
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserAgencyMonthlyServiceImpl.java

@ -20,15 +20,15 @@ package com.epmet.service.stats.user.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.stats.user.FactRegUserAgencyMonthlyDao;
import com.epmet.dto.extract.result.GridUserCountResultDTO;
import com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO;
import com.epmet.entity.stats.user.FactRegUserAgencyMonthlyEntity;
import com.epmet.service.stats.user.FactRegUserAgencyMonthlyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -99,4 +99,14 @@ public class FactRegUserAgencyMonthlyServiceImpl extends BaseServiceImpl<FactReg
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public List<GridUserCountResultDTO> selectAgencyUserCount(String customerId, String monthId) {
return baseDao.selectAgencyUserCount(customerId, monthId);
}
@Override
public List<FactRegUserAgencyMonthlyDTO> getOrgUserCountByCustomer(String customerId, String monthId, String level) {
return baseDao.selectOrgUserCountByCustomer(customerId, monthId, level);
}
}

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridMonthlyServiceImpl.java

@ -112,4 +112,9 @@ public class FactRegUserGridMonthlyServiceImpl extends BaseServiceImpl<FactRegUs
return baseDao.selectGridUserCount(customerId, monthId);
}
@Override
public List<FactRegUserGridMonthlyDTO> getGridUserCountByCustomer(String customerId, String monthId) {
return baseDao.selectGridUserCountByCustomer(customerId, monthId);
}
}

32
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml

@ -268,8 +268,8 @@
<select id="selectDistinctGroupMemberCount" resultType="com.epmet.dto.extract.result.GridGroupUserCountResultDTO">
SELECT
COUNT(DISTINCT MEMBER_ID) AS memberCount,
GRID_ID,
CUSTOMER_ID,
${groupField} AS orgId,
CUSTOMER_ID,
PIDS,
AGENCY_ID
FROM
@ -277,6 +277,32 @@
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
GROUP by GRID_ID
GROUP by ${groupField}
</select>
<select id="selectGridGroupCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
GRID_ID AS "orgId",
COUNT(ID) AS "count"
FROM fact_origin_group_main_daily
WHERE
1=1
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
AND GROUP_STATE = 'approved'
GROUP BY GRID_ID
</select>
<select id="selectOrgGroupCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
f.AGENCY_ID,
COUNT(f.ID) AS "count"
FROM fact_origin_group_main_daily f
INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID
AND da.LEVEL = #{level}
WHERE
1=1
AND f.CUSTOMER_ID = #{customerId}
AND f.MONTH_ID = #{monthId}
AND f.GROUP_STATE = 'approved'
GROUP BY f.AGENCY_ID
</select>
</mapper>

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

@ -95,6 +95,23 @@
</select>
<!-- 党员参与议事:支持或者反对的次数 -->
<select id="getVoteCount" resultType="com.epmet.dto.extract.result.IssueVoteUserCountResultDTO">
SELECT
${groupField} AS orgId,
COUNT(1) AS voteCount,
COUNT( DISTINCT ISSUE_ID) issueCount
FROM
fact_origin_issue_log_daily
WHERE
DEL_FLAG = '0'
and CUSTOMER_ID = #{customerId,jdbcType=VARCHAR}
and MONTH_ID = #{monthId,jdbcType=VARCHAR}
AND ACTION_CODE LIKE 'vote_%'
group by ${groupField}
</select>
<!-- 参与人数: 议题的表决行为的用户数去重的累计值 -->
<select id="calPartyPartiIssueTotal" parameterType="map" resultType="int">
SELECT
COUNT(1)AS TOTAL
@ -120,8 +137,6 @@
</if>
</select>
<!-- 参与人数: 议题的表决行为的用户数去重的累计值 -->
<select id="selectCountJoinUserTotal" parameterType="map" resultType="int">
SELECT
count( DISTINCT m.OPERATION_USER_ID ) as total
@ -138,20 +153,4 @@
and m.PIDS LIKE CONCAT(#{pids},'%')
</if>
</select>
<select id="getVoteCount" resultType="com.epmet.dto.extract.result.IssueVoteUserCountResultDTO">
SELECT
GRID_ID,
ISSUE_ID,
COUNT(1) AS voteCount,
COUNT( DISTINCT ISSUE_ID) issueCount
FROM
fact_origin_issue_log_daily
WHERE
DEL_FLAG = '0'
and CUSTOMER_ID = #{customerId,jdbcType=VARCHAR}
and MONTH_ID = #{monthId,jdbcType=VARCHAR}
AND ACTION_CODE LIKE 'vote_%'
group by GRID_ID
</select>
</mapper>

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

@ -267,4 +267,28 @@
AND t1.CUSTOMER_ID = #{customerId}
and t1.PIDS LIKE CONCAT(#{agencyPath},'%')
</select>
<select id="selectGridIssueCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
GRID_ID AS "orgId",
COUNT(ID) AS "count"
FROM fact_origin_issue_main_daily
WHERE
1=1
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
GROUP BY GRID_ID
</select>
<select id="selectOrgIssueCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
f.AGENCY_ID,
COUNT(f.ID) AS "count"
FROM fact_origin_issue_main_daily f
INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID
AND da.LEVEL = #{level}
WHERE
1=1
AND f.CUSTOMER_ID = #{customerId}
AND f.MONTH_ID = #{monthId}
GROUP BY f.AGENCY_ID
</select>
</mapper>

68
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml

@ -252,4 +252,72 @@
GROUP BY f.AGENCY_ID ) b
ON a.AGENCY_ID = b.AGENCY_ID
</select>
<select id="selectGridSatisfaction" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
a.ORG_ID,
a.sum,
IFNULL(b.count, 0) AS "count"
FROM
(SELECT
ORG_ID,
COUNT( ID ) AS "sum"
FROM
fact_origin_project_log_daily
WHERE
1 = 1
AND ( ACTION_CODE = 'bad' OR ACTION_CODE = 'good' OR ACTION_CODE = 'perfect' )
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
GROUP BY
ORG_ID) a
LEFT JOIN
(SELECT
ORG_ID,
COUNT( ID ) AS "count"
FROM
fact_origin_project_log_daily
WHERE
1 = 1
AND ( ACTION_CODE = 'good' OR ACTION_CODE = 'perfect' )
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
GROUP BY
ORG_ID) b
ON a.ORG_ID = b.ORG_ID
</select>
<select id="selectOrgSatisfaction" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
a.AGENCY_ID,
a.sum,
IFNULL(b.count, 0) AS "count"
FROM
(SELECT
f.AGENCY_ID,
COUNT( f.ID ) AS "sum"
FROM
fact_origin_project_log_daily f
INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID AND da.`LEVEL` = #{level}
WHERE
1 = 1
AND ( ACTION_CODE = 'bad' OR ACTION_CODE = 'good' OR ACTION_CODE = 'perfect' )
AND f.CUSTOMER_ID = #{customerId}
AND f.MONTH_ID = #{monthId}
GROUP BY
f.AGENCY_ID) a
LEFT JOIN
(SELECT
f.AGENCY_ID,
COUNT( f.ID ) AS "count"
FROM
fact_origin_project_log_daily f
INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID AND da.`LEVEL` = #{level}
WHERE
1 = 1
AND ( ACTION_CODE = 'good' OR ACTION_CODE = 'perfect' )
AND f.CUSTOMER_ID = #{customerId}
AND f.MONTH_ID = #{monthId}
GROUP BY
f.AGENCY_ID) b
ON a.AGENCY_ID = b.AGENCY_ID
</select>
</mapper>

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

@ -282,4 +282,125 @@
fm.GRID_ID) b
ON a.GRID_ID = b.GRID_ID
</select>
<select id="getGridProjectCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
GRID_ID AS "orgId",
COUNT(ID) AS "count"
FROM fact_origin_project_main_daily
WHERE
1=1
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
GROUP BY GRID_ID
</select>
<select id="getOrgProjectCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
f.AGENCY_ID,
COUNT(f.ID) AS "count"
FROM fact_origin_project_main_daily f
INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID
AND da.LEVEL = #{level}
WHERE
1=1
AND f.CUSTOMER_ID = #{customerId}
AND f.MONTH_ID = #{monthId}
GROUP BY f.AGENCY_ID
</select>
<!-- 根据客户Id查询 -->
<select id="selectDifficultyBaseInfo" resultType="com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity">
SELECT
project.CUSTOMER_ID,
project.ID AS EVENT_ID,
'grid' AS orgType,
project.GRID_ID AS orgId,
project.AGENCY_ID AS parentId,
project.TOPIC_ID AS eventImgUrl,
gridInfo.allPathName AS eventSource,
project.PROJECT_STATUS AS eventStatusCode,
IF
( project.PROJECT_STATUS = 'pending', '处理中', '已结案' ) AS eventStatusDesc,
relation.reOrg AS eventReOrg,
handleCount.HandledCount AS eventHandledCount,
costTime.costTime AS eventCostTime ,
gridInfo.allParentIds
FROM
fact_origin_project_main_daily project
LEFT JOIN (
SELECT
grid.ID AS dimGridId,
concat(
IF
(
ISNULL( agency.ALL_PARENT_NAME ) || LENGTH( trim( agency.ALL_PARENT_NAME ) ) <![CDATA[<]]> 1,
'',
concat( agency.ALL_PARENT_NAME, '-' )
),
agency.AGENCY_NAME,
'-',
grid.GRID_NAME
) AS allPathName,
REPLACE(concat(
IF
(
ISNULL( agency.PIDS ) || LENGTH( trim( agency.PIDS ) ) <![CDATA[<]]> 1,
'',
concat( agency.PIDS, ':' )
),
agency.ID
),':',',') AS allParentIds
FROM
DIM_GRID grid
LEFT JOIN DIM_AGENCY agency ON grid.AGENCY_ID = agency.ID
AND agency.DEL_FLAG = '0'
AND agency.CUSTOMER_ID = #{customerId}
WHERE
grid.DEL_FLAG = '0'
AND grid.CUSTOMER_ID = #{customerId}
) gridInfo ON project.GRID_ID = gridInfo.dimGridId
LEFT JOIN ( SELECT PROJECT_ID, COUNT( DISTINCT ORG_ID ) AS reOrg FROM fact_origin_project_org_period_daily WHERE DEL_FLAG = '0' AND CUSTOMER_ID = '3ef7e4bb195eb9e622d68b52509aa940' GROUP BY PROJECT_ID ) relation ON project.ID = relation.PROJECT_ID -- 处理次数
LEFT JOIN (
SELECT
PROJECT_ID,
COUNT( ID ) AS handledCount
FROM
fact_origin_project_org_period_daily
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND IS_RESOLVED = 'resolved'
GROUP BY
PROJECT_ID
) handleCount ON project.ID = handleCount.PROJECT_ID
LEFT JOIN (
SELECT
main.ID AS PROJECT_ID,
TIMESTAMPDIFF(
MINUTE,
str_to_date( main.DATE_ID, '%Y%m%d' ),
IF
( main.IS_RESOLVED = 'resolved', time.HANDLED_DATE, NOW( ) )
) AS costTime
FROM
fact_origin_project_main_daily main
LEFT JOIN fact_origin_project_org_period_daily time ON main.ID = time.PROJECT_ID
AND time.DEL_FLAG = '0'
AND time.OPERATION = 'close'
WHERE
main.DEL_FLAG = '0'
AND main.CUSTOMER_ID = #{customerId}
GROUP BY
main.ID
) costTime ON project.ID = costTime.PROJECT_ID
WHERE
project.DEL_FLAG = '0'
AND project.CUSTOMER_ID = #{customerId}
<if test="null != list and list.size() != 0">
<foreach collection="list" item="projectId" open="AND " separator=" AND " >
project.ID <![CDATA[<>]]> #{projectId}
</foreach>
</if>
</select>
</mapper>

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

@ -153,4 +153,28 @@
AND m.CUSTOMER_ID = #{customerId}
AND m.PIDS LIKE CONCAT(#{agencyPath},'%')
</select>
<select id="selectGridTopicCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
GRID_ID AS "orgId",
COUNT(ID) AS "count"
FROM fact_origin_topic_main_daily
WHERE
1=1
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
GROUP BY GRID_ID
</select>
<select id="selectOrgTopicCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
f.AGENCY_ID,
COUNT(f.ID) AS "count"
FROM fact_origin_topic_main_daily f
INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID
AND da.LEVEL = #{level}
WHERE
1=1
AND f.CUSTOMER_ID = #{customerId}
AND f.MONTH_ID = #{monthId}
GROUP BY f.AGENCY_ID
</select>
</mapper>

3
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml

@ -120,7 +120,8 @@
AGENCY_ID,
MONTH_ID,
YEAR_ID,
SATISFACTION_RATIO
SATISFACTION_RATIO,
CLOSED_PROJECT_RATIO
FROM
fact_index_govrn_ablity_org_monthly
WHERE

57
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenOrgRankDataDao.xml

@ -8,6 +8,63 @@
where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId}
limit 1000;
</delete>
<delete id="deleteRankData">
delete from screen_org_rank_data
where CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
<if test='null != orgType and "" != orgType'>
and ORG_TYPE=#{orgType}
</if>
<if test='null!=orgIds and orgIds.size()>0'>
and
(
<foreach collection="orgIds" item="orgId" separator=" OR ">
ORG_ID = #{orgId}
</foreach>
)
</if>
limit #{deleteSize}
</delete>
<select id="initAgencyDataList" resultType="com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity">
SELECT
CUSTOMER_ID,
'agency' AS ORG_TYPE,
ID AS ORG_ID,
PID AS PARENT_ID,
AGENCY_NAME AS ORG_NAME,
0 AS PARTY_TOTAL,
0 AS GROUP_TOTAL,
0 AS TOPIC_TOTAL,
0 AS ISSUE_TOTAL,
0 AS PROJECT_TOTAL,
0 AS CLOSE_PROJECT_RATIO,
0 AS SATISFACTION_RATIO
FROM
dim_agency
WHERE
CUSTOMER_ID = #{customerId}
AND `LEVEL` = #{level}
AND AGENCY_DIM_TYPE = 'all'
</select>
<select id="initGridDataList" resultType="com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity">
SELECT DISTINCT
CUSTOMER_ID,
'grid' AS ORG_TYPE,
ID AS ORG_ID,
AGENCY_ID AS PARENT_ID,
GRID_NAME AS ORG_NAME,
0 AS PARTY_TOTAL,
0 AS GROUP_TOTAL,
0 AS TOPIC_TOTAL,
0 AS ISSUE_TOTAL,
0 AS PROJECT_TOTAL,
0 AS CLOSE_PROJECT_RATIO,
0 AS SATISFACTION_RATIO
FROM
dim_grid
WHERE
CUSTOMER_ID = #{customerId}
</select>
<insert id="batchInsertOrgRankData" parameterType="map">
insert into screen_org_rank_data

5
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml

@ -151,9 +151,8 @@
spbd.CUSTOMER_ID,
spbd.YEAR_ID,
spbd.MONTH_ID,
spbd.PARENT_ID AS orgId,
spbd.ORG_ID AS orgId,
spbd.ORG_TYPE,
sca.AGENCY_NAME AS orgName,
IFNULL(spbd.ORGANIZE_COUNT,0) AS organizeCount,
IFNULL(spbd.JOIN_USER_COUNT,0) AS joinUserCount
FROM
@ -166,6 +165,6 @@
AND spbd.ORG_TYPE = 'agency'
AND spbd.CUSTOMER_ID = #{customerId}
AND spbd.MONTH_ID = #{monthId}
AND spbd.ORG_ID = #{parentId}
AND spbd.PARENT_ID = #{parentId}
</select>
</mapper>

4
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml

@ -51,7 +51,9 @@
AND ACT_STATUS = 'finished'
AND CUSTOMER_ID = #{customerId}
AND DATE_FORMAT( ACTUAL_END_TIME, '%Y%m' ) = #{monthId}
AND SPONSOR_TYPE = #{orgType}
<if test="orgType != null and orgType != '' ">
AND SPONSOR_TYPE = #{orgType}
</if>
AND
(
<foreach collection="orgIds" item="orgId" separator=" OR ">

6
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActUserRelation.xml

@ -10,7 +10,7 @@
COUNT(asr.USER_ID) AS joinUserCount
FROM
act_user_relation asr
LEFT JOIN act_info ai ON asr.ACT_ID = ai.ID
LEFT JOIN act_info ai ON asr.ACT_ID = ai.ID
WHERE
ai.DEL_FLAG = 0
AND asr.DEL_FLAG = '0'
@ -18,7 +18,9 @@
AND asr.REWARD_FLAG = 'agree'
AND ai.CUSTOMER_ID = #{customerId}
AND DATE_FORMAT( ai.ACTUAL_END_TIME, '%Y%m' ) = #{monthId}
AND ai.SPONSOR_TYPE = #{orgType}
<if test="orgType != null and orgType != '' ">
AND ai.SPONSOR_TYPE = #{orgType}
</if>
GROUP BY ai.SPONSOR_ID
</select>
</mapper>

3
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml

@ -15,7 +15,8 @@
SELECT
ID,
CUSTOMER_ID,
AGENCY_ID
AGENCY_ID,
GRID_NAME
FROM
dim_grid
WHERE

9
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml

@ -71,4 +71,13 @@
da.ID
</select>
<select id="getIssueIncCountAndTotalByMonthId" resultType="com.epmet.entity.stats.FactIssueAgencyMonthlyEntity">
select
AGENCY_ID,PID,MONTH_ID,ISSUE_INCR,ISSUE_TOTAL
from fact_issue_agency_monthly
where
CUSTOMER_ID = #{customerId,jdbcType=VARCHAR}
and DEL_FLAG = '0'
AND MONTH_ID = #{monthId,jdbcType=VARCHAR}
</select>
</mapper>

28
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyMonthlyDao.xml

@ -101,5 +101,31 @@
AND CUSTOMER_ID = #{customerId}
</if>
</delete>
<select id="selectOrgUserCountByCustomer" resultType="com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO">
SELECT
AGENCY_ID,
PARTYMEMBER_TOTAL
FROM
fact_reg_user_agency_monthly f
INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID
AND da.LEVEL = #{level}
WHERE
f.DEL_FLAG = '0'
AND f.CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
</select>
<select id="selectAgencyUserCount" resultType="com.epmet.dto.extract.result.GridUserCountResultDTO">
SELECT
REG_INCR,
PARTYMEMBER_INCR,
AGENCY_ID as orgId,
REG_TOTAL
FROM
fact_reg_user_agency_monthly
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
</select>
</mapper>

14
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml

@ -111,7 +111,8 @@
SELECT
REG_INCR,
PARTYMEMBER_INCR,
GRID_ID
GRID_ID as orgId,
REG_TOTAL
FROM
fact_reg_user_grid_monthly
WHERE
@ -119,6 +120,17 @@
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
</select>
<select id="selectGridUserCountByCustomer" resultType="com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO">
SELECT
GRID_ID,
PARTYMEMBER_TOTAL
FROM
fact_reg_user_grid_monthly
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
</select>
</mapper>
Loading…
Cancel
Save