Browse Source

Merge branch 'dev_data_stats' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_data_stats

 Conflicts:
	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java
master
wxz 5 years ago
parent
commit
9527951fe6
  1. 15
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/AgencySubTreeDto.java
  2. 4
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java
  3. 147
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserAgencyDailyDTO.java
  4. 147
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserAgencyMonthlyDTO.java
  5. 152
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserGridDailyDTO.java
  6. 152
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserGridMonthlyDTO.java
  7. 147
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserAgencyDailyDTO.java
  8. 147
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserAgencyMonthlyDTO.java
  9. 152
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserGridDailyDTO.java
  10. 152
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserGridMonthlyDTO.java
  11. 28
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java
  12. 29
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/PublicityController.java
  13. 36
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java
  14. 29
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimAgencyDao.java
  15. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedGridDailyDao.java
  16. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyDailyDao.java
  17. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyMonthlyDao.java
  18. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java
  19. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridMonthlyDao.java
  20. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyDailyDao.java
  21. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyMonthlyDao.java
  22. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridDailyDao.java
  23. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java
  24. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java
  25. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java
  26. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerEntity.java
  27. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDateEntity.java
  28. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDepartmentEntity.java
  29. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimGridEntity.java
  30. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimTopicStatusEntity.java
  31. 117
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserAgencyDailyEntity.java
  32. 117
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserAgencyMonthlyEntity.java
  33. 122
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserGridDailyEntity.java
  34. 122
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserGridMonthlyEntity.java
  35. 117
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserAgencyDailyEntity.java
  36. 117
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserAgencyMonthlyEntity.java
  37. 122
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserGridDailyEntity.java
  38. 122
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserGridMonthlyEntity.java
  39. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java
  40. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java
  41. 79
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java
  42. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java
  43. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedGridDailyService.java
  44. 27
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java
  45. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedGridDailyServiceImpl.java
  46. 96
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserAgencyDailyService.java
  47. 96
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserAgencyMonthlyService.java
  48. 96
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserGridDailyService.java
  49. 96
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserGridMonthlyService.java
  50. 96
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserAgencyDailyService.java
  51. 96
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserAgencyMonthlyService.java
  52. 96
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridDailyService.java
  53. 96
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridMonthlyService.java
  54. 101
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserAgencyDailyServiceImpl.java
  55. 102
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserAgencyMonthlyServiceImpl.java
  56. 102
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserGridDailyServiceImpl.java
  57. 102
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserGridMonthlyServiceImpl.java
  58. 102
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserAgencyDailyServiceImpl.java
  59. 102
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserAgencyMonthlyServiceImpl.java
  60. 102
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridDailyServiceImpl.java
  61. 102
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridMonthlyServiceImpl.java
  62. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java
  63. 31
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java
  64. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/DimIdGenerator.java
  65. 164
      epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml
  66. 82
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimAgencyDao.xml
  67. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml
  68. 5
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedGridDailyDao.xml
  69. 4
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml

15
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/AgencySubTreeDto.java

@ -35,6 +35,21 @@ public class AgencySubTreeDto implements Serializable {
String customerId;
/**
* 父级机关Id当为最顶层是pid为0
* */
String pid;
/**
* 级别
* 社区级community
* 街道:street,
* 区县级: district,
* 市级: city
* 省级:province
* */
String level;
/**
* 下级机关集合
* */
List<AgencySubTreeDto> subAgencies;

4
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java

@ -30,9 +30,9 @@ public class ArticleGridPublishedSummaryDTO implements Serializable {
/**
* 发布文章总数
*/
private Integer publishedCount;
private Integer articleTotalCount;
/**
* 状态为发布中的文章总数
*/
private Integer publishingCount;
private Integer articlePublishedCount;
}

147
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserAgencyDailyDTO.java

@ -0,0 +1,147 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.stats.user;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.math.BigDecimal;
/**
* 机关下(按日)参与用户数分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Data
public class FactParticipationUserAgencyDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 机关id
*/
private String agencyId;
/**
*
*/
private String dateId;
/**
*
*/
private String weekId;
/**
*
*/
private String yearId;
/**
* 截止到本日参与用户总数
*/
private Integer regTotal;
/**
* 截止到本日参与用户中居民总数
*/
private Integer resiTotal;
/**
* 截止到本日参与用户中热心居民总数
*/
private Integer warmHeartedTotal;
/**
* 截止到本日参与用户中党员总数
*/
private Integer partymemberTotal;
/**
* 本日参与用户中注册居民日增量
*/
private Integer regIncr;
/**
* 本日参与用户中热心居民日增量
*/
private Integer warmIncr;
/**
* 本日参与用户中党员认证日增量
*/
private Integer partymemberIncr;
/**
* 热心居民占比
*/
private BigDecimal warmHeartedProportion;
/**
* 居民总数占比
*/
private BigDecimal resiProportion;
/**
* 党员总数占比
*/
private BigDecimal partymemberProportion;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 删除标识
*/
private String delFlag;
}

147
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserAgencyMonthlyDTO.java

@ -0,0 +1,147 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.stats.user;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.math.BigDecimal;
/**
* 机关下(按月)参与用户数分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Data
public class FactParticipationUserAgencyMonthlyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 机关id
*/
private String agencyId;
/**
*
*/
private String monthId;
/**
*
*/
private String quarterId;
/**
*
*/
private String yearId;
/**
* 截止到本月底参与用户总数
*/
private Integer regTotal;
/**
* 截止到本月底参与用户中居民总数
*/
private Integer resiTotal;
/**
* 截止到本月底参与用户中热心居民总数
*/
private Integer warmHeartedTotal;
/**
* 截止到本月底参与用户中党员总数
*/
private Integer partymemberTotal;
/**
* 本月参与用户中注册居民月增量
*/
private Integer regIncr;
/**
* 本月参与用户中热心居民月增量
*/
private Integer warmIncr;
/**
* 本月参与用户中党员认证月增量
*/
private Integer partymemberIncr;
/**
* 居民总数占比
*/
private BigDecimal resiProportion;
/**
* 党员总数占比
*/
private BigDecimal partymemberProportion;
/**
* 热心居民占比
*/
private BigDecimal warmHeartedProportion;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 删除标识
*/
private String delFlag;
}

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

