Browse Source

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

dev_shibei_match
wangchao 6 years ago
parent
commit
652c095286
  1. 2
      epmet-auth/deploy/docker-compose-dev.yml
  2. 2
      epmet-auth/deploy/docker-compose-test.yml
  3. 10
      epmet-auth/pom.xml
  4. 19
      epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java
  5. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java
  6. 109
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java
  7. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/IdCardNoValidatorUtils.java
  8. 2
      epmet-gateway/deploy/docker-compose-test.yml
  9. 3
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/UserAnalysisConstant.java
  10. 20
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserIncrTrendResDTO.java
  11. 6
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserIncrTrendResultDTO.java
  12. 121
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedAgencyDailyDTO.java
  13. 121
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedDepartmentDailyDTO.java
  14. 121
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedGridDailyDTO.java
  15. 44
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDTO.java
  16. 36
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDailyDTO.java
  17. 62
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedDepartmentDTO.java
  18. 45
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedGridDTO.java
  19. 2
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagAgencyDTO.java
  20. 126
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyDailyDTO.java
  21. 106
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyMonthlyDTO.java
  22. 106
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyQuarterlyDTO.java
  23. 106
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyYearlyDTO.java
  24. 126
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridDailyDTO.java
  25. 106
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridMonthlyDTO.java
  26. 106
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridQuarterlyDTO.java
  27. 106
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridYearlyDTO.java
  28. 48
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/publicity/PublicityController.java
  29. 42
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedAgencyDailyDao.java
  30. 40
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyMonthlyDao.java
  31. 40
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyYearlyDao.java
  32. 40
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyMonthlyDao.java
  33. 40
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyQuarterlyDao.java
  34. 40
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyYearlyDao.java
  35. 33
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridMonthlyDao.java
  36. 33
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridQuarterlyDao.java
  37. 145
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/PublicityDao.java
  38. 37
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java
  39. 91
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedAgencyDailyEntity.java
  40. 91
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedDepartmentDailyEntity.java
  41. 91
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedGridDailyEntity.java
  42. 96
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyDailyEntity.java
  43. 76
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyMonthlyEntity.java
  44. 76
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyQuarterlyEntity.java
  45. 76
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyYearlyEntity.java
  46. 96
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridDailyEntity.java
  47. 76
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridQuarterlyEntity.java
  48. 76
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridYearlyEntity.java
  49. 6
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java
  50. 19
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java
  51. 28
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/PublicityService.java
  52. 134
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java
  53. 5
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java
  54. 129
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java
  55. 17
      epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml
  56. 8
      epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml
  57. 35
      epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedAgencyDailyDao.xml
  58. 27
      epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedDepartmentDailyDao.xml
  59. 27
      epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedGridDailyDao.xml
  60. 20
      epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyMonthlyDao.xml
  61. 22
      epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyQuarterlyDao.xml
  62. 23
      epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyYearlyDao.xml
  63. 28
      epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyDailyDao.xml
  64. 20
      epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyMonthlyDao.xml
  65. 22
      epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyQuarterlyDao.xml
  66. 23
      epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyYearlyDao.xml
  67. 28
      epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridDailyDao.xml
  68. 24
      epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridMonthlyDao.xml
  69. 24
      epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridQuarterlyDao.xml
  70. 24
      epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridYearlyDao.xml
  71. 262
      epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/PublicityDao.xml
  72. 70
      epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml
  73. 4
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java
  74. 25
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridIdListByCustomerResultDTO.java
  75. 14
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/form/MonthProjectListFormDTO.java
  76. 5
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/ArticleGridPublishedSummaryDTO.java
  77. 30
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java
  78. 47
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java
  79. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java
  80. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java
  81. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyDailyDao.java
  82. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java
  83. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.java
  84. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java
  85. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java
  86. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleOperateRecordDao.java
  87. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedAgencyDailyEntity.java
  88. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedDepartmentDailyEntity.java
  89. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedGridDailyEntity.java
  90. 36
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleOperateRecordEntity.java
  91. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java
  92. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java
  93. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java
  94. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java
  95. 66
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java
  96. 65
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java
  97. 183
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java
  98. 220
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java
  99. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java
  100. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java

2
epmet-auth/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-auth-server:
container_name: epmet-auth-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.20
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.23
ports:
- "8081:8081"
network_mode: host # 使用现有网络

2
epmet-auth/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-auth-server:
container_name: epmet-auth-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-auth:0.3.20
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-auth:0.3.21
ports:
- "8081:8081"
network_mode: host # 使用现有网络

10
epmet-auth/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.20</version>
<version>0.3.23</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-cloud</artifactId>
@ -159,8 +159,8 @@
<wx.mp.configs.token>111</wx.mp.configs.token>
<wx.mp.configs.aesKey>111</wx.mp.configs.aesKey>
<!--居民端小程序配置-->
<resi.wx.ma.appId>wx9b6102a8ee5add65</resi.wx.ma.appId>
<resi.wx.ma.secret>16fdb68bc2b3e732324ba5d8b8a9b5e2</resi.wx.ma.secret>
<resi.wx.ma.appId>wx07674c23af51b521</resi.wx.ma.appId>
<resi.wx.ma.secret>a2fd0d29b007cbbcf8c8dda8c693d99b</resi.wx.ma.secret>
<!--政府端小程序配置-->
<gov.wx.ma.appId>wx3d1372029eb816a3</gov.wx.ma.appId>
<gov.wx.ma.secret>651f02d71ed3f123dfb584b8bf0f4d8b</gov.wx.ma.secret>
@ -196,8 +196,8 @@
<wx.mp.configs.token>111</wx.mp.configs.token>
<wx.mp.configs.aesKey>111</wx.mp.configs.aesKey>
<!--居民端小程序配置-->
<resi.wx.ma.appId>wx9b6102a8ee5add65</resi.wx.ma.appId>
<resi.wx.ma.secret>16fdb68bc2b3e732324ba5d8b8a9b5e2</resi.wx.ma.secret>
<resi.wx.ma.appId>wx07674c23af51b521</resi.wx.ma.appId>
<resi.wx.ma.secret>a2fd0d29b007cbbcf8c8dda8c693d99b</resi.wx.ma.secret>
<!--政府端小程序配置-->
<gov.wx.ma.appId>wx3d1372029eb816a3</gov.wx.ma.appId>
<gov.wx.ma.secret>651f02d71ed3f123dfb584b8bf0f4d8b</gov.wx.ma.secret>

19
epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java

@ -13,11 +13,13 @@ import com.epmet.commons.tools.utils.CpUserDetailRedis;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.PhoneValidatorUtils;
import com.epmet.constant.SmsTemplateConstant;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.GovStaffRoleDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.GovOrgFeignClient;
import com.epmet.jwt.JwtTokenProperties;
@ -57,6 +59,8 @@ public class GovLoginServiceImpl implements GovLoginService {
private CpUserDetailRedis cpUserDetailRedis;
@Autowired
private GovOrgFeignClient govOrgFeignClient;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
/**
* @param formDTO
@ -70,8 +74,7 @@ public class GovLoginServiceImpl implements GovLoginService {
//1、校验手机号是否符合规范
if (!PhoneValidatorUtils.isMobile(formDTO.getMobile())) {
logger.error(String.format(SEND_SMS_CODE_ERROR, formDTO.getMobile(), EpmetErrorCode.ERROR_PHONE.getCode(), EpmetErrorCode.ERROR_PHONE.getMsg()));
//TODO 2020-05-21 手机号验证先去掉方便测试
//throw new RenException(EpmetErrorCode.ERROR_PHONE.getCode());
throw new RenException(EpmetErrorCode.ERROR_PHONE.getCode());
}
//2、根据手机号校验用户是否存在
Result<List<CustomerStaffDTO>> customerStaffResult = epmetUserFeignClient.checkCustomerStaff(formDTO.getMobile());
@ -79,14 +82,17 @@ public class GovLoginServiceImpl implements GovLoginService {
logger.error(String.format(SEND_SMS_CODE_ERROR, formDTO.getMobile(), customerStaffResult.getCode(), customerStaffResult.getMsg()));
throw new RenException(customerStaffResult.getCode());
}
//3、发送短信验证码 TODO 2020-05-21 发送验证先去掉方便测试
/*Result<Map<String, String>> smsCodeResult = messageFeignClient.sendSmsCaptcha(formDTO.getMobile());
//3、发送短信验证码
SendVerificationCodeFormDTO sendVerificationCodeFormDTO=new SendVerificationCodeFormDTO();
sendVerificationCodeFormDTO.setMobile(formDTO.getMobile());
sendVerificationCodeFormDTO.setAliyunTemplateCode(SmsTemplateConstant.LGOIN_CONFIRM);
Result<SendVerificationCodeResultDTO> smsCodeResult=epmetMessageOpenFeignClient.sendVerificationCode(sendVerificationCodeFormDTO);
if (!smsCodeResult.success()) {
logger.error(String.format(SEND_SMS_CODE_ERROR, formDTO.getMobile(), smsCodeResult.getCode(), smsCodeResult.getMsg()));
throw new RenException(smsCodeResult.getCode());
}
//4、保存短信验证码(删除现有短信验证码、将新的短信验证码存入Redis)
captchaRedis.saveSmsCode(formDTO, smsCodeResult.getData().get("code"));*/
captchaRedis.saveSmsCode(formDTO, smsCodeResult.getData().getCode());
logger.info(String.format("发送短信验证码成功,手机号[%s]", formDTO.getMobile()));
}
@ -109,8 +115,7 @@ public class GovLoginServiceImpl implements GovLoginService {
String rightSmsCode = captchaRedis.getSmsCode(formDTO.getMobile());
if (!formDTO.getSmsCode().equals(rightSmsCode)) {
logger.error(String.format("验证码错误code[%s],msg[%s]",EpmetErrorCode.MOBILE_CODE_ERROR.getCode(),EpmetErrorCode.MOBILE_CODE_ERROR.getMsg()));
//TODO 2020-05-21 校验验证码先去掉方便测试
//throw new RenException(EpmetErrorCode.MOBILE_CODE_ERROR.getCode());
throw new RenException(EpmetErrorCode.MOBILE_CODE_ERROR.getCode());
}
//3、查询用户所有的组织信息
List<String> customerIdList = new ArrayList<>();

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";
String DATA_STATISTICAL_SERVER = "data-statistical-server";
}

109
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java

@ -16,10 +16,7 @@ import org.joda.time.format.DateTimeFormatter;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.*;
/**
* 日期处理工具类
@ -49,7 +46,7 @@ public class DateUtils {
public static final String MONTH_NAME_PATTERN = "yyyy年MM月";
public static final String DATE_PATTERN_YYYY = "yyyy";
public static final String DATE_PATTERN_YYYYMM = "yyyyMM";
public static final String DATE_PATTERN_YYYY_MM = "yyyy-MM";
public static final String WEEK_TYPE_ENGLISH = "english";
public static final String WEEK_TYPE_CHINESE = "chinese";
@ -367,15 +364,111 @@ public class DateUtils {
/**
* @return java.lang.String
* @param dateStr yyyyMMdd
* @param dateStr yyyyMMdd返回yyyy.MM.dd yyyyMM返回yyyy/MM
* @author yinzuomei
* @description 返回yyyy.MM.dd
* @Date 2020/6/22 18:38
**/
public static String getDatePointPattern(String dateStr){
public static String getxAxisDatePattern(String dateStr,String character){
if(StringUtils.isNotBlank(dateStr)&&dateStr.length()==8){
return String.valueOf(new StringBuffer(dateStr).insert(4,".").insert(7,"."));
return String.valueOf(new StringBuffer(dateStr).insert(4,character).insert(7,character));
}else if(StringUtils.isNotBlank(dateStr)&&dateStr.length()==6){
return String.valueOf(new StringBuffer(dateStr).insert(4,character));
}
return dateStr;
}
/**
* @return java.lang.String
* @param beforDay
* @author yinzuomei
* @description 获取当前日期的前n天 返回yyyyMMdd
* @Date 2020/6/23 1:50
**/
public static String getBeforeNDay(int beforDay){
Calendar c = Calendar.getInstance();
c.add(Calendar.DATE, - beforDay);
Date date = c.getTime();
return DateUtils.format(date,DateUtils.DATE_PATTERN_YYYYMMDD);
}
/**
* @return java.lang.String
* @param beforMonth
* @author yinzuomei
* @description 获取当前 月份的前n月 返回yyyyMM
* @Date 2020/6/23 1:50
**/
public static String getBeforeNMonth(int beforMonth){
Calendar c = Calendar.getInstance();
c.add(Calendar.MONTH, - beforMonth);
Date date = c.getTime();
return DateUtils.format(date,DateUtils.DATE_PATTERN_YYYYMM);
}
/**
* @return java.util.List<java.lang.String> 返回yyyyMMdd
* @param startTime yyyyMMdd
* @param endTime yyyyMMdd
* @author yinzuomei
* @description 获取两个日期之间所有的日期集合包含开始结束
* @Date 2020/6/23 1:26
**/
public static List<String> getDaysBetween(String startTime, String endTime){
// 返回的日期集合
List<String> days = new ArrayList<String>();
try{
Date start = DateUtils.parse(startTime,DateUtils.DATE_PATTERN_YYYYMMDD);
Date end = DateUtils.parse(endTime,DateUtils.DATE_PATTERN_YYYYMMDD);
Calendar tempStart = Calendar.getInstance();
tempStart.setTime(start);
Calendar tempEnd = Calendar.getInstance();
tempEnd.setTime(end);
// 日期加1(包含结束)
tempEnd.add(Calendar.DATE, +1);
while (tempStart.before(tempEnd)) {
days.add(DateUtils.format(tempStart.getTime(),DateUtils.DATE_PATTERN_YYYYMMDD));
tempStart.add(Calendar.DAY_OF_YEAR, 1);
}
}catch (Exception e){
e.printStackTrace();
}
return days;
}
/**
* @return java.util.List<java.lang.String>
* @param minDate yyyMM
* @param maxDate yyyyMM
* @author yinzuomei
* @description 计算两个月份中间所有的月份包含起始
* @Date 2020/6/23 2:10
**/
public static List<String> getMonthBetween(String minDate, String maxDate){
ArrayList<String> result = new ArrayList<String>();
try{
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMM");//格式化为年月
Calendar min = Calendar.getInstance();
Calendar max = Calendar.getInstance();
min.setTime(sdf.parse(minDate));
min.set(min.get(Calendar.YEAR), min.get(Calendar.MONTH), 1);
max.setTime(sdf.parse(maxDate));
max.set(max.get(Calendar.YEAR), max.get(Calendar.MONTH), 2);
Calendar curr = min;
while (curr.before(max)) {
result.add(sdf.format(curr.getTime()));
curr.add(Calendar.MONTH, 1);
}
min = null;max = null;curr = null;
}catch(Exception e){
e.printStackTrace();
}
return result;
}
}

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/IdCardNoValidatorUtils.java

