Browse Source

Merge remote-tracking branch 'origin/dev_data_stats' into dev_data_stats

dev
yinzuomei 6 years ago
parent
commit
41e01f59ec
  1. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java
  2. 4
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/constant/IssueConstant.java
  3. 82
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java
  4. 5
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java
  5. 2
      epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml
  6. 4
      epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml
  7. 121
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueAgencyDailyDTO.java
  8. 111
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueAgencyMonthlyDTO.java
  9. 121
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueGridDailyDTO.java
  10. 111
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueGridMonthlyDTO.java
  11. 137
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicStatusAgencyDailyDTO.java
  12. 127
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicStatusAgencyMonthlyDTO.java
  13. 136
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicStatusGridDailyDTO.java
  14. 131
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicTotalAgencyDailyDTO.java
  15. 131
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicTotalGridDailyDTO.java
  16. 38
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/GridTopicData.java
  17. 38
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/GroupTopicData.java
  18. 43
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/TopicStatisticalData.java
  19. 1
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserGridDailyDTO.java
  20. 41
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/result/UserStatisticalData.java
  21. 27
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/result/ResiGroupTopicResultDTO.java
  22. 31
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/result/ResiTopicOperationResultDTO.java
  23. 24
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/result/ResiTopicResultDTO.java
  24. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java
  25. 26
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java
  26. 131
      epmet-module/data-statistical/data-statistical-client/src/main/java/feign/DataStatisticalOpenFeignClient.java
  27. 135
      epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/DataStatisticalOpenFeignClientFallBack.java
  28. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java
  29. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java
  30. 31
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsTopicController.java
  31. 31
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsUserController.java
  32. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimAgencyDao.java
  33. 40
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueAgencyDailyDao.java
  34. 40
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueAgencyMonthlyDao.java
  35. 39
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueGridDailyDao.java
  36. 39
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueGridMonthlyDao.java
  37. 39
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicStatusAgencyDailyDao.java
  38. 39
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicStatusAgencyMonthlyDao.java
  39. 39
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicStatusGridDailyDao.java
  40. 39
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicTotalAgencyDailyDao.java
  41. 39
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicTotalGridDailyDao.java
  42. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyDailyDao.java
  43. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyMonthlyDao.java
  44. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java
  45. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridMonthlyDao.java
  46. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyDailyDao.java
  47. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyMonthlyDao.java
  48. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridDailyDao.java
  49. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java
  50. 59
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java
  51. 91
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueAgencyDailyEntity.java
  52. 81
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueAgencyMonthlyEntity.java
  53. 91
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueGridDailyEntity.java
  54. 81
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueGridMonthlyEntity.java
  55. 107
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicStatusAgencyDailyEntity.java
  56. 97
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicStatusAgencyMonthlyEntity.java
  57. 106
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicStatusGridDailyEntity.java
  58. 101
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicTotalAgencyDailyEntity.java
  59. 101
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicTotalGridDailyEntity.java
  60. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsTopicService.java
  61. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsUserService.java
  62. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java
  63. 88
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java
  64. 84
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java
  65. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java
  66. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java
  67. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimTopicStatusServiceImpl.java
  68. 96
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueAgencyDailyService.java
  69. 96
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueAgencyMonthlyService.java
  70. 96
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueGridDailyService.java
  71. 96
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueGridMonthlyService.java
  72. 96
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicStatusAgencyDailyService.java
  73. 96
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicStatusAgencyMonthlyService.java
  74. 96
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicStatusGridDailyService.java
  75. 96
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicTotalAgencyDailyService.java
  76. 96
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicTotalGridDailyService.java
  77. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/TopicStatisticalService.java
  78. 102
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueAgencyDailyServiceImpl.java
  79. 102
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueAgencyMonthlyServiceImpl.java
  80. 102
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueGridDailyServiceImpl.java
  81. 102
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueGridMonthlyServiceImpl.java
  82. 102
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicStatusAgencyDailyServiceImpl.java
  83. 102
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicStatusAgencyMonthlyServiceImpl.java
  84. 102
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicStatusGridDailyServiceImpl.java
  85. 102
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicTotalAgencyDailyServiceImpl.java
  86. 102
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicTotalGridDailyServiceImpl.java
  87. 124
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/TopicStatisticalServiceImpl.java
  88. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/UserStatisticalService.java
  89. 117
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/UserStatisticalServiceImpl.java
  90. 28
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java
  91. 920
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java
  92. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java
  93. 482
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java
  94. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/ModuleConstant.java
  95. 23
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimAgencyDao.xml
  96. 84
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueAgencyDailyDao.xml
  97. 78
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueAgencyMonthlyDao.xml
  98. 87
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueGridDailyDao.xml
  99. 77
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueGridMonthlyDao.xml
  100. 95
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusAgencyDailyDao.xml

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java

@ -117,5 +117,5 @@ public interface ServiceConstant {
/**
* 数据统计
*/
String DATA_STATISTICAL = "data-statistical-server";
String DATA_STATISTICAL_SERVER = "data-statistical-server";
}

4
epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/constant/IssueConstant.java

@ -6,8 +6,8 @@ package com.epmet.issue.constant;
* @date 2020/6/22 14:07
*/
public interface IssueConstant {
String MONTH = "month";
String DATE = "date";
String MONTH = "monthly";
String DATE = "daily";
String VOTING_NAME = "表决中";
String SHIFT_NAME = "已转项目";
String CLOSED_NAME = "已关闭";

82
epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java

@ -2,6 +2,7 @@ package com.epmet.service.issue.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dao.issue.IssueDao;
import com.epmet.dto.form.LoginUserDetailsFormDTO;
import com.epmet.dto.result.LoginUserDetailsResultDTO;
@ -17,6 +18,7 @@ import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@ -35,15 +37,29 @@ public class IssueServiceImpl implements IssueService {
IssueSummaryInfoResultDTO result = new IssueSummaryInfoResultDTO();
String agencyId = getAgencyId(tokenDto);
IssueDataDTO data = issueDao.selectAgencyInfo(agencyId);
result.setAgencyId(agencyId);
result.setDateName(data.getDateName());
result.setIssueTotal(data.getIssueTotal());
result.setVotingTotal(data.getVotingTotal());
result.setShiftProjectTotal(data.getShiftProjectTotal());
result.setClosedTotal(data.getClosedTotal());
result.setVotingRatio(toRatio(data.getVotingPercent()));
result.setShiftProjectRatio(toRatio(data.getShiftProjectPercent()));
result.setClosedRatio(toRatio(data.getClosedPercent()));
if (null == data) {
//获取当前日期前一天
Date date = DateUtils.getBeforeDay(new Date());
result.setAgencyId(agencyId);
result.setDateName(DateUtils.format(date, "yyyy.MM.dd"));
result.setIssueTotal(NumConstant.ZERO);
result.setVotingTotal(NumConstant.ZERO);
result.setShiftProjectTotal(NumConstant.ZERO);
result.setClosedTotal(NumConstant.ZERO);
result.setVotingRatio("0%");
result.setShiftProjectRatio("0%");
result.setClosedRatio("0%");
} else {
result.setAgencyId(agencyId);
result.setDateName(data.getDateName());
result.setIssueTotal(data.getIssueTotal());
result.setVotingTotal(data.getVotingTotal());
result.setShiftProjectTotal(data.getShiftProjectTotal());
result.setClosedTotal(data.getClosedTotal());
result.setVotingRatio(toRatio(data.getVotingPercent()));
result.setShiftProjectRatio(toRatio(data.getShiftProjectPercent()));
result.setClosedRatio(toRatio(data.getClosedPercent()));
}
return result;
}
@ -52,21 +68,39 @@ public class IssueServiceImpl implements IssueService {
List<IssueSummaryPieResultDTO> list = new ArrayList<>();
String agencyId = getAgencyId(tokenDto);
IssueDataDTO data = issueDao.selectAgencyInfo(agencyId);
IssueSummaryPieResultDTO voting = new IssueSummaryPieResultDTO();
voting.setName(IssueConstant.VOTING_NAME);
voting.setValue(data.getVotingTotal());
voting.setRatio(toRatio(data.getVotingPercent()));
list.add(voting);
IssueSummaryPieResultDTO shift = new IssueSummaryPieResultDTO();
shift.setName(IssueConstant.SHIFT_NAME);
shift.setValue(data.getShiftProjectTotal());
shift.setRatio(toRatio(data.getShiftProjectPercent()));
list.add(shift);
IssueSummaryPieResultDTO closed = new IssueSummaryPieResultDTO();
closed.setName(IssueConstant.CLOSED_NAME);
closed.setValue(data.getClosedTotal());
closed.setRatio(toRatio(data.getClosedPercent()));
list.add(closed);
if (null == data) {
IssueSummaryPieResultDTO voting = new IssueSummaryPieResultDTO();
voting.setName(IssueConstant.VOTING_NAME);
voting.setValue(NumConstant.ZERO);
voting.setRatio("0%");
list.add(voting);
IssueSummaryPieResultDTO shift = new IssueSummaryPieResultDTO();
shift.setName(IssueConstant.SHIFT_NAME);
shift.setValue(NumConstant.ZERO);
shift.setRatio("0%");
list.add(shift);
IssueSummaryPieResultDTO closed = new IssueSummaryPieResultDTO();
closed.setName(IssueConstant.CLOSED_NAME);
closed.setValue(NumConstant.ZERO);
closed.setRatio("0%");
list.add(closed);
} else {
IssueSummaryPieResultDTO voting = new IssueSummaryPieResultDTO();
voting.setName(IssueConstant.VOTING_NAME);
voting.setValue(data.getVotingTotal());
voting.setRatio(toRatio(data.getVotingPercent()));
list.add(voting);
IssueSummaryPieResultDTO shift = new IssueSummaryPieResultDTO();
shift.setName(IssueConstant.SHIFT_NAME);
shift.setValue(data.getShiftProjectTotal());
shift.setRatio(toRatio(data.getShiftProjectPercent()));
list.add(shift);
IssueSummaryPieResultDTO closed = new IssueSummaryPieResultDTO();
closed.setName(IssueConstant.CLOSED_NAME);
closed.setValue(data.getClosedTotal());
closed.setRatio(toRatio(data.getClosedPercent()));
list.add(closed);
}
return list;
}

5
epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java

@ -158,8 +158,9 @@ public class TopicServiceImpl implements TopicService {
String agencyId = this.getLoginUserDetails(tokenDto);
List<TopicSummaryInfoResultDTO> topicSummaryInfo = topicDao.topicSummaryInfo(agencyId);
TopicShiftedCountResultDTO shiftedCount = topicDao.getShiftedCount(agencyId);
int i = (shiftedCount.getShiftedIssueCount() / topicSummaryInfo.stream().collect(Collectors.summingInt(TopicSummaryInfoResultDTO::getValue))) * NumConstant.ONE_HUNDRED;
String ratio = String.valueOf(i) + TopicConstant.RATIO;
Integer collect = topicSummaryInfo.stream().collect(Collectors.summingInt(TopicSummaryInfoResultDTO::getValue));
String ratio;
ratio = collect == NumConstant.ZERO ? NumConstant.ZERO + TopicConstant.RATIO : (shiftedCount.getShiftedIssueCount() / collect) * NumConstant.ONE_HUNDRED + TopicConstant.RATIO;
TopicSummaryInfoResultDTO result = new TopicSummaryInfoResultDTO();
result.setName(TopicConstant.SHIFTED);
result.setRatio(ratio);

2
epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml

@ -143,6 +143,7 @@
<logger name="com.epmet.dao.publicity" level="DEBUG"/>
<logger name="com.epmet.dao.topic" level="DEBUG"/>
<logger name="com.epmet.dao.user" level="DEBUG"/>
<logger name="com.epmet.dao.voice" level="DEBUG"/>
<root level="INFO">
<appender-ref ref="DEBUG_FILE"/>
<appender-ref ref="INFO_FILE"/>
@ -161,6 +162,7 @@
<logger name="com.epmet.dao.publicity" level="INFO"/>
<logger name="com.epmet.dao.topic" level="INFO"/>
<logger name="com.epmet.dao.user" level="INFO"/>
<logger name="com.epmet.dao.voice" level="INFO"/>
<root level="INFO">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="DEBUG_FILE"/>

4
epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml

@ -13,7 +13,7 @@
CLOSED_TOTAL,
CLOSED_PERCENT,
MAX(DATE_ID) AS DATE_ID,
DATE_FORMAT(DATE_ID, '%Y.%m.%d') AS DATE_NAME
DATE_FORMAT(MAX(DATE_ID), '%Y.%m.%d') AS DATE_NAME
FROM
fact_issue_agency_daily fiad
WHERE DEL_FLAG = '0'
@ -35,6 +35,7 @@
WHERE fiad.DEL_FLAG = '0'
AND fiad.PID = #{agencyId}
GROUP BY AGENCY_ID
ORDER BY fiad.ISSUE_TOTAL DESC
</select>
<!-- 获取机关下网格统计信息-->
<select id="selectGridList" resultType="com.epmet.issue.dto.result.IssueDataDTO">
@ -52,6 +53,7 @@
WHERE figd.DEL_FLAG = '0'
AND figd.AGENCY_ID = #{agencyId}
GROUP BY GRID_ID
ORDER BY figd.ISSUE_TOTAL DESC
</select>
<!-- 获取当前机关日增量-->
<select id="selectAgencyIncDailyList" resultType="com.epmet.issue.dto.result.IssueDataDTO">

121
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueAgencyDailyDTO.java

@ -0,0 +1,121 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.stats.topic;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 转议题话题-机关日统计数据表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Data
public class FactTopicIssueAgencyDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 父级机关ID
*/
private String pid;
/**
* 客户Id
* */
private String customerId;
/**
* 机关ID
*/
private String agencyId;
/**
* 日期ID
*/
private String dateId;
/**
* 周ID
*/
private String weekId;
/**
* 月ID
*/
private String monthId;
/**
* 季ID
*/
private String quarterId;
/**
* 年ID
*/
private String yearId;
/**
* 已转议题数量
*/
private Integer issueTotal;
/**
* 已转议题当日增量
*/
private Integer issueIncr;
/**
* 删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

111
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueAgencyMonthlyDTO.java

@ -0,0 +1,111 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.stats.topic;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 转议题话题-机关月统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Data
public class FactTopicIssueAgencyMonthlyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 机关ID
*/
private String agencyId;
/**
* 父级ID
*/
private String pid;
/**
* 客户Id
* */
private String customerId;
/**
* 月ID
*/
private String monthId;
/**
* 季度ID
*/
private String quarterId;
/**
* 年ID
*/
private String yearId;
/**
* 已转议题总量
*/
private Integer issueTotal;
/**
* 已转议题增量
*/
private Integer issueIncr;
/**
* 删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

121
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueGridDailyDTO.java

@ -0,0 +1,121 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.stats.topic;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 转议题话题-网格日统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Data
public class FactTopicIssueGridDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 机关ID
*/
private String agencyId;
/**
* 客户Id
* */
private String customerId;
/**
* 网格ID
*/
private String gridId;
/**
* 日期ID
*/
private String dateId;
/**
* 周ID
*/
private String weekId;
/**
* 月ID
*/
private String monthId;
/**
* 季度ID
*/
private String quarterId;
/**
* 年ID
*/
private String yearId;
/**
* 新增转议题数
*/
private Integer issueIncr;
/**
* 转议题总数
*/
private Integer issueTotal;
/**
* 删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

111
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueGridMonthlyDTO.java

@ -0,0 +1,111 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.stats.topic;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 转议题话题-网格月统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Data
public class FactTopicIssueGridMonthlyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 机关ID
*/
private String agencyId;
/**
* 客户Id
* */
private String customerId;
/**
* 网格ID
*/
private String gridId;
/**
* 月ID
*/
private String monthId;
/**
* 季度ID
*/
private String quarterId;
/**
* 年ID
*/
private String yearId;
/**
* 已转议题增量
*/
private Integer issueIncr;
/**
* 已转议题总量
*/
private Integer issueTotal;
/**
* 删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

137
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicStatusAgencyDailyDTO.java

@ -0,0 +1,137 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.stats.topic;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.math.BigDecimal;
/**
* 状态话题-机关日统计数据表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Data
public class FactTopicStatusAgencyDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 机构ID 关联机关dm表
*/
private String agencyId;
/**
* 客户Id
* */
private String customerId;
/**
* 父级机关ID
*/
private String pid;
/**
* 统计日期 关联日期dm表
*/
private String dateId;
/**
* 周ID
*/
private String weekId;
/**
* 月ID
*/
private String monthId;
/**
* 季度ID
*/
private String quarterId;
/**
* 年ID
*/
private String yearId;
/**
* 话题状态ID 关联dim_topic_status表
讨论中 discussing
已屏蔽 hidden
已关闭 closed
已转项目 shift_project
*/
private String topicStatusId;
/**
* 话题数量 指定状态的话题数量
*/
private Integer topicCount;
/**
* 话题状态百分比 指定状态话题数/话题总数
总数在topic_total_agency_daily中
*/
private BigDecimal topicProportion;
/**
* 话题增量 单位时间内的状态话题的增加数
*/
private Integer topicIncrement;
/**
* 删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

127
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicStatusAgencyMonthlyDTO.java

@ -0,0 +1,127 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.stats.topic;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.math.BigDecimal;
/**
* 状态话题-机关月统计数据表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Data
public class FactTopicStatusAgencyMonthlyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 机构ID 关联机关dm表
*/
private String agencyId;
/**
* 客户Id
* */
private String customerId;
/**
* 父级机关ID
*/
private String pid;
/**
* 统计月份 关联月度dm表
*/
private String monthId;
/**
* 季度ID 关联季度dm表
*/
private String quarterId;
/**
* 年ID 关联年度dm表
*/
private String yearId;
/**
* 话题状态 讨论中 discussing
已屏蔽 hidden
已关闭 closed
已转项目 shift_project
*/
private String topicStatusId;
/**
* 话题数量
*/
private Integer topicCount;
/**
* 话题状态占比 月末一天
指定状态话题数/话题总数
总数在topic_total_agency_daily中
*/
private BigDecimal topicProportion;
/**
* 话题增量 单位时间内的话题状态增加数
*/
private Integer topicIncr;
/**
* 删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

136
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicStatusGridDailyDTO.java

@ -0,0 +1,136 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.stats.topic;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.math.BigDecimal;
/**
* 状态话题-网格日统计数据表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Data
public class FactTopicStatusGridDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 机关ID
*/
private String agencyId;
/**
* 客户Id
* */
private String customerId;
/**
* 网格ID 关联网格dm表
*/
private String gridId;
/**
* 日期ID
*/
private String dateId;
/**
* 周ID
*/
private String weekId;
/**
* 月ID
*/
private String monthId;
/**
* 季度ID
*/
private String quarterId;
/**
* 年ID
*/
private String yearId;
/**
* 话题状态ID 讨论中 discussing
已屏蔽 hidden
已关闭 closed
已转项目 shift_project
*/
private String topicStatusId;
/**
* 话题数量
*/
private Integer topicCount;
/**
* 话题状态占比 指定状态话题数/话题总数
总数在topic_total_grid_daily中
*/
private BigDecimal topicProportion;
/**
* 话题增量
*/
private Integer topicIncrement;
/**
* 删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

131
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicTotalAgencyDailyDTO.java

@ -0,0 +1,131 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.stats.topic;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 话题总数-机关日统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Data
public class FactTopicTotalAgencyDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 机关ID
*/
private String agencyId;
/**
* 客户Id
* */
private String customerId;
/**
* 父级机关ID
*/
private String pid;
/**
* 统计日期 关联日期dm表
*/
private String dateId;
/**
* 周ID
*/
private String weekId;
/**
* 月ID
*/
private String monthId;
/**
* 季度ID
*/
private String quarterId;
/**
* 年ID
*/
private String yearId;
/**
* 话题总数
*/
private Integer topicTotal;
/**
* 话题增量
*/
private Integer topicIncr;
/**
* 屏蔽话题数
*/
private Integer hiddenTotalCount;
/**
* 已转议题数
*/
private Integer issueTotalCount;
/**
* 删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

131
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicTotalGridDailyDTO.java

@ -0,0 +1,131 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.stats.topic;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 话题总数-网格日统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Data
public class FactTopicTotalGridDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 机关ID
*/
private String agencyId;
/**
* 客户Id
* */
private String customerId;
/**
* 网格ID
*/
private String gridId;
/**
* 统计日期 关联日期dm表
*/
private String dateId;
/**
* 周ID
*/
private String weekId;
/**
* 月ID
*/
private String monthId;
/**
* 季度ID
*/
private String quarterId;
/**
* 年ID
*/
private String yearId;
/**
* 话题总量
*/
private Integer topicTotal;
/**
* 话题增量
*/
private Integer topicIncr;
/**
* 屏蔽话题数量
*/
private Integer hiddenTotalCount;
/**
* 已转议题数量
*/
private Integer issueTotalCount;
/**
* 删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

38
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/GridTopicData.java

@ -0,0 +1,38 @@
package com.epmet.dto.stats.topic.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @ClassName GridTopicData
* @Auth wangc
* @Date 2020-06-22 17:31
*/
@Data
public class GridTopicData implements Serializable {
private static final long serialVersionUID = -7427128491727512781L;
private String gridId;
private Integer topicIncr = 0;
private Integer discussingIncr = 0;
private Integer hiddenIncr = 0;
private Integer closedIncr = 0;
private Integer total = 0;
private Integer discussingTotal = 0;
private Integer hiddenTotal = 0;
private Integer closedTotal = 0;
private Integer issueIncr = 0;
private Integer issueTotal = 0;
}

38
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/GroupTopicData.java

@ -0,0 +1,38 @@
package com.epmet.dto.stats.topic.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @ClassName GroupTopicData
* @Auth wangc
* @Date 2020-06-22 15:29
*/
@Data
public class GroupTopicData implements Serializable {
private static final long serialVersionUID = -7968684838832002029L;
private String groupId;
private Integer topicIncr = 0;
private Integer discussingIncr = 0;
private Integer hiddenIncr = 0;
private Integer closedIncr = 0;
private Integer total = 0;
private Integer discussingTotal = 0;
private Integer hiddenTotal = 0;
private Integer closedTotal = 0;
private Integer issueIncr = 0;
private Integer issueTotal = 0;
}

43
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/TopicStatisticalData.java

@ -0,0 +1,43 @@
package com.epmet.dto.stats.topic.result;
import com.epmet.dto.stats.topic.*;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description 话题统计数据对象
* @ClassName TopicStatisticalDataResultDTO
* @Auth wangc
* @Date 2020-06-22 13:16
*/
@Data
public class TopicStatisticalData implements Serializable {
private static final long serialVersionUID = 3690257892396607149L;
private List<FactTopicIssueAgencyDailyDTO> issueAgencyDailyList ;
private List<FactTopicIssueAgencyMonthlyDTO> issueAgencyMonthlyList ;
private List<FactTopicIssueGridDailyDTO> issueGridDailyList ;
private List<FactTopicIssueGridMonthlyDTO> issueGridMonthlyList ;
private List<FactTopicStatusAgencyDailyDTO> topicAgencyDailyList ;
private List<FactTopicStatusAgencyMonthlyDTO> topicAgencyMonthlyList ;
private List<FactTopicStatusGridDailyDTO> topicGridDailyList;
private List<FactTopicTotalAgencyDailyDTO> totalAgencyDailyList;
private List<FactTopicTotalGridDailyDTO> totalGridDailyList;
private String dateId;
private String monthId;
private String customerId;
}

1
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserGridDailyDTO.java

@ -59,6 +59,7 @@ public class FactParticipationUserGridDailyDTO implements Serializable {
*/
private String dateId;
/**
*
*/

41
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/result/UserStatisticalData.java

@ -0,0 +1,41 @@
package com.epmet.dto.stats.user.result;
import com.epmet.dto.stats.user.*;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description 用户统计数据对象
* @ClassName UserStatisticalData
* @Auth wangc
* @Date 2020-06-19 15:02
*/
@Data
public class UserStatisticalData implements Serializable {
private static final long serialVersionUID = 7423427555123585566L;
private List<FactParticipationUserAgencyDailyDTO> partiAgencyDailyList;
private List<FactParticipationUserGridDailyDTO> partiGridDailyList;
private List<FactParticipationUserAgencyMonthlyDTO> partiAgencyMonthlyList;
private List<FactParticipationUserGridMonthlyDTO> partiGridMonthlyList;
private List<FactRegUserAgencyDailyDTO> regAgencyDailyList;
private List<FactRegUserGridDailyDTO> regGridDailyList;
private List<FactRegUserAgencyMonthlyDTO> regAgencyMonthlyList;
private List<FactRegUserGridMonthlyDTO> regGridMonthlyList;
private String customerId;
private String dateId;
private String monthId;
}

27
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/result/ResiGroupTopicResultDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.topic.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description -话题对象
* @ClassName ResiGroupTopicResultDTO
* @Auth wangc
* @Date 2020-06-20 17:23
*/
@Data
public class ResiGroupTopicResultDTO implements Serializable {
private static final long serialVersionUID = -6243796311184636458L;
private String gridId;
private String groupId;
private String groupName;
private String customerId;
private List<ResiTopicResultDTO> topics;
}

31
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/result/ResiTopicOperationResultDTO.java

@ -0,0 +1,31 @@
package com.epmet.dto.topic.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 话题操作记录DTO
* @ClassName ResiTopicOperationResultDTO
* @Auth wangc
* @Date 2020-06-22 10:58
*/
@Data
public class ResiTopicOperationResultDTO implements Serializable {
private static final long serialVersionUID = -7811429974017636134L;
/**
* 话题Id
* */
private String topicId;
/**
* 操作状态
* */
private String status;
/**
* 操作时间 yyyy-MM-dd
* */
private String createdTime;
}

24
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/result/ResiTopicResultDTO.java

@ -0,0 +1,24 @@
package com.epmet.dto.topic.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 话题对象
* @ClassName ResiTopicResultDTO
* @Auth wangc
* @Date 2020-06-20 17:22
*/
@Data
public class ResiTopicResultDTO implements Serializable {
private static final long serialVersionUID = 6818736495648532514L;
private String topicId;
private String status;
private boolean shiftIssue;
private String incrFlag;
}

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

@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.PostMapping;
* @date: 2020/6/22 17:39
* @author: jianjun liu
*/
@FeignClient(name = ServiceConstant.DATA_STATISTICAL, fallback = DataStatisticalOpenFeignClientFallBack.class)
@FeignClient(name = ServiceConstant.DATA_STATISTICAL_SERVER, fallback = DataStatisticalOpenFeignClientFallBack.class)
public interface DataStatisticalOpenFeignClient {
/**

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

@ -25,7 +25,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
*/
@Override
public Result articleSummaryDailyStatsjob() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "articleSummaryDailyStatsjob");
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "articleSummaryDailyStatsjob");
}
/**
@ -37,7 +37,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
*/
@Override
public Result tagUsedDailyStatsjob() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagUsedDailyStatsjob");
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagUsedDailyStatsjob");
}
/**
@ -48,7 +48,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
*/
@Override
public Result tagUsedMonthlyStatsjob() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagUsedMonthlyStatsjob");
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagUsedMonthlyStatsjob");
}
/**
@ -59,7 +59,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
*/
@Override
public Result tagUsedQuarterlyStatsjob() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagUsedQuarterlyStatsjob");
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagUsedQuarterlyStatsjob");
}
/**
@ -70,7 +70,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
*/
@Override
public Result tagViewedDailyStatsjob() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagViewedDailyStatsjob");
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagViewedDailyStatsjob");
}
/**
@ -81,7 +81,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
*/
@Override
public Result tagViewedMonthlyStatsjob() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagViewedMonthlyStatsjob");
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagViewedMonthlyStatsjob");
}
/**
@ -92,27 +92,27 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
*/
@Override
public Result tagViewedQuarterlyStatsjob() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagViewedQuarterlyStatsjob");
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagViewedQuarterlyStatsjob");
}
@Override
public Result groupGridDaily() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "groupGridDaily");
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "groupGridDaily");
}
@Override
public Result groupAgencyDaily() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "groupAgencyDaily");
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "groupAgencyDaily");
}
@Override
public Result groupAgencyMonthly() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "groupAgencyMonthly");
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "groupAgencyMonthly");
}
@Override
public Result agencyGridIssueStats() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "agencyGridIssueStats");
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "agencyGridIssueStats");
}
/**
@ -121,7 +121,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
*/
@Override
public Result agencyProjectStats() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "agencyProjectStats");
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "agencyProjectStats");
}
/**
@ -130,6 +130,6 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
*/
@Override
public Result gridProjectStats() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "gridProjectStats");
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "gridProjectStats");
}
}

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