@ -0,0 +1,152 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.stats.user;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.math.BigDecimal;
/**
* 网格下(按日)参与用户数分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Data
public class FactParticipationUserGridDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 网格id
*/
private String gridId;
/**
* 客户id
*/
private String customerId;
/**
* 机关id
*/
private String agencyId;
/**
*
*/
private String dateId;
/**
*
*/
private String weekId;
/**
*
*/
private String yearId;
/**
* 截止到本日参与用户总数
*/
private Integer regTotal;
/**
* 截止到本日居民总数
*/
private Integer resiTotal;
/**
* 截止到本日热心居民总数
*/
private Integer warmHeartedTotal;
/**
* 截止到本日党员总数
*/
private Integer partymemberTotal;
/**
* 本日注册居民日增量
*/
private Integer regIncr;
/**
* 本日热心居民日增量
*/
private Integer warmIncr;
/**
* 本日党员认证日增量
*/
private Integer partymemberIncr;
/**
* 居民总数占比
*/
private BigDecimal resiProportion;
/**
* 党员总数占比
*/
private BigDecimal partymemberProportion;
/**
* 热心居民占比
*/
private BigDecimal warmHeartedProportion;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 删除标识
*/
private String delFlag;
}

152
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserGridMonthlyDTO.java

@ -0,0 +1,152 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.stats.user;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.math.BigDecimal;
/**
* 网格下()参与用户数分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Data
public class FactParticipationUserGridMonthlyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 网格id
*/
private String gridId;
/**
* 客户id
*/
private String customerId;
/**
* 机关id
*/
private String agencyId;
/**
*
*/
private String monthId;
/**
*
*/
private String quarterId;
/**
*
*/
private String yearId;
/**
* 截止到本月底的参与用户总数
*/
private Integer regTotal;
/**
* 截止到本月底的居民总数
*/
private Integer resiTotal;
/**
* 截止到本月底的热心居民总数
*/
private Integer warmHeartedTotal;
/**
* 截止到本月底的党员总数
*/
private Integer partymemberTotal;
/**
* 注册居民本月增量
*/
private Integer regIncr;
/**
* 热心居民本月增量
*/
private Integer warmIncr;
/**
* 党员认证本月增量
*/
private Integer partymemberIncr;
/**
* 党员总数占比
*/
private BigDecimal partymemberProportion;
/**
* 居民总数占比
*/
private BigDecimal resiProportion;
/**
* 热心居民占比
*/
private BigDecimal warmHeartedProportion;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 删除标识
*/
private String delFlag;
}

147
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserAgencyDailyDTO.java

@ -0,0 +1,147 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.stats.user;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.math.BigDecimal;
/**
* 机关(按日)注册用户数分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Data
public class FactRegUserAgencyDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 机关id
*/
private String agencyId;
/**
*
*/
private String dateId;
/**
*
*/
private String weekId;
/**
*
*/
private String yearId;
/**
* 注册用户总数
*/
private Integer regTotal;
/**
* 截止到本日居民总数=注册用户总数
*/
private Integer resiTotal;
/**
* 截止到本日热心居民总数
*/
private Integer warmHeartedTotal;
/**
* 截止到本日党员总数
*/
private Integer partymemberTotal;
/**
* 本日注册居民日增量
*/
private Integer regIncr;
/**
* 本日热心居民日增量
*/
private Integer warmIncr;
/**
* 本日党员认证日增量
*/
private Integer partymemberIncr;
/**
* 居民总数占比
*/
private BigDecimal resiProportion;
/**
* 党员总数占比
*/
private BigDecimal partymemberProportion;
/**
* 热心居民占比
*/
private BigDecimal warmHeartedProportion;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 删除标识
*/
private String delFlag;
}

147
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserAgencyMonthlyDTO.java

@ -0,0 +1,147 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.stats.user;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.math.BigDecimal;
/**
* 机关(按月)注册用户数分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Data
public class FactRegUserAgencyMonthlyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 机关id
*/
private String agencyId;
/**
*
*/
private String monthId;
/**
*
*/
private String quarterId;
/**
*
*/
private String yearId;
/**
* 截止到本月底注册用户总数
*/
private Integer regTotal;
/**
* 截止到本月底居民总数
*/
private Integer resiTotal;
/**
* 截止到本月底热心居民总数
*/
private Integer warmHeartedTotal;
/**
* 截止到本月底党员总数
*/
private Integer partymemberTotal;
/**
* 本月注册居民月增量
*/
private Integer regIncr;
/**
* 本月热心居民月增量
*/
private Integer warmIncr;
/**
* 本月党员认证月增量
*/
private Integer partymemberIncr;
/**
* 居民总数占比
*/
private BigDecimal resiProportion;
/**
* 党员总数占比
*/
private BigDecimal partymemberProportion;
/**
* 热心居民占比
*/
private BigDecimal warmHeartedProportion;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 删除标识
*/
private String delFlag;
}

152
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserGridDailyDTO.java

@ -0,0 +1,152 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.stats.user;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.math.BigDecimal;
/**
* 网格(按日)注册用户数分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Data
public class FactRegUserGridDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 网格id
*/
private String gridId;
/**
* 客户id
*/
private String customerId;
/**
* 机关id
*/
private String agencyId;
/**
*
*/
private String dateId;
/**
*
*/
private String weekId;
/**
*
*/
private String yearId;
/**
* 截止到本日注册用户总数
*/
private Integer regTotal;
/**
* 截止到本日居民总数
*/
private Integer resiTotal;
/**
* 截止到本日热心居民总数
*/
private Integer warmHeartedTotal;
/**
* 截止到本日党员总数
*/
private Integer partymemberTotal;
/**
* 本日注册居民日增量
*/
private Integer regIncr;
/**
* 本日热心居民日增量
*/
private Integer warmIncr;
/**
* 本日党员认证日增量
*/
private Integer partymemberIncr;
/**
* 居民总数占比
*/
private BigDecimal resiProportion;
/**
* 党员总数占比
*/
private BigDecimal partymemberProportion;
/**
* 热心居民占比
*/
private BigDecimal warmHeartedProportion;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 删除标识
*/
private String delFlag;
}