@ -46,7 +46,7 @@ public class IdCardNoValidatorUtils {
return false;
}
} else {
logger.info(String.format("身份证号%s最后一位为数字"));
logger.info(String.format("身份证号%s最后一位为数字",idCardNo));
}
}
if (idCardNo.length() == 18) {

2
epmet-gateway/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-gateway-server:
container_name: epmet-gateway-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-gateway:0.3.17
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-gateway:0.3.18
ports:
- "8080:8080"
network_mode: host # 使用现有网络

3
epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/UserAnalysisConstant.java

@ -34,4 +34,7 @@ public interface UserAnalysisConstant {
* 党员
*/
String PARTYMEMBER="党员";
String DAY_TYPE="day";
String MONTH_TYPE="month";
}

20
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserIncrTrendResDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.result.user;
import lombok.Data;
import java.io.Serializable;
/**
* 描述一下
*
* @author yinzuomei@elink-cn.com
* @date 2020/6/23 9:13
*/
@Data
public class UserIncrTrendResDTO implements Serializable {
private static final long serialVersionUID = 290620373673325352L;
private Integer regIncr;
private Integer warmIncr;
private Integer partymemberIncr;
private String dateIdOrMonthId;
}

6
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserIncrTrendResultDTO.java

@ -1,5 +1,6 @@
package com.epmet.dto.result.user;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
@ -13,7 +14,7 @@ import java.io.Serializable;
@Data
public class UserIncrTrendResultDTO implements Serializable {
/**
* 日期如果按日查询返回yyyy-MM-dd,如果按月返回yyyy-MM
* 日期如果按日查询返回yyyy/MM/dd,如果按月返回yyyy/MM
*/
private String date;
@ -27,4 +28,7 @@ public class UserIncrTrendResultDTO implements Serializable {
*/
private Integer value;
// yyyyMMdd yyyyMM
@JsonIgnore
private String dateOrMonthId;
}

121
epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedAgencyDailyDTO.java

@ -1,121 +0,0 @@
/**
* 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.publicity.dto.result;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 文章发布数量机关日统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-19
*/
@Data
public class FactArticlePublishedAgencyDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID ID
*/
private String id;
/**
* 客户ID 客户ID
*/
private String customerId;
/**
* 上级机关ID 上级机关ID
*/
private String pid;
/**
* 机关ID
*/
private String agencyId;
/**
* 文章累计发文数量 文章数量
*/
private Integer articleTotalCount;
/**
* 当前发文数量 当前未下线的文章数量
*/
private Integer articlePublishedCount;
/**
* 日期ID 日期ID
*/
private String dateId;
/**
* 周ID 周ID eg2020W01 = 2020年第一周
*/
private String weekId;
/**
* 月份ID 月份ID eg202006 = 2020年6月2020-07 = 2020年7月
*/
private String monthId;
/**
* 季度ID 季度ID eg2020Q1 = 2020年第一季度2020Q2 = 2020年第二季度2020Q3 = 2020年第三季度2020Q4 = 2020年第四季度
*/
private String quarterId;
/**
* 年度ID 年度ID eg2020 = 2020年2021 = 2021年
*/
private String yearId;
/**
* 删除状态
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

121
epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedDepartmentDailyDTO.java

@ -1,121 +0,0 @@
/**
* 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.publicity.dto.result;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 文章发布数量部门日统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-19
*/
@Data
public class FactArticlePublishedDepartmentDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID ID
*/
private String id;
/**
* 客户ID 客户ID
*/
private String customerId;
/**
* 发布文章单位所属机关ID 发布文章单位所属机关ID
*/
private String agencyId;
/**
* 部门ID
*/
private String departmentId;
/**
* 文章累计发文数量 文章数量
*/
private Integer articleTotalCount;
/**
* 当前发文数量 当前未下线的文章数量
*/
private Integer articlePublishedCount;
/**
* 日期ID 日期ID
*/
private String dateId;
/**
* 周ID 周ID eg2020W01 = 2020年第一周
*/
private String weekId;
/**
* 月份ID 月份ID eg202006 = 2020年6月2020-07 = 2020年7月
*/
private String monthId;
/**
* 季度ID 季度ID eg2020Q1 = 2020年第一季度2020Q2 = 2020年第二季度2020Q3 = 2020年第三季度2020Q4 = 2020年第四季度
*/
private String quarterId;
/**
* 年度ID 年度ID eg2020 = 2020年2021 = 2021年
*/
private String yearId;
/**
* 删除状态
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

121
epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedGridDailyDTO.java

@ -1,121 +0,0 @@
/**
* 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.publicity.dto.result;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 文章发布数量网格日统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-19
*/
@Data
public class FactArticlePublishedGridDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID ID
*/
private String id;
/**
* 客户ID 客户ID
*/
private String customerId;
/**
* 发布单位所属机关ID 发布单位所属机关ID
*/
private String agencyId;
/**
* 网格ID
*/
private String gridId;
/**
* 文章累计发文数量 文章数量
*/
private Integer articleTotalCount;
/**
* 当前发文数量 当前未下线的文章数量
*/
private Integer articlePublishedCount;
/**
* 日期ID 日期ID
*/
private String dateId;
/**
* 周ID 周ID eg2020W01 = 2020年第一周
*/
private String weekId;
/**
* 月份ID 月份ID eg202006 = 2020年6月2020-07 = 2020年7月
*/
private String monthId;
/**
* 季度ID 季度ID eg2020Q1 = 2020年第一季度2020Q2 = 2020年第二季度2020Q3 = 2020年第三季度2020Q4 = 2020年第四季度
*/
private String quarterId;
/**
* 年度ID 年度ID eg2020 = 2020年2021 = 2021年
*/
private String yearId;
/**
* 删除状态
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

44
epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedGridDailyDao.java → epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDTO.java

@ -15,19 +15,47 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.publicity;
package com.epmet.publicity.dto.result;
import lombok.Data;
import java.io.Serializable;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.publicity.FactArticlePublishedGridDailyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 文章发布数量网格日统计表
* 文章发表数量下级机关统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-19
*/
@Mapper
public interface FactArticlePublishedGridDailyDao extends BaseDao<FactArticlePublishedGridDailyEntity> {
@Data
public class FactPublishedAgencyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 机关名称
*/
private String name;
/**
* 发文数量
*/
private Integer value;
/**
* 固定值文章数量
*/
private String type="文章数量";
/**
* 机关Id
*/
private String agencyId;
/**
* 上级机关Id
*/
private String pid;
}

36
epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedDepartmentDailyDao.java → epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDailyDTO.java

@ -15,19 +15,39 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.publicity;
package com.epmet.publicity.dto.result;
import lombok.Data;
import java.io.Serializable;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.publicity.FactArticlePublishedDepartmentDailyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 文章发布数量部门日统计表
* 文章发表数量下级机关统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-19
*/
@Mapper
public interface FactArticlePublishedDepartmentDailyDao extends BaseDao<FactArticlePublishedDepartmentDailyEntity> {
@Data
public class FactPublishedAgencyDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 累计发文总数
*/
private Integer publishedTotal;
/**
* 发布中的文章总数
*/
private Integer publishingTotal;
/**
* 数据截止日期
*/
private String dateName;
}

62
epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedDepartmentDTO.java

@ -0,0 +1,62 @@
/**
* 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.publicity.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 文章发表数量直属部门统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-19
*/
@Data
public class FactPublishedDepartmentDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 部门名称
*/
private String name;
/**
* 发文数量
*/
private Integer value;
/**
* 固定值文章数量
*/
private String type="文章数量";
/**
* 机关Id
*/
private String agencyId;
/**
* 部门Id
*/
private String departmentId;
}

45
epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyDailyDao.java → epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedGridDTO.java

@ -15,19 +15,48 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.publicity;
package com.epmet.publicity.dto.result;
import lombok.Data;
import java.io.Serializable;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.publicity.FactTagViewedAgencyDailyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 文章引用标签阅读数量机关日统计表
* 文章发表数量直属部门统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-19
*/
@Mapper
public interface FactTagViewedAgencyDailyDao extends BaseDao<FactTagViewedAgencyDailyEntity> {
@Data
public class FactPublishedGridDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 网格名称
*/
private String name;
/**
* 发文数量
*/
private Integer value;
/**
* 固定值文章数量
*/
private String type="文章数量";
/**
* 机关Id
*/
private String agencyId;
/**
* 网格Id
*/
private String gridId;
}

2
epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagAgencyDTO.java

@ -24,7 +24,7 @@ import java.util.Date;
/**
* 文章引用标签阅读数量机关统计表
* 文章引用标签阅读数量机关统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-19

126
epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyDailyDTO.java

@ -1,126 +0,0 @@
/**
* 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.publicity.dto.result;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 文章引用标签阅读数量机关日统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-19
*/
@Data
public class FactTagViewedAgencyDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID ID
*/
private String id;
/**
* 客户ID 客户ID
*/
private String customerId;
/**
* 上级机关ID 上级机关ID
*/
private String pid;
/**
* 机关ID
*/
private String agencyId;
/**
* 标签ID 标签ID
*/
private String tagId;
/**
* 标签名称 标签名称
*/
private String tagName;
/**
* 文章引用标签阅读数 文章引用标签阅读数
*/
private Integer tagReadCount;
/**
* 日期ID 天数ID eg20200601 = 2020年6月1日20200602 = 2020年6月2日
*/
private String dateId;
/**
* 周ID 周ID eg2020W01 = 2020年第一周
*/
private String weekId;
/**
* 月份ID 月份ID eg202006 = 2020年6月2020-07 = 2020年7月
*/
private String monthId;
/**
* 季度ID 季度ID eg2020Q1 = 2020年第一季度2020Q2 = 2020年第二季度2020Q3 = 2020年第三季度2020Q4 = 2020年第四季度
*/
private String quarterId;
/**
* 年度ID 年度ID eg2020 = 2020年2021 = 2021年
*/
private String yearId;
/**
* 删除状态
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

106
epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyMonthlyDTO.java

@ -1,106 +0,0 @@
/**
* 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.publicity.dto.result;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 文章引用标签阅读数量机关月统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-19
*/
@Data
public class FactTagViewedAgencyMonthlyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID ID
*/
private String id;
/**
* 客户ID 客户ID
*/
private String customerId;
/**
* 上级机关ID 上级机关ID
*/
private String pid;
/**
* 机关ID
*/
private String agencyId;
/**
* 标签ID 标签ID
*/
private String tagId;
/**
* 标签名称 标签名称
*/
private String tagName;
/**
* 文章引用标签阅读数 文章引用标签阅读数
*/
private Integer tagReadCount;
/**
* 月份ID 月份ID eg2020-06 = 2020年6月2020-07 = 2020年7月
*/
private String monthId;
/**
* 删除状态
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

106
epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyQuarterlyDTO.java

@ -1,106 +0,0 @@
/**
* 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.publicity.dto.result;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 文章引用标签阅读数量机关季度统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-19
*/
@Data
public class FactTagViewedAgencyQuarterlyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID ID
*/
private String id;
/**
* 客户ID 客户ID
*/
private String customerId;
/**
* 上级机关ID 上级机关ID
*/
private String pid;
/**
* 机关ID
*/
private String agencyId;
/**
* 标签ID 标签ID
*/
private String tagId;
/**
* 标签名称 标签名称
*/
private String tagName;
/**
* 文章引用标签阅读数 文章引用标签阅读数
*/
private Integer tagReadCount;
/**
* 季度ID 季度ID eg2020Q1 = 2020年第一季度2020Q2 = 2020年第二季度2020Q3 = 2020年第三季度2020Q4 = 2020年第四季度
*/
private String quarterId;
/**
* 删除状态
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

106
epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyYearlyDTO.java

@ -1,106 +0,0 @@
/**
* 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.publicity.dto.result;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 文章引用标签阅读数量机关年度统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-19
*/
@Data
public class FactTagViewedAgencyYearlyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID ID
*/
private String id;
/**
* 客户ID 客户ID
*/
private String customerId;
/**
* 上级机关ID 上级机关ID
*/
private String pid;
/**
* 机关ID
*/
private String agencyId;
/**
* 标签ID 标签ID
*/
private String tagId;
/**
* 标签名称 标签名称
*/
private String tagName;
/**
* 文章引用标签阅读数 文章引用标签阅读数
*/
private Integer tagReadCount;
/**
* 年度ID 年度ID eg2020 = 2020年2021 = 2021年
*/
private String yearId;
/**
* 删除状态
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

126
epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridDailyDTO.java

@ -1,126 +0,0 @@
/**
* 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.publicity.dto.result;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 文章引用标签阅读数量网格日统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-19
*/
@Data
public class FactTagViewedGridDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID ID
*/
private String id;
/**
* 客户ID 客户ID
*/
private String customerId;
/**
* 文章发布所属机关ID 文章发布所属机关ID
*/
private String agencyId;
/**
* 网格ID
*/
private String gridId;
/**
* 标签ID 标签ID
*/
private String tagId;
/**
* 标签名称 标签名称
*/
private String tagName;
/**
* 文章引用标签阅读数 文章引用标签阅读数
*/
private Integer tagReadCount;
/**
* 日期ID 天数ID eg20200601 = 2020年6月1日20200602 = 2020年6月2日
*/
private String dateId;
/**
* 周ID 周ID eg2020W01 = 2020年第一周
*/
private String weekId;
/**
* 月份ID 月份ID eg202006 = 2020年6月2020-07 = 2020年7月
*/
private String monthId;
/**
* 季度ID 季度ID eg2020Q1 = 2020年第一季度2020Q2 = 2020年第二季度2020Q3 = 2020年第三季度2020Q4 = 2020年第四季度
*/
private String quarterId;
/**
* 年度ID 年度ID eg2020 = 2020年2021 = 2021年
*/
private String yearId;
/**
* 删除状态
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

106
epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridMonthlyDTO.java

@ -1,106 +0,0 @@
/**
* 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.publicity.dto.result;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 文章引用标签阅读数量网格月统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-19
*/
@Data
public class FactTagViewedGridMonthlyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID ID
*/
private String id;
/**
* 客户ID 客户ID
*/
private String customerId;
/**
* 文章发布所属机关ID 文章发布所属机关ID
*/
private String agencyId;
/**
* 网格ID
*/
private String gridId;
/**
* 标签ID 标签ID
*/
private String tagId;
/**
* 标签名称 标签名称
*/
private String tagName;
/**
* 文章引用标签阅读数 文章引用标签阅读数
*/
private Integer tagReadCount;
/**
* 月份ID 月份ID eg2020-06 = 2020年6月2020-07 = 2020年7月
*/
private String monthId;
/**
* 删除状态
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

106
epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridQuarterlyDTO.java

@ -1,106 +0,0 @@
/**
* 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.publicity.dto.result;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 文章引用标签阅读数量网格季度统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-19
*/
@Data
public class FactTagViewedGridQuarterlyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID ID
*/
private String id;
/**
* 客户ID 客户ID
*/
private String customerId;
/**
* 文章发布所属机关ID 文章发布所属机关ID
*/
private String agencyId;
/**
* 网格ID
*/
private String gridId;
/**
* 标签ID 标签ID
*/
private String tagId;
/**
* 标签名称 标签名称
*/
private String tagName;
/**
* 文章引用标签阅读数 文章引用标签阅读数
*/
private Integer tagReadCount;
/**
* 季度ID 季度ID eg2020Q1 = 2020年第一季度2020Q2 = 2020年第二季度2020Q3 = 2020年第三季度2020Q4 = 2020年第四季度
*/
private String quarterId;
/**
* 删除状态
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

106
epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridYearlyDTO.java

@ -1,106 +0,0 @@
/**
* 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.publicity.dto.result;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 文章引用标签阅读数量网格年度统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-19
*/
@Data
public class FactTagViewedGridYearlyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID ID
*/
private String id;
/**
* 客户ID 客户ID
*/
private String customerId;
/**
* 文章发布所属机关ID 文章发布所属机关ID
*/
private String agencyId;
/**
* 网格ID
*/
private String gridId;
/**
* 标签ID 标签ID
*/
private String tagId;
/**
* 标签名称 标签名称
*/
private String tagName;
/**
* 文章引用标签阅读数 文章引用标签阅读数
*/
private Integer tagReadCount;
/**
* 年度ID 年度ID eg2020 = 2020年2021 = 2021年
*/
private String yearId;
/**
* 删除状态
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

48
epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/publicity/PublicityController.java

@ -23,11 +23,13 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.publicity.dto.form.TagFormDTO;
import com.epmet.publicity.dto.result.FactArticlePublishedAgencyDailyDTO;
import com.epmet.publicity.dto.result.FactTagAgencyDTO;
import com.epmet.publicity.dto.result.*;
import com.epmet.service.publicity.PublicityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@ -53,8 +55,8 @@ public class PublicityController {
* @Description 宣传能力工作端当前机关累计发文和当前发文
**/
@PostMapping("summaryinfo")
public Result<FactArticlePublishedAgencyDailyDTO> summaryInfo(@LoginUser TokenDto tokenDto) {
return new Result<FactArticlePublishedAgencyDailyDTO>().ok(publicityService.summaryInfo(tokenDto));
public Result<FactPublishedAgencyDailyDTO> summaryInfo(@LoginUser TokenDto tokenDto) {
return new Result<FactPublishedAgencyDailyDTO>().ok(publicityService.summaryInfo(tokenDto));
}
/**
@ -91,4 +93,40 @@ public class PublicityController {
return new Result<List<FactTagAgencyDTO>>().ok(publicityService.tagused(tokenDto, pageSize, type));
}
/**
* @param tokenDto 登录者token
* @Description 获取下级机关发文数
* @author jyy
*/
@PostMapping("subagency/publishedarticle")
public Result<List<FactPublishedAgencyDTO>> subagencyPublishedarticle(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, TagFormDTO.GroupJava.class);
String type = formDTO.getType();
return new Result<List<FactPublishedAgencyDTO>>().ok(publicityService.subagencyPublishedarticle(tokenDto, type));
}
/**
* @param tokenDto 登录者token
* @Description 获取直属部门发文数
* @author jyy
*/
@PostMapping("department/publishedarticle")
public Result<List<FactPublishedDepartmentDTO>> departmentPublishedarticle(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, TagFormDTO.GroupJava.class);
String type = formDTO.getType();
return new Result<List<FactPublishedDepartmentDTO>>().ok(publicityService.departmentPublishedarticle(tokenDto, type));
}
/**
* @param tokenDto 登录者token
* @Description 获取指数网格发文数
* @author jyy
*/
@PostMapping("subgrid/publishedarticle")
public Result<List<FactPublishedGridDTO>> subgridPublishedarticle(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, TagFormDTO.GroupJava.class);
String type = formDTO.getType();
return new Result<List<FactPublishedGridDTO>>().ok(publicityService.subgridPublishedarticle(tokenDto, type));
}
}

42
epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedAgencyDailyDao.java

@ -1,42 +0,0 @@
/**
* 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.publicity;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.publicity.FactArticlePublishedAgencyDailyEntity;
import com.epmet.publicity.dto.result.FactArticlePublishedAgencyDailyDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 文章发布数量机关日统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-19
*/
@Mapper
public interface FactArticlePublishedAgencyDailyDao extends BaseDao<FactArticlePublishedAgencyDailyEntity> {
/**
* @Description 宣传能力工作端当前机关累计发文和当前发文
* @param agencyId
* @author jyy
*/
FactArticlePublishedAgencyDailyDTO summaryInfo(@Param("agencyId") String agencyId);
}

40
epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyMonthlyDao.java

@ -1,40 +0,0 @@
/**
* 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.publicity;
import com.epmet.publicity.dto.result.FactTagAgencyDTO;
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-19
*/
@Mapper
public interface FactTagUsedAgencyMonthlyDao {
/**
* @param agencyId monthId
* @Description 根据标签分组获取当月每个标签数量按照数量降序取前pagesize个
* @author zxc
*/
List<FactTagAgencyDTO> getMonthlyCountByTag(@Param("agencyId") String agencyId, @Param("monthId") String monthId, @Param("pageSize") Integer pageSize);
}

40
epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyYearlyDao.java

@ -1,40 +0,0 @@
/**
* 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.publicity;
import com.epmet.publicity.dto.result.FactTagAgencyDTO;
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-19
*/
@Mapper
public interface FactTagUsedAgencyYearlyDao {
/**
* @param agencyId monthId
* @Description 根据标签分组获取当月每个标签数量按照数量降序取前pagesize个
* @author zxc
*/
List<FactTagAgencyDTO> getYearlyCountByTag(@Param("agencyId") String agencyId, @Param("yearId") String yearId, @Param("pageSize") Integer pageSize);
}

40
epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyMonthlyDao.java

@ -1,40 +0,0 @@
/**
* 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.publicity;
import com.epmet.publicity.dto.result.FactTagAgencyDTO;
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-19
*/
@Mapper
public interface FactTagViewedAgencyMonthlyDao {
/**
* @param agencyId monthId
* @Description 根据标签分组获取当月每个标签数量按照数量降序取前pagesize个
* @author zxc
*/
List<FactTagAgencyDTO> getMonthlyCountByTag(@Param("agencyId") String agencyId, @Param("monthId") String monthId, @Param("pageSize") Integer pageSize);
}

40
epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyQuarterlyDao.java

@ -1,40 +0,0 @@
/**
* 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.publicity;
import com.epmet.publicity.dto.result.FactTagAgencyDTO;
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-19
*/
@Mapper
public interface FactTagViewedAgencyQuarterlyDao {
/**
* @param agencyId monthId
* @Description 根据标签分组获取当月每个标签数量按照数量降序取前pagesize个
* @author zxc
*/
List<FactTagAgencyDTO> getQuarterlyCountByTag(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId, @Param("pageSize") Integer pageSize);
}

40
epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyYearlyDao.java

@ -1,40 +0,0 @@
/**
* 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.publicity;
import com.epmet.publicity.dto.result.FactTagAgencyDTO;
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-19
*/
@Mapper
public interface FactTagViewedAgencyYearlyDao {
/**
* @param agencyId monthId
* @Description 根据标签分组获取当月每个标签数量按照数量降序取前pagesize个
* @author zxc
*/
List<FactTagAgencyDTO> getYearlyCountByTag(@Param("agencyId") String agencyId, @Param("yearId") String yearId, @Param("pageSize") Integer pageSize);
}

33
epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridMonthlyDao.java

@ -1,33 +0,0 @@
/**
* 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.publicity;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.publicity.FactTagViewedGridMonthlyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 文章引用标签阅读数量网格月统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-19
*/
@Mapper
public interface FactTagViewedGridMonthlyDao extends BaseDao<FactTagViewedGridMonthlyEntity> {
}

33
epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridQuarterlyDao.java

@ -1,33 +0,0 @@
/**
* 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.publicity;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.publicity.FactTagViewedGridQuarterlyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 文章引用标签阅读数量网格季度统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-19
*/
@Mapper
public interface FactTagViewedGridQuarterlyDao extends BaseDao<FactTagViewedGridQuarterlyEntity> {
}

145
epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/PublicityDao.java