@ -1,131 +0,0 @@
package feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import feign.impl.DataStatisticalOpenFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
/**
* desc: 数据统计 对外feign client
*
* @return:
* @date: 2020/6/22 17:39
* @author: jianjun liu
*/
@FeignClient(name = ServiceConstant.DATA_STATISTICAL, fallback = DataStatisticalOpenFeignClientFallBack.class)
public interface DataStatisticalOpenFeignClient {
/**
* desc: 统计文章总数及在线文章总数 包含 机关 部门 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@PostMapping(value = "data/stats/statspublicity/articleSummaryDailyStatsjob")
Result articleSummaryDailyStatsjob();
/**
* desc: 定时任务 统计文章总数及在线文章总数 包含 机关 部门 网格
*
* @return:
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@PostMapping(value = "data/stats/statspublicity/tagUsedDailyStatsjob")
Result tagUsedDailyStatsjob();
/**
* desc: 统计发表文章最多的分类 包含 机关 部门 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@PostMapping(value = "data/stats/statspublicity/tagUsedMonthlyStatsjob")
Result tagUsedMonthlyStatsjob();
/**
* desc: 统计发表文章最多的分类 包含 机关 部门 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@PostMapping(value = "data/stats/statspublicity/tagUsedQuarterlyStatsjob")
Result tagUsedQuarterlyStatsjob();
/**
* desc: 统计阅读最多的标签 包含 机关 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@PostMapping(value = "data/stats/statspublicity/tagViewedDailyStatsjob")
Result tagViewedDailyStatsjob();
/**
* desc: 统计阅读最多的标签 包含 机关 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@PostMapping(value = "data/stats/statspublicity/tagViewedMonthlyStatsjob")
Result tagViewedMonthlyStatsjob();
/**
* desc: 统计阅读最多的标签 包含 机关 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@PostMapping(value = "data/stats/statspublicity/tagViewedQuarterlyStatsjob")
Result tagViewedQuarterlyStatsjob();
/**
* @Description 统计 网格小组 dim网格-
* @param
* @author zxc
*/
@PostMapping("/data/stats/statsgroup/groupgriddaily")
Result groupGridDaily();
/**
* @Description 统计 网格小组 dim机关-
* @param
* @author zxc
*/
@PostMapping("/data/stats/statsgroup/groupagencydaily")
Result groupAgencyDaily();
/**
* @Description 统计 网格小组 dim机关-
* @param
* @author zxc
*/
@PostMapping("/data/stats/statsgroup/groupagencymonthly")
Result groupAgencyMonthly();
/**
* 议题统计
* @author zhaoqifeng
* @date 2020/6/23 14:34
* @param
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("/data/stats/statsissue/issuestats")
Result agencyGridIssueStats();
/**
* @Description 数据统计-项目-机关日月统计
* @Author sun
*/
@PostMapping("/data/stats/statsproject/agencyprojectstats")
Result agencyProjectStats();
/**
* @Description 数据统计-项目-网格日月统计
* @Author sun
*/
@PostMapping("/data/stats/statsproject/gridprojectstats")
Result gridProjectStats();
}

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

@ -1,135 +0,0 @@
package feign.impl;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import feign.DataStatisticalOpenFeignClient;
import org.springframework.stereotype.Component;
/**
* desc:
*
* @return:
* @date: 2020/6/22 9:38
* @author: jianjun liu
* email:liujianjun@git.elinkit.com.cn
*/
@Component
public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOpenFeignClient {
/**
* desc: 统计文章总数及在线文章总数 包含 机关 部门 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result articleSummaryDailyStatsjob() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "articleSummaryDailyStatsjob");
}
/**
* desc: 定时任务 统计文章总数及在线文章总数 包含 机关 部门 网格
*
* @return:
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result tagUsedDailyStatsjob() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagUsedDailyStatsjob");
}
/**
* desc: 统计发表文章最多的分类 包含 机关 部门 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result tagUsedMonthlyStatsjob() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagUsedMonthlyStatsjob");
}
/**
* desc: 统计发表文章最多的分类 包含 机关 部门 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result tagUsedQuarterlyStatsjob() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagUsedQuarterlyStatsjob");
}
/**
* desc: 统计阅读最多的标签 包含 机关 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result tagViewedDailyStatsjob() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagViewedDailyStatsjob");
}
/**
* desc: 统计阅读最多的标签 包含 机关 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result tagViewedMonthlyStatsjob() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagViewedMonthlyStatsjob");
}
/**
* desc: 统计阅读最多的标签 包含 机关 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result tagViewedQuarterlyStatsjob() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagViewedQuarterlyStatsjob");
}
@Override
public Result groupGridDaily() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "groupGridDaily");
}
@Override
public Result groupAgencyDaily() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "groupAgencyDaily");
}
@Override
public Result groupAgencyMonthly() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "groupAgencyMonthly");
}
@Override
public Result agencyGridIssueStats() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "agencyGridIssueStats");
}
/**
* @Description 数据统计-项目-机关日月统计
* @Author sun
*/
@Override
public Result agencyProjectStats() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "agencyProjectStats");
}
/**
* @Description 数据统计-项目-网格日月统计
* @Author sun
*/
@Override
public Result gridProjectStats() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "gridProjectStats");
}
}

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

@ -3,8 +3,10 @@ package com.epmet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.scheduling.annotation.EnableAsync;
@SpringBootApplication (exclude = {DataSourceAutoConfiguration.class})
@EnableAsync
public class DataStatsApplication {
public static void main(String[] args) {

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

@ -9,10 +9,7 @@ import com.epmet.service.stats.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -223,8 +220,8 @@ public class DimController {
* @date 2020.06.18 10:34
**/
@GetMapping("allagency")
public List<AgencySubTreeDto> allAgency() {
return dimAgencyService.getAllAgency();
public List<AgencySubTreeDto> allAgency(@PathVariable String customerId) {
return dimAgencyService.getAllAgency(customerId);
}
/**
@ -235,8 +232,8 @@ public class DimController {
* @date 2020.06.18 10:34
**/
@GetMapping("topagency")
public List<AgencySubTreeDto> topAgency() {
return dimAgencyService.getTopAgency();
public List<AgencySubTreeDto> topAgency(@PathVariable String customerId) {
return dimAgencyService.getTopAgency(customerId);
}
/**

31
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsTopicController.java

@ -0,0 +1,31 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.service.StatsTopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
/**
* @Description
* @ClassName StatsTopicController
* @Auth wangc
* @Date 2020-06-23 15:19
*/
@RestController
@RequestMapping("statstopic")
public class StatsTopicController {
@Autowired
private StatsTopicService statsTopicService;
@PostMapping("execute")
public Result execute(@RequestParam(value = "date",required = false) Date date){
statsTopicService.partition(date);
return new Result();
}
}

31
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsUserController.java

@ -0,0 +1,31 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.service.StatsUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
/**
* @Description 用户统计
* @ClassName StatsUserController
* @Auth wangc
* @Date 2020-06-23 15:18
*/
@RestController
@RequestMapping("statsuser")
public class StatsUserController {
@Autowired
private StatsUserService statsUserService;
@RequestMapping("execute")
public Result execute(@RequestParam(value = "date",required = false) Date date){
statsUserService.partition(date);
return new Result();
}
}

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

@ -55,7 +55,7 @@ public interface DimAgencyDao extends BaseDao<DimAgencyEntity> {
* @author wangc
* @date 2020.06.18 09:26
**/
List<AgencySubTreeDto> selectAllAgency();
List<AgencySubTreeDto> selectAllAgency(@Param("customerId") String customerId);
/**
* @param pid
@ -73,7 +73,7 @@ public interface DimAgencyDao extends BaseDao<DimAgencyEntity> {
* @author wangc
* @date 2020.06.18 09:26
**/
List<AgencySubTreeDto> selectTopAgency();
List<AgencySubTreeDto> selectTopAgency(@Param("customerId")String customerId);
/**
* desc:根据客户id 获取机关列表

40
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueAgencyDailyDao.java

@ -0,0 +1,40 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.stats.topic;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.topic.FactTopicIssueAgencyDailyDTO;
import com.epmet.entity.stats.topic.FactTopicIssueAgencyDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 转议题话题-机关日统计数据表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Mapper
public interface FactTopicIssueAgencyDailyDao extends BaseDao<FactTopicIssueAgencyDailyEntity> {
void insertBatch(@Param("list") List<FactTopicIssueAgencyDailyDTO> list);
void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId);
}

40
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueAgencyMonthlyDao.java

@ -0,0 +1,40 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.stats.topic;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.topic.FactTopicIssueAgencyMonthlyDTO;
import com.epmet.entity.stats.topic.FactTopicIssueAgencyMonthlyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 转议题话题-机关月统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Mapper
public interface FactTopicIssueAgencyMonthlyDao extends BaseDao<FactTopicIssueAgencyMonthlyEntity> {
void insertBatch(@Param("list") List<FactTopicIssueAgencyMonthlyDTO> list);
void deleteByParams(@Param("monthId")String monthId,@Param("customerId")String customerId);
}

39
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueGridDailyDao.java

@ -0,0 +1,39 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.stats.topic;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.topic.FactTopicIssueGridDailyDTO;
import com.epmet.entity.stats.topic.FactTopicIssueGridDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 转议题话题-网格日统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Mapper
public interface FactTopicIssueGridDailyDao extends BaseDao<FactTopicIssueGridDailyEntity> {
void insertBatch(@Param("list") List<FactTopicIssueGridDailyDTO> list);
void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId);
}

39
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueGridMonthlyDao.java

@ -0,0 +1,39 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.stats.topic;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.topic.FactTopicIssueGridMonthlyDTO;
import com.epmet.entity.stats.topic.FactTopicIssueGridMonthlyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 转议题话题-网格月统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Mapper
public interface FactTopicIssueGridMonthlyDao extends BaseDao<FactTopicIssueGridMonthlyEntity> {
void insertBatch(@Param("list") List<FactTopicIssueGridMonthlyDTO> list);
void deleteByParams(@Param("monthId")String monthId,@Param("customerId")String customerId);
}

39
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicStatusAgencyDailyDao.java

@ -0,0 +1,39 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.stats.topic;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.topic.FactTopicStatusAgencyDailyDTO;
import com.epmet.entity.stats.topic.FactTopicStatusAgencyDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 状态话题-机关日统计数据表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Mapper
public interface FactTopicStatusAgencyDailyDao extends BaseDao<FactTopicStatusAgencyDailyEntity> {
void insertBatch(@Param("list") List<FactTopicStatusAgencyDailyDTO> list);
void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId);
}

39
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicStatusAgencyMonthlyDao.java

@ -0,0 +1,39 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.stats.topic;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.topic.FactTopicStatusAgencyMonthlyDTO;
import com.epmet.entity.stats.topic.FactTopicStatusAgencyMonthlyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 状态话题-机关月统计数据表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Mapper
public interface FactTopicStatusAgencyMonthlyDao extends BaseDao<FactTopicStatusAgencyMonthlyEntity> {
void insertBatch(@Param("list") List<FactTopicStatusAgencyMonthlyDTO> list);
void deleteByParams(@Param("monthId")String monthId,@Param("customerId")String customerId);
}

39
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicStatusGridDailyDao.java

@ -0,0 +1,39 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.stats.topic;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.topic.FactTopicStatusGridDailyDTO;
import com.epmet.entity.stats.topic.FactTopicStatusGridDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 状态话题-网格日统计数据表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Mapper
public interface FactTopicStatusGridDailyDao extends BaseDao<FactTopicStatusGridDailyEntity> {
void insertBatch(@Param("list") List<FactTopicStatusGridDailyDTO> list);
void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId);
}

39
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicTotalAgencyDailyDao.java

@ -0,0 +1,39 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.stats.topic;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.topic.FactTopicTotalAgencyDailyDTO;
import com.epmet.entity.stats.topic.FactTopicTotalAgencyDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 话题总数-机关日统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Mapper
public interface FactTopicTotalAgencyDailyDao extends BaseDao<FactTopicTotalAgencyDailyEntity> {
void insertBatch(@Param("list") List<FactTopicTotalAgencyDailyDTO> list);
void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId);
}

39
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicTotalGridDailyDao.java

@ -0,0 +1,39 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.stats.topic;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.topic.FactTopicTotalGridDailyDTO;
import com.epmet.entity.stats.topic.FactTopicTotalGridDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 话题总数-网格日统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Mapper
public interface FactTopicTotalGridDailyDao extends BaseDao<FactTopicTotalGridDailyEntity> {
void insertBatch(@Param("list") List<FactTopicTotalGridDailyDTO> list);
void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId);
}

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

@ -18,8 +18,12 @@
package com.epmet.dao.stats.user;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.user.FactParticipationUserAgencyDailyDTO;
import com.epmet.entity.stats.user.FactParticipationUserAgencyDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 机关下(按日)参与用户数分析
@ -29,5 +33,9 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface FactParticipationUserAgencyDailyDao extends BaseDao<FactParticipationUserAgencyDailyEntity> {
void insertBatch(@Param("list") List<FactParticipationUserAgencyDailyDTO> list);
void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId);
}

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

@ -18,8 +18,12 @@
package com.epmet.dao.stats.user;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.user.FactParticipationUserAgencyMonthlyDTO;
import com.epmet.entity.stats.user.FactParticipationUserAgencyMonthlyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 机关下(按月)参与用户数分析
@ -29,5 +33,9 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface FactParticipationUserAgencyMonthlyDao extends BaseDao<FactParticipationUserAgencyMonthlyEntity> {
void insertBatch(@Param("list") List<FactParticipationUserAgencyMonthlyDTO> list);
void deleteByParams(@Param("monthId")String monthId,@Param("customerId")String customerId);
}

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

@ -18,8 +18,12 @@
package com.epmet.dao.stats.user;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.user.FactParticipationUserGridDailyDTO;
import com.epmet.entity.stats.user.FactParticipationUserGridDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 网格下(按日)参与用户数分析
@ -29,5 +33,9 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface FactParticipationUserGridDailyDao extends BaseDao<FactParticipationUserGridDailyEntity> {
void insertBatch(@Param("list") List<FactParticipationUserGridDailyDTO> list);
void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId);
}

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

@ -18,8 +18,12 @@
package com.epmet.dao.stats.user;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.user.FactParticipationUserGridMonthlyDTO;
import com.epmet.entity.stats.user.FactParticipationUserGridMonthlyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 网格下()参与用户数分析
@ -29,5 +33,8 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface FactParticipationUserGridMonthlyDao extends BaseDao<FactParticipationUserGridMonthlyEntity> {
void insertBatch(@Param("list") List<FactParticipationUserGridMonthlyDTO> list);
void deleteByParams(@Param("monthId")String monthId,@Param("customerId")String customerId);
}

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

@ -18,8 +18,12 @@
package com.epmet.dao.stats.user;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.user.FactRegUserAgencyDailyDTO;
import com.epmet.entity.stats.user.FactRegUserAgencyDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 机关(按日)注册用户数分析
@ -29,5 +33,9 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface FactRegUserAgencyDailyDao extends BaseDao<FactRegUserAgencyDailyEntity> {
void insertBatch(@Param("list") List<FactRegUserAgencyDailyDTO> list);
void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId);
}

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

@ -18,8 +18,12 @@
package com.epmet.dao.stats.user;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO;
import com.epmet.entity.stats.user.FactRegUserAgencyMonthlyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 机关(按月)注册用户数分析
@ -29,5 +33,8 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface FactRegUserAgencyMonthlyDao extends BaseDao<FactRegUserAgencyMonthlyEntity> {
void insertBatch(@Param("list") List<FactRegUserAgencyMonthlyDTO> list);
void deleteByParams(@Param("monthId")String monthId,@Param("customerId")String customerId);
}

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

@ -18,8 +18,12 @@
package com.epmet.dao.stats.user;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.user.FactRegUserGridDailyDTO;
import com.epmet.entity.stats.user.FactRegUserGridDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 网格(按日)注册用户数分析
@ -29,5 +33,9 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface FactRegUserGridDailyDao extends BaseDao<FactRegUserGridDailyEntity> {
void insertBatch(@Param("list") List<FactRegUserGridDailyDTO> list);
void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId);
}

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

@ -18,8 +18,12 @@
package com.epmet.dao.stats.user;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO;
import com.epmet.entity.stats.user.FactRegUserGridMonthlyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 网格()注册用户数分析
@ -29,5 +33,9 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface FactRegUserGridMonthlyDao extends BaseDao<FactRegUserGridMonthlyEntity> {
void insertBatch(@Param("list") List<FactRegUserGridMonthlyDTO> list);
void deleteByParams(@Param("monthId")String monthId,@Param("customerId")String customerId);
}

59
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java

@ -0,0 +1,59 @@
package com.epmet.dao.topic;
/**
* 话题Dao ResiGroup
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-05-11
*/
import com.epmet.dto.topic.result.ResiGroupTopicResultDTO;
import com.epmet.dto.topic.result.ResiTopicOperationResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
@Mapper
public interface TopicDao {
/**
* @Description 将组按照网格Id排序
* @param targetDate
* @param customerId
* @return List<ResiGroupTopicResultDTO>
* @author wangc
* @date 2020.06.22 11:05
**/
List<ResiGroupTopicResultDTO> selectGroupOrderByGrid(@Param("targetDate")Date targetDate, @Param("customerId")String customerId);
/**
* @Description 查询话题的操作记录如果返回结果中没有对应Id的话题说明当日话题没有操作记录
* @param targetDate
* @return List<ResiTopicOperationResultDTO>
* @author wangc
* @date 2020.06.22 11:07
**/
List<ResiTopicOperationResultDTO> selectTopicOperationRecord(@Param("targetDate")Date targetDate);
/**
* @Description 将组按照网格Id排序
* @param
* @param customerId
* @return List<ResiGroupTopicResultDTO>
* @author wangc
* @date 2020.06.22 11:05
**/
List<ResiGroupTopicResultDTO> selectGroupOrderByGridBetweenTimeRange(@Param("startDate")Date startDate, @Param("endDate")Date endDate, @Param("customerId")String customerId);
/**
* @Description 查询话题的操作记录如果返回结果中没有对应Id的话题说明当日话题没有操作记录
* @param
* @return List<ResiTopicOperationResultDTO>
* @author wangc
* @date 2020.06.22 11:07
**/
List<ResiTopicOperationResultDTO> selectTopicOperationRecordBetweenTimeRange(@Param("startDate")Date startDate, @Param("endDate")Date endDate);
}

91
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueAgencyDailyEntity.java

@ -0,0 +1,91 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.stats.topic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 转议题话题-机关日统计数据表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_topic_issue_agency_daily")
public class FactTopicIssueAgencyDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 父级机关ID
*/
private String pid;
/**
* 机关ID
*/
private String agencyId;
/**
* 客户Id
* */
private String customerId;
/**
* 日期ID
*/
private String dateId;
/**
* 周ID
*/
private String weekId;
/**
* 月ID
*/
private String monthId;
/**
* 季ID
*/
private String quarterId;
/**
* 年ID
*/
private String yearId;
/**
* 已转议题数量
*/
private Integer issueTotal;
/**
* 已转议题当日增量
*/
private Integer issueIncr;
}

81
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueAgencyMonthlyEntity.java

@ -0,0 +1,81 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.stats.topic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 转议题话题-机关月统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_topic_issue_agency_monthly")
public class FactTopicIssueAgencyMonthlyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 机关ID
*/
private String agencyId;
/**
* 父级ID
*/
private String pid;
/**
* 客户Id
* */
private String customerId;
/**
* 月ID
*/
private String monthId;
/**
* 季度ID
*/
private String quarterId;
/**
* 年ID
*/
private String yearId;
/**
* 已转议题总量
*/
private Integer issueTotal;
/**
* 已转议题增量
*/
private Integer issueIncr;
}

91
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueGridDailyEntity.java

@ -0,0 +1,91 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.stats.topic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 转议题话题-网格日统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_topic_issue_grid_daily")
public class FactTopicIssueGridDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 机关ID
*/
private String agencyId;
/**
* 客户Id
* */
private String customerId;
/**
* 网格ID
*/
private String gridId;
/**
* 日期ID
*/
private String dateId;
/**
* 周ID
*/
private String weekId;
/**
* 月ID
*/
private String monthId;
/**
* 季度ID
*/
private String quarterId;
/**
* 年ID
*/
private String yearId;
/**
* 新增转议题数
*/
private Integer issueIncr;
/**
* 转议题总数
*/
private Integer issueTotal;
}

81
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueGridMonthlyEntity.java

@ -0,0 +1,81 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.stats.topic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 转议题话题-网格月统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_topic_issue_grid_monthly")
public class FactTopicIssueGridMonthlyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 机关ID
*/
private String agencyId;
/**
* 客户Id
* */
private String customerId;
/**
* 网格ID
*/
private String gridId;
/**
* 月ID
*/
private String monthId;
/**
* 季度ID
*/
private String quarterId;
/**
* 年ID
*/
private String yearId;
/**
* 已转议题增量
*/
private Integer issueIncr;
/**
* 已转议题总量
*/
private Integer issueTotal;
}

107
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicStatusAgencyDailyEntity.java

@ -0,0 +1,107 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.stats.topic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
/**
* 状态话题-机关日统计数据表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_topic_status_agency_daily")
public class FactTopicStatusAgencyDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 机构ID 关联机关dm表
*/
private String agencyId;
/**
* 父级机关ID
*/
private String pid;
/**
* 客户Id
* */
private String customerId;
/**
* 统计日期 关联日期dm表
*/
private String dateId;
/**
* 周ID
*/
private String weekId;
/**
* 月ID
*/
private String monthId;
/**
* 季度ID
*/
private String quarterId;
/**
* 年ID
*/
private String yearId;
/**
* 话题状态ID 关联dim_topic_status表
讨论中 discussing
已屏蔽 hidden
已关闭 closed
已转项目 shift_project
*/
private String topicStatusId;
/**
* 话题数量 指定状态的话题数量
*/
private Integer topicCount;
/**
* 话题状态百分比 指定状态话题数/话题总数
总数在topic_total_agency_daily中
*/
private BigDecimal topicProportion;
/**
* 话题增量 单位时间内的状态话题的增加数
*/
private Integer topicIncrement;
}

97
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicStatusAgencyMonthlyEntity.java

@ -0,0 +1,97 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.stats.topic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
/**
* 状态话题-机关月统计数据表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_topic_status_agency_monthly")
public class FactTopicStatusAgencyMonthlyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 机构ID 关联机关dm表
*/
private String agencyId;
/**
* 客户Id
* */
private String customerId;
/**
* 父级机关ID
*/
private String pid;
/**
* 统计月份 关联月度dm表
*/
private String monthId;
/**
* 季度ID 关联季度dm表
*/
private String quarterId;
/**
* 年ID 关联年度dm表
*/
private String yearId;
/**
* 话题状态 讨论中 discussing
已屏蔽 hidden
已关闭 closed
已转项目 shift_project
*/
private String topicStatusId;
/**
* 话题数量
*/
private Integer topicCount;
/**
* 话题状态占比 月末一天
指定状态话题数/话题总数
总数在topic_total_agency_daily中
*/
private BigDecimal topicProportion;
/**
* 话题增量 单位时间内的话题状态增加数
*/
private Integer topicIncr;
}