152
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserGridMonthlyDTO.java

@ -0,0 +1,152 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.stats.user;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.math.BigDecimal;
/**
* 网格()注册用户数分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Data
public class FactRegUserGridMonthlyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 网格id
*/
private String gridId;
/**
* 客户id
*/
private String customerId;
/**
* 机关id
*/
private String agencyId;
/**
*
*/
private String monthId;
/**
*
*/
private String quarterId;
/**
*
*/
private String yearId;
/**
* 截止到本月底的注册用户总数
*/
private Integer regTotal;
/**
* 截止到本月底的居民总数
*/
private Integer resiTotal;
/**
* 截止到本月底的热心居民总数
*/
private Integer warmHeartedTotal;
/**
* 截止到本月底的党员总数
*/
private Integer partymemberTotal;
/**
* 注册居民本月增量
*/
private Integer regIncr;
/**
* 热心居民本月增量
*/
private Integer warmIncr;
/**
* 党员认证本月增量
*/
private Integer partymemberIncr;
/**
* 热心居民占比
*/
private BigDecimal warmHeartedProportion;
/**
* 居民总数占比
*/
private BigDecimal resiProportion;
/**
* 党员总数占比
*/
private BigDecimal partymemberProportion;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 删除标识
*/
private String delFlag;
}

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

@ -4,7 +4,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.service.StatsDimService;
import com.epmet.service.stats.DimDateService;
import com.epmet.service.stats.DimMonthService;
import com.epmet.service.stats.DimQuarterService;
import oracle.jdbc.proxy.annotation.Post;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@ -26,6 +26,9 @@ public class DimController {
@Autowired
private StatsDimService statsDimService;
@Autowired
private DimAgencyService dimAgencyService;
/**
* 初始化按日维度
* @return
@ -96,4 +99,27 @@ public class DimController {
return new Result();
}
/**
* @Description 所有机构
* @param
* @return
* @author wangc
* @date 2020.06.18 10:34
**/
@GetMapping("allagency")
public List<AgencySubTreeDto> allAgency(){
return dimAgencyService.getAllAgency();
}
/**
* @Description 顶级机构
* @param
* @return
* @author wangc
* @date 2020.06.18 10:34
**/
@GetMapping("topagency")
public List<AgencySubTreeDto> topAgency(){
return dimAgencyService.getTopAgency();
}
}

29
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/PublicityController.java

@ -1,29 +0,0 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.service.StatsDemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.concurrent.ExecutorService;
/**
* desc:宣传能力controller
*/
@RequestMapping("publicity")
@RestController
public class PublicityController {
@Autowired
private StatsDemoService demoService;
@Autowired
private ExecutorService executorService;
@PostMapping(value = "publicitySummaryStatsjob")
public Result<Boolean> publicitySummaryStatsjob(){
return null;
}
}

36
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java

@ -0,0 +1,36 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.service.StatsPublicityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.concurrent.ExecutorService;
/**
* desc:宣传能力controller
*/
@RequestMapping("statspublicity")
@RestController
public class StatsPublicityController {
@Autowired
private StatsPublicityService statsPublicityService;
@Autowired
private ExecutorService executorService;
/**
* desc:统计文章总数及在线文章总数
*
* @param statsDate 默认为T-1天如果传 则统计的是statsDate的数据
* @return
*/
@PostMapping(value = "publicitySummaryStatsjob")
public Result<Boolean> publicitySummaryStatsjob(Date statsDate) {
return new Result<Boolean>().ok(statsPublicityService.publicitySummary(statsDate));
}
}

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

@ -19,9 +19,11 @@ package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.stats.DimAgencyDTO;
import com.epmet.entity.stats.DimAgencyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -43,4 +45,31 @@ public interface DimAgencyDao extends BaseDao<DimAgencyEntity> {
* @Description 根据客户Id查询机关维度列表数据
**/
List<DimAgencyDTO> selectDimAgencyList(DimAgencyDTO dto);
/**
* @Description 获取所有机关
* @param
* @return List<AgencySubTreeDto>
* @author wangc
* @date 2020.06.18 09:26
**/
List<AgencySubTreeDto> selectAllAgency();
/**
* @Description 根据PID获取下级机关
* @param pid
* @return List<AgencySubTreeDto>
* @author wangc
* @date 2020.06.18 09:26
**/
List<AgencySubTreeDto> selectSubAgencyByPid(@Param("pid")String pid);
/**
* @Description 获取顶层级机关机关
* @param
* @return List<AgencySubTreeDto>
* @author wangc
* @date 2020.06.18 09:26
**/
List<AgencySubTreeDto> selectTopAgency();
}

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