@ -0,0 +1,145 @@
/**
* 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.publicity;
import com.epmet.publicity.dto.result.*;
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-19
*/
@Mapper
public interface PublicityDao {
/**
* @Description 宣传能力工作端当前机关累计发文和当前发文
* @param agencyId 机关id
* @author jyy
*/
FactPublishedAgencyDailyDTO summaryInfo(@Param("agencyId") String agencyId);
/**
* @Description 当月获取机关下获取每个标签阅读数量按照数量降序取前pagesize个
* @param agencyId,monthId,pageSize 机关id展示数量
* @author zxc
*/
List<FactTagAgencyDTO> getViewedMonthlyCountByTag(@Param("agencyId") String agencyId, @Param("monthId") String monthId, @Param("pageSize") Integer pageSize);
/**
* @Description 当季获取机关下获取每个标签阅读数量按照数量降序取前pagesize个
* @param agencyId,quarterId,pageSize 机关id展示数量
* @author zxc
*/
List<FactTagAgencyDTO> getViewedQuarterlyCountByTag(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId, @Param("pageSize") Integer pageSize);
/**
* @Description 当年获取机关下获取每个标签阅读数量按照数量降序取前pagesize个
* @param agencyId,yearId,pageSize 机关id展示数量
* @author zxc
*/
List<FactTagAgencyDTO> getViewedYearlyCountByTag(@Param("agencyId") String agencyId, @Param("yearId") String yearId, @Param("pageSize") Integer pageSize);
/**
* @Description 当月获取机关下获取每个标签发文数量按照数量降序取前pagesize个
* @param agencyId,monthId,pageSize 机关id展示数量
* @author zxc
*/
List<FactTagAgencyDTO> getUsedMonthlyCountByTag(@Param("agencyId") String agencyId, @Param("monthId") String monthId, @Param("pageSize") Integer pageSize);
/**
* @Description 当季获取机关下获取每个标签发文数量按照数量降序取前pagesize个
* @param agencyId,quarterId,pageSize 机关id展示数量
* @author zxc
*/
List<FactTagAgencyDTO> getUsedQuarterlyCountByTag(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId, @Param("pageSize") Integer pageSize);
/**
* @Description 当年获取机关下每个标签发文数量按照数量降序取前pagesize个
* @param agencyId,yearId,pageSize 机关id展示数量
* @author zxc
*/
List<FactTagAgencyDTO> getUsedYearlyCountByTag(@Param("agencyId") String agencyId, @Param("yearId") String yearId, @Param("pageSize") Integer pageSize);
/**
* @Description 当月下级机发文数
* @param agencyId,monthId 机关id
* @author zxc
*/
List<FactPublishedAgencyDTO> getSubAgencyPublishedMonth(@Param("agencyId") String agencyId, @Param("monthId") String monthId);
/**
* @Description 当季下级机发文数
* @param agencyId,quarterId 机关id季度
* @author zxc
*/
List<FactPublishedAgencyDTO> getSubAgencyPublishedQuarter(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId);
/**
* @Description 当年下级机发文数
* @param agencyId,yearId 机关id
* @author zxc
*/
List<FactPublishedAgencyDTO> getSubAgencyPublishedYear(@Param("agencyId") String agencyId, @Param("yearId") String yearId);
/**
* @Description 当月下级部门文数
* @param agencyId,monthId 机关id
* @author zxc
*/
List<FactPublishedDepartmentDTO> getSubDepartPublishedMonth(@Param("agencyId") String agencyId, @Param("monthId") String monthId);
/**
* @Description 当季下级部门文数
* @param agencyId,quarterId 机关id季度
* @author zxc
*/
List<FactPublishedDepartmentDTO> getSubDepartPublishedQuarter(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId);
/**
* @Description 当年下级部门文数
* @param agencyId,yearId 机关id
* @author zxc
*/
List<FactPublishedDepartmentDTO> getSubDepartPublishedYear(@Param("agencyId") String agencyId, @Param("yearId") String yearId);
/**
* @Description 当月下级网格文数
* @param agencyId,monthId 机关id
* @author zxc
*/
List<FactPublishedGridDTO> getSubGridPublishedMonth(@Param("agencyId") String agencyId, @Param("monthId") String monthId);
/**
* @Description 当季下级网格文数
* @param agencyId,quarterId 机关id季度
* @author zxc
*/
List<FactPublishedGridDTO> getSubGridPublishedQuarter(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId);
/**
* @Description 当年下级网格文数
* @param agencyId,yearId 机关id
* @author zxc
*/
List<FactPublishedGridDTO> getSubGridPublishedYear(@Param("agencyId") String agencyId, @Param("yearId") String yearId);
}

37
epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java

@ -3,6 +3,7 @@ package com.epmet.dao.user;
import com.epmet.dto.DimAgencyDTO;
import com.epmet.dto.DimGridDTO;
import com.epmet.dto.result.user.UserIncrTrendResDTO;
import com.epmet.dto.result.user.UserSubAgencyResDTO;
import com.epmet.dto.result.user.UserSubGridResDTO;
import com.epmet.dto.result.user.UserSummaryInfoResultDTO;
@ -95,4 +96,40 @@ public interface UserAnalysisDao {
* @Date 2020/6/23 0:18
**/
List<UserSubGridResDTO> selectRegSubGridRes(@Param("dateId")String dateId, @Param("agencyId") String agencyId);
/**
* @return java.util.List<com.epmet.dto.result.user.UserIncrTrendResDTO>
* @param myAgencyId
* @author yinzuomei
* @description
* @Date 2020/6/23 11:24
**/
List<UserIncrTrendResDTO> selectRegDayIncr(@Param("agencyId")String myAgencyId);
/**
* @return java.util.List<com.epmet.dto.result.user.UserIncrTrendResDTO>
* @param myAgencyId
* @author yinzuomei
* @description
* @Date 2020/6/23 11:24
**/
List<UserIncrTrendResDTO> selectRegMonthIncr(@Param("agencyId")String myAgencyId);
/**
* @return java.util.List<com.epmet.dto.result.user.UserIncrTrendResDTO>
* @param myAgencyId
* @author yinzuomei
* @description
* @Date 2020/6/23 11:24
**/
List<UserIncrTrendResDTO> selectParticipationUserDayIncr(@Param("agencyId")String myAgencyId);
/**
* @return java.util.List<com.epmet.dto.result.user.UserIncrTrendResDTO>
* @param myAgencyId
* @author yinzuomei
* @description
* @Date 2020/6/23 11:24
**/
List<UserIncrTrendResDTO> selectParticipationUserMonthIncr(@Param("agencyId") String myAgencyId);
}

91
epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedAgencyDailyEntity.java

@ -1,91 +0,0 @@
/**
* 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.publicity;
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-19
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_article_published_agency_daily")
public class FactArticlePublishedAgencyDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID 客户ID
*/
private String customerId;
/**
* 上级机关ID 上级机关ID
*/
private String pid;
/**
* 机关ID
*/
private String agencyId;
/**
* 文章累计发文数量 文章数量
*/
private Integer articleTotalCount;
/**
* 当前发文数量 当前未下线的文章数量
*/
private Integer articlePublishedCount;
/**
* 日期ID 日期ID
*/
private String dateId;
/**
* 周ID 周ID eg2020W01 = 2020年第一周
*/
private String weekId;
/**
* 月份ID 月份ID eg202006 = 2020年6月2020-07 = 2020年7月
*/
private String monthId;
/**
* 季度ID 季度ID eg2020Q1 = 2020年第一季度2020Q2 = 2020年第二季度2020Q3 = 2020年第三季度2020Q4 = 2020年第四季度
*/
private String quarterId;
/**
* 年度ID 年度ID eg2020 = 2020年2021 = 2021年
*/
private String yearId;
}

91
epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedDepartmentDailyEntity.java

@ -1,91 +0,0 @@
/**
* 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.publicity;
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-19
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_article_published_department_daily")
public class FactArticlePublishedDepartmentDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID 客户ID
*/
private String customerId;
/**
* 发布文章单位所属机关ID 发布文章单位所属机关ID
*/
private String agencyId;
/**
* 部门ID
*/
private String departmentId;
/**
* 文章累计发文数量 文章数量
*/
private Integer articleTotalCount;
/**
* 当前发文数量 当前未下线的文章数量
*/
private Integer articlePublishedCount;
/**
* 日期ID 日期ID
*/
private String dateId;
/**
* 周ID 周ID eg2020W01 = 2020年第一周
*/
private String weekId;
/**
* 月份ID 月份ID eg202006 = 2020年6月2020-07 = 2020年7月
*/
private String monthId;
/**
* 季度ID 季度ID eg2020Q1 = 2020年第一季度2020Q2 = 2020年第二季度2020Q3 = 2020年第三季度2020Q4 = 2020年第四季度
*/
private String quarterId;
/**
* 年度ID 年度ID eg2020 = 2020年2021 = 2021年
*/
private String yearId;
}

91
epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedGridDailyEntity.java

@ -1,91 +0,0 @@
/**
* 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.publicity;
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-19
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_article_published_grid_daily")
public class FactArticlePublishedGridDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID 客户ID
*/
private String customerId;
/**
* 发布单位所属机关ID 发布单位所属机关ID
*/
private String agencyId;
/**
* 网格ID
*/
private String gridId;
/**
* 文章累计发文数量 文章数量
*/
private Integer articleTotalCount;
/**
* 当前发文数量 当前未下线的文章数量
*/
private Integer articlePublishedCount;
/**
* 日期ID 日期ID
*/
private String dateId;
/**
* 周ID 周ID eg2020W01 = 2020年第一周
*/
private String weekId;
/**
* 月份ID 月份ID eg202006 = 2020年6月2020-07 = 2020年7月
*/
private String monthId;
/**
* 季度ID 季度ID eg2020Q1 = 2020年第一季度2020Q2 = 2020年第二季度2020Q3 = 2020年第三季度2020Q4 = 2020年第四季度
*/
private String quarterId;
/**
* 年度ID 年度ID eg2020 = 2020年2021 = 2021年
*/
private String yearId;
}

96
epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyDailyEntity.java

@ -1,96 +0,0 @@
/**
* 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.publicity;
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-19
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_tag_viewed_agency_daily")
public class FactTagViewedAgencyDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID 客户ID
*/
private String customerId;
/**
* 上级机关ID 上级机关ID
*/
private String pid;
/**
* 机关ID
*/
private String agencyId;
/**
* 标签ID 标签ID
*/
private String tagId;
/**
* 标签名称 标签名称
*/
private String tagName;
/**
* 文章引用标签阅读数 文章引用标签阅读数
*/
private Integer tagReadCount;
/**
* 日期ID 天数ID eg20200601 = 2020年6月1日20200602 = 2020年6月2日
*/
private String dateId;
/**
* 周ID 周ID eg2020W01 = 2020年第一周
*/
private String weekId;
/**
* 月份ID 月份ID eg202006 = 2020年6月2020-07 = 2020年7月
*/
private String monthId;
/**
* 季度ID 季度ID eg2020Q1 = 2020年第一季度2020Q2 = 2020年第二季度2020Q3 = 2020年第三季度2020Q4 = 2020年第四季度
*/
private String quarterId;
/**
* 年度ID 年度ID eg2020 = 2020年2021 = 2021年
*/
private String yearId;
}

76
epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyMonthlyEntity.java

@ -1,76 +0,0 @@
/**
* 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.publicity;
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-19
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_tag_viewed_agency_monthly")
public class FactTagViewedAgencyMonthlyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID 客户ID
*/
private String customerId;
/**
* 上级机关ID 上级机关ID
*/
private String pid;
/**
* 机关ID
*/
private String agencyId;
/**
* 标签ID 标签ID
*/
private String tagId;
/**
* 标签名称 标签名称
*/
private String tagName;
/**
* 文章引用标签阅读数 文章引用标签阅读数
*/
private Integer tagReadCount;
/**
* 月份ID 月份ID eg2020-06 = 2020年6月2020-07 = 2020年7月
*/
private String monthId;
}

76
epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyQuarterlyEntity.java

@ -1,76 +0,0 @@
/**
* 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.publicity;
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-19
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_tag_viewed_agency_quarterly")
public class FactTagViewedAgencyQuarterlyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID 客户ID
*/
private String customerId;
/**
* 上级机关ID 上级机关ID
*/
private String pid;
/**
* 机关ID
*/
private String agencyId;
/**
* 标签ID 标签ID
*/
private String tagId;
/**
* 标签名称 标签名称
*/
private String tagName;
/**
* 文章引用标签阅读数 文章引用标签阅读数
*/
private Integer tagReadCount;
/**
* 季度ID 季度ID eg2020Q1 = 2020年第一季度2020Q2 = 2020年第二季度2020Q3 = 2020年第三季度2020Q4 = 2020年第四季度
*/
private String quarterId;
}

76
epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyYearlyEntity.java

@ -1,76 +0,0 @@
/**
* 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.publicity;
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-19
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_tag_viewed_agency_yearly")
public class FactTagViewedAgencyYearlyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID 客户ID
*/
private String customerId;
/**
* 上级机关ID 上级机关ID
*/
private String pid;
/**
* 机关ID
*/
private String agencyId;
/**
* 标签ID 标签ID
*/
private String tagId;
/**
* 标签名称 标签名称
*/
private String tagName;
/**
* 文章引用标签阅读数 文章引用标签阅读数
*/
private Integer tagReadCount;
/**
* 年度ID 年度ID eg2020 = 2020年2021 = 2021年
*/
private String yearId;
}

96
epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridDailyEntity.java

@ -1,96 +0,0 @@
/**
* 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.publicity;
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-19
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_tag_viewed_grid_daily")
public class FactTagViewedGridDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID 客户ID
*/
private String customerId;
/**
* 文章发布所属机关ID 文章发布所属机关ID
*/
private String agencyId;
/**
* 网格ID
*/
private String gridId;
/**
* 标签ID 标签ID
*/
private String tagId;
/**
* 标签名称 标签名称
*/
private String tagName;
/**
* 文章引用标签阅读数 文章引用标签阅读数
*/
private Integer tagReadCount;
/**
* 日期ID 天数ID eg20200601 = 2020年6月1日20200602 = 2020年6月2日
*/
private String dateId;
/**
* 周ID 周ID eg2020W01 = 2020年第一周
*/
private String weekId;
/**
* 月份ID 月份ID eg202006 = 2020年6月2020-07 = 2020年7月
*/
private String monthId;
/**
* 季度ID 季度ID eg2020Q1 = 2020年第一季度2020Q2 = 2020年第二季度2020Q3 = 2020年第三季度2020Q4 = 2020年第四季度
*/
private String quarterId;
/**
* 年度ID 年度ID eg2020 = 2020年2021 = 2021年
*/
private String yearId;
}

76
epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridQuarterlyEntity.java

@ -1,76 +0,0 @@
/**
* 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.publicity;
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-19
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_tag_viewed_grid_quarterly")
public class FactTagViewedGridQuarterlyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID 客户ID
*/
private String customerId;
/**
* 文章发布所属机关ID 文章发布所属机关ID
*/
private String agencyId;
/**
* 网格ID
*/
private String gridId;
/**
* 标签ID 标签ID
*/
private String tagId;
/**
* 标签名称 标签名称
*/
private String tagName;
/**
* 文章引用标签阅读数 文章引用标签阅读数
*/
private Integer tagReadCount;
/**
* 季度ID 季度ID eg2020Q1 = 2020年第一季度2020Q2 = 2020年第二季度2020Q3 = 2020年第三季度2020Q4 = 2020年第四季度
*/
private String quarterId;
}

76
epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridYearlyEntity.java

@ -1,76 +0,0 @@
/**
* 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.publicity;
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-19
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_tag_viewed_grid_yearly")
public class FactTagViewedGridYearlyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID 客户ID
*/
private String customerId;
/**
* 文章发布所属机关ID 文章发布所属机关ID
*/
private String agencyId;
/**
* 网格ID
*/
private String gridId;
/**
* 标签ID 标签ID
*/
private String tagId;
/**
* 标签名称 标签名称
*/
private String tagName;
/**
* 文章引用标签阅读数 文章引用标签阅读数
*/
private Integer tagReadCount;
/**
* 年度ID 年度ID eg2020 = 2020年2021 = 2021年
*/
private String yearId;
}

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

@ -1,5 +1,6 @@
package com.epmet.service.issue.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dao.issue.IssueDao;
import com.epmet.dto.form.LoginUserDetailsFormDTO;
@ -13,6 +14,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
@ -167,6 +170,7 @@ public class IssueServiceImpl implements IssueService {
}
private String toRatio(BigDecimal data) {
return data.stripTrailingZeros().toString().concat("%");
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
return data.multiply(hundred).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString().concat("%");
}
}

19
epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java

@ -16,6 +16,9 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.List;
@ -43,8 +46,14 @@ public class ProjectServiceImpl implements ProjectService {
//2:根据agencyId查询项目统计数据
ProjectSummaryResultDTO resultDTO = projectDao.selectProjectSummary(agencyId);
if (null != resultDTO) {
resultDTO.setPendingRatio(resultDTO.getPendingRatioInt().stripTrailingZeros().toString() + "%");
resultDTO.setClosedRatio(resultDTO.getClosedRatioInt().stripTrailingZeros().toString() + "%");
//将结果转成百分比
NumberFormat percent = NumberFormat.getPercentInstance();
percent.setMaximumFractionDigits(2);
//四舍五入保留小数点后四位
BigDecimal pendingRatio = resultDTO.getPendingRatioInt().setScale(4, RoundingMode.HALF_UP);
//将小数转成百分比
resultDTO.setPendingRatio(percent.format(pendingRatio.doubleValue()));
resultDTO.setClosedRatio(percent.format(resultDTO.getClosedRatioInt().setScale(4, RoundingMode.HALF_UP).doubleValue()));
}
return resultDTO;
}
@ -62,8 +71,12 @@ public class ProjectServiceImpl implements ProjectService {
//2:根据agencyId查询各状态统计数据
resultList = projectDao.selectSummaryInfo(agencyId);
if (null != resultList && resultList.size() > NumConstant.ZERO) {
//将结果转成百分比
NumberFormat percent = NumberFormat.getPercentInstance();
percent.setMaximumFractionDigits(2);
resultList.forEach(sum -> {
sum.setRatio(sum.getRatioInt().stripTrailingZeros().toString() + "%");
//先四舍五入保留四位小数再把小数转成百分比
sum.setRatio(percent.format(sum.getRatioInt().setScale(4, RoundingMode.HALF_UP).doubleValue()));
});
}
return resultList;

28
epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/PublicityService.java

@ -18,9 +18,12 @@
package com.epmet.service.publicity;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.publicity.dto.result.FactArticlePublishedAgencyDailyDTO;
import com.epmet.publicity.dto.result.FactTagAgencyDTO;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.publicity.dto.result.*;
import org.apache.commons.lang3.StringUtils;
import java.util.Date;
import java.util.List;
/**
@ -36,7 +39,7 @@ public interface PublicityService {
* @param tokenDto
* @author jyy
*/
FactArticlePublishedAgencyDailyDTO summaryInfo(TokenDto tokenDto);
FactPublishedAgencyDailyDTO summaryInfo(TokenDto tokenDto);
/**
* @Description 宣传能力工作端宣传能力-获取阅读最多的分类数据
@ -52,5 +55,24 @@ public interface PublicityService {
*/
public List<FactTagAgencyDTO> tagused(TokenDto tokenDto, Integer pageSize, String type) ;
/**
* @param tokenDto type
* @Description 获取下级机关发文数
* @author jyy
*/
public List<FactPublishedAgencyDTO> subagencyPublishedarticle(TokenDto tokenDto, String type) ;
/**
* @param tokenDto type
* @Description 获取直属部门发文数
* @author jyy
*/
public List<FactPublishedDepartmentDTO> departmentPublishedarticle(TokenDto tokenDto, String type);
/**
* @param tokenDto type
* @Description 获取指数网格发文数
* @author jyy
*/
public List<FactPublishedGridDTO> subgridPublishedarticle(TokenDto tokenDto, String type);
}

134
epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java