106
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicStatusGridDailyEntity.java

@ -0,0 +1,106 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.stats.topic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
/**
* 状态话题-网格日统计数据表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_topic_status_grid_daily")
public class FactTopicStatusGridDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 机关ID
*/
private String agencyId;
/**
* 客户Id
* */
private String customerId;
/**
* 网格ID 关联网格dm表
*/
private String gridId;
/**
* 日期ID
*/
private String dateId;
/**
* 周ID
*/
private String weekId;
/**
* 月ID
*/
private String monthId;
/**
* 季度ID
*/
private String quarterId;
/**
* 年ID
*/
private String yearId;
/**
* 话题状态ID 讨论中 discussing
已屏蔽 hidden
已关闭 closed
已转项目 shift_project
*/
private String topicStatusId;
/**
* 话题数量
*/
private Integer topicCount;
/**
* 话题状态占比 指定状态话题数/话题总数
总数在topic_total_grid_daily中
*/
private BigDecimal topicProportion;
/**
* 话题增量
*/
private Integer topicIncrement;
}

101
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicTotalAgencyDailyEntity.java

@ -0,0 +1,101 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.stats.topic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 话题总数-机关日统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_topic_total_agency_daily")
public class FactTopicTotalAgencyDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 机关ID
*/
private String agencyId;
/**
* 客户Id
* */
private String customerId;
/**
* 父级机关ID
*/
private String pid;
/**
* 统计日期 关联日期dm表
*/
private String dateId;
/**
* 周ID
*/
private String weekId;
/**
* 月ID
*/
private String monthId;
/**
* 季度ID
*/
private String quarterId;
/**
* 年ID
*/
private String yearId;
/**
* 话题总数
*/
private Integer topicTotal;
/**
* 话题增量
*/
private Integer topicIncr;
/**
* 屏蔽话题数
*/
private Integer hiddenTotalCount;
/**
* 已转议题数
*/
private Integer issueTotalCount;
}

101
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicTotalGridDailyEntity.java

@ -0,0 +1,101 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.stats.topic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 话题总数-网格日统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_topic_total_grid_daily")
public class FactTopicTotalGridDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 机关ID
*/
private String agencyId;
/**
* 客户Id
* */
private String customerId;
/**
* 网格ID
*/
private String gridId;
/**
* 统计日期 关联日期dm表
*/
private String dateId;
/**
* 周ID
*/
private String weekId;
/**
* 月ID
*/
private String monthId;
/**
* 季度ID
*/
private String quarterId;
/**
* 年ID
*/
private String yearId;
/**
* 话题总量
*/
private Integer topicTotal;
/**
* 话题增量
*/
private Integer topicIncr;
/**
* 屏蔽话题数量
*/
private Integer hiddenTotalCount;
/**
* 已转议题数量
*/
private Integer issueTotalCount;
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsTopicService.java