@ -42,4 +42,13 @@ public interface FactArticlePublishedGridDailyDao extends BaseDao<FactArticlePub
* @return
*/
List<FactArticlePublishedAgencyDailyEntity> getByBeforeDay(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* desc:根据日期删除 数据
*
* @param customerId
* @param dateId
* @return
*/
int deleteByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId);
}

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

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.stats.user;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.stats.user.FactParticipationUserAgencyDailyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 机关下(按日)参与用户数分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Mapper
public interface FactParticipationUserAgencyDailyDao extends BaseDao<FactParticipationUserAgencyDailyEntity> {
}

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

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.stats.user;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.stats.user.FactParticipationUserAgencyMonthlyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 机关下(按月)参与用户数分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Mapper
public interface FactParticipationUserAgencyMonthlyDao extends BaseDao<FactParticipationUserAgencyMonthlyEntity> {
}

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

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.stats.user;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.stats.user.FactParticipationUserGridDailyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 网格下(按日)参与用户数分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Mapper
public interface FactParticipationUserGridDailyDao extends BaseDao<FactParticipationUserGridDailyEntity> {
}

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

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.stats.user;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.stats.user.FactParticipationUserGridMonthlyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 网格下()参与用户数分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Mapper
public interface FactParticipationUserGridMonthlyDao extends BaseDao<FactParticipationUserGridMonthlyEntity> {
}

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

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.stats.user;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.stats.user.FactRegUserAgencyDailyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 机关(按日)注册用户数分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Mapper
public interface FactRegUserAgencyDailyDao extends BaseDao<FactRegUserAgencyDailyEntity> {
}

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

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.stats.user;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.stats.user.FactRegUserAgencyMonthlyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 机关(按月)注册用户数分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Mapper
public interface FactRegUserAgencyMonthlyDao extends BaseDao<FactRegUserAgencyMonthlyEntity> {
}

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

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.stats.user;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.stats.user.FactRegUserGridDailyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 网格(按日)注册用户数分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Mapper
public interface FactRegUserGridDailyDao extends BaseDao<FactRegUserGridDailyEntity> {
}

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

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.stats.user;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.stats.user.FactRegUserGridMonthlyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 网格()注册用户数分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Mapper
public interface FactRegUserGridMonthlyDao extends BaseDao<FactRegUserGridMonthlyEntity> {
}

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

@ -0,0 +1,14 @@
package com.epmet.dao.user;
import org.apache.ibatis.annotations.Mapper;
/**
* 用户Dao EpmetUser
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-05-11
*/
@Mapper
public interface UserDao {
}

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

@ -23,7 +23,7 @@ import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 机关维度

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerEntity.java

@ -23,7 +23,7 @@ import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 客户维度

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDateEntity.java

@ -23,7 +23,7 @@ import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 日期维度表

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDepartmentEntity.java

@ -23,7 +23,7 @@ import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 客户部门维度

1
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimGridEntity.java

@ -23,7 +23,6 @@ import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 客户网格维度

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimTopicStatusEntity.java

@ -23,7 +23,7 @@ import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 话题状态维度表

117
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserAgencyDailyEntity.java

@ -0,0 +1,117 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.stats.user;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
/**
* 机关下(按日)参与用户数分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_participation_user_agency_daily")
public class FactParticipationUserAgencyDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 机关id
*/
private String agencyId;
/**
*
*/
private String dateId;
/**
*
*/
private String weekId;
/**
*
*/
private String yearId;
/**
* 截止到本日参与用户总数
*/
private Integer regTotal;
/**
* 截止到本日参与用户中居民总数
*/
private Integer resiTotal;
/**
* 截止到本日参与用户中热心居民总数
*/
private Integer warmHeartedTotal;
/**
* 截止到本日参与用户中党员总数
*/
private Integer partymemberTotal;
/**
* 本日参与用户中注册居民日增量
*/
private Integer regIncr;
/**
* 本日参与用户中热心居民日增量
*/
private Integer warmIncr;
/**
* 本日参与用户中党员认证日增量
*/
private Integer partymemberIncr;
/**
* 热心居民占比
*/
private BigDecimal warmHeartedProportion;
/**
* 居民总数占比
*/
private BigDecimal resiProportion;
/**
* 党员总数占比
*/
private BigDecimal partymemberProportion;
}

117
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserAgencyMonthlyEntity.java

@ -0,0 +1,117 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.stats.user;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
/**
* 机关下(按月)参与用户数分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_participation_user_agency_monthly")
public class FactParticipationUserAgencyMonthlyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 机关id
*/
private String agencyId;
/**
*
*/
private String monthId;
/**
*
*/
private String quarterId;
/**
*
*/
private String yearId;
/**
* 截止到本月底参与用户总数
*/
private Integer regTotal;
/**
* 截止到本月底参与用户中居民总数
*/
private Integer resiTotal;
/**
* 截止到本月底参与用户中热心居民总数
*/
private Integer warmHeartedTotal;
/**
* 截止到本月底参与用户中党员总数
*/
private Integer partymemberTotal;
/**
* 本月参与用户中注册居民月增量
*/
private Integer regIncr;
/**
* 本月参与用户中热心居民月增量
*/
private Integer warmIncr;
/**
* 本月参与用户中党员认证月增量
*/
private Integer partymemberIncr;
/**
* 居民总数占比
*/
private BigDecimal resiProportion;
/**
* 党员总数占比
*/
private BigDecimal partymemberProportion;
/**
* 热心居民占比
*/
private BigDecimal warmHeartedProportion;
}

122
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserGridDailyEntity.java

@ -0,0 +1,122 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.stats.user;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
/**
* 网格下(按日)参与用户数分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_participation_user_grid_daily")
public class FactParticipationUserGridDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 网格id
*/
private String gridId;
/**
* 客户id
*/
private String customerId;
/**
* 机关id
*/
private String agencyId;
/**
*
*/
private String dateId;
/**
*
*/
private String weekId;
/**
*
*/
private String yearId;
/**
* 截止到本日参与用户总数
*/
private Integer regTotal;
/**
* 截止到本日居民总数
*/
private Integer resiTotal;
/**
* 截止到本日热心居民总数
*/
private Integer warmHeartedTotal;
/**
* 截止到本日党员总数
*/
private Integer partymemberTotal;
/**
* 本日注册居民日增量
*/
private Integer regIncr;
/**
* 本日热心居民日增量
*/
private Integer warmIncr;
/**
* 本日党员认证日增量
*/
private Integer partymemberIncr;
/**
* 居民总数占比
*/
private BigDecimal resiProportion;
/**
* 党员总数占比
*/
private BigDecimal partymemberProportion;
/**
* 热心居民占比
*/
private BigDecimal warmHeartedProportion;
}