@ -19,24 +19,17 @@ package com.epmet.service.publicity.impl;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dao.publicity.FactArticlePublishedAgencyDailyDao;
import com.epmet.dao.publicity.FactTagViewedAgencyMonthlyDao;
import com.epmet.dao.publicity.FactTagViewedAgencyQuarterlyDao;
import com.epmet.dao.publicity.FactTagViewedAgencyYearlyDao;
import com.epmet.dao.publicity.PublicityDao;
import com.epmet.dto.form.LoginUserDetailsFormDTO;
import com.epmet.dto.result.LoginUserDetailsResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.publicity.dto.result.FactArticlePublishedAgencyDailyDTO;
import com.epmet.publicity.dto.result.FactTagAgencyDTO;
import com.epmet.publicity.dto.result.*;
import com.epmet.service.publicity.PublicityService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@ -48,15 +41,8 @@ import java.util.List;
*/
@Service
public class PublicityServiceImpl implements PublicityService {
@Autowired
private FactArticlePublishedAgencyDailyDao factArticlePublishedAgencyDailyDao;//机关每日发文
@Autowired
private FactTagViewedAgencyMonthlyDao factTagViewedAgencyMonthlyDao;//机关-每月-阅读
@Autowired
private FactTagViewedAgencyQuarterlyDao factTagViewedAgencyQuarterlyDao;//机关-每季度-阅读
@Autowired
private FactTagViewedAgencyYearlyDao factTagViewedAgencyYearlyDao;//机关-每年-阅读
private PublicityDao publicityDao;//机关每日发文
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@ -66,15 +52,16 @@ public class PublicityServiceImpl implements PublicityService {
* @author jyy
*/
@Override
public FactArticlePublishedAgencyDailyDTO summaryInfo(TokenDto tokenDto) {
public FactPublishedAgencyDailyDTO summaryInfo(TokenDto tokenDto) {
String agencyId = this.getLoginUserDetails(tokenDto);
return factArticlePublishedAgencyDailyDao.summaryInfo(agencyId);
agencyId="b9e295f8c1906a0d1c5e0b313afcda3f";
return publicityDao.summaryInfo(agencyId);
}
/**
* @param tokenDto,formDTO
* @Description 宣传能力工作端宣传能力-获取阅读最多的分类数据
* @Description 宣传能力工作端-获取阅读最多的分类数据
* @author jyy
*/
@Override
@ -87,26 +74,23 @@ public class PublicityServiceImpl implements PublicityService {
if (StringUtils.equals("month", type)) {//当月
String monthId = strDate.substring(0, 4) + strDate.substring(5, 7);
return factTagViewedAgencyMonthlyDao.getMonthlyCountByTag(agencyId, monthId, pageSize);
return publicityDao.getViewedMonthlyCountByTag(agencyId, monthId, pageSize);
} else if (StringUtils.equals("quarter", type)) {//当季
String quarterId = strDate + "Q" + DateUtils.getQuarterIndex(date);
return factTagViewedAgencyQuarterlyDao.getQuarterlyCountByTag(agencyId, quarterId, pageSize);
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date);
return publicityDao.getViewedQuarterlyCountByTag(agencyId, quarterId, pageSize);
} else if (StringUtils.equals("year", type)) {//当年
return factTagViewedAgencyYearlyDao.getYearlyCountByTag(agencyId, yearId, pageSize);
return publicityDao.getViewedYearlyCountByTag(agencyId, yearId, pageSize);
} else {
return null;
}
}
/**
* @param tokenDto,pageSize,type
* @Description 宣传能力工作端宣传能力-获取发表最多的分类数据
* @param tokenDto pageSize type
* @Description 宣传能力工作端-获取发表最多的分类数据
* @author jyy
*/
@Override
@ -119,21 +103,105 @@ public class PublicityServiceImpl implements PublicityService {
if (StringUtils.equals("month", type)) {//当月
String monthId = strDate.substring(0, 4) + strDate.substring(5, 7);
return factTagViewedAgencyMonthlyDao.getMonthlyCountByTag(agencyId, monthId, pageSize);
return publicityDao.getUsedMonthlyCountByTag(agencyId, monthId, pageSize);
} else if (StringUtils.equals("quarter", type)) {//当季
String quarterId = strDate + "Q" + DateUtils.getQuarterIndex(date);
return factTagViewedAgencyQuarterlyDao.getQuarterlyCountByTag(agencyId, quarterId, pageSize);
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date);
return publicityDao.getUsedQuarterlyCountByTag(agencyId, quarterId, pageSize);
} else if (StringUtils.equals("year", type)) {//当年
return publicityDao.getUsedYearlyCountByTag(agencyId, yearId, pageSize);
} else {
return null;
}
}
/**
* @param tokenDto type
* @Description 获取下级机关发文数
* @author jyy
*/
@Override
public List<FactPublishedAgencyDTO> subagencyPublishedarticle(TokenDto tokenDto, String type) {
// String agencyId = this.getLoginUserDetails(tokenDto);
String agencyId = "1041fe5e8499dbd8add314291d2f6da4";
Date date = new Date();
String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD);
String yearId = strDate.substring(0, 4);
String monthId = strDate.substring(0, 6);
if (StringUtils.equals("month", type)) {//当月
return publicityDao.getSubAgencyPublishedMonth(agencyId, monthId);
} else if (StringUtils.equals("quarter", type)) {//当季
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date);
return publicityDao.getSubAgencyPublishedQuarter(agencyId, quarterId);
} else if (StringUtils.equals("year", type)) {//当年
return publicityDao.getSubAgencyPublishedYear(agencyId, yearId);
} else {
return null;
}
}
return factTagViewedAgencyYearlyDao.getYearlyCountByTag(agencyId, yearId, pageSize);
/**
* @param tokenDto type
* @Description 获取直属部门发文数
* @author jyy
*/
@Override
public List<FactPublishedDepartmentDTO> departmentPublishedarticle(TokenDto tokenDto, String type) {
// String agencyId = this.getLoginUserDetails(tokenDto);
String agencyId = "0d2ffe9fce682b602b9d451226d08fae";
Date date = new Date();
String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD);
String yearId = strDate.substring(0, 4);
String monthId = strDate.substring(0, 6);
if (StringUtils.equals("month", type)) {//当月
return publicityDao.getSubDepartPublishedMonth(agencyId, monthId);
} else if (StringUtils.equals("quarter", type)) {//当季
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date);
return publicityDao.getSubDepartPublishedQuarter(agencyId, quarterId);
} else if (StringUtils.equals("year", type)) {//当年
return publicityDao.getSubDepartPublishedYear(agencyId, yearId);
} else {
return null;
}
}
/**
* @param tokenDto type
* @Description 获取指数网格发文数
* @author jyy
*/
@Override
public List<FactPublishedGridDTO> subgridPublishedarticle(TokenDto tokenDto, String type) {
// String agencyId = this.getLoginUserDetails(tokenDto);
String agencyId = "0d2ffe9fce682b602b9d451226d08fae";
Date date = new Date();
String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD);
String yearId = strDate.substring(0, 4);
String monthId = strDate.substring(0, 6);
if (StringUtils.equals("month", type)) {//当月
return publicityDao.getSubGridPublishedMonth(agencyId, monthId);
} else if (StringUtils.equals("quarter", type)) {//当季
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date);
return publicityDao.getSubGridPublishedQuarter(agencyId, quarterId);
} else if (StringUtils.equals("year", type)) {//当年
return publicityDao.getSubGridPublishedYear(agencyId, yearId);
} else {
return null;
}
}
/**

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);

129
epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java

@ -89,7 +89,7 @@ public class UserAnalysisServiceImpl implements UserAnalysisService {
userSummaryInfoResultDTO=userAnalysisDao.selectRegUserSummaryInfo(myAgencyId);
}
if(null!=userSummaryInfoResultDTO){
userSummaryInfoResultDTO.setCurrentDate(DateUtils.getDatePointPattern(userSummaryInfoResultDTO.getCurrentDate()));
userSummaryInfoResultDTO.setCurrentDate(DateUtils.getxAxisDatePattern(userSummaryInfoResultDTO.getCurrentDate(),"."));
//提取出工具类
userSummaryInfoResultDTO.setPartymemberProportion(userSummaryInfoResultDTO.getPartymemberProportionValue().stripTrailingZeros().toPlainString());
userSummaryInfoResultDTO.setWarmHeartedProportion(userSummaryInfoResultDTO.getWarmHeartedProportionValue().stripTrailingZeros().toPlainString());
@ -295,6 +295,131 @@ public class UserAnalysisServiceImpl implements UserAnalysisService {
**/
@Override
public List<UserIncrTrendResultDTO> incrTrend(UserIncrTrendFormDTO formDTO) {
return null;
//获取用户所属机关id
String myAgencyId = this.getMyAgency();
List<UserIncrTrendResultDTO> dimList = this.initUserIncrTrendResultDTO(formDTO.getType());
if(CollectionUtils.isEmpty(dimList)){
logger.error("横坐标初始失败");
return new ArrayList<>();
}
List<UserIncrTrendResDTO> list=new ArrayList<>();
if (UserAnalysisConstant.REG_FLAG.equals(formDTO.getRegOrPartiFlag()) && UserAnalysisConstant.DAY_TYPE.equals(formDTO.getType())) {
//注册用户数、日
list=userAnalysisDao.selectRegDayIncr(myAgencyId);
} else if (UserAnalysisConstant.REG_FLAG.equals(formDTO.getRegOrPartiFlag()) && UserAnalysisConstant.MONTH_TYPE.equals(formDTO.getType())) {
//注册用户数、月
list=userAnalysisDao.selectRegMonthIncr(myAgencyId);
} else if (UserAnalysisConstant.PARTI_FLAG.equals(formDTO.getRegOrPartiFlag()) && UserAnalysisConstant.DAY_TYPE.equals(formDTO.getType())) {
//参与用户数、日
list=userAnalysisDao.selectParticipationUserDayIncr(myAgencyId);
} else if (UserAnalysisConstant.PARTI_FLAG.equals(formDTO.getRegOrPartiFlag()) && UserAnalysisConstant.MONTH_TYPE.equals(formDTO.getType())) {
//参与用户数、月
list=userAnalysisDao.selectParticipationUserMonthIncr(myAgencyId);
} else {
logger.error("参数错误");
return new ArrayList<>();
}
for(UserIncrTrendResultDTO dim:dimList){
boolean flag=false;
for(UserIncrTrendResDTO userIncrTrendResDTO:list){
if(dim.getDateOrMonthId().equals(userIncrTrendResDTO.getDateIdOrMonthId())){
flag=true;
//居民、热心居民、党员总数,用于排序
switch(dim.getType()){
case UserAnalysisConstant.REGISTERED_RESI:
dim.setValue(userIncrTrendResDTO.getRegIncr());
break;
case UserAnalysisConstant.WARMHEARTED:
dim.setValue(userIncrTrendResDTO.getWarmIncr());
break;
case UserAnalysisConstant.PARTYMEMBER:
dim.setValue(userIncrTrendResDTO.getPartymemberIncr());
break;
default:
break;
}
}
}
if(!flag){
logger.error(String.format("机关id%s缺少记录dateOrMonthId=%s",myAgencyId,dim.getDateOrMonthId()));
}
}
return dimList;
}
private List<UserIncrTrendResultDTO> initUserIncrTrendResultDTO(String type) {
List<UserIncrTrendResultDTO> list=new ArrayList<>();
if(UserAnalysisConstant.DAY_TYPE.equals(type)){
List<String> dateIdList= DateUtils.getDaysBetween(DateUtils.getBeforeNDay(90),
DateUtils.getBeforeNDay(1));
for(String dateId:dateIdList){
String date=DateUtils.getxAxisDatePattern(dateId,"/");
//居民
UserIncrTrendResultDTO resi=new UserIncrTrendResultDTO();
resi.setDate(date);
resi.setType(UserAnalysisConstant.REGISTERED_RESI);
resi.setValue(NumConstant.ZERO);
resi.setDateOrMonthId(dateId);
//热心居民
UserIncrTrendResultDTO warm=new UserIncrTrendResultDTO();
warm.setDate(date);
warm.setType(UserAnalysisConstant.WARMHEARTED);
warm.setValue(NumConstant.ZERO);
warm.setDateOrMonthId(dateId);
//党员
UserIncrTrendResultDTO party=new UserIncrTrendResultDTO();
party.setDate(date);
party.setType(UserAnalysisConstant.PARTYMEMBER);
party.setValue(NumConstant.ZERO);
party.setDateOrMonthId(dateId);
list.add(resi);
list.add(warm);
list.add(party);
}
}else if(UserAnalysisConstant.MONTH_TYPE.equals(type)){
List<String> monthList= DateUtils.getMonthBetween(DateUtils.getBeforeNMonth(12),
DateUtils.getBeforeNMonth(1));
for(String monthId:monthList){
String date=DateUtils.getxAxisDatePattern(monthId,"/");
//居民
UserIncrTrendResultDTO resi=new UserIncrTrendResultDTO();
resi.setDate(date);
resi.setType(UserAnalysisConstant.REGISTERED_RESI);
resi.setValue(NumConstant.ZERO);
resi.setDateOrMonthId(monthId);
//热心居民
UserIncrTrendResultDTO warm=new UserIncrTrendResultDTO();
warm.setDate(date);
warm.setType(UserAnalysisConstant.WARMHEARTED);
warm.setValue(NumConstant.ZERO);
warm.setDateOrMonthId(monthId);
//党员
UserIncrTrendResultDTO party=new UserIncrTrendResultDTO();
party.setDate(date);
party.setType(UserAnalysisConstant.PARTYMEMBER);
party.setValue(NumConstant.ZERO);
party.setDateOrMonthId(monthId);
list.add(resi);
list.add(warm);
list.add(party);
}
}
return list;
}
/*public static void main(String[] args) {
// System.out.println("前一天"+DateUtils.getBeforeNDay(1));
// System.out.println("前90天"+DateUtils.getBeforeNDay(90));
List<String> list= DateUtils.getDaysBetween("201912","202005");
for(String m:list){
System.out.println(m);
}
// System.out.println(list.size());
System.out.println("上个月"+DateUtils.getBeforeNMonth(1));
System.out.println("前8个月"+DateUtils.getBeforeNMonth(8));
}*/
}

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

@ -137,8 +137,13 @@
<springProfile name="dev,test">
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO"/>
<logger name="com.epmet.module.publicity.dao" level="INFO"/>
<logger name="com.epmet.module.publicity.dao" level="DEBUG"/>
<logger name="com.epmet.dao.group" level="DEBUG"/>
<logger name="com.epmet.dao.issue" level="DEBUG"/>
<logger name="com.epmet.dao.project" level="DEBUG"/>
<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"/>
@ -151,7 +156,13 @@
<springProfile name="prod">
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO"/>
<logger name="com.epmet.module.publicity.dao" level="INFO"/>
<logger name="com.epmet.dao.group" level="INFO"/>
<logger name="com.epmet.dao.issue" level="INFO"/>
<logger name="com.epmet.dao.project" level="INFO"/>
<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"/>

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

@ -33,8 +33,9 @@
INNER JOIN
dim_agency da ON fiad.AGENCY_ID = da.ID
WHERE fiad.DEL_FLAG = '0'
AND PID = #{agencyId}
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">
@ -60,7 +62,7 @@
VOTING_INCR,
SHIFT_PROJECT_INCR,
CLOSED_INCR,
DATE_FORMAT(DATE_ID, '%Y/%m/%d')
DATE_FORMAT(DATE_ID, '%Y/%m/%d') AS DATE_NAME
FROM
fact_issue_agency_daily fiad
WHERE DEL_FLAG = '0'
@ -76,7 +78,7 @@
VOTING_INCR,
SHIFT_PROJECT_INCR,
CLOSED_INCR,
DATE_FORMAT(STR_TO_DATE(MONTH_ID,'%Y%m'), '%Y/%m') AS MONTH_ID
DATE_FORMAT(STR_TO_DATE(MONTH_ID,'%Y%m'), '%Y/%m') AS DATE_NAME
FROM
fact_issue_agency_monthly fiam
WHERE DEL_FLAG = '0'

35
epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedAgencyDailyDao.xml

@ -1,35 +0,0 @@
<?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.publicity.FactArticlePublishedAgencyDailyDao">
<resultMap type="com.epmet.entity.publicity.FactArticlePublishedAgencyDailyEntity" id="factArticlePublishedAgencyDailyMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="pid" column="PID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="articleTotalCount" column="ARTICLE_TOTAL_COUNT"/>
<result property="articlePublishedCount" column="ARTICLE_PUBLISHED_COUNT"/>
<result property="dateId" column="DATE_ID"/>
<result property="weekId" column="WEEK_ID"/>
<result property="monthId" column="MONTH_ID"/>
<result property="quarterId" column="QUARTER_ID"/>
<result property="yearId" column="YEAR_ID"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<!-- 机关每日发文:文章累计发文数量、当前发文数量、数据截止日期 -->
<select id="summaryInfo" parameterType="java.lang.String" resultType="com.epmet.publicity.dto.result.FactArticlePublishedAgencyDailyDTO">
SELECT
article_total_count AS publishedTotal,
article_published_count AS publishingTotal,
DATE_FORMAT( date_id, '%Y-%m-%d' ) AS dateName
FROM fact_article_published_agency_daily
AND agency_id = #{agencyId}
</select>
</mapper>

27
epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedDepartmentDailyDao.xml

@ -1,27 +0,0 @@
<?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.FactArticlePublishedDepartmentDailyDao">
<resultMap type="com.epmet.entity.publicity.FactArticlePublishedDepartmentDailyEntity" id="factArticlePublishedDepartmentDailyMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="departmentId" column="DEPARTMENT_ID"/>
<result property="articleTotalCount" column="ARTICLE_TOTAL_COUNT"/>
<result property="articlePublishedCount" column="ARTICLE_PUBLISHED_COUNT"/>
<result property="dateId" column="DATE_ID"/>
<result property="weekId" column="WEEK_ID"/>
<result property="monthId" column="MONTH_ID"/>
<result property="quarterId" column="QUARTER_ID"/>
<result property="yearId" column="YEAR_ID"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

27
epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedGridDailyDao.xml

@ -1,27 +0,0 @@
<?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.FactArticlePublishedGridDailyDao">
<resultMap type="com.epmet.entity.publicity.FactArticlePublishedGridDailyEntity" id="factArticlePublishedGridDailyMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="articleTotalCount" column="ARTICLE_TOTAL_COUNT"/>
<result property="articlePublishedCount" column="ARTICLE_PUBLISHED_COUNT"/>
<result property="dateId" column="DATE_ID"/>
<result property="weekId" column="WEEK_ID"/>
<result property="monthId" column="MONTH_ID"/>
<result property="quarterId" column="QUARTER_ID"/>
<result property="yearId" column="YEAR_ID"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

20
epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyMonthlyDao.xml

@ -1,20 +0,0 @@
<?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.module.publicity.dao.FactTagUsedAgencyMonthlyDao">
<select id="getMonthlyCountByTag" resultType="com.epmet.publicity.dto.result.FactTagAgencyDTO">
SELECT
tag_name AS name,
agency_id AS agencyId,
tag_id AS tagId,
COUNT(tag_read_count) AS value
FROM fact_tag_viewed_agency_monthly
where agency_id = #{agencyId}
AND month_id = #{monthId}
GROUP BY TAG_ID
ORDER BY value DESC
LIMIT #{pageSize}
</select>
</mapper>

22
epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyQuarterlyDao.xml

@ -1,22 +0,0 @@
<?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.module.publicity.dao.FactTagUsedAgencyQuarterlyDao">
<select id="getQuarterlyCountByTag" parameterType="java.lang.String"
resultType="com.epmet.publicity.dto.result.FactTagAgencyDTO">
SELECT
tag_name AS name,
agency_id AS agencyId,
tag_id AS tagId,
COUNT(tag_read_count) AS value
FROM fact_tag_viewed_agency_quarterly
where agency_id = #{agencyId}
AND quarter_id = #{quarterId}
GROUP BY TAG_ID
ORDER BY value DESC
LIMIT #{pageSize}
</select>
</mapper>

23
epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyYearlyDao.xml

@ -1,23 +0,0 @@
<?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.module.publicity.dao.FactTagUsedAgencyYearlyDao">
<select id="getYearlyCountByTag" parameterType="map"
resultType="com.epmet.publicity.dto.result.FactTagAgencyDTO">
SELECT
tag_name AS name,
agency_id AS agencyId,
tag_id AS tagId,
COUNT(tag_read_count) AS value
FROM fact_tag_viewed_agency_yearly
where agency_id = #{agencyId}
AND year_id = #{yearId}
GROUP BY tag_id
ORDER BY value DESC
LIMIT #{pageSize}
</select>
</mapper>

28
epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyDailyDao.xml

@ -1,28 +0,0 @@
<?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.FactTagViewedAgencyDailyDao">
<resultMap type="com.epmet.entity.publicity.FactTagViewedAgencyDailyEntity" id="factTagViewedAgencyDailyMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="pid" column="PID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="tagId" column="TAG_ID"/>
<result property="tagName" column="TAG_NAME"/>
<result property="tagReadCount" column="TAG_READ_COUNT"/>
<result property="dateId" column="DATE_ID"/>
<result property="weekId" column="WEEK_ID"/>
<result property="monthId" column="MONTH_ID"/>
<result property="quarterId" column="QUARTER_ID"/>
<result property="yearId" column="YEAR_ID"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

20
epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyMonthlyDao.xml

@ -1,20 +0,0 @@
<?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.module.publicity.dao.FactTagViewedAgencyMonthlyDao">
<select id="getMonthlyCountByTag" resultType="com.epmet.publicity.dto.result.FactTagAgencyDTO">
SELECT
tag_name AS name,
agency_id AS agencyId,
tag_id AS tagId,
COUNT(tag_read_count) AS value
FROM fact_tag_viewed_agency_monthly
where agency_id = #{agencyId}
AND month_id = #{monthId}
GROUP BY TAG_ID
ORDER BY value DESC
LIMIT #{pageSize}
</select>
</mapper>