@ -0,0 +1,8 @@
package com.epmet.service;
import java.util.Date;
public interface StatsTopicService {
void partition(Date date);
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsUserService.java

@ -0,0 +1,8 @@
package com.epmet.service;
import java.util.Date;
public interface StatsUserService {
void partition(Date date);
}

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

@ -217,7 +217,7 @@ public class StatsGroupServiceImpl implements StatsGroupService {
*/
public List<String> getAllGrid(String agencyId){
List<String> result = new ArrayList<>();
List<AgencySubTreeDto> allAgency = dimAgencyService.getAllAgency();
List<AgencySubTreeDto> allAgency = dimAgencyService.getAllAgency(null);
Map<String,Set<String>> subGridOfAgency = new HashMap<>();
allAgency.forEach(agency -> {

88
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java

@ -0,0 +1,88 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.stats.DimTopicStatusDTO;
import com.epmet.dto.stats.topic.result.TopicStatisticalData;
import com.epmet.service.StatsTopicService;
import com.epmet.service.stats.DimAgencyService;
import com.epmet.service.stats.DimCustomerService;
import com.epmet.service.stats.DimTopicStatusService;
import com.epmet.service.stats.topic.TopicStatisticalService;
import com.epmet.service.topic.TopicService;
import com.epmet.util.DimIdGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.*;
/**
* @Description
* @ClassName StatsTopicServiceImpl
* @Auth wangc
* @Date 2020-06-23 15:22
*/
@Service
public class StatsTopicServiceImpl implements StatsTopicService {
@Autowired
private DimCustomerService dimCustomerService;
@Autowired
private DimAgencyService dimAgencyService;
@Autowired
private DimTopicStatusService dimTopicStatusService;
@Autowired
private TopicService topicService;
@Autowired
private TopicStatisticalService topicStatisticalService;
@Override
public void partition(Date date) {
int pageNo = NumConstant.ONE;
int pageSize = NumConstant.ONE_HUNDRED;
List<String> customerIdList = null;
do {
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize);
if (!CollectionUtils.isEmpty(customerIdList)) {
for (String customerId : customerIdList) {
//遍历统计每一个客户数据
generate(customerId,date);
}
}
} while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize);
}
void generate(String customerId,Date date){
//1.初始化时间参数
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
//2.初始化时间维度
DimIdGenerator.DimIdBean timeDimension = DimIdGenerator.getDimIdBean(null == date ? calendar.getTime() : date);
//3.初始化话题状态维度
Map<String, Object> topicStatusParams = new HashMap<>();
topicStatusParams.put(FieldConstant.DEL_FLAG_HUMP, NumConstant.ZERO_STR);
List<DimTopicStatusDTO> topicStatusDimension = dimTopicStatusService.list(topicStatusParams);
//4.初始化机关维度
List<AgencySubTreeDto> agencies = dimAgencyService.getAllAgency(customerId);
//5.计算统计数据
TopicStatisticalData data =
topicService.compute(agencies,date,timeDimension,customerId,topicStatusDimension);
//6.生成唯一性统计数据
topicStatisticalService.insertUniquely(data);
}
}

84
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java

@ -0,0 +1,84 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.stats.user.result.UserStatisticalData;
import com.epmet.service.StatsUserService;
import com.epmet.service.stats.DimAgencyService;
import com.epmet.service.stats.DimCustomerService;
import com.epmet.service.stats.user.UserStatisticalService;
import com.epmet.service.user.UserService;
import com.epmet.util.DimIdGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
/**
* @Description 生成用户统计信息
* @ClassName StatsUserServiceImpl
* @Auth wangc
* @Date 2020-06-23 15:21
*/
@Service
public class StatsUserServiceImpl implements StatsUserService {
@Autowired
private DimCustomerService dimCustomerService;
@Autowired
private DimAgencyService dimAgencyService;
@Autowired
private UserService userService;
@Autowired
private UserStatisticalService userStatisticalService;
@Override
public void partition(Date date) {
int pageNo = NumConstant.ONE;
int pageSize = NumConstant.ONE_HUNDRED;
List<String> customerIdList = null;
do {
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize);
if (!CollectionUtils.isEmpty(customerIdList)) {
for (String customerId : customerIdList) {
//遍历统计每一个客户数据
generate(customerId,date);
}
}
} while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize);
}
void generate(String customerId,Date date){
//1.初始化时间参数
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
//获取今日的零点
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
//2.初始化时间维度
DimIdGenerator.DimIdBean timeDimension = DimIdGenerator.getDimIdBean(null == date ? calendar.getTime() : date);
//3.初始化机关维度
List<AgencySubTreeDto> agencies = dimAgencyService.getAllAgency(customerId);
List<AgencySubTreeDto> topAgencies = dimAgencyService.getTopAgency(customerId);
//4.计算机关统计数据、生成唯一性统计数据
UserStatisticalData agencyData = userService.traverseAgencyUser(agencies,date,timeDimension);
userStatisticalService.insertUniquely(agencyData);
//5.计算网格统计数据、生成唯一性统计数据
UserStatisticalData gridData = userService.traverseGridUser(agencies,date,timeDimension);
userStatisticalService.insertUniquely(gridData);
}
}

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java

@ -118,7 +118,7 @@ public interface DimAgencyService extends BaseService<DimAgencyEntity> {
* @author wangc
* @date 2020.06.18 09:45
**/
List<AgencySubTreeDto> getAllAgency();
List<AgencySubTreeDto> getAllAgency(String customerId);
/**
* @Description 查询顶级机关以及它下级机关的信息
@ -127,7 +127,7 @@ public interface DimAgencyService extends BaseService<DimAgencyEntity> {
* @author wangc
* @date 2020.06.18 09:45
**/
List<AgencySubTreeDto> getTopAgency();
List<AgencySubTreeDto> getTopAgency(String customerId);
/**
* desc: 根据客户Id 获取机关列表数据

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java

@ -174,8 +174,8 @@ public class DimAgencyServiceImpl extends BaseServiceImpl<DimAgencyDao, DimAgenc
* @date 2020.06.18 09:45
**/
@Override
public List<AgencySubTreeDto> getAllAgency() {
return baseDao.selectAllAgency();
public List<AgencySubTreeDto> getAllAgency(String customerId) {
return baseDao.selectAllAgency(customerId);
}
@ -187,8 +187,8 @@ public class DimAgencyServiceImpl extends BaseServiceImpl<DimAgencyDao, DimAgenc
* @date 2020.06.18 09:45
**/
@Override
public List<AgencySubTreeDto> getTopAgency() {
return baseDao.selectTopAgency();
public List<AgencySubTreeDto> getTopAgency(String customerId) {
return baseDao.selectTopAgency(customerId);
}
@Override

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

@ -20,6 +20,7 @@ package com.epmet.service.stats.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
@ -64,10 +65,12 @@ public class DimTopicStatusServiceImpl extends BaseServiceImpl<DimTopicStatusDao
private QueryWrapper<DimTopicStatusEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
String delFlag = (String)params.get(FieldConstant.DEL_FLAG_HUMP);
if(StringUtils.isBlank(delFlag)) delFlag = NumConstant.ZERO_STR;
QueryWrapper<DimTopicStatusEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
wrapper.eq(FieldConstant.DEL_FLAG,delFlag);
return wrapper;
}

96
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueAgencyDailyService.java

@ -0,0 +1,96 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats.topic;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.stats.topic.FactTopicIssueAgencyDailyDTO;
import com.epmet.entity.stats.topic.FactTopicIssueAgencyDailyEntity;
import java.util.List;
import java.util.Map;
/**
* 转议题话题-机关日统计数据表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
public interface FactTopicIssueAgencyDailyService extends BaseService<FactTopicIssueAgencyDailyEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<FactTopicIssueAgencyDailyDTO>
* @author generator
* @date 2020-06-20
*/
PageData<FactTopicIssueAgencyDailyDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<FactTopicIssueAgencyDailyDTO>
* @author generator
* @date 2020-06-20
*/
List<FactTopicIssueAgencyDailyDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return FactTopicIssueAgencyDailyDTO
* @author generator
* @date 2020-06-20
*/
FactTopicIssueAgencyDailyDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-06-20
*/
void save(FactTopicIssueAgencyDailyDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-06-20
*/
void update(FactTopicIssueAgencyDailyDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-06-20
*/
void delete(String[] ids);
}

96
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueAgencyMonthlyService.java

@ -0,0 +1,96 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats.topic;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.stats.topic.FactTopicIssueAgencyMonthlyDTO;
import com.epmet.entity.stats.topic.FactTopicIssueAgencyMonthlyEntity;
import java.util.List;
import java.util.Map;
/**
* 转议题话题-机关月统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
public interface FactTopicIssueAgencyMonthlyService extends BaseService<FactTopicIssueAgencyMonthlyEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<FactTopicIssueAgencyMonthlyDTO>
* @author generator
* @date 2020-06-20
*/
PageData<FactTopicIssueAgencyMonthlyDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<FactTopicIssueAgencyMonthlyDTO>
* @author generator
* @date 2020-06-20
*/
List<FactTopicIssueAgencyMonthlyDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return FactTopicIssueAgencyMonthlyDTO
* @author generator
* @date 2020-06-20
*/
FactTopicIssueAgencyMonthlyDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-06-20
*/
void save(FactTopicIssueAgencyMonthlyDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-06-20
*/
void update(FactTopicIssueAgencyMonthlyDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-06-20
*/
void delete(String[] ids);
}

96
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueGridDailyService.java

@ -0,0 +1,96 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats.topic;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.stats.topic.FactTopicIssueGridDailyDTO;
import com.epmet.entity.stats.topic.FactTopicIssueGridDailyEntity;
import java.util.List;
import java.util.Map;
/**
* 转议题话题-网格日统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
public interface FactTopicIssueGridDailyService extends BaseService<FactTopicIssueGridDailyEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<FactTopicIssueGridDailyDTO>
* @author generator
* @date 2020-06-20
*/
PageData<FactTopicIssueGridDailyDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<FactTopicIssueGridDailyDTO>
* @author generator
* @date 2020-06-20
*/
List<FactTopicIssueGridDailyDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return FactTopicIssueGridDailyDTO
* @author generator
* @date 2020-06-20
*/
FactTopicIssueGridDailyDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-06-20
*/
void save(FactTopicIssueGridDailyDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-06-20
*/
void update(FactTopicIssueGridDailyDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-06-20
*/
void delete(String[] ids);
}

96
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueGridMonthlyService.java

@ -0,0 +1,96 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats.topic;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.stats.topic.FactTopicIssueGridMonthlyDTO;
import com.epmet.entity.stats.topic.FactTopicIssueGridMonthlyEntity;
import java.util.List;
import java.util.Map;
/**
* 转议题话题-网格月统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
public interface FactTopicIssueGridMonthlyService extends BaseService<FactTopicIssueGridMonthlyEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<FactTopicIssueGridMonthlyDTO>
* @author generator
* @date 2020-06-20
*/
PageData<FactTopicIssueGridMonthlyDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<FactTopicIssueGridMonthlyDTO>
* @author generator
* @date 2020-06-20
*/
List<FactTopicIssueGridMonthlyDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return FactTopicIssueGridMonthlyDTO
* @author generator
* @date 2020-06-20
*/
FactTopicIssueGridMonthlyDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-06-20
*/
void save(FactTopicIssueGridMonthlyDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-06-20
*/
void update(FactTopicIssueGridMonthlyDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-06-20
*/
void delete(String[] ids);
}

96
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicStatusAgencyDailyService.java

@ -0,0 +1,96 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats.topic;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.stats.topic.FactTopicStatusAgencyDailyDTO;
import com.epmet.entity.stats.topic.FactTopicStatusAgencyDailyEntity;
import java.util.List;
import java.util.Map;
/**
* 状态话题-机关日统计数据表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
public interface FactTopicStatusAgencyDailyService extends BaseService<FactTopicStatusAgencyDailyEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<FactTopicStatusAgencyDailyDTO>
* @author generator
* @date 2020-06-20
*/
PageData<FactTopicStatusAgencyDailyDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<FactTopicStatusAgencyDailyDTO>
* @author generator
* @date 2020-06-20
*/
List<FactTopicStatusAgencyDailyDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return FactTopicStatusAgencyDailyDTO
* @author generator
* @date 2020-06-20
*/
FactTopicStatusAgencyDailyDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-06-20
*/
void save(FactTopicStatusAgencyDailyDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-06-20
*/
void update(FactTopicStatusAgencyDailyDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-06-20
*/
void delete(String[] ids);
}

96
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicStatusAgencyMonthlyService.java

@ -0,0 +1,96 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats.topic;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.stats.topic.FactTopicStatusAgencyMonthlyDTO;
import com.epmet.entity.stats.topic.FactTopicStatusAgencyMonthlyEntity;
import java.util.List;
import java.util.Map;
/**
* 状态话题-机关月统计数据表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
public interface FactTopicStatusAgencyMonthlyService extends BaseService<FactTopicStatusAgencyMonthlyEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<FactTopicStatusAgencyMonthlyDTO>
* @author generator
* @date 2020-06-20
*/
PageData<FactTopicStatusAgencyMonthlyDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<FactTopicStatusAgencyMonthlyDTO>
* @author generator
* @date 2020-06-20
*/
List<FactTopicStatusAgencyMonthlyDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return FactTopicStatusAgencyMonthlyDTO
* @author generator
* @date 2020-06-20
*/
FactTopicStatusAgencyMonthlyDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-06-20
*/
void save(FactTopicStatusAgencyMonthlyDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-06-20
*/
void update(FactTopicStatusAgencyMonthlyDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-06-20
*/
void delete(String[] ids);
}

96
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicStatusGridDailyService.java

@ -0,0 +1,96 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats.topic;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.stats.topic.FactTopicStatusGridDailyDTO;
import com.epmet.entity.stats.topic.FactTopicStatusGridDailyEntity;
import java.util.List;
import java.util.Map;
/**
* 状态话题-网格日统计数据表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
public interface FactTopicStatusGridDailyService extends BaseService<FactTopicStatusGridDailyEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<FactTopicStatusGridDailyDTO>
* @author generator
* @date 2020-06-20
*/
PageData<FactTopicStatusGridDailyDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<FactTopicStatusGridDailyDTO>
* @author generator
* @date 2020-06-20
*/
List<FactTopicStatusGridDailyDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return FactTopicStatusGridDailyDTO
* @author generator
* @date 2020-06-20
*/
FactTopicStatusGridDailyDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-06-20
*/
void save(FactTopicStatusGridDailyDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-06-20
*/
void update(FactTopicStatusGridDailyDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-06-20
*/
void delete(String[] ids);
}

96
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicTotalAgencyDailyService.java

@ -0,0 +1,96 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats.topic;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.stats.topic.FactTopicTotalAgencyDailyDTO;
import com.epmet.entity.stats.topic.FactTopicTotalAgencyDailyEntity;
import java.util.List;
import java.util.Map;
/**
* 话题总数-机关日统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
public interface FactTopicTotalAgencyDailyService extends BaseService<FactTopicTotalAgencyDailyEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<FactTopicTotalAgencyDailyDTO>
* @author generator
* @date 2020-06-20
*/
PageData<FactTopicTotalAgencyDailyDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<FactTopicTotalAgencyDailyDTO>
* @author generator
* @date 2020-06-20
*/
List<FactTopicTotalAgencyDailyDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return FactTopicTotalAgencyDailyDTO
* @author generator
* @date 2020-06-20
*/
FactTopicTotalAgencyDailyDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-06-20
*/
void save(FactTopicTotalAgencyDailyDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-06-20
*/
void update(FactTopicTotalAgencyDailyDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-06-20
*/
void delete(String[] ids);
}

96
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicTotalGridDailyService.java

@ -0,0 +1,96 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats.topic;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.stats.topic.FactTopicTotalGridDailyDTO;
import com.epmet.entity.stats.topic.FactTopicTotalGridDailyEntity;
import java.util.List;
import java.util.Map;
/**
* 话题总数-网格日统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
public interface FactTopicTotalGridDailyService extends BaseService<FactTopicTotalGridDailyEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<FactTopicTotalGridDailyDTO>
* @author generator
* @date 2020-06-20
*/
PageData<FactTopicTotalGridDailyDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<FactTopicTotalGridDailyDTO>
* @author generator
* @date 2020-06-20
*/
List<FactTopicTotalGridDailyDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return FactTopicTotalGridDailyDTO
* @author generator
* @date 2020-06-20
*/
FactTopicTotalGridDailyDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-06-20
*/
void save(FactTopicTotalGridDailyDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-06-20
*/
void update(FactTopicTotalGridDailyDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-06-20
*/
void delete(String[] ids);
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/TopicStatisticalService.java

@ -0,0 +1,8 @@
package com.epmet.service.stats.topic;
import com.epmet.dto.stats.topic.result.TopicStatisticalData;
public interface TopicStatisticalService {
void insertUniquely(TopicStatisticalData data);
}

102
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueAgencyDailyServiceImpl.java

@ -0,0 +1,102 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats.topic.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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.stats.topic.FactTopicIssueAgencyDailyDao;
import com.epmet.dto.stats.topic.FactTopicIssueAgencyDailyDTO;
import com.epmet.entity.stats.topic.FactTopicIssueAgencyDailyEntity;
import com.epmet.service.stats.topic.FactTopicIssueAgencyDailyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 转议题话题-机关日统计数据表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Service
public class FactTopicIssueAgencyDailyServiceImpl extends BaseServiceImpl<FactTopicIssueAgencyDailyDao, FactTopicIssueAgencyDailyEntity> implements FactTopicIssueAgencyDailyService {
@Override
public PageData<FactTopicIssueAgencyDailyDTO> page(Map<String, Object> params) {
IPage<FactTopicIssueAgencyDailyEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, FactTopicIssueAgencyDailyDTO.class);
}
@Override
public List<FactTopicIssueAgencyDailyDTO> list(Map<String, Object> params) {
List<FactTopicIssueAgencyDailyEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, FactTopicIssueAgencyDailyDTO.class);
}
private QueryWrapper<FactTopicIssueAgencyDailyEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<FactTopicIssueAgencyDailyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public FactTopicIssueAgencyDailyDTO get(String id) {
FactTopicIssueAgencyDailyEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, FactTopicIssueAgencyDailyDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(FactTopicIssueAgencyDailyDTO dto) {
FactTopicIssueAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicIssueAgencyDailyEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(FactTopicIssueAgencyDailyDTO dto) {
FactTopicIssueAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicIssueAgencyDailyEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

102
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueAgencyMonthlyServiceImpl.java

@ -0,0 +1,102 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats.topic.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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.stats.topic.FactTopicIssueAgencyMonthlyDao;
import com.epmet.dto.stats.topic.FactTopicIssueAgencyMonthlyDTO;
import com.epmet.entity.stats.topic.FactTopicIssueAgencyMonthlyEntity;
import com.epmet.service.stats.topic.FactTopicIssueAgencyMonthlyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 转议题话题-机关月统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Service
public class FactTopicIssueAgencyMonthlyServiceImpl extends BaseServiceImpl<FactTopicIssueAgencyMonthlyDao, FactTopicIssueAgencyMonthlyEntity> implements FactTopicIssueAgencyMonthlyService {
@Override
public PageData<FactTopicIssueAgencyMonthlyDTO> page(Map<String, Object> params) {
IPage<FactTopicIssueAgencyMonthlyEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, FactTopicIssueAgencyMonthlyDTO.class);
}
@Override
public List<FactTopicIssueAgencyMonthlyDTO> list(Map<String, Object> params) {
List<FactTopicIssueAgencyMonthlyEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, FactTopicIssueAgencyMonthlyDTO.class);
}
private QueryWrapper<FactTopicIssueAgencyMonthlyEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<FactTopicIssueAgencyMonthlyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public FactTopicIssueAgencyMonthlyDTO get(String id) {
FactTopicIssueAgencyMonthlyEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, FactTopicIssueAgencyMonthlyDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(FactTopicIssueAgencyMonthlyDTO dto) {
FactTopicIssueAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicIssueAgencyMonthlyEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(FactTopicIssueAgencyMonthlyDTO dto) {
FactTopicIssueAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicIssueAgencyMonthlyEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

102
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueGridDailyServiceImpl.java

@ -0,0 +1,102 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats.topic.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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.stats.topic.FactTopicIssueGridDailyDao;
import com.epmet.dto.stats.topic.FactTopicIssueGridDailyDTO;
import com.epmet.entity.stats.topic.FactTopicIssueGridDailyEntity;
import com.epmet.service.stats.topic.FactTopicIssueGridDailyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 转议题话题-网格日统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Service
public class FactTopicIssueGridDailyServiceImpl extends BaseServiceImpl<FactTopicIssueGridDailyDao, FactTopicIssueGridDailyEntity> implements FactTopicIssueGridDailyService {
@Override
public PageData<FactTopicIssueGridDailyDTO> page(Map<String, Object> params) {
IPage<FactTopicIssueGridDailyEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, FactTopicIssueGridDailyDTO.class);
}
@Override
public List<FactTopicIssueGridDailyDTO> list(Map<String, Object> params) {
List<FactTopicIssueGridDailyEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, FactTopicIssueGridDailyDTO.class);
}
private QueryWrapper<FactTopicIssueGridDailyEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<FactTopicIssueGridDailyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public FactTopicIssueGridDailyDTO get(String id) {
FactTopicIssueGridDailyEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, FactTopicIssueGridDailyDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(FactTopicIssueGridDailyDTO dto) {
FactTopicIssueGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicIssueGridDailyEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(FactTopicIssueGridDailyDTO dto) {
FactTopicIssueGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicIssueGridDailyEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

102
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueGridMonthlyServiceImpl.java

@ -0,0 +1,102 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats.topic.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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.stats.topic.FactTopicIssueGridMonthlyDao;
import com.epmet.dto.stats.topic.FactTopicIssueGridMonthlyDTO;
import com.epmet.entity.stats.topic.FactTopicIssueGridMonthlyEntity;
import com.epmet.service.stats.topic.FactTopicIssueGridMonthlyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 转议题话题-网格月统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Service
public class FactTopicIssueGridMonthlyServiceImpl extends BaseServiceImpl<FactTopicIssueGridMonthlyDao, FactTopicIssueGridMonthlyEntity> implements FactTopicIssueGridMonthlyService {
@Override
public PageData<FactTopicIssueGridMonthlyDTO> page(Map<String, Object> params) {
IPage<FactTopicIssueGridMonthlyEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, FactTopicIssueGridMonthlyDTO.class);
}
@Override
public List<FactTopicIssueGridMonthlyDTO> list(Map<String, Object> params) {
List<FactTopicIssueGridMonthlyEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, FactTopicIssueGridMonthlyDTO.class);
}
private QueryWrapper<FactTopicIssueGridMonthlyEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<FactTopicIssueGridMonthlyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public FactTopicIssueGridMonthlyDTO get(String id) {
FactTopicIssueGridMonthlyEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, FactTopicIssueGridMonthlyDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(FactTopicIssueGridMonthlyDTO dto) {
FactTopicIssueGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicIssueGridMonthlyEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(FactTopicIssueGridMonthlyDTO dto) {
FactTopicIssueGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicIssueGridMonthlyEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

102
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicStatusAgencyDailyServiceImpl.java

@ -0,0 +1,102 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats.topic.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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.stats.topic.FactTopicStatusAgencyDailyDao;
import com.epmet.dto.stats.topic.FactTopicStatusAgencyDailyDTO;
import com.epmet.entity.stats.topic.FactTopicStatusAgencyDailyEntity;
import com.epmet.service.stats.topic.FactTopicStatusAgencyDailyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 状态话题-机关日统计数据表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Service
public class FactTopicStatusAgencyDailyServiceImpl extends BaseServiceImpl<FactTopicStatusAgencyDailyDao, FactTopicStatusAgencyDailyEntity> implements FactTopicStatusAgencyDailyService {
@Override
public PageData<FactTopicStatusAgencyDailyDTO> page(Map<String, Object> params) {
IPage<FactTopicStatusAgencyDailyEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, FactTopicStatusAgencyDailyDTO.class);
}
@Override
public List<FactTopicStatusAgencyDailyDTO> list(Map<String, Object> params) {
List<FactTopicStatusAgencyDailyEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, FactTopicStatusAgencyDailyDTO.class);
}
private QueryWrapper<FactTopicStatusAgencyDailyEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<FactTopicStatusAgencyDailyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public FactTopicStatusAgencyDailyDTO get(String id) {
FactTopicStatusAgencyDailyEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, FactTopicStatusAgencyDailyDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(FactTopicStatusAgencyDailyDTO dto) {
FactTopicStatusAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicStatusAgencyDailyEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(FactTopicStatusAgencyDailyDTO dto) {
FactTopicStatusAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicStatusAgencyDailyEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

102
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicStatusAgencyMonthlyServiceImpl.java

@ -0,0 +1,102 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats.topic.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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.stats.topic.FactTopicStatusAgencyMonthlyDao;
import com.epmet.dto.stats.topic.FactTopicStatusAgencyMonthlyDTO;
import com.epmet.entity.stats.topic.FactTopicStatusAgencyMonthlyEntity;
import com.epmet.service.stats.topic.FactTopicStatusAgencyMonthlyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 状态话题-机关月统计数据表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Service
public class FactTopicStatusAgencyMonthlyServiceImpl extends BaseServiceImpl<FactTopicStatusAgencyMonthlyDao, FactTopicStatusAgencyMonthlyEntity> implements FactTopicStatusAgencyMonthlyService {
@Override
public PageData<FactTopicStatusAgencyMonthlyDTO> page(Map<String, Object> params) {
IPage<FactTopicStatusAgencyMonthlyEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, FactTopicStatusAgencyMonthlyDTO.class);
}
@Override
public List<FactTopicStatusAgencyMonthlyDTO> list(Map<String, Object> params) {
List<FactTopicStatusAgencyMonthlyEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, FactTopicStatusAgencyMonthlyDTO.class);
}
private QueryWrapper<FactTopicStatusAgencyMonthlyEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<FactTopicStatusAgencyMonthlyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public FactTopicStatusAgencyMonthlyDTO get(String id) {
FactTopicStatusAgencyMonthlyEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, FactTopicStatusAgencyMonthlyDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(FactTopicStatusAgencyMonthlyDTO dto) {
FactTopicStatusAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicStatusAgencyMonthlyEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(FactTopicStatusAgencyMonthlyDTO dto) {
FactTopicStatusAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicStatusAgencyMonthlyEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

102
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicStatusGridDailyServiceImpl.java

@ -0,0 +1,102 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats.topic.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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.stats.topic.FactTopicStatusGridDailyDao;
import com.epmet.dto.stats.topic.FactTopicStatusGridDailyDTO;
import com.epmet.entity.stats.topic.FactTopicStatusGridDailyEntity;
import com.epmet.service.stats.topic.FactTopicStatusGridDailyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 状态话题-网格日统计数据表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Service
public class FactTopicStatusGridDailyServiceImpl extends BaseServiceImpl<FactTopicStatusGridDailyDao, FactTopicStatusGridDailyEntity> implements FactTopicStatusGridDailyService {
@Override
public PageData<FactTopicStatusGridDailyDTO> page(Map<String, Object> params) {
IPage<FactTopicStatusGridDailyEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, FactTopicStatusGridDailyDTO.class);
}
@Override
public List<FactTopicStatusGridDailyDTO> list(Map<String, Object> params) {
List<FactTopicStatusGridDailyEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, FactTopicStatusGridDailyDTO.class);
}
private QueryWrapper<FactTopicStatusGridDailyEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<FactTopicStatusGridDailyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public FactTopicStatusGridDailyDTO get(String id) {
FactTopicStatusGridDailyEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, FactTopicStatusGridDailyDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(FactTopicStatusGridDailyDTO dto) {
FactTopicStatusGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicStatusGridDailyEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(FactTopicStatusGridDailyDTO dto) {
FactTopicStatusGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicStatusGridDailyEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

102
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicTotalAgencyDailyServiceImpl.java

@ -0,0 +1,102 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats.topic.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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.stats.topic.FactTopicTotalAgencyDailyDao;
import com.epmet.dto.stats.topic.FactTopicTotalAgencyDailyDTO;
import com.epmet.entity.stats.topic.FactTopicTotalAgencyDailyEntity;
import com.epmet.service.stats.topic.FactTopicTotalAgencyDailyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 话题总数-机关日统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Service
public class FactTopicTotalAgencyDailyServiceImpl extends BaseServiceImpl<FactTopicTotalAgencyDailyDao, FactTopicTotalAgencyDailyEntity> implements FactTopicTotalAgencyDailyService {
@Override
public PageData<FactTopicTotalAgencyDailyDTO> page(Map<String, Object> params) {
IPage<FactTopicTotalAgencyDailyEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, FactTopicTotalAgencyDailyDTO.class);
}
@Override
public List<FactTopicTotalAgencyDailyDTO> list(Map<String, Object> params) {
List<FactTopicTotalAgencyDailyEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, FactTopicTotalAgencyDailyDTO.class);
}
private QueryWrapper<FactTopicTotalAgencyDailyEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<FactTopicTotalAgencyDailyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public FactTopicTotalAgencyDailyDTO get(String id) {
FactTopicTotalAgencyDailyEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, FactTopicTotalAgencyDailyDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(FactTopicTotalAgencyDailyDTO dto) {
FactTopicTotalAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicTotalAgencyDailyEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(FactTopicTotalAgencyDailyDTO dto) {
FactTopicTotalAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicTotalAgencyDailyEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

102
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicTotalGridDailyServiceImpl.java

@ -0,0 +1,102 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats.topic.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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.stats.topic.FactTopicTotalGridDailyDao;
import com.epmet.dto.stats.topic.FactTopicTotalGridDailyDTO;
import com.epmet.entity.stats.topic.FactTopicTotalGridDailyEntity;
import com.epmet.service.stats.topic.FactTopicTotalGridDailyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 话题总数-网格日统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-20
*/
@Service
public class FactTopicTotalGridDailyServiceImpl extends BaseServiceImpl<FactTopicTotalGridDailyDao, FactTopicTotalGridDailyEntity> implements FactTopicTotalGridDailyService {
@Override
public PageData<FactTopicTotalGridDailyDTO> page(Map<String, Object> params) {
IPage<FactTopicTotalGridDailyEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, FactTopicTotalGridDailyDTO.class);
}
@Override
public List<FactTopicTotalGridDailyDTO> list(Map<String, Object> params) {
List<FactTopicTotalGridDailyEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, FactTopicTotalGridDailyDTO.class);
}
private QueryWrapper<FactTopicTotalGridDailyEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<FactTopicTotalGridDailyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public FactTopicTotalGridDailyDTO get(String id) {
FactTopicTotalGridDailyEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, FactTopicTotalGridDailyDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(FactTopicTotalGridDailyDTO dto) {
FactTopicTotalGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicTotalGridDailyEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(FactTopicTotalGridDailyDTO dto) {
FactTopicTotalGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicTotalGridDailyEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

124
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/TopicStatisticalServiceImpl.java

@ -0,0 +1,124 @@
package com.epmet.service.stats.topic.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.dao.stats.topic.*;
import com.epmet.dto.stats.topic.result.TopicStatisticalData;
import com.epmet.service.stats.topic.TopicStatisticalService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* @Description
* @ClassName TopicStatisticalServiceImpl
* @Auth wangc
* @Date 2020-06-23 14:29
*/
@Service
public class TopicStatisticalServiceImpl implements TopicStatisticalService {
private static final Logger logger = LoggerFactory.getLogger(TopicStatisticalServiceImpl.class);
@Autowired
private FactTopicIssueAgencyDailyDao topicIssueAgencyDailyDao;
@Autowired
private FactTopicIssueAgencyMonthlyDao topicIssueAgencyMonthlyDao;
@Autowired
private FactTopicIssueGridDailyDao topicIssueGridDailyDao;
@Autowired
private FactTopicIssueGridMonthlyDao topicIssueGridMonthlyDao;
@Autowired
private FactTopicStatusAgencyDailyDao topicStatusAgencyDailyDao;
@Autowired
private FactTopicStatusAgencyMonthlyDao topicStatusAgencyMonthlyDao;
@Autowired
private FactTopicStatusGridDailyDao topicStatusGridDailyDao;
@Autowired
private FactTopicTotalAgencyDailyDao topicTotalAgencyDailyDao;
@Autowired
private FactTopicTotalGridDailyDao topicTotalGridDailyDao;
@Override
@Transactional(rollbackFor = Exception.class)
public void insertUniquely(TopicStatisticalData data) {
if(null == data) return;
if(StringUtils.isBlank(data.getDateId()) || StringUtils.isBlank(data.getMonthId())){
logger.warn("缺失重要参数:dateId或monthId");
return ;
}
if(null != data.getIssueAgencyDailyList() && data.getIssueAgencyDailyList().size() > NumConstant.ZERO){
topicIssueAgencyDailyDao.deleteByParams(data.getDateId(),data.getCustomerId());
topicIssueAgencyDailyDao.insertBatch(data.getIssueAgencyDailyList());
}
if(null != data.getIssueAgencyMonthlyList() && data.getIssueAgencyMonthlyList().size() > NumConstant.ZERO){
topicIssueAgencyMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId());
topicIssueAgencyMonthlyDao.insertBatch(data.getIssueAgencyMonthlyList());
}
if(null != data.getIssueGridDailyList() && data.getIssueGridDailyList().size() > NumConstant.ZERO){
topicIssueGridDailyDao.deleteByParams(data.getDateId(),data.getCustomerId());
topicIssueGridDailyDao.insertBatch(data.getIssueGridDailyList());
}
if(null != data.getIssueGridMonthlyList() && data.getIssueGridMonthlyList().size() > NumConstant.ZERO){
topicIssueGridMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId());
topicIssueGridMonthlyDao.insertBatch(data.getIssueGridMonthlyList());
}
if(null != data.getTopicAgencyDailyList() && data.getTopicAgencyDailyList().size() > NumConstant.ZERO){
topicStatusAgencyDailyDao.deleteByParams(data.getDateId(),data.getCustomerId());
topicStatusAgencyDailyDao.insertBatch(data.getTopicAgencyDailyList());
}
if(null != data.getTopicAgencyMonthlyList() && data.getTopicAgencyMonthlyList().size() > NumConstant.ZERO){
topicStatusAgencyMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId());
topicStatusAgencyMonthlyDao.insertBatch(data.getTopicAgencyMonthlyList());
}
if(null != data.getTopicGridDailyList() && data.getTopicGridDailyList().size() > NumConstant.ZERO){
topicStatusGridDailyDao.deleteByParams(data.getDateId(),data.getCustomerId());
topicStatusGridDailyDao.insertBatch(data.getTopicGridDailyList());
}
if(null != data.getTotalAgencyDailyList() && data.getTotalAgencyDailyList().size() > NumConstant.ZERO){
topicTotalAgencyDailyDao.deleteByParams(data.getDateId(),data.getCustomerId());
topicTotalAgencyDailyDao.insertBatch(data.getTotalAgencyDailyList());
}
if(null != data.getTotalGridDailyList() && data.getTotalGridDailyList().size() > NumConstant.ZERO){
topicTotalGridDailyDao.deleteByParams(data.getDateId(),data.getCustomerId());
topicTotalGridDailyDao.insertBatch(data.getTotalGridDailyList());
}
}
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/UserStatisticalService.java

@ -0,0 +1,8 @@
package com.epmet.service.stats.user;
import com.epmet.dto.stats.user.result.UserStatisticalData;
public interface UserStatisticalService {
void insertUniquely(UserStatisticalData data);
}

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

@ -0,0 +1,117 @@
package com.epmet.service.stats.user.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.dao.stats.user.*;
import com.epmet.dto.stats.user.result.UserStatisticalData;
import com.epmet.service.stats.user.UserStatisticalService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* @Description
* @ClassName UserStatisticalServiceImpl
* @Auth wangc
* @Date 2020-06-23 14:27
*/
@Service
public class UserStatisticalServiceImpl implements UserStatisticalService {
private static final Logger logger = LoggerFactory.getLogger(UserStatisticalServiceImpl.class);
@Autowired
private FactParticipationUserAgencyDailyDao participationUserAgencyDailyDao;
@Autowired
private FactParticipationUserAgencyMonthlyDao participationUserAgencyMonthlyDao;
@Autowired
private FactParticipationUserGridDailyDao participationUserGridDailyDao;
@Autowired
private FactParticipationUserGridMonthlyDao participationUserGridMonthlyDao;
@Autowired
private FactRegUserAgencyDailyDao regUserAgencyDailyDao;
@Autowired
private FactRegUserAgencyMonthlyDao regUserAgencyMonthlyDao;
@Autowired
private FactRegUserGridDailyDao regUserGridDailyDao;
@Autowired
private FactRegUserGridMonthlyDao regUserGridMonthlyDao;
@Override
@Transactional(rollbackFor = Exception.class)
public void insertUniquely(UserStatisticalData data) {
if (null == data) return ;
if(StringUtils.isBlank(data.getDateId()) || StringUtils.isBlank(data.getMonthId())){
logger.warn("缺失重要参数:dateId或monthId");
return ;
}
if(null != data.getPartiAgencyDailyList() && data.getPartiAgencyDailyList().size() > NumConstant.ZERO){
participationUserAgencyDailyDao.deleteByParams(data.getDateId(),data.getCustomerId());
participationUserAgencyDailyDao.insertBatch(data.getPartiAgencyDailyList());
}
if(null != data.getPartiAgencyMonthlyList() && data.getPartiAgencyMonthlyList().size() > NumConstant.ZERO){
participationUserAgencyMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId());
participationUserAgencyMonthlyDao.insertBatch(data.getPartiAgencyMonthlyList());
}
if(null != data.getPartiGridMonthlyList() && data.getPartiGridMonthlyList().size() > NumConstant.ZERO){
participationUserGridMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId());
participationUserGridMonthlyDao.insertBatch(data.getPartiGridMonthlyList());
}
if(null != data.getPartiGridDailyList() && data.getPartiGridDailyList().size() > NumConstant.ZERO){
participationUserGridDailyDao.deleteByParams(data.getDateId(),data.getCustomerId());
participationUserGridDailyDao.insertBatch(data.getPartiGridDailyList());
}
if(null != data.getRegAgencyDailyList() && data.getRegAgencyDailyList().size() > NumConstant.ZERO){
regUserAgencyDailyDao.deleteByParams(data.getDateId(),data.getCustomerId());
regUserAgencyDailyDao.insertBatch(data.getRegAgencyDailyList());
}
if(null != data.getRegAgencyMonthlyList() && data.getRegAgencyMonthlyList().size() > NumConstant.ZERO){
regUserAgencyMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId());
regUserAgencyMonthlyDao.insertBatch(data.getRegAgencyMonthlyList());
}
if(null != data.getRegGridDailyList() && data.getRegGridDailyList().size() > NumConstant.ZERO){
regUserGridDailyDao.deleteByParams(data.getDateId(),data.getCustomerId());
regUserGridDailyDao.insertBatch(data.getRegGridDailyList());
}
if(null != data.getRegGridMonthlyList() && data.getRegGridMonthlyList().size() > NumConstant.ZERO){
regUserGridMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId());
regUserGridMonthlyDao.insertBatch(data.getRegGridMonthlyList());
}
}
}

28
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java

@ -0,0 +1,28 @@
package com.epmet.service.topic;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.stats.DimTopicStatusDTO;
import com.epmet.dto.stats.topic.result.TopicStatisticalData;
import com.epmet.util.DimIdGenerator;
import java.util.Date;
import java.util.List;
/**
* @Author wangc
* @CreateTime 2020/6/19 13:22
*/
public interface TopicService {
/**
* @Description 计算并生成统计数据 整合维度 : 机关 网格 话题
* @param agencies
* @param targetDate
* @param timeDimension
* @return
* @author wangc
* @date 2020.06.22 11:12
**/
TopicStatisticalData compute(List<AgencySubTreeDto> agencies, Date targetDate, DimIdGenerator.DimIdBean timeDimension, String customerId, List<DimTopicStatusDTO> statusDimension);
}

920
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java

@ -0,0 +1,920 @@
package com.epmet.service.topic.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.topic.TopicDao;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.stats.DimTopicStatusDTO;
import com.epmet.dto.stats.topic.*;
import com.epmet.dto.stats.topic.result.GridTopicData;
import com.epmet.dto.stats.topic.result.GroupTopicData;
import com.epmet.dto.stats.topic.result.TopicStatisticalData;
import com.epmet.dto.topic.result.ResiGroupTopicResultDTO;
import com.epmet.dto.topic.result.ResiTopicOperationResultDTO;
import com.epmet.dto.topic.result.ResiTopicResultDTO;
import com.epmet.service.topic.TopicService;
import com.epmet.service.user.impl.UserServiceImpl;
import com.epmet.util.DimIdGenerator;
import com.epmet.util.ModuleConstant;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.text.NumberFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Description
* @ClassName TopicServiceImpl
* @Auth wangc
* @Date 2020-06-20 17:00
*/
@DataSource(DataSourceConstant.RESI_GROUP)
@Service
public class TopicServiceImpl implements TopicService {
private static final Logger logger = LoggerFactory.getLogger(UserServiceImpl.class);
@Autowired
private TopicDao topicDao;
/**
* @Description 计算并生成统计数据 整合维度 : 机关 网格 话题
* @param agencies
* @param targetDate
* @param timeDimension
* @return
* @author wangc
* @date 2020.06.22 11:12
**/
@Override
public TopicStatisticalData compute(List<AgencySubTreeDto> agencies, Date targetDate, DimIdGenerator.DimIdBean timeDimension, String customerId, List<DimTopicStatusDTO> statusDimension) {
if(null == agencies || agencies.size() == NumConstant.ZERO){
logger.warn("没有相应的机关集合");
return null;
}
//Map<String, List<AgencySubTreeDto>> agencyMap = agencies.stream().collect(Collectors.groupingBy(AgencySubTreeDto::getAgencyId));
Map<String, Set<String>> subGridOfAgency = new HashMap<>();
agencies.forEach(agency -> {
initAgencyGridMap(agency.getAgencyId(),agency,subGridOfAgency);
});
List<ResiGroupTopicResultDTO> topics = topicDao.selectGroupOrderByGrid(targetDate,customerId);
topics.forEach(groupTopic -> {
if(null != groupTopic.getTopics() && groupTopic.getTopics().size() == NumConstant.ONE && StringUtils.isBlank(groupTopic.getTopics().get(NumConstant.ZERO).getTopicId())){
groupTopic.setTopics(new ArrayList<>());
}
});
Map<String,List<ResiGroupTopicResultDTO>> gridGroupMap =
topics.stream().collect(Collectors.groupingBy(ResiGroupTopicResultDTO::getGridId));
return calculateAndSummarizeTopicStatisticalData(subGridOfAgency,agencies,gridGroupMap,targetDate,statusDimension,timeDimension,customerId);
}
/**
* @Description 初始化机关-所有下级网格Map
* @param pid - 固定一个机关Id
* @param agency - AgencySubTreeDto
* @param subGridOfAgency - Map<String,Set<String>>
* @return
* @author wangc
* @date 2020.06.18 15:54
**/
void initAgencyGridMap(String pid, AgencySubTreeDto agency, Map<String,Set<String>> subGridOfAgency){
//向map中放入数据
if(subGridOfAgency.containsKey(pid)){
//包含key
Set<String> grids = subGridOfAgency.get(pid);
if(null == grids){
grids = new HashSet<>();
subGridOfAgency.put(pid,grids);
}
if(null != agency.getGridIds() && agency.getGridIds().size() > NumConstant.ZERO){
grids.addAll(agency.getGridIds());
}
}else{
//不包含key
Set<String> grids = new HashSet<>(agency.getGridIds());
subGridOfAgency.put(pid,grids);
}
//定义递归出口
if(StringUtils.equals(ModuleConstant.AGENCY_LEVEL_COMMUNITY,agency.getLevel()) || null == agency.getSubAgencies() || agency.getSubAgencies().size() == NumConstant.ZERO){
return ;
}
//定义递归入口
agency.getSubAgencies().forEach(obj -> {
initAgencyGridMap(pid,obj,subGridOfAgency);
});
}
/**
* @Description 计算并整合出每一个组内话题的数据
* @param subGridOfAgency
* @param gridGroupMap
* @param targetDate
* @return
* @author wangc
* @date 2020.06.22 13:13
**/
TopicStatisticalData calculateAndSummarizeTopicStatisticalData(Map<String, Set<String>> subGridOfAgency, List<AgencySubTreeDto> agencies, Map<String,List<ResiGroupTopicResultDTO>> gridGroupMap, Date targetDate,List<DimTopicStatusDTO> statusDimension ,DimIdGenerator.DimIdBean timeDimension ,String customerId){
if(null == subGridOfAgency || subGridOfAgency.size() <= NumConstant.ZERO){
return null;
}
if(null == gridGroupMap || gridGroupMap.size() <= NumConstant.ZERO){
return null;
}
//定义数据包 - 返回对象
TopicStatisticalData dataPacket = new TopicStatisticalData();
dataPacket.setDateId(timeDimension.getDateId());
dataPacket.setMonthId(timeDimension.getMonthId());
dataPacket.setCustomerId(customerId);
//参数:subGridOfAgency 所有机关的下级网格信息
//参数:gridGroupMap 所有网格的组以及组内话题
//[所有]话题当日的操作记录
List<ResiTopicOperationResultDTO> operations =
topicDao.selectTopicOperationRecord(targetDate);
//key:话题Id value:这个话题在当日的操作记录
//操作类型有: ①discussing(发布) ②hidden(屏蔽) ③hidden_cancelled(取消屏蔽) ④closed(关闭) ⑤shift_issue(转议题)
//注意不要把【发布】和【取消屏蔽】混淆!!!
Map<String,List<ResiTopicOperationResultDTO>> topicOperationMap =
operations.stream().collect(Collectors.groupingBy(ResiTopicOperationResultDTO::getTopicId));
analyzeTopic(subGridOfAgency,agencies,gridGroupMap,topicOperationMap,targetDate,dataPacket,statusDimension,timeDimension);
return dataPacket;
}
/**
* @Description 生成话题统计数据
* @param
* @return
* @author wangc
* @date 2020.06.22 13:45
**/
void analyzeTopic(Map<String, Set<String>> subGridOfAgency, List<AgencySubTreeDto> agencies, Map<String,List<ResiGroupTopicResultDTO>> gridGroupMap, Map<String,List<ResiTopicOperationResultDTO>> topicOperationMap, Date targetDate, TopicStatisticalData dataPacket, List<DimTopicStatusDTO> statusDimension, DimIdGenerator.DimIdBean timeDimension){
Boolean isMonthEnd = false;
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
calendar.add(Calendar.DATE, NumConstant.ONE_NEG);
Date targetDateCheck = null == targetDate ? calendar.getTime() : targetDate;
calendar.setTime(targetDateCheck);
//如果目标日期是当月的最后一天
if(calendar.get(Calendar.DATE) == calendar.getActualMaximum(Calendar.DAY_OF_MONTH)){
//求出这个月的第一天
calendar.setTime(new Date());
calendar.set(Calendar.DAY_OF_MONTH, NumConstant.ONE);
calendar.set(Calendar.HOUR_OF_DAY, NumConstant.ZERO);
calendar.set(Calendar.MINUTE, NumConstant.ZERO);
calendar.set(Calendar.SECOND, NumConstant.ZERO);
isMonthEnd = true;
}
//计算百分比使用,保留小数点后两位
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.SIX);
Map<String,DimTopicStatusDTO> statusMap = new HashMap<>();
statusDimension.forEach(status -> statusMap.put(status.getId(),status));
Map<String,AgencySubTreeDto> agencyMap = new HashMap<>();
agencies.forEach(agency -> {agencyMap.put(agency.getAgencyId(),agency);});
List<ResiGroupTopicResultDTO> groupList = new LinkedList<>();
for(Map.Entry<String,List<ResiGroupTopicResultDTO>> entry : gridGroupMap.entrySet()){
if(null != entry.getValue() && entry.getValue().size() > NumConstant.ZERO)
groupList.addAll(entry.getValue());
}
//key -> groupId
Map<String,GroupTopicData> groupTopicData = traverseGroupTopic(groupList,topicOperationMap);
Map<String,Boolean> gridDistinct = new HashMap<>();
agencies.forEach(agency -> {
if(null != agency.getGridIds() && agency.getGridIds().size() > NumConstant.ZERO){
agency.getGridIds().forEach(grid -> {
gridDistinct.put(grid,false);
});
}
});
for(Map.Entry<String,Set<String>> entry : subGridOfAgency.entrySet()){
FactTopicIssueAgencyDailyDTO issueAgencyD = new FactTopicIssueAgencyDailyDTO();
FactTopicTotalAgencyDailyDTO totalAgencyD = new FactTopicTotalAgencyDailyDTO();
FactTopicStatusAgencyDailyDTO topicAgencyD_discussing = new FactTopicStatusAgencyDailyDTO();
FactTopicStatusAgencyDailyDTO topicAgencyD_hidden = new FactTopicStatusAgencyDailyDTO();
FactTopicStatusAgencyDailyDTO topicAgencyD_closed = new FactTopicStatusAgencyDailyDTO();
initAgencyDailyDTO(entry.getKey(),agencyMap.get(entry.getKey()).getPid(),agencyMap.get(entry.getKey()).getCustomerId(),timeDimension,statusMap,issueAgencyD,totalAgencyD,topicAgencyD_discussing,topicAgencyD_hidden,topicAgencyD_closed);
if(null != entry.getValue() && entry.getValue().size() > NumConstant.ZERO){
entry.getValue().forEach(gridId -> {
FactTopicIssueGridDailyDTO issueGridD = new FactTopicIssueGridDailyDTO();
FactTopicStatusGridDailyDTO topicGridD_discussing = new FactTopicStatusGridDailyDTO();
FactTopicStatusGridDailyDTO topicGridD_hidden = new FactTopicStatusGridDailyDTO();
FactTopicStatusGridDailyDTO topicGridD_closed = new FactTopicStatusGridDailyDTO();
FactTopicTotalGridDailyDTO totalGirdD = new FactTopicTotalGridDailyDTO();
initGridDailyDTO(entry.getKey(),gridId,agencyMap.get(entry.getKey()).getCustomerId(),timeDimension,statusMap,issueGridD,totalGirdD,topicGridD_discussing,topicGridD_hidden,topicGridD_closed);
List<ResiGroupTopicResultDTO> groups = gridGroupMap.get(gridId);
if(null != groups && groups.size() > NumConstant.ZERO) {
groups.forEach(group -> {
if (null != group && StringUtils.isNotBlank(group.getGroupId())) {
issueAgencyD.setIssueIncr(issueAgencyD.getIssueIncr() + groupTopicData.get(group.getGroupId()).getIssueIncr());
issueAgencyD.setIssueTotal(issueAgencyD.getIssueTotal() + groupTopicData.get(group.getGroupId()).getIssueTotal());
issueGridD.setIssueIncr(issueGridD.getIssueIncr() + groupTopicData.get(group.getGroupId()).getIssueIncr());
issueGridD.setIssueTotal(issueGridD.getIssueTotal() + groupTopicData.get(group.getGroupId()).getIssueTotal());
totalAgencyD.setIssueTotalCount(issueAgencyD.getIssueTotal());
totalAgencyD.setHiddenTotalCount(totalAgencyD.getHiddenTotalCount() + groupTopicData.get(group.getGroupId()).getHiddenTotal());
totalAgencyD.setTopicIncr(totalAgencyD.getTopicIncr() + groupTopicData.get(group.getGroupId()).getTopicIncr());
totalAgencyD.setTopicTotal(totalAgencyD.getTopicTotal() + groupTopicData.get(group.getGroupId()).getTotal());
totalGirdD.setIssueTotalCount(issueGridD.getIssueTotal());
totalGirdD.setHiddenTotalCount(totalGirdD.getHiddenTotalCount() + groupTopicData.get(group.getGroupId()).getHiddenTotal());
totalGirdD.setTopicIncr(totalGirdD.getTopicIncr() + groupTopicData.get(group.getGroupId()).getTopicIncr());
totalGirdD.setTopicTotal(totalGirdD.getTopicTotal() + groupTopicData.get(group.getGroupId()).getTotal());
GroupTopicData data = groupTopicData.get(group.getGroupId());
if (null != data) {
topicAgencyD_discussing.setTopicCount(topicAgencyD_discussing.getTopicCount() + data.getDiscussingTotal());
topicAgencyD_discussing.setTopicIncrement(topicAgencyD_discussing.getTopicIncrement() + data.getDiscussingIncr());
topicAgencyD_hidden.setTopicCount(topicAgencyD_hidden.getTopicCount() + data.getHiddenTotal());
topicAgencyD_hidden.setTopicIncrement(topicAgencyD_hidden.getTopicIncrement() + data.getHiddenIncr());
topicAgencyD_closed.setTopicCount(topicAgencyD_closed.getTopicCount() + data.getClosedTotal());
topicAgencyD_closed.setTopicIncrement(topicAgencyD_closed.getTopicIncrement() + data.getClosedIncr());
topicGridD_discussing.setTopicCount(topicGridD_discussing.getTopicCount() + data.getDiscussingTotal());
topicGridD_discussing.setTopicIncrement(topicGridD_discussing.getTopicIncrement() + data.getDiscussingIncr());
topicGridD_hidden.setTopicCount(topicGridD_hidden.getTopicCount() + data.getHiddenTotal());
topicGridD_hidden.setTopicIncrement(topicGridD_hidden.getTopicIncrement() + data.getHiddenIncr());
topicGridD_closed.setTopicCount(topicGridD_closed.getTopicCount() + data.getClosedTotal());
topicGridD_closed.setTopicIncrement(topicGridD_closed.getTopicIncrement() + data.getClosedIncr());
}
}
});
}
//网格-百分比
setGridTopicProportion(numberFormat, topicGridD_discussing, topicGridD_hidden, topicGridD_closed, totalGirdD);
if(!gridDistinct.get(gridId)) {
setGridDailyDataPacket(dataPacket, issueGridD, totalGirdD, topicGridD_discussing, topicGridD_hidden, topicGridD_closed);
}
gridDistinct.put(gridId,true);
});
//机关-百分比
setAgencyTopicProportion(numberFormat,topicAgencyD_discussing,topicAgencyD_hidden,topicAgencyD_closed,totalAgencyD);
setAgencyDailyDataPacket(dataPacket,issueAgencyD,totalAgencyD,topicAgencyD_discussing,topicAgencyD_hidden,topicAgencyD_closed);
}
}
if(isMonthEnd){
gridDistinct.forEach((k,v) -> {
gridDistinct.put(k,false);
});
List<ResiGroupTopicResultDTO> topicsBetweenTimeRange = topicDao.selectGroupOrderByGridBetweenTimeRange(calendar.getTime(),targetDate,null);
Map<String,List<ResiGroupTopicResultDTO>> GridGroupMapBetweenTimeRange =
topicsBetweenTimeRange.stream().collect(Collectors.groupingBy(ResiGroupTopicResultDTO::getGridId));
List<ResiGroupTopicResultDTO> groupListBetweenTimeRange = new LinkedList<>();
for(Map.Entry<String,List<ResiGroupTopicResultDTO>> entryBetweenTimeRange : GridGroupMapBetweenTimeRange.entrySet()){
if(null != entryBetweenTimeRange.getValue() && entryBetweenTimeRange.getValue().size() > NumConstant.ZERO)
groupListBetweenTimeRange.addAll(entryBetweenTimeRange.getValue());
}
List<ResiTopicOperationResultDTO> operationsBetweenTimeRange =
topicDao.selectTopicOperationRecordBetweenTimeRange(calendar.getTime(),targetDate);
Map<String,List<ResiTopicOperationResultDTO>> topicOperationMapBetweenTimeRange =
operationsBetweenTimeRange.stream().collect(Collectors.groupingBy(ResiTopicOperationResultDTO::getTopicId));
Map<String,GroupTopicData> groupTopicDataBetweenTimeRange = traverseGroupTopic(groupListBetweenTimeRange,topicOperationMapBetweenTimeRange);
for(Map.Entry<String,Set<String>> entry : subGridOfAgency.entrySet()){
FactTopicIssueAgencyMonthlyDTO issueAgencyM = new FactTopicIssueAgencyMonthlyDTO();
FactTopicStatusAgencyMonthlyDTO topicAgencyM_discussing = new FactTopicStatusAgencyMonthlyDTO();
FactTopicStatusAgencyMonthlyDTO topicAgencyM_hidden = new FactTopicStatusAgencyMonthlyDTO();
FactTopicStatusAgencyMonthlyDTO topicAgencyM_closed = new FactTopicStatusAgencyMonthlyDTO();
initAgencyMonthlyDTO(entry.getKey(),agencyMap.get(entry.getKey()).getPid(),agencyMap.get(entry.getKey()).getCustomerId(),timeDimension,statusMap,issueAgencyM,topicAgencyM_discussing,topicAgencyM_hidden,topicAgencyM_closed);
if(null != entry.getValue() && entry.getValue().size() > NumConstant.ZERO){
entry.getValue().forEach(gridId -> {
FactTopicIssueGridMonthlyDTO issueGridM = new FactTopicIssueGridMonthlyDTO();
initGridMonthlyDTO(entry.getKey(),agencyMap.get(entry.getKey()).getCustomerId(),gridId,timeDimension,issueGridM);
List<ResiGroupTopicResultDTO> groups = gridGroupMap.get(gridId);
groups.forEach(group -> {
if(null != group && StringUtils.isNotBlank(group.getGroupId())){
issueAgencyM.setIssueIncr(issueAgencyM.getIssueIncr() + groupTopicDataBetweenTimeRange.get(group.getGroupId()).getIssueIncr());
issueAgencyM.setIssueTotal(issueAgencyM.getIssueTotal() + groupTopicDataBetweenTimeRange.get(group.getGroupId()).getIssueTotal());
issueGridM.setIssueIncr(issueGridM.getIssueIncr() + groupTopicDataBetweenTimeRange.get(group.getGroupId()).getIssueIncr());
issueGridM.setIssueTotal(issueGridM.getIssueTotal() + groupTopicDataBetweenTimeRange.get(group.getGroupId()).getIssueTotal());
GroupTopicData data = groupTopicData.get(group.getGroupId());
if(null != data){
topicAgencyM_discussing.setTopicCount(topicAgencyM_discussing.getTopicCount() + data.getDiscussingTotal());
topicAgencyM_discussing.setTopicIncr(topicAgencyM_discussing.getTopicIncr() + data.getDiscussingIncr());
topicAgencyM_hidden.setTopicCount(topicAgencyM_hidden.getTopicCount() + data.getHiddenTotal());
topicAgencyM_hidden.setTopicIncr(topicAgencyM_hidden.getTopicIncr() + data.getHiddenIncr());
topicAgencyM_closed.setTopicCount(topicAgencyM_closed.getTopicCount() + data.getClosedTotal());
topicAgencyM_closed.setTopicIncr(topicAgencyM_closed.getTopicIncr() + data.getClosedIncr());
}
}
});
if(!gridDistinct.get(gridId)) {
setGridMonthlyDataPacket(dataPacket, issueGridM);
}
gridDistinct.put(gridId,true);
});
//机关-百分比
setAgencyTopicMonthlyProportion(numberFormat,topicAgencyM_discussing,topicAgencyM_hidden,topicAgencyM_closed);
setAgencyMonthlyDataPacket(dataPacket,issueAgencyM,topicAgencyM_discussing,topicAgencyM_hidden,topicAgencyM_closed);
}
}
}
}
/**
* @Description 生成每个组的话题统计数据
* @param
* @return Map<String,GroupTopicData> key:groupId
* @author wangc
* @date 2020.06.22 16:03
**/
Map<String,GroupTopicData> traverseGroupTopic(List<ResiGroupTopicResultDTO> groups, Map<String,List<ResiTopicOperationResultDTO>> topicOperationMap){
if(null == groups || groups.size() < NumConstant.ONE)
return null;
Map<String , GroupTopicData> groupTopicStatistical = new HashMap<>();
groups.forEach(group -> {
if (null != group) {
GroupTopicData groupTopicData = new GroupTopicData();
groupTopicData.setGroupId(group.getGroupId());
groupTopicData.setTotal(group.getTopics().size());
if (null == group.getTopics() || group.getTopics().size() == NumConstant.ZERO) {
groupTopicData.setTopicIncr(NumConstant.ZERO);
groupTopicData.setHiddenTotal(NumConstant.ZERO);
groupTopicData.setHiddenIncr(NumConstant.ZERO);
groupTopicData.setIssueIncr(NumConstant.ZERO);
groupTopicData.setClosedTotal(NumConstant.ZERO);
groupTopicData.setClosedIncr(NumConstant.ZERO);
groupTopicData.setDiscussingTotal(NumConstant.ZERO);
groupTopicData.setDiscussingIncr(NumConstant.ZERO);
groupTopicData.setIssueTotal(NumConstant.ZERO);
}else{
for (ResiTopicResultDTO topic : group.getTopics()) {
if (StringUtils.equals(NumConstant.ONE_STR, topic.getIncrFlag())) {
groupTopicData.setTopicIncr(groupTopicData.getTopicIncr() + NumConstant.ONE);
}
List<ResiTopicOperationResultDTO> operations = topicOperationMap.get(topic.getTopicId());
boolean operFlag = true;
if(null == operations || operations.size() < NumConstant.ZERO){
operFlag = false;
}
Map<String,List<ResiTopicOperationResultDTO>> hiddenGroupByDate = operFlag ? operations.stream().filter(oper -> StringUtils.equals("hidden",oper.getStatus())).collect(Collectors.groupingBy(ResiTopicOperationResultDTO::getCreatedTime)) : null;
Map<String,List<ResiTopicOperationResultDTO>> hiddenCancelledGroupByDate = operFlag ? operations.stream().filter(oper -> StringUtils.equals("hidden_cancelled",oper.getStatus())).collect(Collectors.groupingBy(ResiTopicOperationResultDTO::getCreatedTime)) : null;
//对于话题,每个话题的操作记录中,【关闭】与【转议题】只会出现一次,而【屏蔽】与【取消屏蔽】会出现多次
switch (topic.getStatus()) {
case "hidden":
groupTopicData.setHiddenTotal(groupTopicData.getHiddenTotal() + NumConstant.ONE);
if (operFlag) {
//如果在同一天内被多次屏蔽,只计算一次
hiddenGroupByDate.forEach((k, v) -> {
if (null != v && v.size() > NumConstant.ZERO) {
groupTopicData.setHiddenIncr(groupTopicData.getHiddenIncr() + NumConstant.ONE);
}
});
for (ResiTopicOperationResultDTO operation : operations) {
if (StringUtils.equals(operation.getStatus(), "shift_issue"))
groupTopicData.setIssueIncr(groupTopicData.getIssueIncr() + NumConstant.ONE);
}
}
break;
case "closed":
groupTopicData.setClosedTotal(groupTopicData.getClosedTotal() + NumConstant.ONE);
if (operFlag) {
for (ResiTopicOperationResultDTO operation : operations) {
if (StringUtils.equals(operation.getStatus(), "closed"))
groupTopicData.setClosedIncr(groupTopicData.getClosedIncr() + NumConstant.ONE);
if (StringUtils.equals(operation.getStatus(), "shift_issue"))
groupTopicData.setIssueIncr(groupTopicData.getIssueIncr() + NumConstant.ONE);
}
}
break;
case "discussing":
groupTopicData.setDiscussingTotal(groupTopicData.getDiscussingTotal() + NumConstant.ONE);
Set<String> dateRelease = new HashSet<>();
if(operFlag) {
if (null != hiddenGroupByDate && hiddenGroupByDate.size() > NumConstant.ZERO){
hiddenGroupByDate.forEach((k, v) -> {
if (null != v && v.size() > NumConstant.ZERO) {
if (null != hiddenCancelledGroupByDate.get(k) && hiddenCancelledGroupByDate.get(k).size() > NumConstant.ZERO) {
if (hiddenCancelledGroupByDate.get(k).size() == v.size()) {
groupTopicData.setDiscussingIncr(groupTopicData.getDiscussingIncr() + NumConstant.ONE);
dateRelease.add(k);
return; //相当于continue,循环下一个日期
} else {
//话题操作日志与话题状态不符
}
}
}
});
}
if (operations.stream().filter(operation -> StringUtils.equals(operation.getStatus(), "discussing") && !dateRelease.contains(operation.getCreatedTime())).findAny().isPresent()) {
groupTopicData.setDiscussingIncr(groupTopicData.getDiscussingIncr() + NumConstant.ONE);
}
if (operations.stream().filter(operation -> StringUtils.equals(operation.getStatus(), "shift_issue")).findAny().isPresent()) {
groupTopicData.setIssueIncr(groupTopicData.getIssueIncr() + NumConstant.ONE);
}
}
break;
}
if (topic.isShiftIssue()) {
groupTopicData.setIssueTotal(groupTopicData.getIssueTotal() + NumConstant.ONE);
}
}
}
groupTopicStatistical.put(group.getGroupId(), groupTopicData);
}
});
return groupTopicStatistical;
}
void initAgencyDailyDTO(String agencyId, String pid, String customerId,DimIdGenerator.DimIdBean timeDimension, Map<String,DimTopicStatusDTO> statusMap, FactTopicIssueAgencyDailyDTO issueAgencyD, FactTopicTotalAgencyDailyDTO totalAgencyD, FactTopicStatusAgencyDailyDTO topicAgencyD_discussing, FactTopicStatusAgencyDailyDTO topicAgencyD_hidden, FactTopicStatusAgencyDailyDTO topicAgencyD_closed){
issueAgencyD.setAgencyId(agencyId);
issueAgencyD.setPid(pid);
issueAgencyD.setCustomerId(customerId);
issueAgencyD.setDateId(timeDimension.getDateId());
issueAgencyD.setWeekId(timeDimension.getWeekId());
issueAgencyD.setMonthId(timeDimension.getMonthId());
issueAgencyD.setQuarterId(timeDimension.getQuarterId());
issueAgencyD.setYearId(timeDimension.getYearId());
issueAgencyD.setIssueIncr(NumConstant.ZERO);
issueAgencyD.setIssueTotal(NumConstant.ZERO);
issueAgencyD.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT);
totalAgencyD.setAgencyId(agencyId);
totalAgencyD.setPid(pid);
totalAgencyD.setCustomerId(customerId);
totalAgencyD.setDateId(timeDimension.getDateId());
totalAgencyD.setWeekId(timeDimension.getWeekId());
totalAgencyD.setMonthId(timeDimension.getMonthId());
totalAgencyD.setQuarterId(timeDimension.getQuarterId());
totalAgencyD.setYearId(timeDimension.getYearId());
totalAgencyD.setIssueTotalCount(NumConstant.ZERO);
totalAgencyD.setHiddenTotalCount(NumConstant.ZERO);
totalAgencyD.setTopicIncr(NumConstant.ZERO);
totalAgencyD.setTopicTotal(NumConstant.ZERO);
totalAgencyD.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT);
topicAgencyD_discussing.setAgencyId(agencyId);
topicAgencyD_discussing.setPid(pid);
topicAgencyD_discussing.setCustomerId(customerId);
topicAgencyD_discussing.setDateId(timeDimension.getDateId());
topicAgencyD_discussing.setWeekId(timeDimension.getWeekId());
topicAgencyD_discussing.setMonthId(timeDimension.getMonthId());
topicAgencyD_discussing.setQuarterId(timeDimension.getQuarterId());
topicAgencyD_discussing.setYearId(timeDimension.getYearId());
topicAgencyD_discussing.setTopicStatusId(statusMap.get("discussing").getId());
topicAgencyD_discussing.setTopicIncrement(NumConstant.ZERO);
topicAgencyD_discussing.setTopicCount(NumConstant.ZERO);
topicAgencyD_discussing.setTopicProportion(BigDecimal.ZERO);
topicAgencyD_discussing.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT);
topicAgencyD_hidden.setAgencyId(agencyId);
topicAgencyD_hidden.setPid(pid);
topicAgencyD_hidden.setCustomerId(customerId);
topicAgencyD_hidden.setDateId(timeDimension.getDateId());
topicAgencyD_hidden.setWeekId(timeDimension.getWeekId());
topicAgencyD_hidden.setMonthId(timeDimension.getMonthId());
topicAgencyD_hidden.setQuarterId(timeDimension.getQuarterId());
topicAgencyD_hidden.setYearId(timeDimension.getYearId());
topicAgencyD_hidden.setTopicStatusId(statusMap.get("hidden").getId());
topicAgencyD_hidden.setTopicIncrement(NumConstant.ZERO);
topicAgencyD_hidden.setTopicCount(NumConstant.ZERO);
topicAgencyD_hidden.setTopicProportion(BigDecimal.ZERO);
topicAgencyD_hidden.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT);
topicAgencyD_closed.setAgencyId(agencyId);
topicAgencyD_closed.setPid(pid);
topicAgencyD_closed.setCustomerId(customerId);
topicAgencyD_closed.setDateId(timeDimension.getDateId());
topicAgencyD_closed.setWeekId(timeDimension.getWeekId());
topicAgencyD_closed.setMonthId(timeDimension.getMonthId());
topicAgencyD_closed.setQuarterId(timeDimension.getQuarterId());
topicAgencyD_closed.setYearId(timeDimension.getYearId());
topicAgencyD_closed.setTopicStatusId(statusMap.get("closed").getId());
topicAgencyD_closed.setTopicIncrement(NumConstant.ZERO);
topicAgencyD_closed.setTopicCount(NumConstant.ZERO);
topicAgencyD_closed.setTopicProportion(BigDecimal.ZERO);
topicAgencyD_closed.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT);
}
void initGridDailyDTO(String agencyId, String gridId, String customerId ,DimIdGenerator.DimIdBean timeDimension,Map<String,DimTopicStatusDTO> statusMap, FactTopicIssueGridDailyDTO issueGridD, FactTopicTotalGridDailyDTO totalGridD, FactTopicStatusGridDailyDTO topicGridD_discussing,FactTopicStatusGridDailyDTO topicGridD_hidden,FactTopicStatusGridDailyDTO topicGridD_closed){
issueGridD.setAgencyId(agencyId);
issueGridD.setGridId(gridId);
issueGridD.setCustomerId(customerId);
issueGridD.setDateId(timeDimension.getDateId());
issueGridD.setWeekId(timeDimension.getWeekId());
issueGridD.setMonthId(timeDimension.getMonthId());
issueGridD.setQuarterId(timeDimension.getQuarterId());
issueGridD.setYearId(timeDimension.getYearId());
issueGridD.setIssueIncr(NumConstant.ZERO);
issueGridD.setIssueTotal(NumConstant.ZERO);
issueGridD.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT);
totalGridD.setAgencyId(agencyId);
totalGridD.setGridId(gridId);
totalGridD.setCustomerId(customerId);
totalGridD.setDateId(timeDimension.getDateId());
totalGridD.setWeekId(timeDimension.getWeekId());
totalGridD.setMonthId(timeDimension.getMonthId());
totalGridD.setQuarterId(timeDimension.getQuarterId());
totalGridD.setYearId(timeDimension.getYearId());
totalGridD.setHiddenTotalCount(NumConstant.ZERO);
totalGridD.setIssueTotalCount(NumConstant.ZERO);
totalGridD.setTopicIncr(NumConstant.ZERO);
totalGridD.setTopicTotal(NumConstant.ZERO);
totalGridD.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT);
topicGridD_discussing.setAgencyId(agencyId);
topicGridD_discussing.setGridId(gridId);
topicGridD_discussing.setCustomerId(customerId);
topicGridD_discussing.setDateId(timeDimension.getDateId());
topicGridD_discussing.setWeekId(timeDimension.getWeekId());
topicGridD_discussing.setMonthId(timeDimension.getMonthId());
topicGridD_discussing.setQuarterId(timeDimension.getQuarterId());
topicGridD_discussing.setYearId(timeDimension.getYearId());
topicGridD_discussing.setTopicStatusId(statusMap.get("discussing").getId());
topicGridD_discussing.setTopicCount(NumConstant.ZERO);
topicGridD_discussing.setTopicIncrement(NumConstant.ZERO);
topicGridD_discussing.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT);
topicGridD_hidden.setAgencyId(agencyId);
topicGridD_hidden.setGridId(gridId);
topicGridD_hidden.setCustomerId(customerId);
topicGridD_hidden.setDateId(timeDimension.getDateId());
topicGridD_hidden.setWeekId(timeDimension.getWeekId());
topicGridD_hidden.setMonthId(timeDimension.getMonthId());
topicGridD_hidden.setQuarterId(timeDimension.getQuarterId());
topicGridD_hidden.setYearId(timeDimension.getYearId());
topicGridD_hidden.setTopicStatusId(statusMap.get("hidden").getId());
topicGridD_hidden.setTopicCount(NumConstant.ZERO);
topicGridD_hidden.setTopicIncrement(NumConstant.ZERO);
topicGridD_hidden.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT);
topicGridD_closed.setAgencyId(agencyId);
topicGridD_closed.setGridId(gridId);
topicGridD_closed.setCustomerId(customerId);
topicGridD_closed.setDateId(timeDimension.getDateId());
topicGridD_closed.setWeekId(timeDimension.getWeekId());
topicGridD_closed.setMonthId(timeDimension.getMonthId());
topicGridD_closed.setQuarterId(timeDimension.getQuarterId());
topicGridD_closed.setYearId(timeDimension.getYearId());
topicGridD_closed.setTopicStatusId(statusMap.get("closed").getId());
topicGridD_closed.setTopicCount(NumConstant.ZERO);
topicGridD_closed.setTopicIncrement(NumConstant.ZERO);
topicGridD_closed.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT);
}
void setGridTopicProportion(NumberFormat numberFormat,FactTopicStatusGridDailyDTO topicGridD_discussing, FactTopicStatusGridDailyDTO topicGridD_hidden, FactTopicStatusGridDailyDTO topicGridD_closed,FactTopicTotalGridDailyDTO totalGirdD){
topicGridD_discussing.setTopicProportion(totalGirdD.getTopicTotal() == NumConstant.ZERO
? BigDecimal.ZERO
: new BigDecimal(
numberFormat.format(
(float)topicGridD_discussing.getTopicCount() / (float) totalGirdD.getTopicTotal()
)));
topicGridD_hidden.setTopicProportion(totalGirdD.getTopicTotal() == NumConstant.ZERO
? BigDecimal.ZERO
: new BigDecimal(
numberFormat.format(
(float)topicGridD_hidden.getTopicCount() / (float) totalGirdD.getTopicTotal()
)));
topicGridD_closed.setTopicProportion(totalGirdD.getTopicTotal() == NumConstant.ZERO
? BigDecimal.ZERO
: new BigDecimal(
numberFormat.format(
(float)topicGridD_closed.getTopicCount() / (float) totalGirdD.getTopicTotal()
)));
}
void setAgencyTopicProportion(NumberFormat numberFormat,FactTopicStatusAgencyDailyDTO topicAgencyD_discussing, FactTopicStatusAgencyDailyDTO topicAgencyD_hidden, FactTopicStatusAgencyDailyDTO topicAgencyD_closed,FactTopicTotalAgencyDailyDTO totalAgencyD){
topicAgencyD_discussing.setTopicProportion(totalAgencyD.getTopicTotal() == NumConstant.ZERO
? BigDecimal.ZERO
: new BigDecimal(
numberFormat.format(
(float)topicAgencyD_discussing.getTopicCount() / (float) totalAgencyD.getTopicTotal()
)));
topicAgencyD_hidden.setTopicProportion(totalAgencyD.getTopicTotal() == NumConstant.ZERO
? BigDecimal.ZERO
: new BigDecimal(
numberFormat.format(
(float)topicAgencyD_hidden.getTopicCount() / (float) totalAgencyD.getTopicTotal()
)));
topicAgencyD_closed.setTopicProportion(totalAgencyD.getTopicTotal() == NumConstant.ZERO
? BigDecimal.ZERO
: new BigDecimal(
numberFormat.format(
(float)topicAgencyD_closed.getTopicCount() / (float) totalAgencyD.getTopicTotal()
)));
}
void setAgencyDailyDataPacket(TopicStatisticalData dataPacket,FactTopicIssueAgencyDailyDTO issueAgencyD, FactTopicTotalAgencyDailyDTO totalAgencyD, FactTopicStatusAgencyDailyDTO topicAgencyD_discussing, FactTopicStatusAgencyDailyDTO topicAgencyD_hidden, FactTopicStatusAgencyDailyDTO topicAgencyD_closed){
if(null == dataPacket.getIssueAgencyDailyList()){
List<FactTopicIssueAgencyDailyDTO> issueAgencyDailyList = new LinkedList<>();
issueAgencyDailyList.add(issueAgencyD);
dataPacket.setIssueAgencyDailyList(issueAgencyDailyList);
}else{
dataPacket.getIssueAgencyDailyList().add(issueAgencyD);
}
if(null == dataPacket.getTotalAgencyDailyList()){
List<FactTopicTotalAgencyDailyDTO> totalAgencyDailyList = new LinkedList<>();
totalAgencyDailyList.add(totalAgencyD);
dataPacket.setTotalAgencyDailyList(totalAgencyDailyList);
}else{
dataPacket.getTotalAgencyDailyList().add(totalAgencyD);
}
if(null == dataPacket.getTopicAgencyDailyList()){
List<FactTopicStatusAgencyDailyDTO> topicAgencyDailyList = new LinkedList<>();
topicAgencyDailyList.add(topicAgencyD_discussing);
topicAgencyDailyList.add(topicAgencyD_hidden);
topicAgencyDailyList.add(topicAgencyD_closed);
dataPacket.setTopicAgencyDailyList(topicAgencyDailyList);
}else{
dataPacket.getTopicAgencyDailyList().add(topicAgencyD_discussing);
dataPacket.getTopicAgencyDailyList().add(topicAgencyD_hidden);
dataPacket.getTopicAgencyDailyList().add(topicAgencyD_closed);
}
}
void setGridDailyDataPacket(TopicStatisticalData dataPacket,FactTopicIssueGridDailyDTO issueGridD, FactTopicTotalGridDailyDTO totalGridD, FactTopicStatusGridDailyDTO topicGridD_discussing,FactTopicStatusGridDailyDTO topicGridD_hidden,FactTopicStatusGridDailyDTO topicGridD_closed){
if(null == dataPacket.getIssueGridDailyList()){
List<FactTopicIssueGridDailyDTO> issueGridDailyList = new LinkedList<>();
issueGridDailyList.add(issueGridD);
dataPacket.setIssueGridDailyList(issueGridDailyList);
}else{
dataPacket.getIssueGridDailyList().add(issueGridD);
}
if(null == dataPacket.getTotalGridDailyList()){
List<FactTopicTotalGridDailyDTO> totalGridDailyList = new LinkedList<>();
totalGridDailyList.add(totalGridD);
dataPacket.setTotalGridDailyList(totalGridDailyList);
}else{
dataPacket.getTotalGridDailyList().add(totalGridD);
}
if(null == dataPacket.getTopicGridDailyList()){
List<FactTopicStatusGridDailyDTO> topicGridDailyList = new LinkedList<>();
topicGridDailyList.add(topicGridD_discussing);
topicGridDailyList.add(topicGridD_hidden);
topicGridDailyList.add(topicGridD_closed);
dataPacket.setTopicGridDailyList(topicGridDailyList);
}else{
dataPacket.getTopicGridDailyList().add(topicGridD_discussing);
dataPacket.getTopicGridDailyList().add(topicGridD_hidden);
dataPacket.getTopicGridDailyList().add(topicGridD_closed);
}
}
void initAgencyMonthlyDTO(String agencyId, String pid, String customerId,DimIdGenerator.DimIdBean timeDimension, Map<String,DimTopicStatusDTO> statusMap,FactTopicIssueAgencyMonthlyDTO issueAgencyM ,FactTopicStatusAgencyMonthlyDTO topicAgencyM_discussing ,FactTopicStatusAgencyMonthlyDTO topicAgencyM_hidden ,FactTopicStatusAgencyMonthlyDTO topicAgencyM_closed){
issueAgencyM.setAgencyId(agencyId);
issueAgencyM.setPid(pid);
issueAgencyM.setCustomerId(customerId);
issueAgencyM.setMonthId(timeDimension.getMonthId());
issueAgencyM.setQuarterId(timeDimension.getQuarterId());
issueAgencyM.setYearId(timeDimension.getYearId());
issueAgencyM.setIssueIncr(NumConstant.ZERO);
issueAgencyM.setIssueTotal(NumConstant.ZERO);
issueAgencyM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT);
topicAgencyM_discussing.setAgencyId(agencyId);
topicAgencyM_discussing.setPid(pid);
topicAgencyM_discussing.setCustomerId(customerId);
topicAgencyM_discussing.setMonthId(timeDimension.getMonthId());
topicAgencyM_discussing.setQuarterId(timeDimension.getQuarterId());
topicAgencyM_discussing.setYearId(timeDimension.getYearId());
topicAgencyM_discussing.setTopicStatusId(statusMap.get("discussing").getId());
topicAgencyM_discussing.setTopicIncr(NumConstant.ZERO);
topicAgencyM_discussing.setTopicCount(NumConstant.ZERO);
topicAgencyM_discussing.setTopicProportion(BigDecimal.ZERO);
topicAgencyM_discussing.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT);
topicAgencyM_hidden.setAgencyId(agencyId);
topicAgencyM_hidden.setPid(pid);
topicAgencyM_hidden.setCustomerId(customerId);
topicAgencyM_hidden.setMonthId(timeDimension.getMonthId());
topicAgencyM_hidden.setQuarterId(timeDimension.getQuarterId());
topicAgencyM_hidden.setYearId(timeDimension.getYearId());
topicAgencyM_hidden.setTopicStatusId(statusMap.get("hidden").getId());
topicAgencyM_hidden.setTopicIncr(NumConstant.ZERO);
topicAgencyM_hidden.setTopicCount(NumConstant.ZERO);
topicAgencyM_hidden.setTopicProportion(BigDecimal.ZERO);
topicAgencyM_hidden.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT);
topicAgencyM_closed.setAgencyId(agencyId);
topicAgencyM_closed.setPid(pid);
topicAgencyM_closed.setCustomerId(customerId);
topicAgencyM_closed.setMonthId(timeDimension.getMonthId());
topicAgencyM_closed.setQuarterId(timeDimension.getQuarterId());
topicAgencyM_closed.setYearId(timeDimension.getYearId());
topicAgencyM_closed.setTopicStatusId(statusMap.get("closed").getId());
topicAgencyM_closed.setTopicIncr(NumConstant.ZERO);
topicAgencyM_closed.setTopicCount(NumConstant.ZERO);
topicAgencyM_closed.setTopicProportion(BigDecimal.ZERO);
topicAgencyM_closed.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT);
}
void initGridMonthlyDTO(String agencyId, String gridId,String customerId,DimIdGenerator.DimIdBean timeDimension,FactTopicIssueGridMonthlyDTO issueGridM){
issueGridM.setAgencyId(agencyId);
issueGridM.setGridId(gridId);
issueGridM.setCustomerId(customerId);
issueGridM.setMonthId(timeDimension.getMonthId());
issueGridM.setQuarterId(timeDimension.getQuarterId());
issueGridM.setYearId(timeDimension.getYearId());
issueGridM.setIssueIncr(NumConstant.ZERO);
issueGridM.setIssueTotal(NumConstant.ZERO);
issueGridM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT);
}
void setAgencyTopicMonthlyProportion(NumberFormat numberFormat,FactTopicStatusAgencyMonthlyDTO topicAgencyM_discussing, FactTopicStatusAgencyMonthlyDTO topicAgencyM_hidden, FactTopicStatusAgencyMonthlyDTO topicAgencyM_closed){
Integer total = topicAgencyM_discussing.getTopicCount() + topicAgencyM_hidden.getTopicCount() + topicAgencyM_closed.getTopicCount();
topicAgencyM_discussing.setTopicProportion(total == NumConstant.ZERO
? BigDecimal.ZERO
: new BigDecimal(
numberFormat.format(
(float)topicAgencyM_discussing.getTopicCount() / (float) total
)));
topicAgencyM_hidden.setTopicProportion(total == NumConstant.ZERO
? BigDecimal.ZERO
: new BigDecimal(
numberFormat.format(
(float)topicAgencyM_hidden.getTopicCount() / (float) total
)));
topicAgencyM_closed.setTopicProportion(total == NumConstant.ZERO
? BigDecimal.ZERO
: new BigDecimal(
numberFormat.format(
(float)topicAgencyM_closed.getTopicCount() / (float) total
)));
}
void setAgencyMonthlyDataPacket(TopicStatisticalData dataPacket,FactTopicIssueAgencyMonthlyDTO issueAgencyM, FactTopicStatusAgencyMonthlyDTO topicAgencyM_discussing, FactTopicStatusAgencyMonthlyDTO topicAgencyM_hidden, FactTopicStatusAgencyMonthlyDTO topicAgencyM_closed){
if(null == dataPacket.getIssueAgencyMonthlyList()){
List<FactTopicIssueAgencyMonthlyDTO> issueAgencyMonthlyList = new LinkedList<>();
issueAgencyMonthlyList.add(issueAgencyM);
dataPacket.setIssueAgencyMonthlyList(issueAgencyMonthlyList);
}else{
dataPacket.getIssueAgencyMonthlyList().add(issueAgencyM);
}
if(null == dataPacket.getTopicAgencyMonthlyList()){
List<FactTopicStatusAgencyMonthlyDTO> topicAgencyMonthlyList = new LinkedList<>();
topicAgencyMonthlyList.add(topicAgencyM_discussing);
topicAgencyMonthlyList.add(topicAgencyM_hidden);
topicAgencyMonthlyList.add(topicAgencyM_closed);
dataPacket.setTopicAgencyMonthlyList(topicAgencyMonthlyList);
}else{
dataPacket.getTopicAgencyMonthlyList().add(topicAgencyM_discussing);
dataPacket.getTopicAgencyMonthlyList().add(topicAgencyM_hidden);
dataPacket.getTopicAgencyMonthlyList().add(topicAgencyM_closed);
}
}
void setGridMonthlyDataPacket(TopicStatisticalData dataPacket,FactTopicIssueGridMonthlyDTO issueGridM ){
if(null == dataPacket.getIssueGridMonthlyList()){
List<FactTopicIssueGridMonthlyDTO> issueGridMonthlyList = new LinkedList<>();
issueGridMonthlyList.add(issueGridM);
dataPacket.setIssueGridMonthlyList(issueGridMonthlyList);
}else{
dataPacket.getIssueGridMonthlyList().add(issueGridM);
}
}
}

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

@ -1,6 +1,8 @@
package com.epmet.service.user;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.stats.user.result.UserStatisticalData;
import com.epmet.util.DimIdGenerator;
import java.util.Date;
import java.util.List;
@ -10,12 +12,12 @@ public interface UserService {
/**
* @Description 遍历所有机关(它的下级机关)统计注册用户和参与用户的数据,使用level控制
* @param topAgencies - List<AgencySubTreeDto>
* @param agencies - List<AgencySubTreeDto>
* @return
* @author wangc
* @date 2020.06.18 10:03
**/
void traverseAgencyUser(List<AgencySubTreeDto> topAgencies, Date targetDate);
UserStatisticalData traverseAgencyUser(List<AgencySubTreeDto> agencies, Date targetDate, DimIdGenerator.DimIdBean timeDimension);
/**
* @Description 遍历所有机关的直属网格统计注册用户参与用户的数据
@ -24,5 +26,5 @@ public interface UserService {
* @author wangc
* @date 2020.06.18 10:03
**/
void traverseGridUser(List<AgencySubTreeDto> agencies, Date targetDate);
UserStatisticalData traverseGridUser(List<AgencySubTreeDto> agencies, Date targetDate, DimIdGenerator.DimIdBean timeDimension);
}

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

@ -5,8 +5,11 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.user.UserDao;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.stats.user.*;
import com.epmet.dto.stats.user.result.UserStatisticalData;
import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO;
import com.epmet.service.user.UserService;
import com.epmet.util.DimIdGenerator;
import com.epmet.util.ModuleConstant;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@ -14,12 +17,14 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Description 直连epmet-user
* @Description 15直连epmet-user
* @ClassName UserServiceImpl
* @Auth wangc
* @Date 2020-06-18 09:55
@ -41,13 +46,18 @@ public class UserServiceImpl implements UserService {
* @date 2020.06.18 10:03
**/
@Override
public void traverseAgencyUser(List<AgencySubTreeDto> agencies, Date targetDate) {
public UserStatisticalData traverseAgencyUser(List<AgencySubTreeDto> agencies, Date targetDate, DimIdGenerator.DimIdBean timeDimension) {
if(null == agencies || agencies.size() == NumConstant.ZERO){
logger.warn("没有相应的机关集合");
return ;
return null;
}
UserStatisticalData dataPacket = new UserStatisticalData();
dataPacket.setDateId(timeDimension.getDateId());
dataPacket.setMonthId(timeDimension.getMonthId());
//自上向下检索
//Map<String, List<AgencySubTreeDto>> agencyMap = agencies.stream().collect(Collectors.groupingBy(AgencySubTreeDto::getAgencyId));
Map<String, List<AgencySubTreeDto>> agencyMap = agencies.stream().collect(Collectors.groupingBy(AgencySubTreeDto::getAgencyId));
Map<String,Set<String>> subGridOfAgency = new HashMap<>();
agencies.forEach(agency -> {
initAgencyGridMap(agency.getAgencyId(),agency,subGridOfAgency);
@ -56,10 +66,18 @@ public class UserServiceImpl implements UserService {
//对每一个机关进行数据统计
if(subGridOfAgency.size() > NumConstant.ZERO){
subGridOfAgency.forEach((k,v) -> {
queryUserData(v,targetDate);
queryUserData(ModuleConstant.DIM_SUB_AGENCY,
k,
(null == agencyMap.get(k) || agencyMap.get(k).isEmpty()) ? NumConstant.ZERO_STR : agencyMap.get(k).get(NumConstant.ZERO).getPid(),
(null == agencyMap.get(k) || agencyMap.get(k).isEmpty()) ? null : agencyMap.get(k).get(NumConstant.ZERO).getCustomerId(),
v,
targetDate,
dataPacket,
timeDimension);
});
}
return dataPacket;
}
/**
@ -70,25 +88,40 @@ public class UserServiceImpl implements UserService {
* @date 2020.06.18 10:03
**/
@Override
public void traverseGridUser(List<AgencySubTreeDto> agencies, Date targetDate) {
public UserStatisticalData traverseGridUser(List<AgencySubTreeDto> agencies, Date targetDate, DimIdGenerator.DimIdBean timeDimension) {
if(null == agencies || agencies.size() == NumConstant.ZERO){
logger.warn("没有相应的机关集合");
return ;
return null;
}
UserStatisticalData dataPacket = new UserStatisticalData();
dataPacket.setMonthId(timeDimension.getMonthId());
dataPacket.setDateId(timeDimension.getDateId());
//自上向下检索
Map<String, List<AgencySubTreeDto>> agencyMap = agencies.stream().collect(Collectors.groupingBy(AgencySubTreeDto::getAgencyId));
if(null != agencyMap && agencyMap.size() > NumConstant.ZERO){
agencyMap.forEach((k,v) -> {
if(null != v && v.size() > NumConstant.ZERO){
queryUserData(new HashSet<>(v.get(NumConstant.ZERO).getGridIds()),targetDate);
queryUserData(ModuleConstant.DIM_BELONGING_GRID,
k,
v.get(NumConstant.ZERO).getPid(),
v.get(NumConstant.ZERO).getCustomerId(),
new HashSet<>(v.get(NumConstant.ZERO).getGridIds()),
targetDate,
dataPacket,
timeDimension);
}
});
}
return dataPacket;
}
/**
* @Description 初始化机关-所有下级网格Map
* @param pid - 固定一个机关Id
* @param agency - AgencySubTreeDto
* @param subGridOfAgency - Map<String,Set<String>>
* @return
@ -128,48 +161,30 @@ public class UserServiceImpl implements UserService {
/**
* @Description 执行查询用户数据统计的逻辑
* @param relation - agency(下级机关加网格) | grid(直属网格)
* @param agencyId
* @param pid
* @param customerId
* @param gridIds - 机关下所有网格集合/机关下直属网格集合
* @param targetDate
* @param dataPacket - 数据包
* @param timeDimension DimIdGenerator.DimIdBean
* @return
* @author wangc
* @date 2020.06.19 10:01
**/
void queryUserData(Set<String> gridIds,Date targetDate){
//默认查询注册用户
//1.计算机关下注册用户一个时间单位内的累计与增长
CommonTotalAndIncCountResultDTO regData =
userDao.selectResiTotalAndIncrByLevel(ModuleConstant.REG_OR_PARTI_FLAG_REG,gridIds,targetDate);
//2.查询注册用户的Id列表
List<String> incrRegUsers =
userDao.selectIncrUserIds(ModuleConstant.REG_OR_PARTI_FLAG_REG,gridIds,targetDate);
List<String> totalRegUsers =
userDao.selectTotalUserIds(ModuleConstant.REG_OR_PARTI_FLAG_REG,gridIds,targetDate);
//3.查询机关下一个时间单位内热心居民的累计与增量(注册用户)
CommonTotalAndIncCountResultDTO warmRegData =
userDao.selectWarmTotalAndIncr(totalRegUsers,incrRegUsers,gridIds,targetDate);
//4.查询机关下一个时间单位内党员的累计与增量(注册用户)
CommonTotalAndIncCountResultDTO partyRegData =
userDao.selectPartyTotalAndIncr(totalRegUsers,incrRegUsers,targetDate);
//参与用户
//1.计算机关下参与用户一个时间单位内的累计与增长
CommonTotalAndIncCountResultDTO partiData =
userDao.selectResiTotalAndIncrByLevel(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,gridIds,targetDate);
//2.查询参与用户的Id列表
List<String> incrPartiUsers =
userDao.selectIncrUserIds(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,gridIds,targetDate);
List<String> totalPartiUsers =
userDao.selectTotalUserIds(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,gridIds,targetDate);
//3.查询机关下一个时间单位内热心居民的累计与增量(参与用户)
CommonTotalAndIncCountResultDTO warmPartiData =
userDao.selectWarmTotalAndIncr(totalPartiUsers,incrPartiUsers,gridIds,targetDate);
//4.查询机关下一个时间单位内党员的累计与增量(参与用户)
CommonTotalAndIncCountResultDTO partyPartiData =
userDao.selectPartyTotalAndIncr(totalPartiUsers,incrPartiUsers,targetDate);
void queryUserData(String relation, String agencyId, String pid, String customerId, Set<String> gridIds, Date targetDate, UserStatisticalData dataPacket, DimIdGenerator.DimIdBean timeDimension){
if(StringUtils.isBlank(pid))
pid = NumConstant.ZERO_STR;
dataPacket.setCustomerId(customerId);
//计算百分比使用,保留小数点后两位
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.SIX);
Boolean isMonthEnd = false;
Calendar calendar =Calendar.getInstance();
calendar.setTime(new Date());
calendar.add(Calendar.DATE, NumConstant.ONE_NEG);
@ -185,27 +200,362 @@ public class UserServiceImpl implements UserService {
calendar.set(Calendar.MINUTE, NumConstant.ZERO);
calendar.set(Calendar.SECOND, NumConstant.ZERO);
//本月注册用户增长数
Integer regIncrMonthly = userDao.selectResiIncrWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_REG,gridIds,calendar.getTime(),targetDateCheck);
//本月新增注册用户Id集合
List<String> incrRegIdsMonthly = userDao.selectIncrUserIdsWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_REG,gridIds,calendar.getTime(),targetDateCheck);
//本月新增党员数(注册用户)
Integer incrPartyOfRegMonthly = userDao.selectPartyIncrWithinTimeRange(incrRegIdsMonthly,calendar.getTime(),targetDateCheck);
//本月新增热心居民数(注册用户)
Integer incrWarmOfRegMonthly = userDao.selectWarmIncrWithinTimeRange(incrRegIdsMonthly,gridIds,calendar.getTime(),targetDateCheck);
//本月参与用户增长数
Integer partiIncrMonthly = userDao.selectResiIncrWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,gridIds,calendar.getTime(),targetDateCheck);
//本月新增参与用户Id集合
List<String> incrPartiIdsMonthly = userDao.selectIncrUserIdsWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,gridIds,calendar.getTime(),targetDateCheck);
//本月新增党员数(参与用户)
Integer incrPartyOfPartiMonthly = userDao.selectPartyIncrWithinTimeRange(incrPartiIdsMonthly,calendar.getTime(),targetDateCheck);
//本月新增热心居民数(参与用户)
Integer incrWarmOfPartiMonthly = userDao.selectWarmIncrWithinTimeRange(incrPartiIdsMonthly,gridIds,calendar.getTime(),targetDateCheck);
isMonthEnd = true;
}
if(StringUtils.equals(ModuleConstant.DIM_SUB_AGENCY,relation)){
//默认查询注册用户
//1.计算机关下注册用户一个时间单位内的累计与增长
CommonTotalAndIncCountResultDTO regData =
userDao.selectResiTotalAndIncrByLevel(ModuleConstant.REG_OR_PARTI_FLAG_REG,gridIds,targetDate);
//2.查询注册用户的Id列表
List<String> incrRegUsers =
userDao.selectIncrUserIds(ModuleConstant.REG_OR_PARTI_FLAG_REG,gridIds,targetDate);
List<String> totalRegUsers =
userDao.selectTotalUserIds(ModuleConstant.REG_OR_PARTI_FLAG_REG,gridIds,targetDate);
//3.查询机关下一个时间单位内热心居民的累计与增量(注册用户)
CommonTotalAndIncCountResultDTO warmRegData =
userDao.selectWarmTotalAndIncr(totalRegUsers,incrRegUsers,gridIds,targetDate);
//4.查询机关下一个时间单位内党员的累计与增量(注册用户)
CommonTotalAndIncCountResultDTO partyRegData =
userDao.selectPartyTotalAndIncr(totalRegUsers,incrRegUsers,targetDate);
//参与用户
//1.计算机关下参与用户一个时间单位内的累计与增长
CommonTotalAndIncCountResultDTO partiData =
userDao.selectResiTotalAndIncrByLevel(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,gridIds,targetDate);
//2.查询参与用户的Id列表
List<String> incrPartiUsers =
userDao.selectIncrUserIds(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,gridIds,targetDate);
List<String> totalPartiUsers =
userDao.selectTotalUserIds(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,gridIds,targetDate);
//3.查询机关下一个时间单位内热心居民的累计与增量(参与用户)
CommonTotalAndIncCountResultDTO warmPartiData =
userDao.selectWarmTotalAndIncr(totalPartiUsers,incrPartiUsers,gridIds,targetDate);
//4.查询机关下一个时间单位内党员的累计与增量(参与用户)
CommonTotalAndIncCountResultDTO partyPartiData =
userDao.selectPartyTotalAndIncr(totalPartiUsers,incrPartiUsers,targetDate);
//agency
FactRegUserAgencyDailyDTO regAgencyD = new FactRegUserAgencyDailyDTO();
regAgencyD.setCustomerId(customerId);
regAgencyD.setAgencyId(agencyId);
regAgencyD.setDateId(timeDimension.getDateId());
regAgencyD.setWeekId(timeDimension.getWeekId());
regAgencyD.setYearId(timeDimension.getYearId());
regAgencyD.setResiTotal(regData.getTotal());
regAgencyD.setRegTotal(regData.getTotal());
regAgencyD.setWarmHeartedTotal(warmRegData.getTotal());
regAgencyD.setPartymemberTotal(partyRegData.getTotal());
regAgencyD.setRegIncr(regData.getIncr());
regAgencyD.setWarmIncr(warmRegData.getIncr());
regAgencyD.setPartymemberIncr(partiData.getIncr());
regAgencyD.setResiProportion(new BigDecimal(NumConstant.ONE));
regAgencyD.setPartymemberProportion(null == regData.getTotal() || regData.getTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)partyRegData.getTotal()/(float)regData.getTotal() )));
regAgencyD.setWarmHeartedProportion(null == regData.getTotal() || regData.getTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)warmRegData.getTotal()/(float)regData.getTotal() )));
regAgencyD.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT);
if(null != dataPacket.getRegAgencyDailyList()){
dataPacket.getRegAgencyDailyList().add(regAgencyD);
}else{
List<FactRegUserAgencyDailyDTO> list = new ArrayList<>();
list.add(regAgencyD);
dataPacket.setRegAgencyDailyList(list);
}
FactParticipationUserAgencyDailyDTO partiAgencyD = new FactParticipationUserAgencyDailyDTO();
partiAgencyD.setCustomerId(customerId);
partiAgencyD.setAgencyId(agencyId);
partiAgencyD.setDateId(timeDimension.getDateId());
partiAgencyD.setWeekId(timeDimension.getWeekId());
partiAgencyD.setYearId(timeDimension.getYearId());
partiAgencyD.setResiTotal(partiData.getTotal());
partiAgencyD.setRegTotal(partiData.getTotal());
partiAgencyD.setWarmHeartedTotal(warmPartiData.getTotal());
partiAgencyD.setPartymemberTotal(partyPartiData.getTotal());
partiAgencyD.setRegIncr(partiData.getIncr());
partiAgencyD.setWarmIncr(warmPartiData.getIncr());
partiAgencyD.setPartymemberIncr(partyPartiData.getIncr());
partiAgencyD.setResiProportion(new BigDecimal(NumConstant.ONE));
partiAgencyD.setPartymemberProportion(null == partiData.getTotal() || partiData.getTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)partyPartiData.getTotal()/(float)partiData.getIncr() )));
partiAgencyD.setWarmHeartedProportion(null == partiData.getTotal() || partiData.getTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)warmPartiData.getTotal()/(float)partiData.getIncr() )));
partiAgencyD.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT);
if(null != dataPacket.getPartiAgencyDailyList()){
dataPacket.getPartiAgencyDailyList().add(partiAgencyD);
}else{
List<FactParticipationUserAgencyDailyDTO> list = new ArrayList<>();
list.add(partiAgencyD);
dataPacket.setPartiAgencyDailyList(list);
}
//月末处理
if(isMonthEnd){
//本月注册用户增长数
Integer regIncrMonthly = userDao.selectResiIncrWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_REG,gridIds,calendar.getTime(),targetDateCheck);
//本月新增注册用户Id集合
List<String> incrRegIdsMonthly = userDao.selectIncrUserIdsWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_REG,gridIds,calendar.getTime(),targetDateCheck);
//本月新增党员数(注册用户)
Integer incrPartyOfRegMonthly = userDao.selectPartyIncrWithinTimeRange(incrRegIdsMonthly,calendar.getTime(),targetDateCheck);
//本月新增热心居民数(注册用户)
Integer incrWarmOfRegMonthly = userDao.selectWarmIncrWithinTimeRange(incrRegIdsMonthly,gridIds,calendar.getTime(),targetDateCheck);
//本月参与用户增长数
Integer partiIncrMonthly = userDao.selectResiIncrWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,gridIds,calendar.getTime(),targetDateCheck);
//本月新增参与用户Id集合
List<String> incrPartiIdsMonthly = userDao.selectIncrUserIdsWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,gridIds,calendar.getTime(),targetDateCheck);
//本月新增党员数(参与用户)
Integer incrPartyOfPartiMonthly = userDao.selectPartyIncrWithinTimeRange(incrPartiIdsMonthly,calendar.getTime(),targetDateCheck);
//本月新增热心居民数(参与用户)
Integer incrWarmOfPartiMonthly = userDao.selectWarmIncrWithinTimeRange(incrPartiIdsMonthly,gridIds,calendar.getTime(),targetDateCheck);
FactRegUserAgencyMonthlyDTO regAgencyM = new FactRegUserAgencyMonthlyDTO();
regAgencyM.setCustomerId(customerId);
regAgencyM.setAgencyId(agencyId);
regAgencyM.setMonthId(timeDimension.getMonthId());
regAgencyM.setQuarterId(timeDimension.getQuarterId());
regAgencyM.setYearId(timeDimension.getYearId());
regAgencyM.setRegTotal(regData.getTotal());
regAgencyM.setResiTotal(regData.getTotal());
regAgencyM.setWarmHeartedTotal(warmRegData.getTotal());
regAgencyM.setPartymemberTotal(partyRegData.getTotal());
regAgencyM.setRegIncr(regIncrMonthly);
regAgencyM.setWarmIncr(incrWarmOfRegMonthly);
regAgencyM.setPartymemberIncr(incrPartyOfRegMonthly);
regAgencyM.setResiProportion(new BigDecimal(NumConstant.ONE));
regAgencyM.setPartymemberProportion(regAgencyD.getPartymemberProportion());
regAgencyM.setWarmHeartedProportion(regAgencyD.getWarmHeartedProportion());
regAgencyM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT);
FactParticipationUserAgencyMonthlyDTO partiAgencyM = new FactParticipationUserAgencyMonthlyDTO();
partiAgencyM.setCustomerId(customerId);
partiAgencyM.setAgencyId(agencyId);
partiAgencyM.setMonthId(timeDimension.getMonthId());
partiAgencyM.setQuarterId(timeDimension.getQuarterId());
partiAgencyM.setYearId(timeDimension.getYearId());
partiAgencyM.setRegTotal(partiData.getTotal());
partiAgencyM.setResiTotal(partiData.getTotal());
partiAgencyM.setWarmHeartedTotal(warmPartiData.getTotal());
partiAgencyM.setPartymemberTotal(partyPartiData.getTotal());
partiAgencyM.setRegIncr(partiIncrMonthly);
partiAgencyM.setWarmIncr(incrWarmOfPartiMonthly);
partiAgencyM.setPartymemberIncr(incrPartyOfPartiMonthly);
partiAgencyM.setResiProportion(new BigDecimal(NumConstant.ONE));
partiAgencyM.setPartymemberProportion(partiAgencyD.getPartymemberProportion());
partiAgencyM.setWarmHeartedProportion(partiAgencyD.getWarmHeartedProportion());
partiAgencyM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT);
}
}else{
//直属网格数据
Set<String> singleGridIdSet = new HashSet<>();
final boolean monthEndFlag = isMonthEnd;
//grid
gridIds.forEach(gridId -> {
singleGridIdSet.add(gridId);
// START QUERY
//1.计算机关下注册用户一个时间单位内的累计与增长
CommonTotalAndIncCountResultDTO regData =
userDao.selectResiTotalAndIncrByLevel(ModuleConstant.REG_OR_PARTI_FLAG_REG,singleGridIdSet,targetDate);
//2.查询注册用户的Id列表
List<String> incrRegUsers =
userDao.selectIncrUserIds(ModuleConstant.REG_OR_PARTI_FLAG_REG,singleGridIdSet,targetDate);
List<String> totalRegUsers =
userDao.selectTotalUserIds(ModuleConstant.REG_OR_PARTI_FLAG_REG,singleGridIdSet,targetDate);
//3.查询机关下一个时间单位内热心居民的累计与增量(注册用户)
CommonTotalAndIncCountResultDTO warmRegData =
userDao.selectWarmTotalAndIncr(totalRegUsers,incrRegUsers,singleGridIdSet,targetDate);
//4.查询机关下一个时间单位内党员的累计与增量(注册用户)
CommonTotalAndIncCountResultDTO partyRegData =
userDao.selectPartyTotalAndIncr(totalRegUsers,incrRegUsers,targetDate);
//参与用户
//1.计算机关下参与用户一个时间单位内的累计与增长
CommonTotalAndIncCountResultDTO partiData =
userDao.selectResiTotalAndIncrByLevel(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,singleGridIdSet,targetDate);
//2.查询参与用户的Id列表
List<String> incrPartiUsers =
userDao.selectIncrUserIds(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,singleGridIdSet,targetDate);
List<String> totalPartiUsers =
userDao.selectTotalUserIds(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,singleGridIdSet,targetDate);
//3.查询机关下一个时间单位内热心居民的累计与增量(参与用户)
CommonTotalAndIncCountResultDTO warmPartiData =
userDao.selectWarmTotalAndIncr(totalPartiUsers,incrPartiUsers,singleGridIdSet,targetDate);
//4.查询机关下一个时间单位内党员的累计与增量(参与用户)
CommonTotalAndIncCountResultDTO partyPartiData =
userDao.selectPartyTotalAndIncr(totalPartiUsers,incrPartiUsers,targetDate);
// END QUERY
//注册用户网格级别
FactRegUserGridDailyDTO regGridD = new FactRegUserGridDailyDTO();
regGridD.setCustomerId(customerId);
regGridD.setGridId(gridId);
regGridD.setCustomerId(customerId);
regGridD.setAgencyId(agencyId);//网格直属得机关
regGridD.setDateId(timeDimension.getDateId());
regGridD.setWeekId(timeDimension.getWeekId());
regGridD.setYearId(timeDimension.getYearId());
regGridD.setResiTotal(regData.getTotal());
regGridD.setRegTotal(regData.getTotal());
regGridD.setWarmHeartedTotal(warmRegData.getTotal());
regGridD.setPartymemberTotal(partyRegData.getTotal());
regGridD.setRegIncr(regData.getIncr());
regGridD.setWarmIncr(warmRegData.getIncr());
regGridD.setPartymemberIncr(partyRegData.getIncr());
regGridD.setResiProportion(new BigDecimal(NumConstant.ONE));
regGridD.setPartymemberProportion(null == regData.getTotal() || regData.getTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)partyRegData.getTotal()/(float)regData.getTotal() )));
regGridD.setWarmHeartedProportion(null == regData.getTotal() || regData.getTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)warmRegData.getTotal()/(float)regData.getTotal() )));
regGridD.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT);
if(null != dataPacket.getRegGridDailyList()){
dataPacket.getRegGridDailyList().add(regGridD);
}else{
List<FactRegUserGridDailyDTO> list = new ArrayList<>();
list.add(regGridD);
dataPacket.setRegGridDailyList(list);
}
//参与用户网格级别
FactParticipationUserGridDailyDTO partiGridD = new FactParticipationUserGridDailyDTO();
partiGridD.setCustomerId(customerId);
partiGridD.setGridId(gridId);
partiGridD.setAgencyId(agencyId);
partiGridD.setDateId(timeDimension.getDateId());
partiGridD.setWeekId(timeDimension.getWeekId());
partiGridD.setYearId(timeDimension.getYearId());
partiGridD.setResiTotal(partiData.getTotal());
partiGridD.setRegTotal(partiData.getTotal());
partiGridD.setWarmHeartedTotal(warmPartiData.getTotal());
partiGridD.setPartymemberTotal(partyPartiData.getTotal());
partiGridD.setRegIncr(partiData.getIncr());
partiGridD.setWarmIncr(warmPartiData.getIncr());
partiGridD.setPartymemberIncr(partyPartiData.getIncr());
partiGridD.setResiProportion(new BigDecimal(NumConstant.ONE));
partiGridD.setPartymemberProportion(null == partiData.getTotal() || partiData.getTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)partyPartiData.getTotal()/(float)partiData.getTotal() )));
partiGridD.setWarmHeartedProportion(null == partiData.getTotal() || partiData.getTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)warmPartiData.getTotal()/(float)partiData.getTotal() )));
partiGridD.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT);
if(null != dataPacket.getPartiGridDailyList()){
dataPacket.getPartiGridDailyList().add(partiGridD);
}else{
List<FactParticipationUserGridDailyDTO> list = new ArrayList<>();
list.add(partiGridD);
dataPacket.setPartiGridDailyList(list);
}
if(monthEndFlag){
//本月注册用户增长数
Integer regIncrMonthly = userDao.selectResiIncrWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_REG,singleGridIdSet,calendar.getTime(),targetDateCheck);
//本月新增注册用户Id集合
List<String> incrRegIdsMonthly = userDao.selectIncrUserIdsWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_REG,singleGridIdSet,calendar.getTime(),targetDateCheck);
//本月新增党员数(注册用户)
Integer incrPartyOfRegMonthly = userDao.selectPartyIncrWithinTimeRange(incrRegIdsMonthly,calendar.getTime(),targetDateCheck);
//本月新增热心居民数(注册用户)
Integer incrWarmOfRegMonthly = userDao.selectWarmIncrWithinTimeRange(incrRegIdsMonthly,singleGridIdSet,calendar.getTime(),targetDateCheck);
//本月参与用户增长数
Integer partiIncrMonthly = userDao.selectResiIncrWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,singleGridIdSet,calendar.getTime(),targetDateCheck);
//本月新增参与用户Id集合
List<String> incrPartiIdsMonthly = userDao.selectIncrUserIdsWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,singleGridIdSet,calendar.getTime(),targetDateCheck);
//本月新增党员数(参与用户)
Integer incrPartyOfPartiMonthly = userDao.selectPartyIncrWithinTimeRange(incrPartiIdsMonthly,calendar.getTime(),targetDateCheck);
//本月新增热心居民数(参与用户)
Integer incrWarmOfPartiMonthly = userDao.selectWarmIncrWithinTimeRange(incrPartiIdsMonthly,singleGridIdSet,calendar.getTime(),targetDateCheck);
FactRegUserGridMonthlyDTO regGridM = new FactRegUserGridMonthlyDTO();
regGridM.setCustomerId(customerId);
regGridM.setAgencyId(agencyId);
regGridM.setGridId(gridId);
regGridM.setMonthId(timeDimension.getMonthId());
regGridM.setQuarterId(timeDimension.getQuarterId());
regGridM.setYearId(timeDimension.getYearId());
regGridM.setRegTotal(regData.getTotal());
regGridM.setResiTotal(regData.getTotal());
regGridM.setWarmHeartedTotal(warmRegData.getTotal());
regGridM.setPartymemberTotal(partyRegData.getTotal());
regGridM.setRegIncr(regIncrMonthly);
regGridM.setWarmIncr(incrWarmOfRegMonthly);
regGridM.setPartymemberIncr(incrPartyOfRegMonthly);
regGridM.setResiProportion(new BigDecimal(NumConstant.ONE));
regGridM.setPartymemberProportion(regGridD.getPartymemberProportion());
regGridM.setWarmHeartedProportion(regGridD.getWarmHeartedProportion());
regGridM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT);
if(null != dataPacket.getRegGridMonthlyList()){
dataPacket.getRegGridMonthlyList().add(regGridM);
}else{
List<FactRegUserGridMonthlyDTO> list = new ArrayList<>();
list.add(regGridM);
dataPacket.setRegGridMonthlyList(list);
}
FactParticipationUserGridMonthlyDTO partiGridM = new FactParticipationUserGridMonthlyDTO();
partiGridM.setCustomerId(customerId);
partiGridM.setAgencyId(agencyId);
partiGridM.setMonthId(timeDimension.getMonthId());
partiGridM.setQuarterId(timeDimension.getQuarterId());
partiGridM.setYearId(timeDimension.getYearId());
partiGridM.setRegTotal(partiData.getTotal());
partiGridM.setResiTotal(partiData.getTotal());
partiGridM.setWarmHeartedTotal(warmPartiData.getTotal());
partiGridM.setPartymemberTotal(partyPartiData.getTotal());
partiGridM.setRegIncr(partiIncrMonthly);
partiGridM.setWarmIncr(incrWarmOfPartiMonthly);
partiGridM.setPartymemberIncr(incrPartyOfPartiMonthly);
partiGridM.setResiProportion(new BigDecimal(NumConstant.ONE));
partiGridM.setPartymemberProportion(partiGridD.getPartymemberProportion());
partiGridM.setWarmHeartedProportion(partiGridD.getWarmHeartedProportion());
partiGridM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT);
if(null != dataPacket.getPartiGridMonthlyList()){
dataPacket.getPartiGridMonthlyList().add(partiGridM);
}else{
List<FactParticipationUserGridMonthlyDTO> list = new ArrayList<>();
list.add(partiGridM);
dataPacket.setPartiGridMonthlyList(list);
}
}
singleGridIdSet.clear();
});
}
}
}
public static void main(String[] args) {
@ -213,7 +563,7 @@ public class UserServiceImpl implements UserService {
SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
calendar.set(Calendar.DAY_OF_MONTH, 1);
//calendar.set(Calendar.DAY_OF_MONTH, 1);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
@ -227,4 +577,12 @@ public class UserServiceImpl implements UserService {
System.out.println(format.format(calendar.getTime()));
System.out.println(format2.format(calendar.getTime()));
}
/**
* @Description 先查出所有的用户单位时间内新增的注册居民党员热心居民(跟随网格)然后查出单位时间内每一个网格下的参与用户Id集合和注册用户Id集合
* @param
* @return
* @author wangc
* @date 2020.06.23 00:32
**/
}

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/ModuleConstant.java

@ -16,4 +16,19 @@ public interface ModuleConstant {
* 机关级别-社区
* */
String AGENCY_LEVEL_COMMUNITY = "community";
/**
* 维度: 下级机关
* */
String DIM_SUB_AGENCY = "agency";
/**
* 维度: 直属网格
* */
String DIM_BELONGING_GRID = "grid";
/**
* 统计机器人
* */
String CREATED_BY_STATISTICAL_ROBOT = "statisticalRobot";
}

23
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimAgencyDao.xml

@ -61,6 +61,11 @@
AND grid.DEL_FLAG = '0'
WHERE
agency.DEL_FLAG = '0'
AND
agency.AGENCY_DIM_TYPE = 'all'
<if test='null != customerId and "" != customerId'>
AND agency.CUSTOMER_ID = #{customerId}
</if>
ORDER BY
agency.CUSTOMER_ID,
agency.PID
@ -81,7 +86,10 @@
AND grid.DEL_FLAG = '0'
WHERE
agency.DEL_FLAG = '0'
AND agency.PID = #{pid}
AND
agency.PID = #{pid}
AND
agency.AGENCY_DIM_TYPE = 'all'
ORDER BY
agency.CUSTOMER_ID,
agency.ID,
@ -105,10 +113,16 @@
agency.DEL_FLAG = '0'
AND
agency.PID = '0'
AND
agency.AGENCY_DIM_TYPE = 'all'
<if test='null != customerId and "" != customerId'>
AND agency.CUSTOMER_ID = #{customerId}
</if>
ORDER BY
agency.CUSTOMER_ID,
agency.PID
</select>
<select id="getAgencyListByCustomerId" resultType="com.epmet.entity.stats.DimAgencyEntity">
SELECT
ID,
@ -124,13 +138,6 @@
</select>
<resultMap id="treeMapWithDept" type="com.epmet.dto.AgencySubDeptTreeDto">
<id column="agencyId" property="agencyId" />
<result column="agencyName" property="agencyName"/>

84
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueAgencyDailyDao.xml

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.stats.topic.FactTopicIssueAgencyDailyDao">
<insert id="insertBatch" parameterType="java.util.List">
INSERT INTO fact_topic_issue_agency_daily
(
ID,
PID,
AGENCY_ID,
CUSTOMER_ID,
DATE_ID,
WEEK_ID,
MONTH_ID,
QUARTER_ID,
YEAR_ID,
ISSUE_TOTAL,
ISSUE_INCR,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
) values
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{item.pid},
#{item.agencyId},
#{item.customerId},
#{item.dateId},
#{item.weekId},
#{item.monthId},
#{item.quarterId},
#{item.yearId},
#{item.issueTotal},
#{item.issueIncr},
#{item.createdBy},
now(),
#{item.createdBy},
now()
)
</foreach>
</insert>
<delete id="deleteByParams">
DELETE FROM fact_topic_issue_agency_daily
WHERE
DATE_ID = #{dateId}
<if test='null != customerId and "" != customerId'>
AND CUSTOMER_ID = #{customerId}
</if>
</delete>
</mapper>