122
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserGridMonthlyEntity.java

@ -0,0 +1,122 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.stats.user;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
/**
* 网格下()参与用户数分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_participation_user_grid_monthly")
public class FactParticipationUserGridMonthlyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 网格id
*/
private String gridId;
/**
* 客户id
*/
private String customerId;
/**
* 机关id
*/
private String agencyId;
/**
*
*/
private String monthId;
/**
*
*/
private String quarterId;
/**
*
*/
private String yearId;
/**
* 截止到本月底的参与用户总数
*/
private Integer regTotal;
/**
* 截止到本月底的居民总数
*/
private Integer resiTotal;
/**
* 截止到本月底的热心居民总数
*/
private Integer warmHeartedTotal;
/**
* 截止到本月底的党员总数
*/
private Integer partymemberTotal;
/**
* 注册居民本月增量
*/
private Integer regIncr;
/**
* 热心居民本月增量
*/
private Integer warmIncr;
/**
* 党员认证本月增量
*/
private Integer partymemberIncr;
/**
* 党员总数占比
*/
private BigDecimal partymemberProportion;
/**
* 居民总数占比
*/
private BigDecimal resiProportion;
/**
* 热心居民占比
*/
private BigDecimal warmHeartedProportion;
}

117
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserAgencyDailyEntity.java

@ -0,0 +1,117 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.stats.user;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
/**
* 机关(按日)注册用户数分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_reg_user_agency_daily")
public class FactRegUserAgencyDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 机关id
*/
private String agencyId;
/**
*
*/
private String dateId;
/**
*
*/
private String weekId;
/**
*
*/
private String yearId;
/**
* 注册用户总数
*/
private Integer regTotal;
/**
* 截止到本日居民总数=注册用户总数
*/
private Integer resiTotal;
/**
* 截止到本日热心居民总数
*/
private Integer warmHeartedTotal;
/**
* 截止到本日党员总数
*/
private Integer partymemberTotal;
/**
* 本日注册居民日增量
*/
private Integer regIncr;
/**
* 本日热心居民日增量
*/
private Integer warmIncr;
/**
* 本日党员认证日增量
*/
private Integer partymemberIncr;
/**
* 居民总数占比
*/
private BigDecimal resiProportion;
/**
* 党员总数占比
*/
private BigDecimal partymemberProportion;
/**
* 热心居民占比
*/
private BigDecimal warmHeartedProportion;
}

117
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserAgencyMonthlyEntity.java

@ -0,0 +1,117 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.stats.user;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
/**
* 机关(按月)注册用户数分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_reg_user_agency_monthly")
public class FactRegUserAgencyMonthlyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 机关id
*/
private String agencyId;
/**
*
*/
private String monthId;
/**
*
*/
private String quarterId;
/**
*
*/
private String yearId;
/**
* 截止到本月底注册用户总数
*/
private Integer regTotal;
/**
* 截止到本月底居民总数
*/
private Integer resiTotal;
/**
* 截止到本月底热心居民总数
*/
private Integer warmHeartedTotal;
/**
* 截止到本月底党员总数
*/
private Integer partymemberTotal;
/**
* 本月注册居民月增量
*/
private Integer regIncr;
/**
* 本月热心居民月增量
*/
private Integer warmIncr;
/**
* 本月党员认证月增量
*/
private Integer partymemberIncr;
/**
* 居民总数占比
*/
private BigDecimal resiProportion;
/**
* 党员总数占比
*/
private BigDecimal partymemberProportion;
/**
* 热心居民占比
*/
private BigDecimal warmHeartedProportion;
}

122
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserGridDailyEntity.java

@ -0,0 +1,122 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.stats.user;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
/**
* 网格(按日)注册用户数分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_reg_user_grid_daily")
public class FactRegUserGridDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 网格id
*/
private String gridId;
/**
* 客户id
*/
private String customerId;
/**
* 机关id
*/
private String agencyId;
/**
*
*/
private String dateId;
/**
*
*/
private String weekId;
/**
*
*/
private String yearId;
/**
* 截止到本日注册用户总数
*/
private Integer regTotal;
/**
* 截止到本日居民总数
*/
private Integer resiTotal;
/**
* 截止到本日热心居民总数
*/
private Integer warmHeartedTotal;
/**
* 截止到本日党员总数
*/
private Integer partymemberTotal;
/**
* 本日注册居民日增量
*/
private Integer regIncr;
/**
* 本日热心居民日增量
*/
private Integer warmIncr;
/**
* 本日党员认证日增量
*/
private Integer partymemberIncr;
/**
* 居民总数占比
*/
private BigDecimal resiProportion;
/**
* 党员总数占比
*/
private BigDecimal partymemberProportion;
/**
* 热心居民占比
*/
private BigDecimal warmHeartedProportion;
}

122
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserGridMonthlyEntity.java

@ -0,0 +1,122 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.stats.user;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
/**
* 网格()注册用户数分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_reg_user_grid_monthly")
public class FactRegUserGridMonthlyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 网格id
*/
private String gridId;
/**
* 客户id
*/
private String customerId;
/**
* 机关id
*/
private String agencyId;
/**
*
*/
private String monthId;
/**
*
*/
private String quarterId;
/**
*
*/
private String yearId;
/**
* 截止到本月底的注册用户总数
*/
private Integer regTotal;
/**
* 截止到本月底的居民总数
*/
private Integer resiTotal;
/**
* 截止到本月底的热心居民总数
*/
private Integer warmHeartedTotal;
/**
* 截止到本月底的党员总数
*/
private Integer partymemberTotal;
/**
* 注册居民本月增量
*/
private Integer regIncr;
/**
* 热心居民本月增量
*/
private Integer warmIncr;
/**
* 党员认证本月增量
*/
private Integer partymemberIncr;
/**
* 热心居民占比
*/
private BigDecimal warmHeartedProportion;
/**
* 居民总数占比
*/
private BigDecimal resiProportion;
/**
* 党员总数占比
*/
private BigDecimal partymemberProportion;
}