22
epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyQuarterlyDao.xml

@ -1,22 +0,0 @@
<?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.module.publicity.dao.FactTagViewedAgencyQuarterlyDao">
<select id="getQuarterlyCountByTag" parameterType="java.lang.String"
resultType="com.epmet.publicity.dto.result.FactTagAgencyDTO">
SELECT
tag_name AS name,
agency_id AS agencyId,
tag_id AS tagId,
COUNT(tag_read_count) AS value
FROM fact_tag_viewed_agency_quarterly
where agency_id = #{agencyId}
AND quarter_id = #{quarterId}
GROUP BY TAG_ID
ORDER BY value DESC
LIMIT #{pageSize}
</select>
</mapper>

23
epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyYearlyDao.xml

@ -1,23 +0,0 @@
<?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.module.publicity.dao.FactTagViewedAgencyYearlyDao">
<select id="getYearlyCountByTag" parameterType="map"
resultType="com.epmet.publicity.dto.result.FactTagAgencyDTO">
SELECT
tag_name AS name,
agency_id AS agencyId,
tag_id AS tagId,
COUNT(tag_read_count) AS value
FROM fact_tag_viewed_agency_yearly
where agency_id = #{agencyId}
AND year_id = #{yearId}
GROUP BY tag_id
ORDER BY value DESC
LIMIT #{pageSize}
</select>
</mapper>

28
epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridDailyDao.xml

@ -1,28 +0,0 @@
<?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.FactTagViewedGridDailyDao">
<resultMap type="com.epmet.entity.publicity.FactTagViewedGridDailyEntity" id="factTagViewedGridDailyMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="tagId" column="TAG_ID"/>
<result property="tagName" column="TAG_NAME"/>
<result property="tagReadCount" column="TAG_READ_COUNT"/>
<result property="dateId" column="DATE_ID"/>
<result property="weekId" column="WEEK_ID"/>
<result property="monthId" column="MONTH_ID"/>
<result property="quarterId" column="QUARTER_ID"/>
<result property="yearId" column="YEAR_ID"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

24
epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridMonthlyDao.xml

@ -1,24 +0,0 @@
<?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.FactTagViewedGridMonthlyDao">
<resultMap type="com.epmet.entity.publicity.FactTagViewedGridMonthlyEntity" id="factTagViewedGridMonthlyMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="tagId" column="TAG_ID"/>
<result property="tagName" column="TAG_NAME"/>
<result property="tagReadCount" column="TAG_READ_COUNT"/>
<result property="monthId" column="MONTH_ID"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

24
epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridQuarterlyDao.xml

@ -1,24 +0,0 @@
<?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.FactTagViewedGridQuarterlyDao">
<resultMap type="com.epmet.entity.publicity.FactTagViewedGridQuarterlyEntity" id="factTagViewedGridQuarterlyMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="tagId" column="TAG_ID"/>
<result property="tagName" column="TAG_NAME"/>
<result property="tagReadCount" column="TAG_READ_COUNT"/>
<result property="quarterId" column="QUARTER_ID"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

24
epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridYearlyDao.xml

@ -1,24 +0,0 @@
<?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.FactTagViewedGridYearlyDao">
<resultMap type="com.epmet.entity.publicity.FactTagViewedGridYearlyEntity" id="factTagViewedGridYearlyMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="tagId" column="TAG_ID"/>
<result property="tagName" column="TAG_NAME"/>
<result property="tagReadCount" column="TAG_READ_COUNT"/>
<result property="yearId" column="YEAR_ID"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

262
epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/PublicityDao.xml

@ -0,0 +1,262 @@
<?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.publicity.PublicityDao">
<!-- 机关每日发文:文章累计发文数量、当前发文数量、数据截止日期 -->
<select id="summaryInfo" resultType="com.epmet.publicity.dto.result.FactPublishedAgencyDailyDTO">
SELECT
article_total_count AS publishedTotal,
article_published_count AS publishingTotal,
DATE_FORMAT( date_id, '%Y.%m.%d' ) AS dateName
FROM fact_article_published_agency_daily
where agency_id = #{agencyId}
</select>
<!-- 机关当月—每个标签阅读数量—前pageSize -->
<select id="getViewedMonthlyCountByTag" resultType="com.epmet.publicity.dto.result.FactTagAgencyDTO">
SELECT
tag_name AS name,
agency_id AS agencyId,
tag_id AS tagId,
COUNT(tag_read_count) AS value
FROM fact_tag_viewed_agency_monthly
where agency_id = #{agencyId}
AND month_id = #{monthId}
GROUP BY TAG_ID
ORDER BY value DESC
LIMIT #{pageSize}
</select>
<!-- 机关当季—每个标签阅读数量—前pageSize -->
<select id="getViewedQuarterlyCountByTag" resultType="com.epmet.publicity.dto.result.FactTagAgencyDTO">
SELECT
tag_name AS name,
agency_id AS agencyId,
tag_id AS tagId,
COUNT(tag_read_count) AS value
FROM fact_tag_viewed_agency_quarterly
where agency_id = #{agencyId}
AND quarter_id = #{quarterId}
GROUP BY TAG_ID
ORDER BY value DESC
LIMIT #{pageSize}
</select>
<!-- 机关当年—每个标签阅读数量—前pageSize -->
<select id="getViewedYearlyCountByTag" resultType="com.epmet.publicity.dto.result.FactTagAgencyDTO">
SELECT
tag_name AS name,
agency_id AS agencyId,
tag_id AS tagId,
COUNT(tag_read_count) AS value
FROM fact_tag_viewed_agency_yearly
where agency_id = #{agencyId}
AND year_id = #{yearId}
GROUP BY tag_id
ORDER BY value DESC
LIMIT #{pageSize}
</select>
<!-- 机关当月—每个标签发文数量—前pageSize -->
<select id="getUsedMonthlyCountByTag" resultType="com.epmet.publicity.dto.result.FactTagAgencyDTO">
SELECT
tag_name AS name,
agency_id AS agencyId,
tag_id AS tagId,
COUNT(used_count) AS value
FROM fact_tag_used_agency_monthly
where agency_id = #{agencyId}
AND month_id = #{monthId}
GROUP BY TAG_ID
ORDER BY value DESC
LIMIT #{pageSize}
</select>
<!-- 机关当季—每个标签发文数量—前pageSize -->
<select id="getUsedQuarterlyCountByTag" resultType="com.epmet.publicity.dto.result.FactTagAgencyDTO">
SELECT
tag_name AS name,
agency_id AS agencyId,
tag_id AS tagId,
COUNT(used_count) AS value
FROM fact_tag_used_agency_quarterly
where agency_id = #{agencyId}
AND quarter_id = #{quarterId}
GROUP BY TAG_ID
ORDER BY value DESC
LIMIT #{pageSize}
</select>
<!-- 机关当年—每个标签发文数量—前pageSize -->
<select id="getUsedYearlyCountByTag" resultType="com.epmet.publicity.dto.result.FactTagAgencyDTO">
SELECT
tag_name AS name,
agency_id AS agencyId,
tag_id AS tagId,
COUNT(used_count) AS value
FROM fact_tag_used_agency_yearly
where agency_id = #{agencyId}
AND year_id = #{yearId}
GROUP BY tag_id
ORDER BY value DESC
LIMIT #{pageSize}
</select>
<!-- 当月——下级机发文数:机关名称、机关id、发文数量、上级机关id -->
<select id="getSubAgencyPublishedMonth" resultType="com.epmet.publicity.dto.result.FactPublishedAgencyDTO">
SELECT
agency.agency_name AS name,
pub.agency_id AS agencyId,
pub.pid AS pid,
SUM(pub.published_count) AS value
FROM
fact_article_published_agency_daily AS pub ,
dim_agency AS agency
where
pub.agency_id = agency.id
AND pub.PID =#{agencyId}
AND pub.month_id=#{monthId}
GROUP BY pub.agency_id
</select>
<!-- 当季——下级机发文数:机关名称、机关id、发文数量、上级机关id -->
<select id="getSubAgencyPublishedQuarter" resultType="com.epmet.publicity.dto.result.FactPublishedAgencyDTO">
SELECT
agency.agency_name AS name,
pub.agency_id AS agencyId,
pub.pid AS pid,
SUM(pub.published_count) AS value
FROM
fact_article_published_agency_daily AS pub ,
dim_agency AS agency
where
pub.agency_id = agency.id
AND pub.PID =#{agencyId}
AND pub.quarter_id=#{quarterId}
GROUP BY pub.agency_id
</select>
<!-- 当年——下级机发文数:机关名称、机关id、发文数量、上级机关id -->
<select id="getSubAgencyPublishedYear" resultType="com.epmet.publicity.dto.result.FactPublishedAgencyDTO">
SELECT
agency.agency_name AS name,
pub.agency_id AS agencyId,
pub.pid AS pid,
SUM(pub.published_count) AS value
FROM
fact_article_published_agency_daily AS pub ,
dim_agency AS agency
where
pub.agency_id = agency.id
AND pub.PID =#{agencyId}
AND pub.year_id=#{yearId}
GROUP BY pub.agency_id
</select>
<!-- 当月——下级部门文数:部门名称、机关id、发文数量、部门id -->
<select id="getSubDepartPublishedMonth" resultType="com.epmet.publicity.dto.result.FactPublishedDepartmentDTO">
SELECT
depart.department_name AS name,
pub.agency_id AS agencyId,
pub.department_id AS departmentId,
SUM(pub.published_count) AS value
FROM
fact_article_published_department_daily AS pub ,
dim_department AS depart
where
pub.department_id = depart.id
AND pub.agency_id =#{agencyId}
AND pub.month_id=#{monthId}
GROUP BY pub.department_id
</select>
<!-- 当季——下级部门文数:部门名称、机关id、发文数量、部门id -->
<select id="getSubDepartPublishedQuarter" resultType="com.epmet.publicity.dto.result.FactPublishedDepartmentDTO">
SELECT
depart.department_name AS name,
pub.agency_id AS agencyId,
pub.department_id AS departmentId,
SUM(pub.published_count) AS value
FROM
fact_article_published_department_daily AS pub ,
dim_department AS depart
where
pub.department_id = depart.id
AND pub.agency_id =#{agencyId}
AND pub.quarter_id=#{quarterId}
GROUP BY pub.department_id
</select>
<!-- 当年——下级部门文数:部门名称、机关id、发文数量、部门id -->
<select id="getSubDepartPublishedYear" resultType="com.epmet.publicity.dto.result.FactPublishedDepartmentDTO">
SELECT
depart.department_name AS name,
pub.agency_id AS agencyId,
pub.department_id AS departmentId,
SUM(pub.published_count) AS value
FROM
fact_article_published_department_daily AS pub ,
dim_department AS depart
where
pub.department_id = depart.id
AND pub.agency_id =#{agencyId}
AND pub.year_id=#{yearId}
GROUP BY pub.department_id
</select>
<!-- 当月——下级网格文数:网格名称、机关id、发文数量、网格id -->
<select id="getSubGridPublishedMonth" resultType="com.epmet.publicity.dto.result.FactPublishedGridDTO">
SELECT
grid.grid_name AS name,
pub.agency_id AS agencyId,
pub.grid_id AS gridId,
SUM(pub.published_count) AS value
FROM
fact_article_published_grid_daily AS pub ,
dim_grid AS grid
where
pub.grid_id = grid.id
AND pub.agency_id = #{agencyId}
AND pub.month_id=#{monthId}
GROUP BY pub.grid_id
</select>
<!-- 当季——下级网格文数:网格名称、机关id、发文数量、网格id -->
<select id="getSubGridPublishedQuarter" resultType="com.epmet.publicity.dto.result.FactPublishedGridDTO">
SELECT
grid.grid_name AS name,
pub.agency_id AS agencyId,
pub.grid_id AS gridId,
SUM(pub.published_count) AS value
FROM
fact_article_published_grid_daily AS pub ,
dim_grid AS grid
where
pub.grid_id = grid.id
AND pub.agency_id = #{agencyId}
AND pub.quarter_id=#{quarterId}
GROUP BY pub.grid_id
</select>
<!-- 当年——下级网格文数:网格名称、机关id、发文数量、网格id -->
<select id="getSubGridPublishedYear" resultType="com.epmet.publicity.dto.result.FactPublishedGridDTO">
SELECT
grid.grid_name AS name,
pub.agency_id AS agencyId,
pub.grid_id AS gridId,
SUM(pub.published_count) AS value
FROM
fact_article_published_grid_daily AS pub ,
dim_grid AS grid
where
pub.grid_id = grid.id
AND pub.agency_id = #{agencyId}
AND pub.year_id = #{yearId}
GROUP BY pub.grid_id
</select>
</mapper>

70
epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml

@ -146,4 +146,74 @@
AND m.DATE_ID = #{dateId}
AND m.AGENCY_ID = #{agencyId}
</select>
<!-- -->
<select id="selectRegDayIncr" parameterType="java.lang.String"
resultType="com.epmet.dto.result.user.UserIncrTrendResDTO">
SELECT
m.DATE_ID as dateIdOrMonthId,
m.REG_INCR as regIncr,
m.PARTYMEMBER_INCR as partymemberIncr,
m.WARM_INCR as warmIncr
FROM
fact_reg_user_agency_daily m
WHERE
m.DEL_FLAG = '0'
AND m.AGENCY_ID =#{myAgencyId}
ORDER BY
m.DATE_ID DESC
LIMIT 90
</select>
<!-- -->
<select id="selectRegMonthIncr" parameterType="java.lang.String"
resultType="com.epmet.dto.result.user.UserIncrTrendResDTO">
SELECT
m.MONTH_ID as dateIdOrMonthId,
m.REG_INCR as regIncr,
m.PARTYMEMBER_INCR as partymemberIncr,
m.WARM_INCR as warmIncr
FROM
fact_reg_user_agency_monthly m
WHERE
m.DEL_FLAG = '0'
AND m.AGENCY_ID =#{myAgencyId}
ORDER BY
m.MONTH_ID DESC
LIMIT 12
</select>
<!-- -->
<select id="selectParticipationUserDayIncr" parameterType="java.lang.String"
resultType="com.epmet.dto.result.user.UserIncrTrendResDTO">
SELECT
m.DATE_ID as dateIdOrMonthId,
m.REG_INCR as regIncr,
m.PARTYMEMBER_INCR as partymemberIncr,
m.WARM_INCR as warmIncr
FROM
fact_participation_user_agency_daily m
WHERE
m.DEL_FLAG = '0'
AND m.AGENCY_ID =#{myAgencyId}
ORDER BY
m.DATE_ID DESC
LIMIT 90
</select>
<!-- -->
<select id="selectParticipationUserMonthIncr" parameterType="java.lang.String"
resultType="com.epmet.dto.result.user.UserIncrTrendResDTO">
SELECT
m.MONTH_ID as dateIdOrMonthId,
m.REG_INCR as regIncr,
m.PARTYMEMBER_INCR as partymemberIncr,
m.WARM_INCR as warmIncr
FROM
fact_participation_user_agency_monthly m
WHERE
m.DEL_FLAG = '0'
AND m.AGENCY_ID =#{myAgencyId}
ORDER BY
m.MONTH_ID DESC
LIMIT 12
</select>
</mapper>

4
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java

@ -29,4 +29,8 @@ public interface GroupConstant {
String CITY = "city";
String PROVINCE = "province";
String ERRORGRIDDAILY = "groupGridDaily ==>【网格小组统计出错了... 维度:网格-日】customerId为:";
String ERRORAGENCYDAILY = "groupAgencyDaily ==>【网格小组统计出错了... 维度:机关-日】customerId为:";
}

25
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridIdListByCustomerResultDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.group.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @CreateTime 2020/6/23 13:54
*/
@Data
public class GridIdListByCustomerResultDTO implements Serializable {
private static final long serialVersionUID = -4170349451726088582L;
/**
* 网格ID
*/
private String GridId;
/**
* 机关ID
*/
private String agencyId;
}

14
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/form/MonthProjectListFormDTO.java

@ -18,6 +18,10 @@ public class MonthProjectListFormDTO implements Serializable {
* 客户Id
*/
private String customerId;
/**
* 月维度Id
*/
private String monthId;
/**
* 机关Id
@ -29,14 +33,4 @@ public class MonthProjectListFormDTO implements Serializable {
*/
private String gridId;
/**
* 起始时间
*/
private Date startTime;
/**
* 结束时间
*/
private Date endTime;
}

5
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/ArticleGridPublishedSummaryDTO.java

@ -44,6 +44,11 @@ public class ArticleGridPublishedSummaryDTO implements Serializable {
* 发布文章总数
*/
private Integer articleTotalCount;
/**
* 今日发布文章数
*/
private Integer publishedCount;
/**
* 状态为发布中的文章总数
*/

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

@ -1,8 +1,8 @@
package feign;
package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import feign.impl.DataStatisticalOpenFeignClientFallBack;
import com.epmet.feign.impl.DataStatisticalOpenFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
@ -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 {
/**
@ -104,4 +104,28 @@ public interface DataStatisticalOpenFeignClient {
@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();
}

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

@ -1,9 +1,9 @@
package feign.impl;
package com.epmet.feign.impl;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import feign.DataStatisticalOpenFeignClient;
import com.epmet.feign.DataStatisticalOpenFeignClient;
import org.springframework.stereotype.Component;
/**
@ -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,21 +92,44 @@ 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_SERVER, "agencyGridIssueStats");
}
/**
* @Description 数据统计-项目-机关日月统计
* @Author sun
*/
@Override
public Result agencyProjectStats() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "agencyProjectStats");
}
/**
* @Description 数据统计-项目-网格日月统计
* @Author sun
*/
@Override
public Result gridProjectStats() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "gridProjectStats");
}
}

22
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java

@ -3,7 +3,9 @@ package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.service.StatsProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 数据统计-项目
@ -18,11 +20,21 @@ public class StatsProjectController {
/**
* @Author sun
* @Description 数据-项目-机关网格()统计
* @Description 数据-项目-机关日()统计
**/
@PostMapping("projectstats")
public Result agencyGridProjectStats() {
statsProjectService.agencyGridProjectStats();
@PostMapping("agencyprojectstats")
public Result agencyProjectStats() {
statsProjectService.agencyProjectStats();
return new Result();
}
/**
* @Author sun
* @Description 数据-项目-网格日()统计
**/
@PostMapping("gridprojectstats")
public Result gridProjectStats() {
statsProjectService.gridProjectStats();
return new Result();
}

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java

@ -20,6 +20,7 @@ package com.epmet.dao.org;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.group.AgencyDTO;
import com.epmet.dto.group.result.AgencyGridTotalCountResultDTO;
import com.epmet.dto.group.result.GridIdListByCustomerResultDTO;
import com.epmet.entity.org.CustomerGridEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -57,5 +58,5 @@ public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
* @param dateId
* @author zxc
*/
List<String> getCustomerGridIdList(@Param("customerId") String customerId, @Param("dateId") String dateId);
List<GridIdListByCustomerResultDTO> getCustomerGridIdList(@Param("customerId") String customerId, @Param("dateId") String dateId);
}

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

@ -20,6 +20,7 @@ package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.stats.FactIssueAgencyDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 议题数量(按日)
@ -29,5 +30,14 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface FactIssueAgencyDailyDao extends BaseDao<FactIssueAgencyDailyEntity> {
/**
* 删除
* @author zhaoqifeng
* @date 2020/6/23 14:02
* @param customerId
* @param dateId
* @return void
*/
void deleteByCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId);
}

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

@ -42,5 +42,14 @@ public interface FactIssueAgencyMonthlyDao extends BaseDao<FactIssueAgencyMonthl
* @return java.util.List<com.epmet.dto.stats.FactIssueAgencyMonthlyDTO>
*/
List<FactIssueAgencyMonthlyDTO> selectAgencyMonthlyInc(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 删除
* @author zhaoqifeng
* @date 2020/6/23 14:02
* @param customerId
* @param monthId
* @return void
*/
void deleteByCustomerId(@Param("customerId") String customerId, @Param("monthId") String monthId);
}

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