78
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueAgencyMonthlyDao.xml

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.stats.topic.FactTopicIssueAgencyMonthlyDao">
<insert id="insertBatch" parameterType="java.util.List">
INSERT INTO fact_topic_issue_agency_monthly
(
ID,
PID,
AGENCY_ID,
CUSTOMER_ID,
MONTH_ID,
QUARTER_ID,
YEAR_ID,
ISSUE_TOTAL,
ISSUE_INCR,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
) values
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{item.pid},
#{item.agencyId},
#{item.customerId},
#{item.monthId},
#{item.quarterId},
#{item.yearId},
#{item.issueTotal},
#{item.issueIncr},
#{item.createdBy},
now(),
#{item.createdBy},
now()
)
</foreach>
</insert>
<delete id="deleteByParams">
DELETE FROM fact_topic_issue_agency_monthly
WHERE
MONTH_ID = #{monthId}
<if test='null != customerId and "" != customerId'>
AND CUSTOMER_ID = #{customerId}
</if>
</delete>
</mapper>

87
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueGridDailyDao.xml

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.stats.topic.FactTopicIssueGridDailyDao">
<insert id="insertBatch" parameterType="java.util.List">
INSERT INTO fact_topic_issue_grid_daily
(
ID,
AGENCY_ID,
GRID_ID,
CUSTOMER_ID,
DATE_ID,
WEEK_ID,
MONTH_ID,
QUARTER_ID,
YEAR_ID,
ISSUE_TOTAL,
ISSUE_INCR,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
) values
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{item.agencyId},
#{item.gridId},
#{item.customerId},
#{item.dateId},
#{item.weekId},
#{item.monthId},
#{item.quarterId},
#{item.yearId},
#{item.issueTotal},
#{item.issueIncr},
#{item.createdBy},
now(),
#{item.createdBy},
now()
)
</foreach>
</insert>
<delete id="deleteByParams">
DELETE FROM fact_topic_issue_grid_daily
WHERE
DATE_ID = #{dateId}
<if test='null != customerId and "" != customerId'>
AND CUSTOMER_ID = #{customerId}
</if>
</delete>
</mapper>