1
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java

@ -1,5 +1,6 @@
package com.epmet.service;
public interface StatsDimService {
void initGridDim();

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

@ -2,8 +2,6 @@ package com.epmet.service.impl;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.StatsSubject;
import com.epmet.dao.org.CustomerDepartmentDao;
import com.epmet.dao.stats.LastExecRecordDao;
import com.epmet.entity.crm.CustomerEntity;
import com.epmet.entity.org.CustomerAgencyEntity;
import com.epmet.entity.org.CustomerDepartmentEntity;
@ -169,4 +167,5 @@ public class StatsDimServiceImpl implements StatsDimService {
lastExecRecordService.updateById(lastExecRecord);
}
}

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

@ -1,25 +1,32 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO;
import com.epmet.entity.stats.DimGridEntity;
import com.epmet.entity.stats.FactArticlePublishedGridDailyEntity;
import com.epmet.service.StatsPublicityService;
import com.epmet.service.stats.*;
import com.epmet.service.voice.ArticlePublishRangeService;
import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
/**
* desc: 宣传能力数据统计 service
*
* @date: 2020/6/17 16:08
* @author: jianjun liu
* email:liujianjun@git.elinkit.com.cn
*/
@Slf4j
@Service
public class StatsPublicityServiceImpl implements StatsPublicityService {
@ -45,33 +52,83 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
@Autowired
private FactArticlePublishedGridDailyService factArticlePublishedGridDailyService;
@Autowired
private ExecutorService executorService;
@Override
public Boolean publicitySummary(Date statsDate) {
if (statsDate == null) {
statsDate = DateUtils.addDateDays(new Date(), -1);
}
DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate);
int pageNo = 1;
int pageSize = 100;
List<String> customerIdList = null;
do {
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize);
if (!CollectionUtils.isEmpty(customerIdList)) {
for (String customerId : customerIdList) {//获取所有网格
List<DimGridEntity> gridDTOList = dimGridService.getGridListByCustomerId(customerId);
if (!CollectionUtils.isEmpty(gridDTOList)) {
List<ArticleGridPublishedSummaryDTO> publishedArticleCount = articlePublishRangeService.getAllPublishedCount(customerId, statsDate);
}
for (String customerId : customerIdList) {
/*executorService.submit(()->{
});*/
statsPublishedGridDaily(statsDate, dimIdBean, customerId);
}
}
} while (!CollectionUtils.isEmpty(customerIdList) || customerIdList.size() >= pageSize);
return null;
} while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() >= pageSize);
return true;
}
private List<ArticleGridPublishedSummaryDTO> statsPublishArticle(String customerId, Date statsDate) {
List<ArticleGridPublishedSummaryDTO> articleCount = articlePublishRangeService.getAllPublishedCount(customerId, statsDate);
/**
* desc:按日统计 网格纬度的 文章总数数据
*
* @param statsDate
* @param dimIdBean
* @param customerId
*/
private void statsPublishedGridDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId) {
//获取所有网格
List<DimGridEntity> gridDTOList = dimGridService.getGridListByCustomerId(customerId);
if (CollectionUtils.isEmpty(gridDTOList)) {
log.warn("publicitySummary getGridListByCustomerId return empty,customerId:{}", customerId);
return;
}
//转换为 需要插入的Entity
Map<String, FactArticlePublishedGridDailyEntity> gridDailyEntityMap = convertGridDailyEntity(gridDTOList, dimIdBean);
//获取当天的业务数据
List<ArticleGridPublishedSummaryDTO> publishedArticleCount = articlePublishRangeService.getAllPublishedCount(customerId, statsDate);
if (!CollectionUtils.isEmpty(publishedArticleCount)) {
for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) {
FactArticlePublishedGridDailyEntity gridDailyEntities = gridDailyEntityMap.get(summaryDTO.getGridId());
if (gridDailyEntities == null) {
log.error("publicitySummary bizData gridId:{} not exist in dimGrid", summaryDTO.getGridId());
continue;
}
gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount());
gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount());
}
}
boolean b = factArticlePublishedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), gridDailyEntityMap.values());
}
return articleCount;
/**
* desc:将网格对象构建为 gridDaily 对象
*
* @param dimGridEntities
* @param dimIdBean
* @return
*/
private Map<String, FactArticlePublishedGridDailyEntity> convertGridDailyEntity(List<DimGridEntity> dimGridEntities, DimIdGenerator.DimIdBean dimIdBean) {
Map<String, FactArticlePublishedGridDailyEntity> result = new HashMap<>();
dimGridEntities.forEach(dimGridEntity -> {
FactArticlePublishedGridDailyEntity entity = ConvertUtils.sourceToTarget(dimIdBean, FactArticlePublishedGridDailyEntity.class);
entity.setCustomerId(dimGridEntity.getCustomerId());
entity.setAgencyId(dimGridEntity.getAgencyId());
entity.setGridId(dimGridEntity.getId());
entity.setArticleTotalCount(0);
entity.setArticlePublishedCount(0);
result.put(dimGridEntity.getId(), entity);
});
return result;
}
}

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