@ -20,6 +20,7 @@ package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.stats.FactIssueGridDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 网格议题数量(按日)
@ -29,5 +30,14 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface FactIssueGridDailyDao extends BaseDao<FactIssueGridDailyEntity> {
/**
* 删除
* @author zhaoqifeng
* @date 2020/6/23 14:02
* @param customerId
* @param dateId
* @return void
*/
void deleteByCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId);
}

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

@ -42,4 +42,14 @@ public interface FactIssueGridMonthlyDao extends BaseDao<FactIssueGridMonthlyEnt
* @return java.util.List<com.epmet.dto.stats.FactIssueGridMonthlyDTO>
*/
List<FactIssueGridMonthlyDTO> selectGridMonthlyInc(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 删除
* @author zhaoqifeng
* @date 2020/6/23 14:02
* @param customerId
* @param monthId
* @return void
*/
void deleteByCustomerId(@Param("customerId") String customerId, @Param("monthId") String monthId);
}

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java

@ -23,7 +23,6 @@ import com.epmet.entity.voice.ArticleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
@ -43,15 +42,14 @@ public interface ArticleDao extends BaseDao<ArticleEntity> {
* @param publisherType
* @return
*/
List<ArticleGridPublishedSummaryDTO> getAllPublishedCount(@Param("customerId") String customerId, @Param("publishDate") Date publishDate, @Param("publisherType") String publisherType);
List<ArticleGridPublishedSummaryDTO> getAllPublishedCount(@Param("customerId") String customerId, @Param("publishDate") String publishDate, @Param("publisherType") String publisherType);
/**
* desc:根据客户Id 和发布时间 获取文章数据
*
* @param customerId
* @param publishDate
* @param publisherType
* @return
*/
List<ArticleEntity> getPublishedArticleByDay(@Param("customerId") String customerId, @Param("publishDate") Date publishDate, @Param("publisherType") String publisherType);
List<ArticleEntity> getPublishedArticleByDay(@Param("customerId") String customerId, @Param("publishDate") String publishDate);
}

10
epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridDailyDao.java → epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleOperateRecordDao.java