77
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueGridMonthlyDao.xml

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.stats.topic.FactTopicIssueGridMonthlyDao">
<insert id="insertBatch" parameterType="java.util.List">
INSERT INTO fact_topic_issue_grid_monthly
(
ID,
AGENCY_ID,
GRID_ID,
CUSTOMER_ID,
MONTH_ID,
QUARTER_ID,
YEAR_ID,
ISSUE_TOTAL,
ISSUE_INCR,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
) values
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{item.agencyId},
#{item.gridId},
#{item.customerId},
#{item.monthId},
#{item.quarterId},
#{item.yearId},
#{item.issueTotal},
#{item.issueIncr},
#{item.createdBy},
now(),
#{item.createdBy},
now()
)
</foreach>
</insert>
<delete id="deleteByParams">
DELETE FROM fact_topic_issue_grid_monthly
WHERE
MONTH_ID = #{monthId}
<if test='null != customerId and "" != customerId'>
AND CUSTOMER_ID = #{customerId}
</if>
</delete>
</mapper>

95
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusAgencyDailyDao.xml

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.stats.topic.FactTopicStatusAgencyDailyDao">
<insert id="insertBatch" parameterType="java.util.List">
INSERT INTO fact_topic_status_agency_daily
(
ID,
AGENCY_ID,
PID,
CUSTOMER_ID,
DATE_ID,
WEEK_ID,
MONTH_ID,
QUARTER_ID,
YEAR_ID,
TOPIC_STATUS_ID,
TOPIC_COUNT,
TOPIC_PROPORTION,
TOPIC_INCREMENT,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
) values
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{item.agencyId},
#{item.pid},
#{item.customerId},
#{item.dateId},
#{item.weekId},
#{item.monthId},
#{item.quarterId},
#{item.yearId},
#{item.topicStatusId},
#{item.topicCount},
#{item.topicProportion},
#{item.topicIncrement},
#{item.createdBy},
now(),
#{item.createdBy},
now()
)
</foreach>
</insert>
<delete id="deleteByParams">
DELETE FROM fact_topic_status_agency_daily
WHERE
DATE_ID = #{dateId}
<if test='null != customerId and "" != customerId'>
AND CUSTOMER_ID = #{customerId}
</if>
</delete>
</mapper>

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

Loading…
Cancel
Save