@ -19,6 +19,7 @@ package com.epmet.service.stats;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.stats.DimAgencyDTO;
import com.epmet.entity.org.CustomerAgencyEntity;
import com.epmet.entity.stats.DimAgencyEntity;
@ -103,4 +104,22 @@ public interface DimAgencyService extends BaseService<DimAgencyEntity> {
List<DimAgencyDTO> getDimAgencyList(DimAgencyDTO dto);
void addAgencyDims(List<CustomerAgencyEntity> agencies);
/**
* @Description 查询所有机关以及它下级机关的信息
* @param
* @return List<AgencySubTreeDto>
* @author wangc
* @date 2020.06.18 09:45
**/
List<AgencySubTreeDto> getAllAgency();
/**
* @Description 查询顶级机关以及它下级机关的信息
* @param
* @return List<AgencySubTreeDto>
* @author wangc
* @date 2020.06.18 09:45
**/
List<AgencySubTreeDto> getTopAgency();
}

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedGridDailyService.java

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity;
import com.epmet.entity.stats.FactArticlePublishedGridDailyEntity;
import java.util.Collection;
import java.util.List;
/**
@ -40,5 +41,19 @@ public interface FactArticlePublishedGridDailyService extends BaseService<FactAr
* @date: 2020/6/18 9:53
* @author: jianjun liu
*/
@Deprecated
List<FactArticlePublishedAgencyDailyEntity> getByBeforeDay(String customerId, String dateId);
/**
* desc: 删除并插入数据
*
* @param dateId
* @param values
* @return:
* @date: 2020/6/18 14:54
* @author: jianjun liu
*/
boolean deleteAndInsertBatch(String customerId, String dateId, Collection<FactArticlePublishedGridDailyEntity> values);
}

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

@ -24,6 +24,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.stats.DimAgencyDao;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.stats.DimAgencyDTO;
import com.epmet.entity.org.CustomerAgencyEntity;
import com.epmet.entity.stats.DimAgencyEntity;
@ -37,6 +38,7 @@ import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 机关维度
@ -133,4 +135,29 @@ public class DimAgencyServiceImpl extends BaseServiceImpl<DimAgencyDao, DimAgenc
}
}
/**
* @Description 查询所有机关以及它下级机关的信息
* @param
* @return List<AgencySubTreeDto>
* @author wangc
* @date 2020.06.18 09:45
**/
@Override
public List<AgencySubTreeDto> getAllAgency() {
return baseDao.selectAllAgency();
}
/**
* @Description 查询顶级机关以及它下级机关的信息
* @param
* @return List<AgencySubTreeDto>
* @author wangc
* @date 2020.06.18 09:45
**/
@Override
public List<AgencySubTreeDto> getTopAgency() {
return baseDao.selectTopAgency();
}
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedGridDailyServiceImpl.java

@ -27,7 +27,9 @@ import com.epmet.service.stats.FactArticlePublishedGridDailyService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collection;
import java.util.List;
/**
@ -49,4 +51,13 @@ public class FactArticlePublishedGridDailyServiceImpl extends BaseServiceImpl<Fa
}
return baseDao.getByBeforeDay(customerId,dateId);
}
@Override
@Transactional(rollbackFor = Exception.class)
public boolean deleteAndInsertBatch(String customerId,String dateId, Collection<FactArticlePublishedGridDailyEntity> values) {
int i = baseDao.deleteByDateId(customerId, dateId);
log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId,i);
this.insertBatch(values, 100);
return true;
}
}

96
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserAgencyDailyService.java

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

96
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserAgencyMonthlyService.java

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

96
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserGridDailyService.java

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

96
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserGridMonthlyService.java

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

96
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserAgencyDailyService.java

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

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

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

96
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridDailyService.java

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -0,0 +1,19 @@
package com.epmet.service.user;
import com.epmet.dto.AgencySubTreeDto;
import java.util.List;
import java.util.Map;
public interface UserService {
/**
* @Description 遍历所有机关(它的下级机关)统计注册用户和参与用户的数据,使用level控制
* @param regOrPartiFlag - String
* @parma agencies - Map<String, List<AgencySubTreeDto>>
* @return
* @author wangc
* @date 2020.06.18 10:03
**/
void traverseAgencyUser(String regOrPartiFlag,Map<String, List<AgencySubTreeDto>>agencies);
}

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

@ -0,0 +1,31 @@
package com.epmet.service.user.impl;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.service.user.UserService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* @Description 直连epmet-user
* @ClassName UserServiceImpl
* @Auth wangc
* @Date 2020-06-18 09:55
*/
@Service
public class UserServiceImpl implements UserService {
/**
* @Description 遍历所有机关(它的下级机关)统计注册用户和参与用户的数据,使用level控制
* @param regOrPartiFlag - String
* @parma agencies - Map<String, List<AgencySubTreeDto>>
* @return
* @author wangc
* @date 2020.06.18 10:03
**/
@Override
public void traverseAgencyUser(String regOrPartiFlag, Map<String, List<AgencySubTreeDto>> agencies) {
}
}

19
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/DimIdGenerator.java