@ -15,19 +15,19 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.publicity;
package com.epmet.dao.voice;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.publicity.FactTagViewedGridDailyEntity;
import com.epmet.entity.voice.ArticleOperateRecordEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 文章引用标签阅读数量网格日统计
* 文章操作记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-19
* @since v1.0.0 2020-06-17
*/
@Mapper
public interface FactTagViewedGridDailyDao extends BaseDao<FactTagViewedGridDailyEntity> {
public interface ArticleOperateRecordDao extends BaseDao<ArticleOperateRecordEntity> {
}

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedAgencyDailyEntity.java

@ -55,6 +55,11 @@ public class FactArticlePublishedAgencyDailyEntity extends BaseEpmetEntity {
*/
private Integer articleTotalCount;
/**
* 今日发布文章数
*/
private Integer publishedCount;
/**
* 当前发文数量 当前未下线的文章数量
*/

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedDepartmentDailyEntity.java

@ -55,6 +55,11 @@ public class FactArticlePublishedDepartmentDailyEntity extends BaseEpmetEntity {
*/
private Integer articleTotalCount;
/**
* 今日发布文章数
*/
private Integer publishedCount;
/**
* 当前发文数量 当前未下线的文章数量
*/

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedGridDailyEntity.java

@ -55,6 +55,11 @@ public class FactArticlePublishedGridDailyEntity extends BaseEpmetEntity {
*/
private Integer articleTotalCount;
/**
* 今日发布文章数
*/
private Integer publishedCount;
/**
* 当前发文数量 当前未下线的文章数量
*/

36
epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridMonthlyEntity.java → epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleOperateRecordEntity.java

@ -15,7 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.publicity;
package com.epmet.entity.voice;
import com.baomidou.mybatisplus.annotation.TableName;
@ -26,51 +26,51 @@ import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 文章引用标签阅读数量网格月统计
* 文章操作记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-19
* @since v1.0.0 2020-06-17
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_tag_viewed_grid_monthly")
public class FactTagViewedGridMonthlyEntity extends BaseEpmetEntity {
@TableName("article_operate_record")
public class ArticleOperateRecordEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID 客户ID
* 客户ID
*/
private String customerId;
/**
* 文章发布所属机关ID 文章发布所属机关ID
* 文章ID
*/
private String agencyId;
private String articleId;
/**
* 网格ID
* 网格ID下线文章时多个以英文:隔开
*/
private String gridId;
private String gridIds;
/**
* 标签ID 标签ID
* 执行人 xx街道-xx中心-姓名
*/
private String tagId;
private String opUser;
/**
* 标签名称 标签名称
* 操作内容 操作内容eg重新编辑文章
*/
private String tagName;
private String content;
/**
* 文章引用标签阅读数 文章引用标签阅读数
* 操作类型 发布文章publish取消文章置顶canceltop设置置顶settop下线文章offline修改文章发布范围updatepublishrange
*/
private Integer tagReadCount;
private String opType;
/**
* 月份ID 月份ID eg2020-06 = 2020年6月2020-07 = 2020年7月
* 操作时间
*/
private String monthId;
private Date opTime;
}

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

@ -8,7 +8,13 @@ public interface StatsProjectService {
/**
* @Author sun
* @Description 数据-项目-机关网格()统计
* @Description 数据-项目-机关日()统计
**/
void agencyGridProjectStats();
void agencyProjectStats();
/**
* @Author sun
* @Description 数据-项目-网格日()统计
**/
void gridProjectStats();
}

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java

@ -1,7 +1,6 @@
package com.epmet.service.group;
import com.epmet.dto.group.result.*;
import com.epmet.entity.stats.DimGridEntity;
import com.epmet.util.DimIdGenerator;
import org.apache.ibatis.annotations.Param;
@ -18,7 +17,7 @@ public interface GroupDataService {
* @param customerId
* @author zxc
*/
List<GroupGridDailyResultDTO> groupGridDaily(String customerId, DimIdGenerator.DimIdBean dimIdBean, List<DimGridEntity> gridsInfo);
List<GroupGridDailyResultDTO> groupGridDaily(String customerId, DimIdGenerator.DimIdBean dimIdBean, List<GridIdListByCustomerResultDTO> gridsInfo);
/**
* @Description 获取同级机关下网格下的小组数量

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java

@ -36,7 +36,7 @@ public class GroupDataServiceImpl implements GroupDataService {
* @author zxc
*/
@Override
public List<GroupGridDailyResultDTO> groupGridDaily(String customerId, DimIdGenerator.DimIdBean dimTime, List<DimGridEntity> gridsInfo) {
public List<GroupGridDailyResultDTO> groupGridDaily(String customerId, DimIdGenerator.DimIdBean dimTime, List<GridIdListByCustomerResultDTO> gridsInfo) {
List<GroupGridDailyResultDTO> result = new ArrayList<>();
if (gridsInfo.size() == NumConstant.ZERO){
return new ArrayList<>();
@ -46,7 +46,7 @@ public class GroupDataServiceImpl implements GroupDataService {
GroupGridDailyResultDTO dailyResult = new GroupGridDailyResultDTO();
BeanUtils.copyProperties(dimTime,dailyResult);
dailyResult.setAgencyId(grid.getAgencyId());
dailyResult.setGridId(grid.getId());
dailyResult.setGridId(grid.getGridId());
dailyResult.setCustomerId(customerId);
result.add(dailyResult);
});

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java

@ -104,7 +104,7 @@ public class StatsDimServiceImpl implements StatsDimService {
lastExecRecord = lastExecRecordService.createLastExecRecord(StatsSubject.DIM_AGENCY);
}
Date statsEndTime = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD);
Date statsEndTime = new Date();
Date statsStartTime = null;
if (lastExecRecord.getExecTime() != null) {
statsStartTime = DateUtils.integrate(lastExecRecord.getExecTime(), DateUtils.DATE_PATTERN_YYYYMMDD);
@ -126,7 +126,7 @@ public class StatsDimServiceImpl implements StatsDimService {
lastExecRecord = lastExecRecordService.createLastExecRecord(StatsSubject.DIM_CUSTOMER);
}
Date statsEndTime = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD);
Date statsEndTime = new Date();
Date statsStartTime = null;
if (lastExecRecord.getExecTime() != null) {
statsStartTime = DateUtils.integrate(lastExecRecord.getExecTime(), DateUtils.DATE_PATTERN_YYYYMMDD);
@ -145,7 +145,7 @@ public class StatsDimServiceImpl implements StatsDimService {
lastExecRecord = lastExecRecordService.createLastExecRecord(StatsSubject.DIM_DEPARTMENT);
}
Date statsEndTime = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD);
Date statsEndTime = new Date();
Date statsStartTime = null;
if (lastExecRecord.getExecTime() != null) {
statsStartTime = DateUtils.integrate(lastExecRecord.getExecTime(), DateUtils.DATE_PATTERN_YYYYMMDD);

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

@ -1,18 +1,19 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.GroupConstant;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.group.form.AgencyMonthlyFormDTO;
import com.epmet.dto.group.result.*;
import com.epmet.dto.stats.DimAgencyDTO;
import com.epmet.entity.stats.DimAgencyEntity;
import com.epmet.entity.stats.DimGridEntity;
import com.epmet.service.StatsGroupService;
import com.epmet.service.group.GroupDataService;
import com.epmet.service.org.CustomerGridService;
import com.epmet.service.stats.*;
import com.epmet.util.DimIdGenerator;
import com.epmet.util.ModuleConstant;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -30,6 +31,7 @@ import java.util.stream.Collectors;
* @CreateTime 2020/6/16 14:14
*/
@Service
@Slf4j
public class StatsGroupServiceImpl implements StatsGroupService {
@Autowired
@ -58,17 +60,26 @@ public class StatsGroupServiceImpl implements StatsGroupService {
public void groupGridDaily(Date date) {
Integer pageNo = NumConstant.ONE;
Integer pageSize = NumConstant.ONE_HUNDRED;
List<String> customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize);
if (customerIds.size() == NumConstant.ZERO){
return;
}
customerIds.forEach(customerId -> {
DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date);
List<DimGridEntity> gridsInfo = dimGridService.getGridListByCustomerId(customerId);
List<GroupGridDailyResultDTO> resultDTOS = groupDataService.groupGridDaily(customerId,dimIdBean,gridsInfo);
factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS,customerId);
});
List<String> customerIds;
do {
customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize);
if (customerIds.size() != NumConstant.ZERO){
customerIds.forEach(customerId -> {
try {
DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date);
// List<DimGridEntity> gridsInfo = dimGridService.getGridListByCustomerId(customerId);
List<GridIdListByCustomerResultDTO> gridsInfo = customerGridService.getCustomerGridIdList(customerId, dimIdBean.getDateId());
List<GroupGridDailyResultDTO> resultDTOS = groupDataService.groupGridDaily(customerId,dimIdBean,gridsInfo);
factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS,customerId);
} catch (Exception e) {
log.error(GroupConstant.ERRORGRIDDAILY+customerId,e);
}
});
}
}while (customerIds.size() != NumConstant.ZERO && customerIds.size() == pageSize);
}
/**
@ -79,17 +90,22 @@ public class StatsGroupServiceImpl implements StatsGroupService {
public void groupAgencyDaily(Date date) {
Integer pageNo = NumConstant.ONE;
Integer pageSize = NumConstant.ONE_HUNDRED;
List<String> customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize);
if (customerIds.size() == NumConstant.ZERO){
return;
}
DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date);
customerIds.forEach(customerId -> {
List<DimAgencyDTO> customerAgencyInfos = dimAgencyService.getAgencyInfoByCustomerId(customerId);
List<AgencyGroupDailyResultDTO> agencyGroupDaily = this.getAgencyGroupDaily(customerAgencyInfos, dimIdBean, customerId);
factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily,customerId);
});
List<String> customerIds;
do {
customerIds = dimCustomerService.selectCustomerIdPage(pageNo++,pageSize);
if (customerIds.size() != NumConstant.ZERO){
DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date);
customerIds.forEach(customerId -> {
try {
List<DimAgencyDTO> customerAgencyInfos = dimAgencyService.getAgencyInfoByCustomerId(customerId);
List<AgencyGroupDailyResultDTO> agencyGroupDaily = this.getAgencyGroupDaily(customerAgencyInfos, dimIdBean, customerId);
factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily,customerId);
} catch (Exception e) {
log.error(GroupConstant.ERRORAGENCYDAILY+customerId,e);
}
});
}
}while (customerIds.size() != NumConstant.ZERO && customerIds.size() == pageSize);
}
/**
@ -136,12 +152,12 @@ public class StatsGroupServiceImpl implements StatsGroupService {
String pidByAgencyId = dimAgencyService.getPidByAgencyId(agencyId);
agencyResult.setPid(StringUtils.isBlank(pidByAgencyId)?"0":pidByAgencyId);
// TODO 1. 机关下有多少网格
List<String> customerGridIdList = customerGridService.getCustomerGridIdList(customerId, dateId);
List<GridIdListByCustomerResultDTO> customerGridIdList = customerGridService.getCustomerGridIdList(customerId, dateId);
AtomicReference<Integer> gridSize = new AtomicReference<>(0);
if (customerGridIdList.size() != NumConstant.ZERO){
customerGridIdList.forEach(gridId -> {
allGrid.forEach(allAgencyGrid -> {
if (gridId.equals(allAgencyGrid)){
if (gridId.getGridId().equals(allAgencyGrid)){
gridSize.updateAndGet(v -> v + NumConstant.ONE);
}
});
@ -258,6 +274,8 @@ public class StatsGroupServiceImpl implements StatsGroupService {
/**
* @Description 获取时间维度 dateId--weekId--monthId--quarterId--yearId
* 如果有自定义时间根据自定义时间获取时间维度
* 没有自定义时间默认获取前一天的时间维度
* @param
* @author zxc
*/

65
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java

@ -96,6 +96,10 @@ public class StatsIssueServiceImpl implements StatsIssueService {
String dateString = DateUtils.format(date);
DimAgencyDTO dimAgencyDTO = new DimAgencyDTO();
dimAgencyDTO.setCustomerId(customerId);
//获取日期相关维度
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date);
//清空数据
factIssueAgencyDailyService.deleteByCustomerId(customerId, dimId.getDateId());
//获取当前客户下所有机关
List<DimAgencyDTO> agencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO);
//获取机关下议题各种状态的数目统计
@ -110,8 +114,6 @@ public class StatsIssueServiceImpl implements StatsIssueService {
List<ProjectAgencyDTO> projectAgencyClosedTotalList = projectService.getAgencyClosedProjectTotal(customerId, dateString);
//已结案项目增量
List<ProjectAgencyDTO> projectAgencyClosedIncList = projectService.getAgencyClosedProjectInc(customerId, dateString);
//获取日期相关维度
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date);
List<FactIssueAgencyDailyEntity> list = new ArrayList<>();
for (DimAgencyDTO agency : agencyList) {
@ -149,7 +151,7 @@ public class StatsIssueServiceImpl implements StatsIssueService {
list.add(entity);
}
//批量插入
factIssueAgencyDailyService.insertBatch(list);
factIssueAgencyDailyService.saveList(list);
}
@Override
@ -157,6 +159,10 @@ public class StatsIssueServiceImpl implements StatsIssueService {
String dateString = DateUtils.format(date);
DimAgencyDTO dimAgencyDTO = new DimAgencyDTO();
dimAgencyDTO.setCustomerId(customerId);
//获取日期相关维度
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date);
//清空数据
factIssueAgencyMonthlyService.deleteByCustomerId(customerId, dimId.getMonthId());
//获取当前客户下所有机关
List<DimAgencyDTO> agencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO);
//获取机关下议题各种状态的数目统计
@ -165,11 +171,8 @@ public class StatsIssueServiceImpl implements StatsIssueService {
List<IssueAgencyDTO> issueAgencyClosedTotalList = issueService.getAgencyClosedIssueTotal(customerId, dateString);
//已结案项目统计
List<ProjectAgencyDTO> projectAgencyClosedTotalList = projectService.getAgencyClosedProjectTotal(customerId, dateString);
//获取日期相关维度
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date);
//统计机关下议题各个指标月度增量
List<FactIssueAgencyMonthlyDTO> issueAgencyMonthlyIncList = factIssueAgencyMonthlyService.getAgencyMonthlyInc(customerId, dimId.getMonthId());
List<FactIssueAgencyMonthlyEntity> list = new ArrayList<>();
for (DimAgencyDTO agency : agencyList) {
FactIssueAgencyDailyEntity daily = initIssueAgencyDaily(dimId);
@ -215,7 +218,7 @@ public class StatsIssueServiceImpl implements StatsIssueService {
list.add(monthly);
}
//批量插入
factIssueAgencyMonthlyService.insertBatch(list);
factIssueAgencyMonthlyService.saveList(list);
}
@Override
@ -225,6 +228,8 @@ public class StatsIssueServiceImpl implements StatsIssueService {
dimAgencyDTO.setCustomerId(customerId);
//获取日期相关维度
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date);
//清空数据
factIssueGridDailyService.deleteByCustomerId(customerId, dimId.getDateId());
//获取客户下所有网格数据
List<DimGridEntity> gridList = dimGridService.getGridListByCustomerId(customerId);
//获取网格下议题各种状态的数目统计
@ -241,6 +246,7 @@ public class StatsIssueServiceImpl implements StatsIssueService {
List<ProjectGridDTO> closedProjectTotalList = projectService.getGridClosedProjectTotal(customerId, dateString);
//已结案项目增量
List<ProjectGridDTO> closedProjectIncList = projectService.getGridClosedProjectTotal(customerId, dateString);
Map<String, Long> resolveMap= new HashMap<>();
Map<String, Long> unResolveMap = new HashMap<>();
Map<String, Long> resolveIncMap = new HashMap<>();
@ -313,7 +319,7 @@ public class StatsIssueServiceImpl implements StatsIssueService {
saveClosedProject(resolveMap, unResolveMap, resolveIncMap, unResolveIncMap, grid, entity);
list.add(entity);
}
factIssueGridDailyService.insertBatch(list);
factIssueGridDailyService.saveList(list);
}
@Override
@ -323,6 +329,8 @@ public class StatsIssueServiceImpl implements StatsIssueService {
dimAgencyDTO.setCustomerId(customerId);
//获取日期相关维度
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date);
//清空数据
factIssueGridMonthlyService.deleteByCustomerId(customerId, dimId.getMonthId());
//获取客户下所有网格数据
List<DimGridEntity> gridList = dimGridService.getGridListByCustomerId(customerId);
//获取网格下议题各种状态的数目统计
@ -383,12 +391,11 @@ public class StatsIssueServiceImpl implements StatsIssueService {
monthly.setClosedCaseResolvedTotal(resolve);
monthly.setClosedCaseUnresolvedTotal(unResolve);
if(total > NumConstant.ZERO) {
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
BigDecimal resolved = new BigDecimal(resolve);
BigDecimal unresolved = new BigDecimal(unResolve);
BigDecimal closed = new BigDecimal(total);
monthly.setClosedCaseResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP));
monthly.setClosedCaseUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP));
monthly.setClosedCaseResolvedPercent(resolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP));
monthly.setClosedCaseUnresolvedPercent(unresolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP));
}
//各指标增量统计
@ -413,7 +420,7 @@ public class StatsIssueServiceImpl implements StatsIssueService {
monthly.setGridId(grid.getId());
list.add(monthly);
}
factIssueGridMonthlyService.insertBatch(list);
factIssueGridMonthlyService.saveList(list);
}
/**
@ -443,12 +450,11 @@ public class StatsIssueServiceImpl implements StatsIssueService {
entity.setClosedCaseResolvedIncr(resolveInc);
entity.setClosedCaseUnresolvedIncr(unResolveInc);
if(total != NumConstant.ZERO) {
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
BigDecimal resolved = new BigDecimal(resolve);
BigDecimal unresolved = new BigDecimal(unResolve);
BigDecimal closed = new BigDecimal(total);
entity.setClosedCaseResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP));
entity.setClosedCaseUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP));
entity.setClosedCaseResolvedPercent(resolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP));
entity.setClosedCaseUnresolvedPercent(unresolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP));
}
}
@ -513,12 +519,11 @@ public class StatsIssueServiceImpl implements StatsIssueService {
entity.setClosedResolvedTotal(resolvedCount);
entity.setClosedUnresolvedTotal(unresolvedCount);
if(entity.getClosedTotal() > NumConstant.ZERO) {
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
BigDecimal resolved = new BigDecimal(resolvedCount);
BigDecimal unresolved = new BigDecimal(unresolvedCount);
BigDecimal closed = new BigDecimal(entity.getClosedTotal());
entity.setClosedResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP));
entity.setClosedUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP));
entity.setClosedResolvedPercent(resolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP));
entity.setClosedUnresolvedPercent(unresolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP));
}
}
@ -597,14 +602,13 @@ public class StatsIssueServiceImpl implements StatsIssueService {
entity.setClosedTotal(closedCount);
entity.setIssueTotal(issueTotal);
if (NumConstant.ZERO != issueTotal) {
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
BigDecimal voting = new BigDecimal(votingCount);
BigDecimal shift = new BigDecimal(shiftCount);
BigDecimal closed = new BigDecimal(closedCount);
BigDecimal total = new BigDecimal(issueTotal);
entity.setVotingPercent(voting.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP));
entity.setShiftProjectPercent(shift.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP));
entity.setClosedPercent(closed.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP));
entity.setVotingPercent(voting.divide(total, NumConstant.SIX, RoundingMode.HALF_UP));
entity.setShiftProjectPercent(shift.divide(total, NumConstant.SIX, RoundingMode.HALF_UP));
entity.setClosedPercent(closed.divide(total, NumConstant.SIX, RoundingMode.HALF_UP));
}
}
@ -676,12 +680,11 @@ public class StatsIssueServiceImpl implements StatsIssueService {
entity.setClosedCaseUnresolvedTotal(unresolvedCount);
entity.setClosedCaseTotal(total);
if (total > NumConstant.ZERO) {
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
BigDecimal resolved = new BigDecimal(resolvedCount);
BigDecimal unresolved = new BigDecimal(unresolvedCount);
BigDecimal closed = new BigDecimal(total);
entity.setClosedCaseResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP));
entity.setClosedCaseUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP));
entity.setClosedCaseResolvedPercent(resolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP));
entity.setClosedCaseUnresolvedPercent(unresolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP));
}
}
@ -763,14 +766,13 @@ public class StatsIssueServiceImpl implements StatsIssueService {
entity.setClosedTotal(closedCount);
entity.setIssueTotal(issueTotal);
if (NumConstant.ZERO != issueTotal) {
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
BigDecimal voting = new BigDecimal(votingCount);
BigDecimal shift = new BigDecimal(shiftCount);
BigDecimal closed = new BigDecimal(closedCount);
BigDecimal total = new BigDecimal(issueTotal);
entity.setVotingPercent(voting.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP));
entity.setShiftProjectPercent(shift.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP));
entity.setClosedPercent(closed.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP));
entity.setVotingPercent(voting.divide(total, NumConstant.SIX, RoundingMode.HALF_UP));
entity.setShiftProjectPercent(shift.divide(total, NumConstant.SIX, RoundingMode.HALF_UP));
entity.setClosedPercent(closed.divide(total, NumConstant.SIX, RoundingMode.HALF_UP));
}
}
@ -806,12 +808,11 @@ public class StatsIssueServiceImpl implements StatsIssueService {
entity.setClosedResolvedTotal(resolvedCount);
entity.setClosedUnresolvedTotal(unresolvedCount);
if (entity.getClosedTotal() > NumConstant.ZERO) {
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
BigDecimal resolved = new BigDecimal(resolvedCount);
BigDecimal unresolved = new BigDecimal(unresolvedCount);
BigDecimal closed = new BigDecimal(entity.getClosedTotal());
entity.setClosedResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP));
entity.setClosedUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP));
entity.setClosedResolvedPercent(resolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP));
entity.setClosedUnresolvedPercent(unresolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP));
}
}

183
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java

@ -14,8 +14,9 @@ import com.epmet.service.project.ProjectProcessService;
import com.epmet.service.project.ProjectService;
import com.epmet.service.stats.*;
import com.epmet.util.DimIdGenerator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
@ -34,6 +35,7 @@ import java.util.concurrent.atomic.AtomicInteger;
@Service
public class StatsProjectServiceImpl implements StatsProjectService {
protected static final Logger log = LoggerFactory.getLogger(StatsProjectServiceImpl.class);
@Autowired
private DimCustomerService dimCustomerService;
@Autowired
@ -57,10 +59,10 @@ public class StatsProjectServiceImpl implements StatsProjectService {
/**
* @Author sun
* @Description 数据-项目-机关网格()统计
* @Description 数据-项目-机关日()统计
**/
@Override
public void agencyGridProjectStats() {
public void agencyProjectStats() {
int pageNo = 1;
int pageSize = 100;
List<String> customerIdList = null;
@ -68,8 +70,13 @@ public class StatsProjectServiceImpl implements StatsProjectService {
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize);
if (!CollectionUtils.isEmpty(customerIdList)) {
for (String customerId : customerIdList) {
//遍历统计每一个客户数据
customerStats(customerId);
try {
//遍历统计每一个客户数据
customerAgencyStats(customerId);
} catch (Exception e) {
log.error("项目-机关-数据统计程序错误,对应客户Id:"+customerId, e);
log.error("Error creating model JSON", e);
}
}
}
} while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize);
@ -77,11 +84,10 @@ public class StatsProjectServiceImpl implements StatsProjectService {
/**
* @Author sun
* @Description 一个客户一个线程, 分别统计机关/网格/月数据
* @Description 分别统计机关日/月数据
**/
@Async
public void customerStats(String customerId) {
Date date = new Date();
public void customerAgencyStats(String customerId) {
Date date = yesterDay();
//1:查询各维度表Id,方便使用
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date);
@ -90,39 +96,25 @@ public class StatsProjectServiceImpl implements StatsProjectService {
dimAgencyDTO.setCustomerId(customerId);
List<DimAgencyDTO> dimAgencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO);
//3:根据客户Id查询网格维度表数据
List<DimGridEntity> dimGridList = dimGridService.getGridListByCustomerId(customerId);
//4:根据客户Id查询项目业务表已结案数据(查询传入日期及之前的数据)
//3:根据客户Id查询项目业务表已结案数据(查询传入日期及之前的数据)
ProjectEntity projectEntity = new ProjectEntity();
projectEntity.setCustomerId(customerId);
projectEntity.setCreatedTime(date);
projectEntity.setStatus(ProjectConstant.CLOSED);
List<ProjectEntity> projectList = projectService.getProjectList(projectEntity);
//5:查询项目处理进展表中有效数据(创建日期截取yyyy-mm-dd格式字段值)(查询传入日期及之前的数据)
//4:查询项目处理进展表中有效数据(创建日期截取yyyy-mm-dd格式字段值)(查询传入日期及之前的数据)
List<ProjectProcessEntity> processList = projectProcessService.getProcessList(projectEntity);
//6:机关层级日月统计
//5:机关层级日月统计
if (null != dimAgencyList && dimAgencyList.size() > NumConstant.ZERO) {
//6.1:执行机关日数据统计
//5.1:执行机关日数据统计
agencyDateProjectStats(customerId, dimId, dimAgencyList, projectList, processList);
//6.2:执行机关月数据统计
if (Calendar.getInstance().get(Calendar.DATE) == 1) {
//5.2:执行机关月数据统计
//if (Calendar.getInstance().get(Calendar.DATE) == 1) {
agencyMonthProjectStats(customerId, dimId, dimAgencyList);
}
}
//7:网格层级日月统计
if (null != dimGridList && dimGridList.size() > NumConstant.ZERO) {
//7.1:执行网格日数据统计
gridDateProjectStats(customerId, dimId, dimGridList, projectList, processList);
//7.2:执行网格月数据统计
if (Calendar.getInstance().get(Calendar.DATE) == 1) {
gridMonthProjectStats(customerId, dimId, dimGridList);
}
//}
}
}
@ -138,7 +130,7 @@ public class StatsProjectServiceImpl implements StatsProjectService {
List<FactAgencyProjectDailyEntity> projectDateEntityList = new ArrayList<>();
//计算百分比使用,保留小数点后两位
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(2);
numberFormat.setMaximumFractionDigits(6);
//1:遍历机关维度数据,统计每个机关各项指标数
for (DimAgencyDTO agency : dimAgencyList) {
@ -232,12 +224,12 @@ public class StatsProjectServiceImpl implements StatsProjectService {
agencyDailyEntity.setResolvedTotal(resolvedTotal.intValue());
agencyDailyEntity.setUnresolvedTotal(unResolvedTotal.intValue());
if (projectTotal.intValue() > NumConstant.ZERO) {
agencyDailyEntity.setPendingRatio(new BigDecimal(numberFormat.format((float) agencyDailyEntity.getPendingTotal() / (float) projectTotal.intValue() * 100)));
agencyDailyEntity.setClosedRatio(new BigDecimal(numberFormat.format((float) closedTotal.intValue() / (float) projectTotal.intValue() * 100)));
agencyDailyEntity.setPendingRatio(new BigDecimal(numberFormat.format((float) agencyDailyEntity.getPendingTotal() / (float) projectTotal.intValue())));
agencyDailyEntity.setClosedRatio(new BigDecimal(numberFormat.format((float) closedTotal.intValue() / (float) projectTotal.intValue())));
}
if (closedTotal.intValue() > NumConstant.ZERO) {
agencyDailyEntity.setResolvedRatio(new BigDecimal(numberFormat.format((float) resolvedTotal.intValue() / (float) closedTotal.intValue() * 100)));
agencyDailyEntity.setUnresolvedRatio(new BigDecimal(numberFormat.format((float) unResolvedTotal.intValue() / (float) closedTotal.intValue() * 100)));
agencyDailyEntity.setResolvedRatio(new BigDecimal(numberFormat.format((float) resolvedTotal.intValue() / (float) closedTotal.intValue())));
agencyDailyEntity.setUnresolvedRatio(new BigDecimal(numberFormat.format((float) unResolvedTotal.intValue() / (float) closedTotal.intValue())));
}
agencyDailyEntity.setProjectIncr(projectIncr.intValue());
agencyDailyEntity.setPendingIncr(projectIncr.intValue() - closedIncr.intValue());
@ -276,8 +268,7 @@ public class StatsProjectServiceImpl implements StatsProjectService {
//1:获取昨天日期所在月份的起始日期和结束日期
MonthProjectListFormDTO formDTO = new MonthProjectListFormDTO();
formDTO.setCustomerId(customerId);
formDTO.setStartTime(getMonthBegin(date));
formDTO.setEndTime(getMonthEnd(date));
formDTO.setMonthId(dimId.getMonthId());
//2:遍历机关维度数据,分别统计每个组织月数据
for (DimAgencyDTO agency : dimAgencyList) {
@ -342,6 +333,65 @@ public class StatsProjectServiceImpl implements StatsProjectService {
}
/**
* @Author sun
* @Description 数据-项目-机关日()统计
**/
@Override
public void gridProjectStats() {
int pageNo = 1;
int pageSize = 100;
List<String> customerIdList = null;
do {
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize);
if (!CollectionUtils.isEmpty(customerIdList)) {
for (String customerId : customerIdList) {
try {
//遍历统计每一个客户数据
customerGridStats(customerId);
} catch (Exception e) {
log.error("项目-网格-数据统计程序错误,对应客户Id:"+customerId, e);
log.error("Error creating model JSON", e);
}
}
}
} while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize);
}
/**
* @Author sun
* @Description 分别统计网格日/月数据
**/
public void customerGridStats(String customerId) {
Date date = yesterDay();
//1:查询各维度表Id,方便使用
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date);
//2:根据客户Id查询网格维度表数据
List<DimGridEntity> dimGridList = dimGridService.getGridListByCustomerId(customerId);
//3:根据客户Id查询项目业务表已结案数据(查询传入日期及之前的数据)
ProjectEntity projectEntity = new ProjectEntity();
projectEntity.setCustomerId(customerId);
projectEntity.setCreatedTime(date);
projectEntity.setStatus(ProjectConstant.CLOSED);
List<ProjectEntity> projectList = projectService.getProjectList(projectEntity);
//4:查询项目处理进展表中有效数据(创建日期截取yyyy-mm-dd格式字段值)(查询传入日期及之前的数据)
List<ProjectProcessEntity> processList = projectProcessService.getProcessList(projectEntity);
//5:网格层级日月统计
if (null != dimGridList && dimGridList.size() > NumConstant.ZERO) {
//5.1:执行网格日数据统计
gridDateProjectStats(customerId, dimId, dimGridList, projectList, processList);
//5.2:执行网格月数据统计
//if (Calendar.getInstance().get(Calendar.DATE) == 1) {
gridMonthProjectStats(customerId, dimId, dimGridList);
//}
}
}
/**
* @param customerId
* @return
@ -354,7 +404,7 @@ public class StatsProjectServiceImpl implements StatsProjectService {
List<FactGridProjectDailyEntity> gridDateEntityList = new ArrayList<>();
//计算百分比使用,保留小数点后两位
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(2);
numberFormat.setMaximumFractionDigits(6);
//1:根据客户Id查询议题库已转项目的网格项目关系数据
List<IssueEntity> gridProjectList = issueService.getGridProjectList(customerId);
@ -448,12 +498,12 @@ public class StatsProjectServiceImpl implements StatsProjectService {
gridDailyEntity.setResolvedTotal(resolvedTotal.intValue());
gridDailyEntity.setUnresolvedTotal(unResolvedTotal.intValue());
if (projectTotal.intValue() > NumConstant.ZERO) {
gridDailyEntity.setPendingRatio(new BigDecimal(numberFormat.format((float) gridDailyEntity.getPendingTotal() / (float) projectTotal.intValue() * 100)));
gridDailyEntity.setClosedRatio(new BigDecimal(numberFormat.format((float) closedTotal.intValue() / (float) projectTotal.intValue() * 100)));
gridDailyEntity.setPendingRatio(new BigDecimal(numberFormat.format((float) gridDailyEntity.getPendingTotal() / (float) projectTotal.intValue())));
gridDailyEntity.setClosedRatio(new BigDecimal(numberFormat.format((float) closedTotal.intValue() / (float) projectTotal.intValue())));
}
if (closedTotal.intValue() > NumConstant.ZERO) {
gridDailyEntity.setResolvedRatio(new BigDecimal(numberFormat.format((float) resolvedTotal.intValue() / (float) closedTotal.intValue() * 100)));
gridDailyEntity.setUnresolvedRatio(new BigDecimal(numberFormat.format((float) unResolvedTotal.intValue() / (float) closedTotal.intValue() * 100)));
gridDailyEntity.setResolvedRatio(new BigDecimal(numberFormat.format((float) resolvedTotal.intValue() / (float) closedTotal.intValue())));
gridDailyEntity.setUnresolvedRatio(new BigDecimal(numberFormat.format((float) unResolvedTotal.intValue() / (float) closedTotal.intValue())));
}
gridDailyEntity.setProjectIncr(projectIncr.intValue());
gridDailyEntity.setPendingIncr(projectIncr.intValue() - closedIncr.intValue());
@ -489,15 +539,14 @@ public class StatsProjectServiceImpl implements StatsProjectService {
//批量月数据新增对象
List<FactGridProjectMonthlyEntity> monthlyEntityList = new ArrayList<>();
//1:获取昨天日期所在月份的起始日期和结束日期
//1:查询客户网格月份内日统计数据
MonthProjectListFormDTO formDTO = new MonthProjectListFormDTO();
formDTO.setCustomerId(customerId);
formDTO.setStartTime(getMonthBegin(yesterDay()));
formDTO.setEndTime(getMonthEnd(yesterDay()));
formDTO.setMonthId(dimId.getMonthId());
//2:遍历网格维度数据,分别统计每个网格月数据
for (DimGridEntity grid : dimGridList) {
//2.1:查询上一月网格日统计数据,按时间倒序
//2.1:查询当前月网格日统计数据,按时间倒序
formDTO.setGridId(grid.getId());
List<FactGridProjectDailyEntity> projectDailyList = factGridProjectDailyService.getMonthProjectList(formDTO);
@ -575,46 +624,4 @@ public class StatsProjectServiceImpl implements StatsProjectService {
return date;
}
/**
* @Author sun
* @Description 获取指定日期所在月份开始的时间
**/
public Date getMonthBegin(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
//设置为1号,当前日期既为本月第一天
c.set(Calendar.DAY_OF_MONTH, 1);
//将小时至0
c.set(Calendar.HOUR_OF_DAY, 0);
//将分钟至0
c.set(Calendar.MINUTE, 0);
//将秒至0
c.set(Calendar.SECOND, 0);
//将毫秒至0
c.set(Calendar.MILLISECOND, 0);
//获取本月第一天的时间
return c.getTime();
}
/**
* @Author sun
* @Description 获取指定日期所在月份结束的时间
**/
public Date getMonthEnd(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
//设置为当月最后一天
c.set(Calendar.DAY_OF_MONTH, c.getActualMaximum(Calendar.DAY_OF_MONTH));
//将小时至23
c.set(Calendar.HOUR_OF_DAY, 23);
//将分钟至59
c.set(Calendar.MINUTE, 59);
//将秒至59
c.set(Calendar.SECOND, 59);
//将毫秒至999
c.set(Calendar.MILLISECOND, 999);
//获取本月最后一天的时间
return c.getTime();
}
}

220
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java

@ -14,6 +14,7 @@ import com.epmet.entity.voice.ArticleEntity;
import com.epmet.entity.voice.ArticleTagsEntity;
import com.epmet.service.StatsPublicityService;
import com.epmet.service.stats.*;
import com.epmet.service.voice.ArticleOperateRecordService;
import com.epmet.service.voice.ArticleService;
import com.epmet.service.voice.ArticleTagsService;
import com.epmet.service.voice.ArticleVisitRecordService;
@ -55,6 +56,8 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
@Autowired
private ArticleVisitRecordService articleVisitRecordService;
@Autowired
private ArticleOperateRecordService articleOperateRecordService;
@Autowired
private FactArticlePublishedGridDailyService factArticlePublishedGridDailyService;
@Autowired
private FactArticlePublishedDepartmentDailyService factArticlePublishedDepartmentDailyService;
@ -107,27 +110,26 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
public Boolean articleSummaryDailyStatsjob(Date statsDate) {
//如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和
if (statsDate == null) {
//当天的凌晨时间 即为今天之前的数据
statsDate = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN);
//查询的是昨天及以前的数据
statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, -1), DateUtils.DATE_PATTERN);
} else {
statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN);
statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN);
}
DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate);
int pageNo = 1;
int pageSize = 100;
List<String> customerIdList = null;
String statsDateStr = DateUtils.format(statsDate);
do {
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize);
if (!CollectionUtils.isEmpty(customerIdList)) {
for (String customerId : customerIdList) {
Date finalStatsDate = statsDate;
try {
//key:所在机关Id
Map<String, ArticleGridPublishedSummaryDTO> agencySummaryMap = new HashMap<>();
statsPublishedGridDaily(finalStatsDate, dimIdBean, customerId, agencySummaryMap);
statsPublishedDepartmentDaily(finalStatsDate, dimIdBean, customerId, agencySummaryMap);
statsPublishedAgencyDaily(finalStatsDate, dimIdBean, customerId, agencySummaryMap);
statsPublishedGridDaily(statsDateStr, dimIdBean, customerId, agencySummaryMap);
statsPublishedDepartmentDaily(statsDateStr, dimIdBean, customerId, agencySummaryMap);
statsPublishedAgencyDaily(statsDateStr, dimIdBean, customerId, agencySummaryMap);
} catch (Exception e) {
log.error("articlePublishedCountDayStats exception", e);
}
@ -157,10 +159,10 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
if (!CollectionUtils.isEmpty(customerIdList)) {
for (String customerId : customerIdList) {
Date finalStatsDate = statsDate;
executorService.submit(() -> {
//executorService.submit(() -> {
//统计
statsTagUsedDaily(finalStatsDate, dimIdBean, customerId);
});
//});
}
}
} while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize);
@ -334,7 +336,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
return true;
}
private void statsPublishedDepartmentDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map<String, ArticleGridPublishedSummaryDTO> agencySummaryMap) {
private void statsPublishedDepartmentDaily(String statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map<String, ArticleGridPublishedSummaryDTO> agencySummaryMap) {
//获取所有客户
List<DimDepartmentEntity> departmentDTOList = dimDepartmentService.getDepartmentListByCustomerId(customerId);
if (CollectionUtils.isEmpty(departmentDTOList)) {
@ -345,7 +347,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
//转换为 需要插入的Entity
Map<String, FactArticlePublishedDepartmentDailyEntity> departmentDailyEntityMap = convertDepartmentDailyEntity(departmentDTOList, dimIdBean);
//获取当天的业务数据
List<ArticleGridPublishedSummaryDTO> publishedArticleCount = articleService.getAllDepartmentPublishedCount(customerId, DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN));
List<ArticleGridPublishedSummaryDTO> publishedArticleCount = articleService.getAllDepartmentPublishedCount(customerId, statsDate);
if (!CollectionUtils.isEmpty(publishedArticleCount)) {
for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) {
@ -356,6 +358,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
}
gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount());
gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount());
gridDailyEntities.setPublishedCount(summaryDTO.getPublishedCount());
//同一个机关下数据累加
buildAgencySummaryData(agencySummaryMap, summaryDTO);
}
@ -381,10 +384,12 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
summary.setPublisherId(summaryDTO.getPublisherId());
summary.setArticleTotalCount(summaryDTO.getArticleTotalCount());
summary.setArticlePublishedCount(summaryDTO.getArticlePublishedCount());
summary.setPublishedCount(summaryDTO.getPublishedCount());
result.put(summaryDTO.getPublisherId(), summaryDTO);
} else {
publishedSummaryDTO.setArticlePublishedCount(publishedSummaryDTO.getArticlePublishedCount() + summaryDTO.getArticlePublishedCount());
publishedSummaryDTO.setArticleTotalCount(publishedSummaryDTO.getArticleTotalCount() + summaryDTO.getArticlePublishedCount());
publishedSummaryDTO.setPublishedCount(publishedSummaryDTO.getPublishedCount() + summaryDTO.getPublishedCount());
}
}
@ -396,7 +401,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
* @param customerId
* @param agencySummaryMap
*/
private void statsPublishedGridDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map<String, ArticleGridPublishedSummaryDTO> agencySummaryMap) {
private void statsPublishedGridDaily(String statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map<String, ArticleGridPublishedSummaryDTO> agencySummaryMap) {
//获取所有网格
List<DimGridEntity> gridDTOList = dimGridService.getGridListByCustomerId(customerId);
if (CollectionUtils.isEmpty(gridDTOList)) {
@ -404,29 +409,34 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
return;
}
executorService.submit(() -> {
//转换为 需要插入的Entity
Map<String, FactArticlePublishedGridDailyEntity> gridDailyEntityMap = convertGridDailyEntity(gridDTOList, dimIdBean);
//获取当天的业务数据
List<ArticleGridPublishedSummaryDTO> publishedArticleCount = articleService.getAllGridPublishedCount(customerId, statsDate);
if (!CollectionUtils.isEmpty(publishedArticleCount)) {
for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) {
FactArticlePublishedGridDailyEntity gridDailyEntity = gridDailyEntityMap.get(summaryDTO.getGridId());
if (gridDailyEntity == null) {
log.error("publicitySummary getAllGridPublishedCount gridId:{} not exist in dimGrid", summaryDTO.getGridId());
continue;
try {
//转换为 需要插入的Entity
Map<String, FactArticlePublishedGridDailyEntity> gridDailyEntityMap = convertGridDailyEntity(gridDTOList, dimIdBean);
//获取当天的业务数据
List<ArticleGridPublishedSummaryDTO> publishedArticleCount = articleService.getAllGridPublishedCount(customerId, statsDate);
if (!CollectionUtils.isEmpty(publishedArticleCount)) {
for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) {
FactArticlePublishedGridDailyEntity gridDailyEntity = gridDailyEntityMap.get(summaryDTO.getPublisherId());
if (gridDailyEntity == null) {
log.error("publicitySummary getAllGridPublishedCount gridId:{} not exist in dimGrid", summaryDTO.getGridId());
continue;
}
gridDailyEntity.setArticleTotalCount(summaryDTO.getArticleTotalCount());
gridDailyEntity.setArticlePublishedCount(summaryDTO.getArticlePublishedCount());
gridDailyEntity.setPublishedCount(summaryDTO.getPublishedCount());
//同一个机关下数据累加
buildAgencySummaryData(agencySummaryMap, summaryDTO);
}
gridDailyEntity.setArticleTotalCount(summaryDTO.getArticleTotalCount());
gridDailyEntity.setArticlePublishedCount(summaryDTO.getArticlePublishedCount());
//同一个机关下数据累加
buildAgencySummaryData(agencySummaryMap, summaryDTO);
}
boolean b = factArticlePublishedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), gridDailyEntityMap.values());
} catch (Exception e) {
log.error("statsPublishedGridDaily exception customerId:{},statsDate:{}", customerId, statsDate);
}
boolean b = factArticlePublishedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), gridDailyEntityMap.values());
});
}
private void statsPublishedAgencyDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map<String, ArticleGridPublishedSummaryDTO> agencySummaryMap) {
private void statsPublishedAgencyDaily(String statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map<String, ArticleGridPublishedSummaryDTO> agencySummaryMap) {
//获取所有机关
List<DimAgencyEntity> agencyDTOList = dimAgencyService.getAgencyListByCustomerId(customerId);
if (CollectionUtils.isEmpty(agencyDTOList)) {
@ -434,6 +444,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
return;
}
executorService.submit(() -> {
try {
//转换为 需要插入的Entity
Map<String, FactArticlePublishedAgencyDailyEntity> agencyDailyEntityMap = convertAgencyDailyEntity(agencyDTOList, dimIdBean);
//获取当天的业务数据
@ -449,6 +460,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
}
gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount());
gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount());
gridDailyEntities.setPublishedCount(summaryDTO.getPublishedCount());
haveDataAgencyDailyMap.put(summaryDTO.getAgencyId(), gridDailyEntities);
//同一个机关下数据累加
//buildAgencySummaryData(agencySummaryMap, summaryDTO);
@ -459,6 +471,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
selfDaily.setAgencyId(summaryDTO.getAgencyId().concat(DimAgencyConstant.TYPE_SELF_ID_SUFFIX));
selfDaily.setArticleTotalCount(summaryDTO.getArticleTotalCount());
selfDaily.setArticlePublishedCount(summaryDTO.getArticlePublishedCount());
selfDaily.setPublishedCount(summaryDTO.getPublishedCount());
haveDataAgencyDailySelfMap.put(selfDaily.getAgencyId(), selfDaily);
}
}
@ -479,7 +492,12 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
if (!CollectionUtils.isEmpty(haveDataAgencyDailySelfMap)) {
agencyDailyEntityMap.putAll(haveDataAgencyDailySelfMap);
}
log.debug("statsPublishedAgencyDaily insert:{}",JSON.toJSONString(agencyDailyEntityMap.values()));
boolean b = factArticlePublishedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), agencyDailyEntityMap.values());
} catch (Exception e) {
e.printStackTrace();
log.error("statsPublishedAgencyDaily exception,customer:{}",customerId);
}
});
}
@ -492,77 +510,85 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
* @param customerId
*/
private void statsTagUsedDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId) {
//1.业务数据来源 发布时间为统计时间的
// 因为一个客户的发布文章数在同一天不会特别的多,所以以客户为单位查询今天发布的所有带有标签的文章 根据发布单位类型进行拆分
// 1.1查出今天所有的文章标签 根据网格Id
// 1.2
//获取所有网格
List<DimAgencyEntity> agencyDTOList = dimAgencyService.getAgencyListByCustomerId(customerId);
if (CollectionUtils.isEmpty(agencyDTOList)) {
log.warn("publicitySummary getAgencyListByCustomerId return empty,customerId:{}", customerId);
return;
}
//转换为 需要插入的Entity
Map<String, DimAgencyEntity> dimAgencyEntityMap = agencyDTOList.stream().collect(Collectors.toMap(DimAgencyEntity::getId, o -> o));
//转换为 需要插入的Entity key gridId_tagId
Map<String, FactTagUsedGridDailyEntity> tagUsedGridDailyMap = new HashMap<>();
Map<String, FactTagUsedDepartmentDailyEntity> tagUsedDeptDailyMap = new HashMap<>();
Map<String, FactTagUsedAgencyDailyEntity> tagUsedAgencyDailyMap = new HashMap<>();
Map<String, FactTagUsedAgencyDailyEntity> tagUsedAgencyDailySelfMap = new HashMap<>();
//获取当天的业务数据
//1获取文章及机关id,网格Id
List<ArticleEntity> publishedArticleList = articleService.getPublishedArticleByPublishTime(customerId, statsDate);
if (CollectionUtils.isEmpty(publishedArticleList)) {
return;
}
//KEY 文章Id
Map<String, ArticleEntity> articleMap = publishedArticleList.stream().collect(Collectors.toMap(ArticleEntity::getId, o -> o));
Date startTime = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN);
Date endTime = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN);
//2 获取文章标签
List<ArticleTagsEntity> articleTagsList = articleTagsService.getArticleTagsByCreateTime(customerId, startTime, endTime);
if (CollectionUtils.isEmpty(articleTagsList)) {
log.error("publicitySummary getArticleTagsByCreateTime customerId:{} have not articleTags,publishedArticleList:{}", customerId, JSON.toJSONString(publishedArticleList));
return;
}
//tagId
for (ArticleTagsEntity tagEntity : articleTagsList) {
ArticleEntity articleEntity = articleMap.get(tagEntity.getArticleId());
if (articleEntity == null) {
log.error("publicitySummary articleMap articleId:{} ", tagEntity.getArticleId());
try {
//1.业务数据来源 发布时间为统计时间的
// 因为一个客户的发布文章数在同一天不会特别的多,所以以客户为单位查询今天发布的所有带有标签的文章 根据发布单位类型进行拆分
// 1.1查出今天所有的文章标签 根据网格Id
// 1.2
//获取所有网格
List<DimAgencyEntity> agencyDTOList = dimAgencyService.getAgencyListByCustomerId(customerId);
if (CollectionUtils.isEmpty(agencyDTOList)) {
log.warn("publicitySummary getAgencyListByCustomerId return empty,customerId:{}", customerId);
return;
}
DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(articleEntity.getOrgId());
convertTagUsedAgencyDailyEntity(dimAgencyEntity.getPid(), tagUsedAgencyDailyMap, articleEntity, tagEntity, dimIdBean);
switch (articleEntity.getPublisherType()) {
case ProjectConstant.PUBLISHER_TYPE_GRID:
convertTagUsedGridDailyEntity(tagUsedGridDailyMap, articleEntity, tagEntity, dimIdBean);
break;
case ProjectConstant.PUBLISHER_TYPE_DEPT:
convertTagUsedDepartmentDailyEntity(tagUsedDeptDailyMap, articleEntity, tagEntity, dimIdBean);
break;
case ProjectConstant.PUBLISHER_TYPE_AGENCY:
convertTagUsedAgencyDailySelfEntity(dimAgencyEntity.getPid(), tagUsedAgencyDailySelfMap, articleEntity, tagEntity, dimIdBean);
break;
//转换为 需要插入的Entity
Map<String, DimAgencyEntity> dimAgencyEntityMap = agencyDTOList.stream().collect(Collectors.toMap(DimAgencyEntity::getId, o -> o));
//转换为 需要插入的Entity key gridId_tagId
Map<String, FactTagUsedGridDailyEntity> tagUsedGridDailyMap = new HashMap<>();
Map<String, FactTagUsedDepartmentDailyEntity> tagUsedDeptDailyMap = new HashMap<>();
Map<String, FactTagUsedAgencyDailyEntity> tagUsedAgencyDailyMap = new HashMap<>();
Map<String, FactTagUsedAgencyDailyEntity> tagUsedAgencyDailySelfMap = new HashMap<>();
//获取当天的业务数据
//1获取文章及机关id,网格Id
List<ArticleEntity> publishedArticleList = articleService.getPublishedArticleByPublishTime(customerId, DateUtils.format(statsDate));
if (CollectionUtils.isEmpty(publishedArticleList)) {
return;
}
//KEY 文章Id
Map<String, ArticleEntity> articleMap = publishedArticleList.stream().collect(Collectors.toMap(ArticleEntity::getId, o -> o));
Date startTime = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN);
Date endTime = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN);
//2 获取文章标签
List<ArticleTagsEntity> articleTagsList = articleTagsService.getArticleTagsByCreateTime(customerId, startTime, endTime);
if (CollectionUtils.isEmpty(articleTagsList)) {
log.error("publicitySummary getArticleTagsByCreateTime customerId:{} have not articleTags,publishedArticleList:{}", customerId, JSON.toJSONString(publishedArticleList));
return;
}
//tagId
for (ArticleTagsEntity tagEntity : articleTagsList) {
ArticleEntity articleEntity = articleMap.get(tagEntity.getArticleId());
if (articleEntity == null) {
log.error("publicitySummary articleMap articleId:{} ", tagEntity.getArticleId());
return;
}
DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(articleEntity.getOrgId());
convertTagUsedAgencyDailyEntity(dimAgencyEntity.getPid(), tagUsedAgencyDailyMap, articleEntity, tagEntity, dimIdBean);
switch (articleEntity.getPublisherType()) {
case ProjectConstant.PUBLISHER_TYPE_GRID:
convertTagUsedGridDailyEntity(tagUsedGridDailyMap, articleEntity, tagEntity, dimIdBean);
break;
case ProjectConstant.PUBLISHER_TYPE_DEPT:
convertTagUsedDepartmentDailyEntity(tagUsedDeptDailyMap, articleEntity, tagEntity, dimIdBean);
break;
case ProjectConstant.PUBLISHER_TYPE_AGENCY:
convertTagUsedAgencyDailySelfEntity(dimAgencyEntity.getPid(), tagUsedAgencyDailySelfMap, articleEntity, tagEntity, dimIdBean);
break;
}
}
}
factTagUsedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagUsedGridDailyMap.values());
factTagUsedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagUsedDeptDailyMap.values());
//向上级机关递归添加 数据
Map<String, FactTagUsedAgencyDailyEntity> finalTagUsedAgencyDailyMap = new HashMap<>();
finalTagUsedAgencyDailyMap.putAll(tagUsedAgencyDailyMap);
for (Map.Entry<String, FactTagUsedAgencyDailyEntity> entry : tagUsedAgencyDailyMap.entrySet()) {
String agencyId = entry.getKey().split(StrConstant.UNDER_LINE)[0];
FactTagUsedAgencyDailyEntity currentEntity = entry.getValue();
DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(currentEntity.getAgencyId());
if (dimAgencyEntity == null) {
log.error("dimAgencyEntityMap bizData agencyId:{} not exist in dimAgency", agencyId);
continue;
factTagUsedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagUsedGridDailyMap.values());
factTagUsedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagUsedDeptDailyMap.values());
//向上级机关递归添加 数据
Map<String, FactTagUsedAgencyDailyEntity> finalTagUsedAgencyDailyMap = new HashMap<>();
finalTagUsedAgencyDailyMap.putAll(tagUsedAgencyDailyMap);
for (Map.Entry<String, FactTagUsedAgencyDailyEntity> entry : tagUsedAgencyDailyMap.entrySet()) {
String agencyId = entry.getKey().split(StrConstant.UNDER_LINE)[0];
FactTagUsedAgencyDailyEntity currentEntity = entry.getValue();
DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(currentEntity.getAgencyId());
if (dimAgencyEntity == null) {
log.error("dimAgencyEntityMap bizData agencyId:{} not exist in dimAgency", agencyId);
continue;
}
setTagUsedData2ParentAgency(dimAgencyEntityMap, finalTagUsedAgencyDailyMap, currentEntity, dimIdBean);
}
if (!CollectionUtils.isEmpty(tagUsedAgencyDailySelfMap)){
finalTagUsedAgencyDailyMap.putAll(tagUsedAgencyDailySelfMap);
}
setTagUsedData2ParentAgency(dimAgencyEntityMap, finalTagUsedAgencyDailyMap, currentEntity, dimIdBean);
factTagUsedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), finalTagUsedAgencyDailyMap.values());
} catch (Exception e) {
e.printStackTrace();
//log.error();
}
factTagUsedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), finalTagUsedAgencyDailyMap.values());
}
/**
@ -610,7 +636,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
if (CollectionUtils.isEmpty(articleTagsList)) {
continue;
}
ArticleEntity articleEntity = articleService.selectById(viewedSummaryDTO.getArticleId());
ArticleEntity articleEntity = articleService.selectArticleById(viewedSummaryDTO.getArticleId());
if (articleEntity == null) {
continue;
}
@ -850,6 +876,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
}
parentAgency.setArticleTotalCount(parentAgency.getArticleTotalCount() + agencySummary.getArticleTotalCount());
parentAgency.setArticlePublishedCount(parentAgency.getArticlePublishedCount() + agencySummary.getArticlePublishedCount());
parentAgency.setPublishedCount(parentAgency.getPublishedCount() + agencySummary.getPublishedCount());
pid = parentAgency.getPid();
if (!NumConstant.ZERO_STR.equals(pid)) {
setPublishedData2ParentAgency(agencyDailyEntityMap, agencySummary, parentAgency);
@ -872,6 +899,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
entity.setGridId(dimGridEntity.getId());
entity.setArticleTotalCount(0);
entity.setArticlePublishedCount(0);
entity.setPublishedCount(0);
result.put(dimGridEntity.getId(), entity);
});
return result;
@ -893,6 +921,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
entity.setDepartmentId(dimGridEntity.getId());
entity.setArticleTotalCount(0);
entity.setArticlePublishedCount(0);
entity.setPublishedCount(0);
result.put(dimGridEntity.getId(), entity);
});
return result;
@ -914,6 +943,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
entity.setAgencyId(dimGridEntity.getId());
entity.setArticleTotalCount(0);
entity.setArticlePublishedCount(0);
entity.setPublishedCount(0);
result.put(dimGridEntity.getId(), entity);
});
return result;

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java

@ -2,6 +2,7 @@ package com.epmet.service.org;
import com.epmet.dto.group.AgencyDTO;
import com.epmet.dto.group.result.AgencyGridTotalCountResultDTO;
import com.epmet.dto.group.result.GridIdListByCustomerResultDTO;
import com.epmet.entity.org.CustomerGridEntity;
import java.util.Date;
@ -30,5 +31,5 @@ public interface CustomerGridService {
* @param dateId
* @author zxc
*/
List<String> getCustomerGridIdList(String customerId,String dateId);
List<GridIdListByCustomerResultDTO> getCustomerGridIdList(String customerId, String dateId);
}

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java

@ -5,6 +5,7 @@ import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.org.CustomerGridDao;
import com.epmet.dto.group.AgencyDTO;
import com.epmet.dto.group.result.AgencyGridTotalCountResultDTO;
import com.epmet.dto.group.result.GridIdListByCustomerResultDTO;
import com.epmet.entity.org.CustomerGridEntity;
import com.epmet.service.org.CustomerGridService;
import org.springframework.beans.factory.annotation.Autowired;
@ -42,7 +43,7 @@ public class CustomerGridServiceImpl implements CustomerGridService {
* @author zxc
*/
@Override
public List<String> getCustomerGridIdList(String customerId, String dateId) {
public List<GridIdListByCustomerResultDTO> getCustomerGridIdList(String customerId, String dateId) {
return customerGridDao.getCustomerGridIdList(customerId, dateId);
}
}

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

Loading…
Cancel
Save