@ -3,6 +3,7 @@ package com.epmet.util;
import com.epmet.commons.tools.utils.DateUtils;
import lombok.Data;
import java.util.Calendar;
import java.util.Date;
public class DimIdGenerator {
@ -25,6 +26,19 @@ public class DimIdGenerator {
return DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMM);
}
/**
* 获取周维度ID ,每周的星期一为 周的开始
* @param date
* @return
*/
public static String getWeekDimId(Date date) {
String yyyy = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYY);
Calendar calendar = Calendar.getInstance();
calendar.setFirstDayOfWeek(Calendar.MONDAY);
calendar.setTime(date);
return yyyy.concat("W").concat(calendar.get(Calendar.WEEK_OF_YEAR)+"");
}
/**
* 获取季度维度ID
* @param date
@ -52,15 +66,16 @@ public class DimIdGenerator {
DimIdBean dimIdBean = new DimIdBean();
dimIdBean.setDateId(getDateDimId(date));
dimIdBean.setMonthId(getMonthDimId(date));
dimIdBean.setWeekId(getWeekDimId(date));
dimIdBean.setQuarterId(getQuarterDimId(date));
dimIdBean.setYearId(getYearDimId(date));
//dimIdBean.setWeekId();
return dimIdBean;
}
public static void main(String[] args) {
DimIdBean dimIdBean = getDimIdBean(new Date());
DimIdBean dimIdBean = getDimIdBean(DateUtils.stringToDate("2020-06-14",DateUtils.DATE_PATTERN));
System.out.println(dimIdBean);
}
@Data

164
epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml

@ -0,0 +1,164 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<property name="log.path" value="logs/data-statistical"/>
<springProperty scope="context" name="appname" source="spring.application.name"/>
<!-- 日志上下文名称 -->
<contextName>${appname}</contextName>
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
<!--1. 输出到控制台-->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>debug</level>
</filter>
<encoder>
<Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
<!-- 设置字符集 -->
<charset>UTF-8</charset>
</encoder>
</appender>
<!--2. 输出到文档-->
<!-- 2.1 level为 DEBUG 日志,时间滚动输出 -->
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/debug.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志归档 -->
<fileNamePattern>${log.path}/debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录debug级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>debug</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 2.2 level为 INFO 日志,时间滚动输出 -->
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/info.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 每天日志归档路径以及格式 -->
<fileNamePattern>${log.path}/info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录info级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>info</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 2.3 level为 WARN 日志,时间滚动输出 -->
<appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/warn.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录warn级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>warn</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 2.4 level为 ERROR 日志,时间滚动输出 -->
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/error.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录ERROR级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 开发、测试环境 -->
<springProfile name="dev,test">
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO"/>
<logger name="com.epmet.dao" level="INFO"/>
<logger name="com.epmet.dao" level="DEBUG"/>
<root level="INFO">
<appender-ref ref="DEBUG_FILE"/>
<appender-ref ref="INFO_FILE"/>
<appender-ref ref="WARN_FILE"/>
<appender-ref ref="ERROR_FILE"/>
</root>
</springProfile>
<!-- 生产环境 -->
<springProfile name="prod">
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO"/>
<logger name="com.epmet.dao" level="INFO"/>
<root level="INFO">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="DEBUG_FILE"/>
<appender-ref ref="INFO_FILE"/>
<appender-ref ref="WARN_FILE"/>
<appender-ref ref="ERROR_FILE"/>
</root>
</springProfile>
</configuration>

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

@ -22,4 +22,86 @@
</if>
</select>
<resultMap id="treeMap" type="com.epmet.dto.AgencySubTreeDto">
<id column="agencyId" property="agencyId" />
<result column="agencyName" property="agencyName"/>
<result column="customer_Id" property="customerId" />
<result column="PID" property="pid" />
<result column="LEVEL" property="level" />
<collection property="gridIds" ofType="java.lang.String">
<constructor>
<arg column="gridId"/>
</constructor>
</collection>
<collection property="subAgencies" column="agencyId"
ofType="com.epmet.dto.AgencySubTreeDto" select="selectSubAgencyByPid"></collection>
</resultMap>
<!-- 获取所有机关 递归入口 -->
<select id="selectAllAgency" resultMap="treeMap">
SELECT
agency.ID AS agencyId,
agency.AGENCY_NAME AS agencyName,
grid.ID AS gridId,
agency.CUSTOMER_ID,
agency.PID,
agency.LEVEL
FROM
dim_agency agency
LEFT JOIN dim_grid grid ON agency.ID = grid.AGENCY_ID
AND grid.DEL_FLAG = '0'
WHERE
agency.DEL_FLAG = '0'
ORDER BY
agency.CUSTOMER_ID,
agency.PID
</select>
<!-- 根据PID获取下级机关 递归传递 -->
<select id="selectSubAgencyByPid" resultMap="treeMap" parameterType="string">
SELECT
agency.id AS agencyId,
agency.AGENCY_NAME AS agencyName,-- agency.PID,agency.PIDS ,
grid.ID AS gridId, -- ,GRID_NAME
agency.CUSTOMER_ID,
agency.PID,
agency.LEVEL
FROM
dim_agency agency
LEFT JOIN dim_grid grid ON agency.ID = grid.AGENCY_ID
AND grid.DEL_FLAG = '0'
WHERE
agency.DEL_FLAG = '0'
AND agency.PID = #{pid}
ORDER BY
agency.CUSTOMER_ID,
agency.ID,
grid.ID
</select>
<!-- 获取顶级机关 递归入口 -->
<select id="selectTopAgency" resultMap="treeMap">
SELECT
agency.ID AS agencyId,
agency.AGENCY_NAME AS agencyName,
grid.ID AS gridId,
agency.CUSTOMER_ID,
agency.PID,
agency.LEVEL
FROM
dim_agency agency
LEFT JOIN dim_grid grid ON agency.ID = grid.AGENCY_ID
AND grid.DEL_FLAG = '0'
WHERE
agency.DEL_FLAG = '0'
AND
agency.PID = '0'
ORDER BY
agency.CUSTOMER_ID,
agency.PID
</select>
</mapper>

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

@ -25,7 +25,7 @@
</select>
<select id="getGridListByCustomerId" resultType="com.epmet.entity.stats.DimGridEntity">
SELECT
ID
ID,
CUSTOMER_ID,
AGENCY_ID
FROM

5
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedGridDailyDao.xml

@ -35,8 +35,11 @@
WHERE
DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId,jdbcType=VARCHAR}
AND DATE_ID = #{dateId,jdbcType=TIMESTAMP}
AND DATE_ID = #{dateId,jdbcType=VARCHAR}
</select>
<delete id="deleteByDateId">
DELETE FROM fact_article_published_grid_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR}
</delete>
</mapper>

4
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml

@ -24,8 +24,8 @@
<select id="getAllPublishedCount" resultType="com.epmet.dto.stats.ArticleGridPublishedSummaryDTO">
SELECT
GRID_ID,
count(ID) publishedCount,
sum( CASE PUBLISH_STATUS WHEN 'published' THEN 1 ELSE 0 END ) publishingCount
count(ID) articleTotalCount,
sum( CASE PUBLISH_STATUS WHEN 'published' THEN 1 ELSE 0 END ) articlePublishedCount
FROM
article_publish_range
WHERE

Loading…
Cancel
Save