Browse Source

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

master
wxz 5 years ago
parent
commit
93fafc0b10
  1. 29
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IssueConstant.java
  2. 35
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueAgencyDTO.java
  3. 31
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectAgencyDTO.java
  4. 37
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/form/MonthProjectListFormDTO.java
  5. 0
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/.gitkeep
  6. 10
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java
  7. 237
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueAgencyDailyDTO.java
  8. 227
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueAgencyMonthlyDTO.java
  9. 237
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueGridDailyDTO.java
  10. 227
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueGridMonthlyDTO.java
  11. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java
  12. 43
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java
  13. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java
  14. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java
  15. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDateDao.java
  16. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDepartmentDao.java
  17. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectDailyDao.java
  18. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectMonthlyDao.java
  19. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedDepartmentDailyDao.java
  20. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyDailyDao.java
  21. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java
  22. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.java
  23. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java
  24. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java
  25. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedDepartmentDailyEntity.java
  26. 207
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueAgencyDailyEntity.java
  27. 197
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueAgencyMonthlyEntity.java
  28. 207
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueGridDailyEntity.java
  29. 197
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueGridMonthlyEntity.java
  30. 51
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java
  31. 61
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java
  32. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java
  33. 422
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java
  34. 247
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java
  35. 125
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java
  36. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java
  37. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java
  38. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java
  39. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java
  40. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDateService.java
  41. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java
  42. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyProjectDailyService.java
  43. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyProjectMonthlyService.java
  44. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedDepartmentDailyService.java
  45. 95
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyDailyService.java
  46. 95
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java
  47. 95
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridDailyService.java
  48. 95
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java
  49. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java
  50. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDepartmentServiceImpl.java
  51. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectDailyServiceImpl.java
  52. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectMonthlyServiceImpl.java
  53. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedDepartmentDailyServiceImpl.java
  54. 100
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyDailyServiceImpl.java
  55. 101
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java
  56. 100
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridDailyServiceImpl.java
  57. 100
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java
  58. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java
  59. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java
  60. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql
  61. 67
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml
  62. 34
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml
  63. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml
  64. 13
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDateDao.xml
  65. 11
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml
  66. 24
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml
  67. 9
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectMonthlyDao.xml
  68. 5
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedDepartmentDailyDao.xml
  69. 50
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyDailyDao.xml
  70. 48
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml
  71. 50
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridDailyDao.xml
  72. 48
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml
  73. 17
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleDao.xml
  74. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml

29
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IssueConstant.java

@ -0,0 +1,29 @@
package com.epmet.constant;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/6/17 17:23
*/
public interface IssueConstant {
/**
*表决中
*/
String VOTING = "voting";
/**
*已转项目
*/
String SHIFT_PROJECT = "shift_project";
/**
*已关闭
*/
String CLOSED = "closed";
/**
*已解决
*/
String RESLOVED = "resloved";
/**
*未解决
*/
String UNRESLOVED = "unresloved";
}

35
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueAgencyDTO.java

@ -0,0 +1,35 @@
package com.epmet.dto.issue;
import lombok.Data;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/6/17 14:06
*/
@Data
public class IssueAgencyDTO implements Serializable {
private static final long serialVersionUID = 8258586413692513595L;
/**
* 组织ID
*/
private String agencyId;
/**
* 上级ID
*/
private String pId;
/**
* 所有上级ID
*/
private String pIds;
/**
* 状态
*/
private String status;
/**
* 数量
*/
private Integer count;
}

31
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectAgencyDTO.java

@ -0,0 +1,31 @@
package com.epmet.dto.project;
import lombok.Data;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/6/18 16:48
*/
@Data
public class ProjectAgencyDTO implements Serializable {
private static final long serialVersionUID = 4581232825130630169L;
/**
* 组织ID
*/
private String agencyId;
/**
* 所有上级ID
*/
private String pIds;
/**
* 状态
*/
private String status;
/**
* 数量
*/
private Integer count;
}

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

@ -0,0 +1,37 @@
package com.epmet.dto.project.form;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Author sun
* 查询项目机关过去一个月的日统计数据
*/
@Data
public class MonthProjectListFormDTO implements Serializable {
private static final long serialVersionUID = -3634745091993094743L;
/**
* 客户Id
*/
private String customerId;
/**
* 机关Id
*/
private String agencyId;
/**
* 起始时间
*/
private Date startTime;
/**
* 结束时间
*/
private Date endTime;
}

0
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/.gitkeep

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

@ -23,10 +23,20 @@ public class ArticleGridPublishedSummaryDTO implements Serializable {
* 客户id
*/
private String customerId;
/**
* 机关id
*/
private String agencyId;
/**
* 网格Id
*/
private String gridId;
/**
* 发布者Id publish_type类型为 部门时 是部门id类型为 机关时 是机关Id
*/
private String publisherId;
/**
* 发布文章总数
*/

237
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueAgencyDailyDTO.java

@ -0,0 +1,237 @@
/**
* 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;
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 FactIssueAgencyDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
* 上级组织ID
*/
private String pid;
/**
* 年度ID
*/
private String yearId;
/**
* 季度ID
*/
private String quarterId;
/**
* 月度ID
*/
private String monthId;
/**
* 周ID
*/
private String weekId;
/**
* 日期ID
*/
private String dateId;
/**
* 当日议题增量
*/
private Integer issueIncr;
/**
* 议题总数
*/
private Integer issueTotal;
/**
* 当日已转项目的议题数增量
*/
private Integer shiftProjectIncr;
/**
* 已转项目的议题总数
*/
private Integer shiftProjectTotal;
/**
* 已转项目所占百分比
*/
private BigDecimal shiftProjectPercent;
/**
* 当日表决中议题数增量
*/
private Integer votingIncr;
/**
* 表决中议题总数
*/
private Integer votingTotal;
/**
* 表决中议题所占百分比
*/
private BigDecimal votingPercent;
/**
* 当日已关闭议题数增量
*/
private Integer closedIncr;
/**
* 当日已关闭议题中已解决数量
*/
private Integer closedResolvedIncr;
/**
* 当日已关闭议题中无需解决数量
*/
private Integer closedUnresolvedIncr;
/**
* 已关闭议题总数
*/
private Integer closedTotal;
/**
* 已关闭议题中已解决总数
*/
private Integer closedResolvedTotal;
/**
* 已关闭议题中未解决总数
*/
private Integer closedUnresolvedTotal;
/**
* 已关闭议题所占百分比
*/
private BigDecimal closedPercent;
/**
* 已关闭议题中已解决百分比
*/
private BigDecimal closedResolvedPercent;
/**
* 已关闭议题中未解决百分比
*/
private BigDecimal closedUnresolvedPercent;
/**
* 当日已结案议题数
*/
private Integer closedCaseIncr;
/**
* 当日已结案议题中已解决数
*/
private Integer closedCaseResolvedIncr;
/**
* 当日已结案议题中未解决数
*/
private Integer closedCaseUnresolvedIncr;
/**
* 已结案议题总数
*/
private Integer closedCaseTotal;
/**
* 已结案议题中已解决总数
*/
private Integer closedCaseResolvedTotal;
/**
* 已结案议题中未解决总数
*/
private Integer closedCaseUnresolvedTotal;
/**
* 已结案议题中已解决百分比
*/
private BigDecimal closedCaseResolvedPercent;
/**
* 已结案议题中未解决百分比
*/
private BigDecimal closedCaseUnresolvedPercent;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 是否删除
*/
private String delFlag;
/**
* 更新时间
*/
private Date updatedTime;
}

227
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueAgencyMonthlyDTO.java

@ -0,0 +1,227 @@
/**
* 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;
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 FactIssueAgencyMonthlyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
* 上级组织ID
*/
private String pid;
/**
* 年度ID
*/
private String yearId;
/**
* 季度ID
*/
private String quarterId;
/**
* 月度ID
*/
private String monthId;
/**
* 当月议题增量
*/
private Integer issueIncr;
/**
* 议题总数
*/
private Integer issueTotal;
/**
* 当月已转项目的议题数增量
*/
private Integer shiftProjectIncr;
/**
* 已转项目的议题总数
*/
private Integer shiftProjectTotal;
/**
* 已转项目所占百分比
*/
private BigDecimal shiftProjectPercent;
/**
* 当月表决中议题数增量
*/
private Integer votingIncr;
/**
* 表决中议题总数
*/
private Integer votingTotal;
/**
* 表决中议题所占百分比
*/
private BigDecimal votingPercent;
/**
* 当月已关闭议题数增量
*/
private Integer closedIncr;
/**
* 当月已关闭议题中已解决数量
*/
private Integer closedResolvedIncr;
/**
* 当月已关闭议题中无需解决数量
*/
private Integer closedUnresolvedIncr;
/**
* 已关闭议题总数
*/
private Integer closedTotal;
/**
* 已关闭议题中已解决总数
*/
private Integer closedResolvedTotal;
/**
* 已关闭议题中未解决总数
*/
private Integer closedUnresolvedTotal;
/**
* 已关闭议题所占百分比
*/
private BigDecimal closedPercent;
/**
* 已关闭议题中已解决百分比
*/
private BigDecimal closedResolvedPercent;
/**
* 已关闭议题中未解决百分比
*/
private BigDecimal closedUnresolvedPercent;
/**
* 当月已结案议题数
*/
private Integer closedCaseIncr;
/**
* 当月已结案议题中已解决数
*/
private Integer closedCaseResolvedIncr;
/**
* 当月已结案议题中未解决数
*/
private Integer closedCaseUnresolvedIncr;
/**
* 已结案议题总数
*/
private Integer closedCaseTotal;
/**
* 已结案议题中已解决总数
*/
private Integer closedCaseResolvedTotal;
/**
* 已结案议题中未解决总数
*/
private Integer closedCaseUnresolvedTotal;
/**
* 已结案议题中已解决百分比
*/
private BigDecimal closedCaseResolvedPercent;
/**
* 已结案议题中未解决百分比
*/
private BigDecimal closedCaseUnresolvedPercent;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 是否删除
*/
private String delFlag;
/**
* 更新时间
*/
private Date updatedTime;
}

237
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueGridDailyDTO.java

@ -0,0 +1,237 @@
/**
* 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;
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 FactIssueGridDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
* 网格ID
*/
private String gridId;
/**
* 年度ID
*/
private String yearId;
/**
* 季度ID
*/
private String quarterId;
/**
* 月度ID
*/
private String monthId;
/**
* 周ID
*/
private String weekId;
/**
* 日期ID
*/
private String dateId;
/**
* 当日议题增量
*/
private Integer issueIncr;
/**
* 议题总数
*/
private Integer issueTotal;
/**
* 当日已转项目的议题数增量
*/
private Integer shiftProjectIncr;
/**
* 已转项目的议题总数
*/
private Integer shiftProjectTotal;
/**
* 已转项目所占百分比
*/
private BigDecimal shiftProjectPercent;
/**
* 当日表决中议题数增量
*/
private Integer votingIncr;
/**
* 表决中议题总数
*/
private Integer votingTotal;
/**
* 表决中议题所占百分比
*/
private BigDecimal votingPercent;
/**
* 当日已关闭议题数增量
*/
private Integer closedIncr;
/**
* 当日已关闭议题中已解决数量
*/
private Integer closedResolvedIncr;
/**
* 当日已关闭议题中无需解决数量
*/
private Integer closedUnresolvedIncr;
/**
* 已关闭议题总数
*/
private Integer closedTotal;
/**
* 已关闭议题中已解决总数
*/
private Integer closedResolvedTotal;
/**
* 已关闭议题中未解决总数
*/
private Integer closedUnresolvedTotal;
/**
* 已关闭议题所占百分比
*/
private BigDecimal closedPercent;
/**
* 已关闭议题中已解决百分比
*/
private BigDecimal closedResolvedPercent;
/**
* 已关闭议题中未解决百分比
*/
private BigDecimal closedUnresolvedPercent;
/**
* 当日已结案议题数
*/
private Integer closedCaseIncr;
/**
* 当日已结案议题中已解决数
*/
private Integer closedCaseResolvedIncr;
/**
* 当日已结案议题中未解决数
*/
private Integer closedCaseUnresolvedIncr;
/**
* 已结案议题总数
*/
private Integer closedCaseTotal;
/**
* 已结案议题中已解决总数
*/
private Integer closedCaseResolvedTotal;
/**
* 已结案议题中未解决总数
*/
private Integer closedCaseUnresolvedTotal;
/**
* 已结案议题中已解决百分比
*/
private BigDecimal closedCaseResolvedPercent;
/**
* 已结案议题中未解决百分比
*/
private BigDecimal closedCaseUnresolvedPercent;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 是否删除
*/
private String delFlag;
/**
* 更新时间
*/
private Date updatedTime;
}

227
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueGridMonthlyDTO.java

@ -0,0 +1,227 @@
/**
* 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;
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 FactIssueGridMonthlyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
* 网格ID
*/
private String gridId;
/**
* 年度ID
*/
private String yearId;
/**
* 季度ID
*/
private String quarterId;
/**
* 月度ID
*/
private String monthId;
/**
* 当月议题增量
*/
private Integer issueIncr;
/**
* 议题总数
*/
private Integer issueTotal;
/**
* 当月已转项目的议题数增量
*/
private Integer shiftProjectIncr;
/**
* 已转项目的议题总数
*/
private Integer shiftProjectTotal;
/**
* 已转项目所占百分比
*/
private BigDecimal shiftProjectPercent;
/**
* 当月表决中议题数增量
*/
private Integer votingIncr;
/**
* 表决中议题总数
*/
private Integer votingTotal;
/**
* 表决中议题所占百分比
*/
private BigDecimal votingPercent;
/**
* 当月已关闭议题数增量
*/
private Integer closedIncr;
/**
* 当月已关闭议题中已解决数量
*/
private Integer closedResolvedIncr;
/**
* 当月已关闭议题中无需解决数量
*/
private Integer closedUnresolvedIncr;
/**
* 已关闭议题总数
*/
private Integer closedTotal;
/**
* 已关闭议题中已解决总数
*/
private Integer closedResolvedTotal;
/**
* 已关闭议题中未解决总数
*/
private Integer closedUnresolvedTotal;
/**
* 已关闭议题所占百分比
*/
private BigDecimal closedPercent;
/**
* 已关闭议题中已解决百分比
*/
private BigDecimal closedResolvedPercent;
/**
* 已关闭议题中未解决百分比
*/
private BigDecimal closedUnresolvedPercent;
/**
* 当月已结案议题数
*/
private Integer closedCaseIncr;
/**
* 当月已结案议题中已解决数
*/
private Integer closedCaseResolvedIncr;
/**
* 当月已结案议题中未解决数
*/
private Integer closedCaseUnresolvedIncr;
/**
* 已结案议题总数
*/
private Integer closedCaseTotal;
/**
* 已结案议题中已解决总数
*/
private Integer closedCaseResolvedTotal;
/**
* 已结案议题中未解决总数
*/
private Integer closedCaseUnresolvedTotal;
/**
* 已结案议题中已解决百分比
*/
private BigDecimal closedCaseResolvedPercent;
/**
* 已结案议题中未解决百分比
*/
private BigDecimal closedCaseUnresolvedPercent;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 是否删除
*/
private String delFlag;
/**
* 更新时间
*/
private Date updatedTime;
}

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

@ -30,5 +30,17 @@ public interface ProjectConstant {
* 项目处理进展-结案
*/
String CLOSE = "close";
/**
* 发布单位类型 机关:agency
*/
String PUBLISH_TYPE_AGENCY = "agency";
/**
* 发布单位类型 部门department
*/
String PUBLISH_TYPE_DEPT = "department";
/**
* 发布单位类型 网格grid
*/
String PUBLISH_TYPE_GRID = "grid";
}

43
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java

@ -1,14 +1,55 @@
package com.epmet.dao.issue;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.issue.IssueAgencyDTO;
import com.epmet.entity.issue.IssueEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface StatsIssueDao extends BaseDao<IssueEntity> {
List<IssueEntity> listAllEntities();
/**
* 获取当前日期组织下议题统计结果
*
* @param customerId
* @return java.util.List<com.epmet.dto.issue.IssueAgencyDTO>
* @author zhaoqifeng
* @date 2020/6/17 14:13
*/
List<IssueAgencyDTO> selectAgencyIssueTotal(@Param("customerId") String customerId);
/**
* 获取当前日期组织下议题增量
* @author zhaoqifeng
* @date 2020/6/18 9:55
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueAgencyDTO>
*/
List<IssueAgencyDTO> selectAgencyIssueInc(@Param("customerId") String customerId, @Param("date") String date);
/**
* 已关闭议题统计
* @author zhaoqifeng
* @date 2020/6/18 14:41
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueAgencyDTO>
*/
List<IssueAgencyDTO> selectAgencyClosedIssueTotal(@Param("customerId") String customerId, @Param("date") String date);
/**
* 已关闭议题增量
* @author zhaoqifeng
* @date 2020/6/18 14:41
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueAgencyDTO>
*/
List<IssueAgencyDTO> selectAgencyClosedIssueInc(@Param("customerId") String customerId, @Param("date") String date);
}

25
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java

@ -18,6 +18,7 @@
package com.epmet.dao.project;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.project.ProjectAgencyDTO;
import com.epmet.entity.project.ProjectEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -34,9 +35,29 @@ import java.util.List;
public interface ProjectDao extends BaseDao<ProjectEntity> {
/**
* @param customerId
* @param projectEntity
* @Author sun
* @Description 根据客户Id查询客户项目业务表有效数据
**/
List<ProjectEntity> selectProjectList(@Param("customerId") String customerId);
List<ProjectEntity> selectProjectList(ProjectEntity projectEntity);
/**
* 已结案项目统计
* @author zhaoqifeng
* @date 2020/6/18 17:01
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.project.ProjectAgencyDTO>
*/
List<ProjectAgencyDTO> selectAgencyClosedProjectTotal(@Param("customerId") String customerId, @Param("date") String date);
/**
* 已结案项目增量
* @author zhaoqifeng
* @date 2020/6/18 17:01
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.project.ProjectAgencyDTO>
*/
List<ProjectAgencyDTO> selectAgencyClosedProjectInc(@Param("customerId") String customerId, @Param("date") String date);
}

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java

@ -18,6 +18,7 @@
package com.epmet.dao.project;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.project.ProjectEntity;
import com.epmet.entity.project.ProjectProcessEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -34,10 +35,10 @@ import java.util.List;
public interface ProjectProcessDao extends BaseDao<ProjectProcessEntity> {
/**
* @param customerId
* @param projectEntity
* @Author sun
* @Description 查询客户项目处理进展表中是创建项目和结案两种进展的有效数据(创建日期截取yyyy-mm-dd格式字段值)
**/
List<ProjectProcessEntity> selectProcessList(@Param("customerId") String customerId);
List<ProjectProcessEntity> selectProcessList(ProjectEntity projectEntity);
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDateDao.java

@ -35,14 +35,6 @@ import java.util.List;
@Mapper
public interface DimDateDao extends BaseDao<DimDateEntity> {
/**
* @param dto
* @return
* @Author sun
* @Description 根据创建时间查询日维度信息
**/
List<DimDateDTO> selectDimDate(DimDateDTO dto);
/**
* 最新的按日维度
*/

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

@ -20,6 +20,9 @@ package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.stats.DimDepartmentEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 客户部门维度
@ -30,4 +33,11 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface DimDepartmentDao extends BaseDao<DimDepartmentEntity> {
int insertOne(DimDepartmentEntity dim);
/**
* desc:根据客户Id获取所有的部门信息
* @param customerId
* @return
*/
List<DimDepartmentEntity> getDepartmentListByCustomerId(@Param("customerId") String customerId);
}

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

@ -18,9 +18,12 @@
package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.project.form.MonthProjectListFormDTO;
import com.epmet.entity.stats.FactAgencyProjectDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据
*
@ -29,5 +32,18 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface FactAgencyProjectDailyDao extends BaseDao<FactAgencyProjectDailyEntity> {
/**
* @param formDTO
* @Author sun
* @Description 查询上一月机关日统计数据按时间倒序
**/
List<FactAgencyProjectDailyEntity> selectMonthProjectList(MonthProjectListFormDTO formDTO);
/**
* @param delEntity
* @Author sun
* @Description 根据客户Id日维度Id批量物理删除一下可能存在的历史数据
**/
void delDateProject(FactAgencyProjectDailyEntity delEntity);
}

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

@ -29,5 +29,12 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface FactAgencyProjectMonthlyDao extends BaseDao<FactAgencyProjectMonthlyEntity> {
/**
* @param delEntity
* @return
* @Author sun
* @Description 根据客户Id月份Id批量物理删除可能存在的历史数据
**/
void delMonthProject(FactAgencyProjectMonthlyEntity delEntity);
}

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

@ -20,6 +20,7 @@ package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 文章发布数量部门日统计表
@ -29,5 +30,12 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface FactArticlePublishedDepartmentDailyDao extends BaseDao<FactArticlePublishedDepartmentDailyEntity> {
/**
* desc:根据客户id日期 删除数据
* @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/FactIssueAgencyDailyDao.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;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.stats.FactIssueAgencyDailyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 议题数量(按日)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Mapper
public interface FactIssueAgencyDailyDao extends BaseDao<FactIssueAgencyDailyEntity> {
}

33
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.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;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.stats.FactIssueAgencyMonthlyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 组织机关议题数量(按月)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Mapper
public interface FactIssueAgencyMonthlyDao extends BaseDao<FactIssueAgencyMonthlyEntity> {
}

33
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.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;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.stats.FactIssueGridDailyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 网格议题数量(按日)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Mapper
public interface FactIssueGridDailyDao extends BaseDao<FactIssueGridDailyEntity> {
}

33
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.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;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.stats.FactIssueGridMonthlyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 网格议题数量(按月)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Mapper
public interface FactIssueGridMonthlyDao extends BaseDao<FactIssueGridMonthlyEntity> {
}

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

@ -18,8 +18,13 @@
package com.epmet.dao.voice;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO;
import com.epmet.entity.voice.ArticleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
* 文章表
@ -29,5 +34,14 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface ArticleDao extends BaseDao<ArticleEntity> {
/**
* desc:根据客户Id 和发布时间 获取文章总数
*
* @param customerId
* @param publishDate
* @param publishType
* @return
*/
List<ArticleGridPublishedSummaryDTO> getAllPublishedCount(@Param("customerId") String customerId, @Param("publishDate") Date publishDate, @Param("publishType") String publishType);
}

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

@ -48,7 +48,7 @@ public class FactArticlePublishedDepartmentDailyEntity extends BaseEpmetEntity {
/**
* 部门ID
*/
private String depsartmentId;
private String departmentId;
/**
* 文章累计发文数量 文章数量

207
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueAgencyDailyEntity.java

@ -0,0 +1,207 @@
/**
* 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;
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_issue_agency_daily")
public class FactIssueAgencyDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
* 上级组织ID
*/
private String pid;
/**
* 年度ID
*/
private String yearId;
/**
* 季度ID
*/
private String quarterId;
/**
* 月度ID
*/
private String monthId;
/**
* 周ID
*/
private String weekId;
/**
* 日期ID
*/
private String dateId;
/**
* 当日议题增量
*/
private Integer issueIncr;
/**
* 议题总数
*/
private Integer issueTotal;
/**
* 当日已转项目的议题数增量
*/
private Integer shiftProjectIncr;
/**
* 已转项目的议题总数
*/
private Integer shiftProjectTotal;
/**
* 已转项目所占百分比
*/
private BigDecimal shiftProjectPercent;
/**
* 当日表决中议题数增量
*/
private Integer votingIncr;
/**
* 表决中议题总数
*/
private Integer votingTotal;
/**
* 表决中议题所占百分比
*/
private BigDecimal votingPercent;
/**
* 当日已关闭议题数增量
*/
private Integer closedIncr;
/**
* 当日已关闭议题中已解决数量
*/
private Integer closedResolvedIncr;
/**
* 当日已关闭议题中无需解决数量
*/
private Integer closedUnresolvedIncr;
/**
* 已关闭议题总数
*/
private Integer closedTotal;
/**
* 已关闭议题中已解决总数
*/
private Integer closedResolvedTotal;
/**
* 已关闭议题中未解决总数
*/
private Integer closedUnresolvedTotal;
/**
* 已关闭议题所占百分比
*/
private BigDecimal closedPercent;
/**
* 已关闭议题中已解决百分比
*/
private BigDecimal closedResolvedPercent;
/**
* 已关闭议题中未解决百分比
*/
private BigDecimal closedUnresolvedPercent;
/**
* 当日已结案议题数
*/
private Integer closedCaseIncr;
/**
* 当日已结案议题中已解决数
*/
private Integer closedCaseResolvedIncr;
/**
* 当日已结案议题中未解决数
*/
private Integer closedCaseUnresolvedIncr;
/**
* 已结案议题总数
*/
private Integer closedCaseTotal;
/**
* 已结案议题中已解决总数
*/
private Integer closedCaseResolvedTotal;
/**
* 已结案议题中未解决总数
*/
private Integer closedCaseUnresolvedTotal;
/**
* 已结案议题中已解决百分比
*/
private BigDecimal closedCaseResolvedPercent;
/**
* 已结案议题中未解决百分比
*/
private BigDecimal closedCaseUnresolvedPercent;
}

197
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueAgencyMonthlyEntity.java

@ -0,0 +1,197 @@
/**
* 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;
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_issue_agency_monthly")
public class FactIssueAgencyMonthlyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
* 上级组织ID
*/
private String pid;
/**
* 年度ID
*/
private String yearId;
/**
* 季度ID
*/
private String quarterId;
/**
* 月度ID
*/
private String monthId;
/**
* 当月议题增量
*/
private Integer issueIncr;
/**
* 议题总数
*/
private Integer issueTotal;
/**
* 当月已转项目的议题数增量
*/
private Integer shiftProjectIncr;
/**
* 已转项目的议题总数
*/
private Integer shiftProjectTotal;
/**
* 已转项目所占百分比
*/
private BigDecimal shiftProjectPercent;
/**
* 当月表决中议题数增量
*/
private Integer votingIncr;
/**
* 表决中议题总数
*/
private Integer votingTotal;
/**
* 表决中议题所占百分比
*/
private BigDecimal votingPercent;
/**
* 当月已关闭议题数增量
*/
private Integer closedIncr;
/**
* 当月已关闭议题中已解决数量
*/
private Integer closedResolvedIncr;
/**
* 当月已关闭议题中无需解决数量
*/
private Integer closedUnresolvedIncr;
/**
* 已关闭议题总数
*/
private Integer closedTotal;
/**
* 已关闭议题中已解决总数
*/
private Integer closedResolvedTotal;
/**
* 已关闭议题中未解决总数
*/
private Integer closedUnresolvedTotal;
/**
* 已关闭议题所占百分比
*/
private BigDecimal closedPercent;
/**
* 已关闭议题中已解决百分比
*/
private BigDecimal closedResolvedPercent;
/**
* 已关闭议题中未解决百分比
*/
private BigDecimal closedUnresolvedPercent;
/**
* 当月已结案议题数
*/
private Integer closedCaseIncr;
/**
* 当月已结案议题中已解决数
*/
private Integer closedCaseResolvedIncr;
/**
* 当月已结案议题中未解决数
*/
private Integer closedCaseUnresolvedIncr;
/**
* 已结案议题总数
*/
private Integer closedCaseTotal;
/**
* 已结案议题中已解决总数
*/
private Integer closedCaseResolvedTotal;
/**
* 已结案议题中未解决总数
*/
private Integer closedCaseUnresolvedTotal;
/**
* 已结案议题中已解决百分比
*/
private BigDecimal closedCaseResolvedPercent;
/**
* 已结案议题中未解决百分比
*/
private BigDecimal closedCaseUnresolvedPercent;
}

207
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueGridDailyEntity.java

@ -0,0 +1,207 @@
/**
* 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;
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_issue_grid_daily")
public class FactIssueGridDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
* 网格ID
*/
private String gridId;
/**
* 年度ID
*/
private String yearId;
/**
* 季度ID
*/
private String quarterId;
/**
* 月度ID
*/
private String monthId;
/**
* 周ID
*/
private String weekId;
/**
* 日期ID
*/
private String dateId;
/**
* 当日议题增量
*/
private Integer issueIncr;
/**
* 议题总数
*/
private Integer issueTotal;
/**
* 当日已转项目的议题数增量
*/
private Integer shiftProjectIncr;
/**
* 已转项目的议题总数
*/
private Integer shiftProjectTotal;
/**
* 已转项目所占百分比
*/
private BigDecimal shiftProjectPercent;
/**
* 当日表决中议题数增量
*/
private Integer votingIncr;
/**
* 表决中议题总数
*/
private Integer votingTotal;
/**
* 表决中议题所占百分比
*/
private BigDecimal votingPercent;
/**
* 当日已关闭议题数增量
*/
private Integer closedIncr;
/**
* 当日已关闭议题中已解决数量
*/
private Integer closedResolvedIncr;
/**
* 当日已关闭议题中无需解决数量
*/
private Integer closedUnresolvedIncr;
/**
* 已关闭议题总数
*/
private Integer closedTotal;
/**
* 已关闭议题中已解决总数
*/
private Integer closedResolvedTotal;
/**
* 已关闭议题中未解决总数
*/
private Integer closedUnresolvedTotal;
/**
* 已关闭议题所占百分比
*/
private BigDecimal closedPercent;
/**
* 已关闭议题中已解决百分比
*/
private BigDecimal closedResolvedPercent;
/**
* 已关闭议题中未解决百分比
*/
private BigDecimal closedUnresolvedPercent;
/**
* 当日已结案议题数
*/
private Integer closedCaseIncr;
/**
* 当日已结案议题中已解决数
*/
private Integer closedCaseResolvedIncr;
/**
* 当日已结案议题中未解决数
*/
private Integer closedCaseUnresolvedIncr;
/**
* 已结案议题总数
*/
private Integer closedCaseTotal;
/**
* 已结案议题中已解决总数
*/
private Integer closedCaseResolvedTotal;
/**
* 已结案议题中未解决总数
*/
private Integer closedCaseUnresolvedTotal;
/**
* 已结案议题中已解决百分比
*/
private BigDecimal closedCaseResolvedPercent;
/**
* 已结案议题中未解决百分比
*/
private BigDecimal closedCaseUnresolvedPercent;
}

197
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueGridMonthlyEntity.java

@ -0,0 +1,197 @@
/**
* 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;
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_issue_grid_monthly")
public class FactIssueGridMonthlyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
* 网格ID
*/
private String gridId;
/**
* 年度ID
*/
private String yearId;
/**
* 季度ID
*/
private String quarterId;
/**
* 月度ID
*/
private String monthId;
/**
* 当月议题增量
*/
private Integer issueIncr;
/**
* 议题总数
*/
private Integer issueTotal;
/**
* 当月已转项目的议题数增量
*/
private Integer shiftProjectIncr;
/**
* 已转项目的议题总数
*/
private Integer shiftProjectTotal;
/**
* 已转项目所占百分比
*/
private BigDecimal shiftProjectPercent;
/**
* 当月表决中议题数增量
*/
private Integer votingIncr;
/**
* 表决中议题总数
*/
private Integer votingTotal;
/**
* 表决中议题所占百分比
*/
private BigDecimal votingPercent;
/**
* 当月已关闭议题数增量
*/
private Integer closedIncr;
/**
* 当月已关闭议题中已解决数量
*/
private Integer closedResolvedIncr;
/**
* 当月已关闭议题中无需解决数量
*/
private Integer closedUnresolvedIncr;
/**
* 已关闭议题总数
*/
private Integer closedTotal;
/**
* 已关闭议题中已解决总数
*/
private Integer closedResolvedTotal;
/**
* 已关闭议题中未解决总数
*/
private Integer closedUnresolvedTotal;
/**
* 已关闭议题所占百分比
*/
private BigDecimal closedPercent;
/**
* 已关闭议题中已解决百分比
*/
private BigDecimal closedResolvedPercent;
/**
* 已关闭议题中未解决百分比
*/
private BigDecimal closedUnresolvedPercent;
/**
* 当月已结案议题数
*/
private Integer closedCaseIncr;
/**
* 当月已结案议题中已解决数
*/
private Integer closedCaseResolvedIncr;
/**
* 当月已结案议题中未解决数
*/
private Integer closedCaseUnresolvedIncr;
/**
* 已结案议题总数
*/
private Integer closedCaseTotal;
/**
* 已结案议题中已解决总数
*/
private Integer closedCaseResolvedTotal;
/**
* 已结案议题中未解决总数
*/
private Integer closedCaseUnresolvedTotal;
/**
* 已结案议题中已解决百分比
*/
private BigDecimal closedCaseResolvedPercent;
/**
* 已结案议题中未解决百分比
*/
private BigDecimal closedCaseUnresolvedPercent;
}

51
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java

@ -0,0 +1,51 @@
package com.epmet.service.Issue;
import com.epmet.dto.issue.IssueAgencyDTO;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/6/17 16:01
*/
public interface IssueService {
/**
* 获取以组织为单位议题统计结果
* @author zhaoqifeng
* @date 2020/6/17 16:04
* @param customerId
* @return java.util.List<com.epmet.dto.issue.IssueAgencyDTO>
*/
List<IssueAgencyDTO> getAgencyIssueTotal(String customerId);
/**
* 获取当前日期组织下议题增量
* @author zhaoqifeng
* @date 2020/6/18 9:56
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueAgencyDTO>
*/
List<IssueAgencyDTO> getAgencyIssueInc(String customerId, String date);
/**
* 获取截止当前日期组织下已关闭议题统计
* @author zhaoqifeng
* @date 2020/6/18 9:56
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueAgencyDTO>
*/
List<IssueAgencyDTO> getAgencyClosedIssueTotal(String customerId, String date);
/**
* 获取当前日期组织下已关闭议题增量
* @author zhaoqifeng
* @date 2020/6/18 9:56
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueAgencyDTO>
*/
List<IssueAgencyDTO> getAgencyClosedIssueInc(String customerId, String date);
}

61
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java

@ -0,0 +1,61 @@
package com.epmet.service.Issue.impl;
import com.epmet.dao.issue.StatsIssueDao;
import com.epmet.dto.issue.IssueAgencyDTO;
import com.epmet.service.Issue.IssueService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/6/17 16:02
*/
@Service
public class IssueServiceImpl implements IssueService {
@Autowired
private StatsIssueDao statsIssueDao;
@Override
public List<IssueAgencyDTO> getAgencyIssueTotal(String customerId) {
List<IssueAgencyDTO> list = statsIssueDao.selectAgencyIssueTotal(customerId);
list.forEach(dto -> {
String[] pIds = dto.getPIds().split(":");
dto.setPId(pIds[pIds.length - 2]);
});
return list;
}
@Override
public List<IssueAgencyDTO> getAgencyIssueInc(String customerId, String date) {
List<IssueAgencyDTO> list = statsIssueDao.selectAgencyIssueInc(customerId, date);
list.forEach(dto -> {
String[] pIds = dto.getPIds().split(":");
dto.setPId(pIds[pIds.length - 2]);
});
return list;
}
@Override
public List<IssueAgencyDTO> getAgencyClosedIssueTotal(String customerId, String date) {
List<IssueAgencyDTO> list = statsIssueDao.selectAgencyClosedIssueTotal(customerId, date);
list.forEach(dto -> {
String[] pIds = dto.getPIds().split(":");
dto.setPId(pIds[pIds.length - 2]);
});
return list;
}
@Override
public List<IssueAgencyDTO> getAgencyClosedIssueInc(String customerId, String date) {
List<IssueAgencyDTO> list = statsIssueDao.selectAgencyClosedIssueInc(customerId, date);
list.forEach(dto -> {
String[] pIds = dto.getPIds().split(":");
dto.setPId(pIds[pIds.length - 2]);
});
return list;
}
}

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java

@ -0,0 +1,20 @@
package com.epmet.service;
import java.util.Date;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/6/17 16:51
*/
public interface StatsIssueService {
/**
* 机关下议题统计
* @author zhaoqifeng
* @date 2020/6/17 16:53
* @param customerId
* @param date
* @return void
*/
void saveIssueAgencyDaily(String customerId, Date date);
}

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

@ -0,0 +1,422 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.IssueConstant;
import com.epmet.dto.issue.IssueAgencyDTO;
import com.epmet.dto.project.ProjectAgencyDTO;
import com.epmet.dto.stats.DimAgencyDTO;
import com.epmet.entity.stats.FactIssueAgencyDailyEntity;
import com.epmet.entity.stats.FactIssueAgencyMonthlyEntity;
import com.epmet.service.Issue.IssueService;
import com.epmet.service.StatsIssueService;
import com.epmet.service.project.ProjectService;
import com.epmet.service.stats.DimAgencyService;
import com.epmet.service.stats.FactIssueAgencyDailyService;
import com.epmet.util.DimIdGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/6/17 16:51
*/
@Service
public class StatsIssueServiceImpl implements StatsIssueService {
@Autowired
private IssueService issueService;
@Autowired
private DimAgencyService dimAgencyService;
@Autowired
private ProjectService projectService;
@Autowired
private FactIssueAgencyDailyService factIssueAgencyDailyService;
@Override
public void saveIssueAgencyDaily(String customerId, Date date) {
String dateString = DateUtils.format(date);
DimAgencyDTO dimAgencyDTO = new DimAgencyDTO();
dimAgencyDTO.setCustomerId(customerId);
//获取当前客户下所有机关
List<DimAgencyDTO> agencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO);
//获取机关下议题各种状态的数目统计
List<IssueAgencyDTO> issueAgencyTotalList = issueService.getAgencyIssueTotal(customerId);
//获取机关下议题各种状态的数目增量
List<IssueAgencyDTO> issueAgencyIncList = issueService.getAgencyIssueInc(customerId, dateString);
//获取机关下已关闭议题统计
List<IssueAgencyDTO> issueAgencyClosedTotalList = issueService.getAgencyIssueInc(customerId, dateString);
//获取机关下已关闭议题增量
List<IssueAgencyDTO> issueAgencyClosedIncList = issueService.getAgencyIssueInc(customerId, dateString);
//已结案项目统计
List<ProjectAgencyDTO> projectAgencyClosedTotalList = projectService.getAgencyClosedProjectTotal(customerId, dateString);
//已结案项目增量
List<ProjectAgencyDTO> projectAgencyClosedIncList = projectService.getAgencyClosedProjectInc(customerId, dateString);
//获取日期相关维度
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date);
List<FactIssueAgencyDailyEntity> list = new ArrayList<>();
for (DimAgencyDTO agency : agencyList) {
FactIssueAgencyDailyEntity entity = initIssueAgencyDaily(dimId);
entity.setCustomerId(agency.getCustomerId());
entity.setAgencyId(agency.getId());
entity.setPid(agency.getPid());
String pIds;
if (null == agency.getPids() || agency.getPids().isEmpty()) {
pIds = agency.getPid().concat(":").concat(agency.getId());
} else {
pIds = ("0").concat(":").concat(agency.getPids()).concat(":").concat(agency.getId());
}
//总量统计
saveTotal(issueAgencyTotalList, agency, entity, pIds);
//增量统计
saveInc(issueAgencyIncList, agency, entity, pIds);
//已关闭议题已解决未解决统计
if (entity.getClosedTotal() > NumConstant.ZERO) {
saveClosedTotal(issueAgencyClosedTotalList, agency, entity, pIds);
//已关闭议题已解决未解决增量统计
if (entity.getClosedIncr() > NumConstant.ZERO) {
saveClosedInc(issueAgencyClosedIncList, agency, entity, pIds);
}
}
//已关闭项目已解决未解决统计
if (entity.getShiftProjectTotal() > NumConstant.ZERO) {
saveClosedProjectTotal(projectAgencyClosedTotalList, agency, entity, pIds);
//已关闭项目已解决未解决增量统计
if (entity.getClosedCaseTotal() > NumConstant.ZERO) {
saveClosedProjectInc(projectAgencyClosedIncList, agency, entity, pIds);
}
}
list.add(entity);
factIssueAgencyDailyService.insertBatch(list);
}
}
/**
* 已关闭项目已解决未解决增量统计
* @author zhaoqifeng
* @date 2020/6/18 17:23
* @param list
* @param agency
* @param entity
* @param pIds
* @return void
*/
private void saveClosedProjectInc(List<ProjectAgencyDTO> list, DimAgencyDTO agency, FactIssueAgencyDailyEntity entity, String pIds) {
//已解决数
int resolvedCount = NumConstant.ZERO;
//未解决数
int unresolvedCount = NumConstant.ZERO;
for (ProjectAgencyDTO project : list) {
if (agency.getId().equals(project.getAgencyId()) || project.getPIds().contains(pIds)) {
if (IssueConstant.RESLOVED.equals(project.getStatus())) {
//已解决数量
resolvedCount = resolvedCount + project.getCount();
} else if (IssueConstant.SHIFT_PROJECT.equals(project.getStatus())) {
//未解决数量
unresolvedCount = unresolvedCount + project.getCount();
}
}
}
int total = resolvedCount + unresolvedCount;
entity.setClosedCaseResolvedIncr(resolvedCount);
entity.setClosedCaseUnresolvedIncr(unresolvedCount);
entity.setClosedCaseIncr(total);
}
/**
* 已关闭项目已解决未解决统计
* @author zhaoqifeng
* @date 2020/6/18 17:23
* @param list
* @param agency
* @param entity
* @param pIds
* @return void
*/
private void saveClosedProjectTotal(List<ProjectAgencyDTO> list, DimAgencyDTO agency, FactIssueAgencyDailyEntity entity, String pIds) {
//已解决数
int resolvedCount = NumConstant.ZERO;
//未解决数
int unresolvedCount = NumConstant.ZERO;
for (ProjectAgencyDTO project : list) {
if (agency.getId().equals(project.getAgencyId()) || project.getPIds().contains(pIds)) {
if (IssueConstant.RESLOVED.equals(project.getStatus())) {
//已解决数量
resolvedCount = resolvedCount + project.getCount();
} else if (IssueConstant.SHIFT_PROJECT.equals(project.getStatus())) {
//未解决数量
unresolvedCount = unresolvedCount + project.getCount();
}
}
}
int total = resolvedCount + unresolvedCount;
entity.setClosedCaseResolvedTotal(resolvedCount);
entity.setClosedCaseUnresolvedTotal(unresolvedCount);
entity.setClosedCaseTotal(total);
if (total > NumConstant.ZERO) {
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
BigDecimal resolved = new BigDecimal(resolvedCount);
BigDecimal unresolved = new BigDecimal(unresolvedCount);
BigDecimal closed = new BigDecimal(total);
entity.setClosedCaseResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP));
entity.setClosedCaseUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP));
}
}
/**
* 议题各状态增量统计
*
* @param list
* @param agency
* @param entity
* @param pIds
* @return void
* @author zhaoqifeng
* @date 2020/6/18 15:55
*/
private void saveInc(List<IssueAgencyDTO> list, DimAgencyDTO agency, FactIssueAgencyDailyEntity entity, String pIds) {
//表决中增量
int votingInc = NumConstant.ZERO;
//已转项目增量
int shiftInc = NumConstant.ZERO;
//已关闭增量
int closedInc = NumConstant.ZERO;
for (IssueAgencyDTO issueAgency : list) {
if (agency.getId().equals(issueAgency.getAgencyId()) || issueAgency.getPIds().contains(pIds)) {
if (IssueConstant.VOTING.equals(issueAgency.getStatus())) {
//表决中议题数量
votingInc = votingInc + issueAgency.getCount();
} else if (IssueConstant.SHIFT_PROJECT.equals(issueAgency.getStatus())) {
//已转项目议题数量
shiftInc = shiftInc + issueAgency.getCount();
} else {
//已关闭议题数量
closedInc = closedInc + issueAgency.getCount();
}
}
}
int issueInc = votingInc + shiftInc + closedInc;
entity.setVotingIncr(votingInc);
entity.setShiftProjectIncr(shiftInc);
entity.setClosedIncr(closedInc);
entity.setIssueIncr(issueInc);
}
/**
* 议题各状态数量统计
*
* @param list
* @param agency
* @param entity
* @param pIds
* @return void
* @author zhaoqifeng
* @date 2020/6/18 15:54
*/
private void saveTotal(List<IssueAgencyDTO> list, DimAgencyDTO agency, FactIssueAgencyDailyEntity entity, String pIds) {
//表决中数量
Integer votingCount = NumConstant.ZERO;
//已转项目数量
Integer shiftCount = NumConstant.ZERO;
//已关闭数量
Integer closedCount = NumConstant.ZERO;
for (IssueAgencyDTO issueAgency : list) {
if (agency.getId().equals(issueAgency.getAgencyId()) || issueAgency.getPIds().contains(pIds)) {
if (IssueConstant.VOTING.equals(issueAgency.getStatus())) {
//表决中议题数量
votingCount = votingCount + issueAgency.getCount();
} else if (IssueConstant.SHIFT_PROJECT.equals(issueAgency.getStatus())) {
//已转项目议题数量
shiftCount = shiftCount + issueAgency.getCount();
} else {
//已关闭议题数量
closedCount = closedCount + issueAgency.getCount();
}
}
}
int issueTotal = votingCount + shiftCount + closedCount;
entity.setVotingTotal(votingCount);
entity.setShiftProjectTotal(shiftCount);
entity.setClosedTotal(closedCount);
entity.setIssueTotal(issueTotal);
if (NumConstant.ZERO != issueTotal) {
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
BigDecimal voting = new BigDecimal(votingCount);
BigDecimal shift = new BigDecimal(shiftCount);
BigDecimal closed = new BigDecimal(closedCount);
BigDecimal total = new BigDecimal(issueTotal);
entity.setVotingPercent(voting.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP));
entity.setShiftProjectPercent(shift.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP));
entity.setClosedPercent(closed.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP));
}
}
/**
* 已关闭议题中已解决和未解决总数统计
*
* @param list
* @param agency
* @param entity
* @param pIds
* @return void
* @author zhaoqifeng
* @date 2020/6/18 15:48
*/
private void saveClosedTotal(List<IssueAgencyDTO> list, DimAgencyDTO agency, FactIssueAgencyDailyEntity entity, String pIds) {
//已解决数
int resolvedCount = NumConstant.ZERO;
//未解决数
int unresolvedCount = NumConstant.ZERO;
for (IssueAgencyDTO issueAgency : list) {
if (agency.getId().equals(issueAgency.getAgencyId()) || issueAgency.getPIds().contains(pIds)) {
if (IssueConstant.RESLOVED.equals(issueAgency.getStatus())) {
//表决中议题数量
resolvedCount = resolvedCount + issueAgency.getCount();
} else if (IssueConstant.SHIFT_PROJECT.equals(issueAgency.getStatus())) {
//已转项目议题数量
unresolvedCount = unresolvedCount + issueAgency.getCount();
}
}
}
entity.setClosedResolvedTotal(resolvedCount);
entity.setClosedUnresolvedTotal(unresolvedCount);
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
BigDecimal resolved = new BigDecimal(resolvedCount);
BigDecimal unresolved = new BigDecimal(unresolvedCount);
BigDecimal closed = new BigDecimal(entity.getClosedTotal());
entity.setClosedResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP));
entity.setClosedUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP));
}
/**
* 已关闭议题中已解决和未解决增量统计
*
* @param list
* @param agency
* @param entity
* @param pIds
* @return void
* @author zhaoqifeng
* @date 2020/6/18 15:48
*/
private void saveClosedInc(List<IssueAgencyDTO> list, DimAgencyDTO agency, FactIssueAgencyDailyEntity entity, String pIds) {
//已解决数
int resolvedInc = NumConstant.ZERO;
//未解决数
int unresolvedInc = NumConstant.ZERO;
for (IssueAgencyDTO issueAgency : list) {
if (agency.getId().equals(issueAgency.getAgencyId()) || issueAgency.getPIds().contains(pIds)) {
if (IssueConstant.RESLOVED.equals(issueAgency.getStatus())) {
//表决中议题数量
resolvedInc = resolvedInc + issueAgency.getCount();
} else if (IssueConstant.SHIFT_PROJECT.equals(issueAgency.getStatus())) {
//已转项目议题数量
unresolvedInc = unresolvedInc + issueAgency.getCount();
}
}
}
entity.setClosedResolvedIncr(resolvedInc);
entity.setClosedUnresolvedIncr(unresolvedInc);
}
/**
* 初始化数据
*
* @param dimIdBean
* @return com.epmet.entity.stats.FactIssueAgencyDailyEntity
* @author zhaoqifeng
* @date 2020/6/18 10:57
*/
private FactIssueAgencyDailyEntity initIssueAgencyDaily(DimIdGenerator.DimIdBean dimIdBean) {
FactIssueAgencyDailyEntity entity = new FactIssueAgencyDailyEntity();
entity.setYearId(dimIdBean.getYearId());
entity.setQuarterId(dimIdBean.getQuarterId());
entity.setMonthId(dimIdBean.getMonthId());
entity.setWeekId(dimIdBean.getWeekId());
entity.setDateId(dimIdBean.getDateId());
entity.setIssueTotal(NumConstant.ZERO);
entity.setIssueIncr(NumConstant.ZERO);
entity.setVotingTotal(NumConstant.ZERO);
entity.setVotingIncr(NumConstant.ZERO);
entity.setVotingPercent(BigDecimal.ZERO);
entity.setShiftProjectTotal(NumConstant.ZERO);
entity.setShiftProjectIncr(NumConstant.ZERO);
entity.setShiftProjectPercent(BigDecimal.ZERO);
entity.setClosedIncr(NumConstant.ZERO);
entity.setClosedResolvedIncr(NumConstant.ZERO);
entity.setClosedPercent(BigDecimal.ZERO);
entity.setClosedUnresolvedIncr(NumConstant.ZERO);
entity.setClosedTotal(NumConstant.ZERO);
entity.setClosedResolvedTotal(NumConstant.ZERO);
entity.setClosedUnresolvedTotal(NumConstant.ZERO);
entity.setClosedResolvedPercent(BigDecimal.ZERO);
entity.setClosedUnresolvedPercent(BigDecimal.ZERO);
entity.setClosedCaseIncr(NumConstant.ZERO);
entity.setClosedCaseResolvedIncr(NumConstant.ZERO);
entity.setClosedCaseUnresolvedIncr(NumConstant.ZERO);
entity.setClosedCaseTotal(NumConstant.ZERO);
entity.setClosedCaseResolvedTotal(NumConstant.ZERO);
entity.setClosedCaseUnresolvedTotal(NumConstant.ZERO);
entity.setClosedCaseResolvedPercent(BigDecimal.ZERO);
entity.setClosedCaseUnresolvedPercent(BigDecimal.ZERO);
return entity;
}
/**
* 初始化数据
*
* @param dimIdBean
* @return com.epmet.entity.stats.FactIssueAgencyMonthlyEntity
* @author zhaoqifeng
* @date 2020/6/18 10:58
*/
private FactIssueAgencyMonthlyEntity initIssueAgencyMonthly(DimIdGenerator.DimIdBean dimIdBean) {
FactIssueAgencyMonthlyEntity entity = new FactIssueAgencyMonthlyEntity();
entity.setYearId(dimIdBean.getYearId());
entity.setQuarterId(dimIdBean.getQuarterId());
entity.setMonthId(dimIdBean.getMonthId());
entity.setIssueTotal(NumConstant.ZERO);
entity.setIssueIncr(NumConstant.ZERO);
entity.setVotingTotal(NumConstant.ZERO);
entity.setVotingIncr(NumConstant.ZERO);
entity.setVotingPercent(BigDecimal.ZERO);
entity.setShiftProjectTotal(NumConstant.ZERO);
entity.setShiftProjectIncr(NumConstant.ZERO);
entity.setShiftProjectPercent(BigDecimal.ZERO);
entity.setClosedIncr(NumConstant.ZERO);
entity.setClosedResolvedIncr(NumConstant.ZERO);
entity.setClosedUnresolvedIncr(NumConstant.ZERO);
entity.setClosedTotal(NumConstant.ZERO);
entity.setClosedResolvedTotal(NumConstant.ZERO);
entity.setClosedUnresolvedTotal(NumConstant.ZERO);
entity.setClosedPercent(BigDecimal.ZERO);
entity.setClosedResolvedPercent(BigDecimal.ZERO);
entity.setClosedUnresolvedPercent(BigDecimal.ZERO);
entity.setClosedCaseIncr(NumConstant.ZERO);
entity.setClosedCaseResolvedIncr(NumConstant.ZERO);
entity.setClosedCaseUnresolvedIncr(NumConstant.ZERO);
entity.setClosedCaseTotal(NumConstant.ZERO);
entity.setClosedCaseResolvedTotal(NumConstant.ZERO);
entity.setClosedCaseUnresolvedTotal(NumConstant.ZERO);
entity.setClosedCaseResolvedPercent(BigDecimal.ZERO);
entity.setClosedCaseUnresolvedPercent(BigDecimal.ZERO);
return entity;
}
}

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

@ -2,16 +2,23 @@ package com.epmet.service.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.ProjectConstant;
import com.epmet.dto.project.form.MonthProjectListFormDTO;
import com.epmet.dto.stats.DimAgencyDTO;
import com.epmet.dto.stats.DimDateDTO;
import com.epmet.dto.stats.DimGridDTO;
import com.epmet.entity.issue.IssueEntity;
import com.epmet.entity.project.ProjectEntity;
import com.epmet.entity.project.ProjectProcessEntity;
import com.epmet.entity.stats.DimDateEntity;
import com.epmet.entity.stats.DimGridEntity;
import com.epmet.entity.stats.FactAgencyProjectDailyEntity;
import com.epmet.entity.stats.FactAgencyProjectMonthlyEntity;
import com.epmet.service.StatsProjectService;
import com.epmet.service.project.ProjectProcessService;
import com.epmet.service.project.ProjectService;
import com.epmet.service.stats.*;
import com.epmet.util.DimIdGenerator;
import oracle.sql.NUMBER;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -33,6 +40,8 @@ public class StatsProjectServiceImpl implements StatsProjectService {
@Autowired
private DimAgencyService dimAgencyService;
@Autowired
private DimGridService dimGridService;
@Autowired
private DimDateService dimDateService;
@Autowired
private DimWeekService dimWeekService;
@ -63,13 +72,20 @@ public class StatsProjectServiceImpl implements StatsProjectService {
**/
@Override
public void statsAgencyProject(String customerId) {
//1:执行机关日数据统计
agencyDateProjectStats(customerId);
//2:执行机关月数据统计
if (Calendar.getInstance().get(Calendar.DATE) == 1) {
agencyMonthProjectStats(customerId);
}
//1:根据客户Id查询机关维度表数据
DimAgencyDTO dimAgencyDTO = new DimAgencyDTO();
dimAgencyDTO.setCustomerId(customerId);
List<DimAgencyDTO> dimAgencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO);
if (null != dimAgencyList && dimAgencyList.size() > NumConstant.ZERO) {
//2:执行机关日数据统计
agencyDateProjectStats(customerId, dimAgencyList);
//3:执行机关月数据统计
if (Calendar.getInstance().get(Calendar.DATE) == 1) {
agencyMonthProjectStats(customerId, dimAgencyList);
}
}
}
/**
@ -77,28 +93,21 @@ public class StatsProjectServiceImpl implements StatsProjectService {
* @Author sun
* @Description 数据-项目-机关日统计
**/
private String agencyDateProjectStats(String customerId) {
private String agencyDateProjectStats(String customerId, List<DimAgencyDTO> dimAgencyList) {
Date date = yesterDay();
//1:查询各维度表Id,方便使用 //TODO
DimDateDTO dimDateDTO = new DimDateDTO();
dimDateDTO.setCreatedTime(date);
dimDateDTO = dimDateService.getDimDate(dimDateDTO).get(0);
//1:查询各维度表Id,方便使用
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(yesterDay());
//2:根据客户Id查询机关维度表数据
DimAgencyDTO dimAgencyDTO = new DimAgencyDTO();
dimAgencyDTO.setCustomerId(customerId);
List<DimAgencyDTO> dimAgencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO);
if (null == dimAgencyList || dimAgencyList.size() < NumConstant.ONE) {
return null;
}
//2:根据客户Id查询项目业务表数据(查询当前日期之前的数据不包含当天的)
ProjectEntity projectEntity = new ProjectEntity();
projectEntity.setCustomerId(customerId);
projectEntity.setCreatedTime(yesterDay());
List<ProjectEntity> projectList = projectService.getProjectList(projectEntity);
//3:根据客户Id查询项目业务表数据
List<ProjectEntity> projectList = projectService.getProjectList(customerId);
//3:查询项目处理进展表中是创建项目和结案两种进展的有效数据(创建日期截取yyyy-mm-dd格式字段值)(查询当前日期之前的数据不包含当天的)
List<ProjectProcessEntity> processList = projectProcessService.getProcessList(projectEntity);
//4:查询项目处理进展表中是创建项目和结案两种进展的有效数据(创建日期截取yyyy-mm-dd格式字段值)
List<ProjectProcessEntity> processList = projectProcessService.getProcessList(customerId);
//5:遍历统计每个机关各项指标数
//4:遍历统计每个机关各项指标数
//批量机关日统计新增对象
List<FactAgencyProjectDailyEntity> dimDateEntityList = new ArrayList<>();
//计算百分比使用,保留小数点后两位
@ -152,7 +161,7 @@ public class StatsProjectServiceImpl implements StatsProjectService {
AtomicInteger unResolvedIncr = new AtomicInteger(0);
//遍历项目进展列表数据,统计日增量数据
processList.forEach(process -> {
if (date.equals(process.getCreatedTime())) {
if (map.containsKey(process.getAgencyId()) && date.equals(process.getCreatedTime())) {
if (ProjectConstant.CREATED.equals(process.getOperation())) {
pendingIncr.addAndGet(1);
}
@ -172,11 +181,10 @@ public class StatsProjectServiceImpl implements StatsProjectService {
agencyDailyEntity.setCustomerId(customerId);
agencyDailyEntity.setAgencyId(agency.getId());
agencyDailyEntity.setParentId(agency.getPid());
//TODO
agencyDailyEntity.setDateId("");
agencyDailyEntity.setWeekId("");
agencyDailyEntity.setMonthId("");
agencyDailyEntity.setYearId("");
agencyDailyEntity.setDateId(dimId.getDateId());
agencyDailyEntity.setWeekId(dimId.getWeekId());
agencyDailyEntity.setMonthId(dimId.getMonthId());
agencyDailyEntity.setYearId(dimId.getYearId());
agencyDailyEntity.setProjectTotal(projectTotal.intValue());
agencyDailyEntity.setPendingTotal(pendingTotal.intValue());
agencyDailyEntity.setClosedTotal(closedTotal.intValue());
@ -199,8 +207,15 @@ public class StatsProjectServiceImpl implements StatsProjectService {
dimDateEntityList.add(agencyDailyEntity);
}
//6:批量保存机关日统计数据
//先删后增
if (null != dimDateEntityList && dimDateEntityList.size() > NumConstant.ZERO) {
//5:根据客户Id、日维度Id批量物理删除一下可能存在的历史数据
FactAgencyProjectDailyEntity delEntity = new FactAgencyProjectDailyEntity();
delEntity.setCustomerId(customerId);
delEntity.setDateId(dimId.getDateId());
factAgencyProjectDailyService.delDateProject(delEntity);
//6:批量保存机关日统计数据
factAgencyProjectDailyService.insertBatch(dimDateEntityList);
}
return null;
@ -211,8 +226,76 @@ public class StatsProjectServiceImpl implements StatsProjectService {
* @Author sun
* @Description 数据-项目-机关月统计
**/
private void agencyMonthProjectStats(String customerId) {
private String agencyMonthProjectStats(String customerId, List<DimAgencyDTO> dimAgencyList) {
//1:获取个维度Id方便使用
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(yesterDay());
//2:获取昨天日期所在月份的起始日期和结束日期
MonthProjectListFormDTO formDTO = new MonthProjectListFormDTO();
formDTO.setCustomerId(customerId);
formDTO.setStartTime(getMonthBegin(yesterDay()));
formDTO.setEndTime(getMonthEnd(yesterDay()));
//批量月数据新增对象
List<FactAgencyProjectMonthlyEntity> monthlyEntityList = new ArrayList<>();
//3:遍历机关维度数据,分别统计每个组织月数据
for (DimAgencyDTO agency : dimAgencyList) {
//4:查询上一月机关日统计数据,按时间倒序
formDTO.setAgencyId(agency.getId());
List<FactAgencyProjectDailyEntity> projectDailyList = factAgencyProjectDailyService.getMonthProjectList(formDTO);
//5:汇总统计上一月机关月统计数据
//月增量中项目总数、处理中总数、已结案总数、已结案已解决总数、已结案未解决总数
int pendingIncr = 0;
int closedIncr = 0;
int resolvedIncr = 0;
int unResolvedIncr = 0;
for (FactAgencyProjectDailyEntity date : projectDailyList) {
pendingIncr += date.getPendingIncr();
closedIncr += date.getClosedIncr();
resolvedIncr += date.getResolvedIncr();
unResolvedIncr += date.getUnresolvedIncr();
}
//6:实体字段属性赋值
FactAgencyProjectMonthlyEntity monthlyEntity = new FactAgencyProjectMonthlyEntity();
monthlyEntity.setCustomerId(customerId);
monthlyEntity.setAgencyId(agency.getId());
monthlyEntity.setParentId(agency.getPid());
monthlyEntity.setMonthId(dimId.getMonthId());
monthlyEntity.setQuarterId(dimId.getQuarterId());
monthlyEntity.setYearId(dimId.getYearId());
if (null != projectDailyList && projectDailyList.size() > NumConstant.ZERO) {
FactAgencyProjectDailyEntity entity = projectDailyList.get(0);
monthlyEntity.setProjectTotal(entity.getProjectTotal());
monthlyEntity.setPendingTotal(entity.getPendingTotal());
monthlyEntity.setPendingRatio(entity.getPendingRatio());
monthlyEntity.setClosedTotal(entity.getClosedTotal());
monthlyEntity.setClosedRatio(entity.getClosedRatio());
monthlyEntity.setResolvedTotal(entity.getResolvedTotal());
monthlyEntity.setResolvedRatio(entity.getResolvedRatio());
monthlyEntity.setUnresolvedTotal(entity.getUnresolvedTotal());
monthlyEntity.setUnresolvedRatio(entity.getUnresolvedRatio());
monthlyEntity.setProjectIncr(pendingIncr + closedIncr);
monthlyEntity.setPendingIncr(pendingIncr);
monthlyEntity.setClosedIncr(closedIncr);
monthlyEntity.setResolvedIncr(resolvedIncr);
monthlyEntity.setUnresolvedIncr(unResolvedIncr);
}
monthlyEntityList.add(monthlyEntity);
}
if (null != monthlyEntityList && monthlyEntityList.size() > NumConstant.ZERO) {
//7:根据客户Id、月份Id批量删除一下可能存在的历史数据
FactAgencyProjectMonthlyEntity delEntity = new FactAgencyProjectMonthlyEntity();
delEntity.setCustomerId(customerId);
delEntity.setMonthId(dimId.getMonthId());
factAgencyProjectMonthlyService.delMonthProject(delEntity);
//8:批量保存机关月统计数据
factAgencyProjectMonthlyService.insertBatch(monthlyEntityList);
}
return null;
}
/**
@ -223,14 +306,57 @@ public class StatsProjectServiceImpl implements StatsProjectService {
**/
@Override
public void statsGridProject(String customerId) {
//1:根据客户Id查询网格维度表数据
List<DimGridEntity> dimGridList = dimGridService.getGridListByCustomerId(customerId);
if (null != dimGridList && dimGridList.size() > NumConstant.ZERO) {
//2:执行机关日数据统计
gridDateProjectStats(customerId, dimGridList);
//3:执行机关月数据统计
if (Calendar.getInstance().get(Calendar.DATE) == 1) {
gridMonthProjectStats(customerId, dimGridList);
}
}
}
/**
* @param customerId
* @return
* @Author sun
* @Description 数据-项目-网格日统计
**/
private String gridDateProjectStats(String customerId, List<DimGridEntity> dimGridList) {
//1:查询各维度表Id,方便使用
//2:根据客户Id查询网格维度表数据
//3:根据客户Id查询项目业务表数据
//4:查询项目处理进展表中是创建项目和结案两种进展的有效数据(创建日期截取yyyy-mm-dd格式字段值)
//5:根据客户Id查询议题表已转项目的议题数据(为了匹配项目所属的网格Id)
//6:遍历统计每个网格各项指标数据
//7:批量保存网格日统计数据
//8:判断当前日期是否为当月首日,执行网格月数据统计
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(yesterDay());
//2:根据客户Id查询项目业务表数据(查询当前日期之前的数据不包含当天的)
ProjectEntity projectEntity = new ProjectEntity();
projectEntity.setCustomerId(customerId);
projectEntity.setCreatedTime(yesterDay());
List<ProjectEntity> projectList = projectService.getProjectList(projectEntity);
//3:查询项目处理进展表中是创建项目和结案两种进展的有效数据(创建日期截取yyyy-mm-dd格式字段值)(查询当前日期之前的数据不包含当天的)
List<ProjectProcessEntity> processList = projectProcessService.getProcessList(projectEntity);
//4:根据客户Id查询议题表已转项目的网格项目关系数据
List<IssueEntity> gridProjectList = null;
//5:遍历统计每个网格各项指标数据
//6:批量保存网格日统计数据
//7:判断当前日期是否为当月首日,执行网格月数据统计
return null;
}
/**
* @param customerId
* @return
* @Author sun
* @Description 数据-项目-网格月统计
**/
private String gridMonthProjectStats(String customerId, List<DimGridEntity> dimGridList) {
return null;
}
/**
@ -251,4 +377,47 @@ public class StatsProjectServiceImpl implements StatsProjectService {
return date;
}
/**
* @Author sun
* @Description 获取指定日期所在月份开始的时间
**/
public Date getMonthBegin(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
//设置为1号,当前日期既为本月第一天
c.set(Calendar.DAY_OF_MONTH, 1);
//将小时至0
c.set(Calendar.HOUR_OF_DAY, 0);
//将分钟至0
c.set(Calendar.MINUTE, 0);
//将秒至0
c.set(Calendar.SECOND, 0);
//将毫秒至0
c.set(Calendar.MILLISECOND, 0);
//获取本月第一天的时间
return c.getTime();
}
/**
* @Author sun
* @Description 获取指定日期所在月份结束的时间
**/
public Date getMonthEnd(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
//设置为当月最后一天
c.set(Calendar.DAY_OF_MONTH, c.getActualMaximum(Calendar.DAY_OF_MONTH));
//将小时至23
c.set(Calendar.HOUR_OF_DAY, 23);
//将分钟至59
c.set(Calendar.MINUTE, 59);
//将秒至59
c.set(Calendar.SECOND, 59);
//将毫秒至999
c.set(Calendar.MILLISECOND, 999);
//获取本月最后一天的时间
System.out.println(c.getTime());
System.out.println(c);
return c.getTime();
}
}

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

@ -3,11 +3,14 @@ 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.DimDepartmentEntity;
import com.epmet.entity.stats.DimGridEntity;
import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity;
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.service.voice.ArticleService;
import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ -46,11 +49,17 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
private DimCustomerService dimCustomerService;
@Autowired
private DimGridService dimGridService;
@Autowired
private DimDepartmentService dimDepartmentService;
@Autowired
private ArticleService articleService;
@Autowired
private ArticlePublishRangeService articlePublishRangeService;
@Autowired
private FactArticlePublishedGridDailyService factArticlePublishedGridDailyService;
@Autowired
private FactArticlePublishedDepartmentDailyService factArticlePublishedDepartmentDailyService;
@Autowired
private ExecutorService executorService;
@ -71,21 +80,78 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
/*executorService.submit(()->{
});*/
statsPublishedGridDaily(statsDate, dimIdBean, customerId);
//key:所在机关Id
Map<String, ArticleGridPublishedSummaryDTO> agencySummaryMap = new HashMap<>();
statsPublishedGridDaily(statsDate, dimIdBean, customerId,agencySummaryMap);
statsPublishedDepartmentDaily(statsDate, dimIdBean, customerId,agencySummaryMap);
statsPublishedAgencyDaily(statsDate, dimIdBean, customerId,agencySummaryMap);
}
}
} while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() >= pageSize);
return true;
}
private void statsPublishedDepartmentDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map<String, ArticleGridPublishedSummaryDTO> agencySummaryMap) {
//获取所有客户
List<DimDepartmentEntity> departmentDTOList = dimDepartmentService.getDepartmentListByCustomerId(customerId);
if (CollectionUtils.isEmpty(departmentDTOList)) {
log.warn("publicitySummary getDepartmentListByCustomerId return empty,customerId:{}", customerId);
return;
}
//转换为 需要插入的Entity
Map<String, FactArticlePublishedDepartmentDailyEntity> departmentDailyEntityMap = convertDepartmentDailyEntity(departmentDTOList, dimIdBean);
//获取当天的业务数据
List<ArticleGridPublishedSummaryDTO> publishedArticleCount = articleService.getAllPublishedCount(customerId,DateUtils.integrate(statsDate,DateUtils.DATE_PATTERN));
if (!CollectionUtils.isEmpty(publishedArticleCount)) {
for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) {
FactArticlePublishedDepartmentDailyEntity gridDailyEntities = departmentDailyEntityMap.get(summaryDTO.getPublisherId());
if (gridDailyEntities == null) {
log.error("publicitySummary bizData departmentId:{} not exist in dimDepartment", summaryDTO.getGridId());
continue;
}
gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount());
gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount());
//同一个机关下数据累加
buildAgencySummaryData(agencySummaryMap, summaryDTO);
}
}
boolean b = factArticlePublishedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), departmentDailyEntityMap.values());
}
/**
* desc:同一个机关下的数据进行类型处理
* @param result
* @param summaryDTO
*/
private void buildAgencySummaryData(Map<String, ArticleGridPublishedSummaryDTO> result, ArticleGridPublishedSummaryDTO summaryDTO) {
//同一个机关下数据累加
ArticleGridPublishedSummaryDTO publishedSummaryDTO = result.get(summaryDTO.getAgencyId());
if (publishedSummaryDTO == null) {
ArticleGridPublishedSummaryDTO summary = new ArticleGridPublishedSummaryDTO();
summary.setCustomerId(summaryDTO.getCustomerId());
summary.setAgencyId(summaryDTO.getAgencyId());
summary.setGridId(summaryDTO.getGridId());
summary.setPublisherId(summaryDTO.getPublisherId());
summary.setArticleTotalCount(summaryDTO.getArticleTotalCount());
summary.setArticlePublishedCount(summaryDTO.getArticlePublishedCount());
result.put(summaryDTO.getPublisherId(),summaryDTO);
}else{
publishedSummaryDTO.setArticlePublishedCount(publishedSummaryDTO.getArticlePublishedCount()+summaryDTO.getArticlePublishedCount());
publishedSummaryDTO.setArticleTotalCount(publishedSummaryDTO.getArticleTotalCount()+summaryDTO.getArticlePublishedCount());
}
}
/**
* desc:按日统计 网格纬度的 文章总数数据
*
* @param statsDate
* @param statsDate
* @param dimIdBean
* @param customerId
* @param agencySummaryMap
*/
private void statsPublishedGridDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId) {
private void statsPublishedGridDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map<String, ArticleGridPublishedSummaryDTO> agencySummaryMap) {
//key:所在机关Id
Map<String,ArticleGridPublishedSummaryDTO> result = new HashMap<>();
//获取所有网格
List<DimGridEntity> gridDTOList = dimGridService.getGridListByCustomerId(customerId);
if (CollectionUtils.isEmpty(gridDTOList)) {
@ -106,11 +172,41 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
}
gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount());
gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount());
//同一个机关下数据累加
buildAgencySummaryData(agencySummaryMap, summaryDTO);
}
}
boolean b = factArticlePublishedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), gridDailyEntityMap.values());
}
private void statsPublishedAgencyDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map<String, ArticleGridPublishedSummaryDTO> agencySummaryMap) {
//获取所有客户
List<DimDepartmentEntity> departmentDTOList = null;//dimAgencyService.getAgencyListByCustomerId(customerId);
if (CollectionUtils.isEmpty(departmentDTOList)) {
log.warn("publicitySummary getAgencyListByCustomerId return empty,customerId:{}", customerId);
return;
}
//转换为 需要插入的Entity
Map<String, FactArticlePublishedDepartmentDailyEntity> departmentDailyEntityMap = convertDepartmentDailyEntity(departmentDTOList, dimIdBean);
//获取当天的业务数据
List<ArticleGridPublishedSummaryDTO> publishedArticleCount = articleService.getAllPublishedCount(customerId,DateUtils.integrate(statsDate,DateUtils.DATE_PATTERN));
if (!CollectionUtils.isEmpty(publishedArticleCount)) {
for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) {
FactArticlePublishedDepartmentDailyEntity gridDailyEntities = departmentDailyEntityMap.get(summaryDTO.getPublisherId());
if (gridDailyEntities == null) {
log.error("publicitySummary bizData departmentId:{} not exist in dimDepartment", summaryDTO.getGridId());
continue;
}
gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount());
gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount());
//同一个机关下数据累加
buildAgencySummaryData(agencySummaryMap, summaryDTO);
}
}
boolean b = factArticlePublishedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), departmentDailyEntityMap.values());
}
/**
* desc:将网格对象构建为 gridDaily 对象
*
@ -131,4 +227,25 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
});
return result;
}
/**
* desc:将网格对象构建为 gridDaily 对象
*
* @param dimDepartmentEntities
* @param dimIdBean
* @return
*/
private Map<String, FactArticlePublishedDepartmentDailyEntity> convertDepartmentDailyEntity(List<DimDepartmentEntity> dimDepartmentEntities, DimIdGenerator.DimIdBean dimIdBean) {
Map<String, FactArticlePublishedDepartmentDailyEntity> result = new HashMap<>();
dimDepartmentEntities.forEach(dimGridEntity -> {
FactArticlePublishedDepartmentDailyEntity entity = ConvertUtils.sourceToTarget(dimIdBean, FactArticlePublishedDepartmentDailyEntity.class);
entity.setCustomerId(dimGridEntity.getCustomerId());
entity.setAgencyId(dimGridEntity.getAgencyId());
entity.setDepartmentId(dimGridEntity.getId());
entity.setArticleTotalCount(0);
entity.setArticlePublishedCount(0);
result.put(dimGridEntity.getId(), entity);
});
return result;
}
}

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java

@ -18,6 +18,7 @@
package com.epmet.service.project;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.project.ProjectEntity;
import com.epmet.entity.project.ProjectProcessEntity;
import java.util.List;
@ -31,9 +32,9 @@ import java.util.List;
public interface ProjectProcessService extends BaseService<ProjectProcessEntity> {
/**
* @param customerId
* @param projectEntity
* @Author sun
* @Description 查询客户项目处理进展表中是创建项目和结案两种进展的有效数据(创建日期截取yyyy-mm-dd格式字段值)
**/
List<ProjectProcessEntity> getProcessList(String customerId);
List<ProjectProcessEntity> getProcessList(ProjectEntity projectEntity);
}

25
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java

@ -18,6 +18,7 @@
package com.epmet.service.project;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.project.ProjectAgencyDTO;
import com.epmet.entity.project.ProjectEntity;
import java.util.List;
@ -31,9 +32,29 @@ import java.util.List;
public interface ProjectService extends BaseService<ProjectEntity> {
/**
* @param customerId
* @param projectEntity
* @Author sun
* @Description 根据客户Id查询客户项目业务表有效数据
**/
List<ProjectEntity> getProjectList(String customerId);
List<ProjectEntity> getProjectList(ProjectEntity projectEntity);
/**
* 已结案项目统计
* @author zhaoqifeng
* @date 2020/6/18 17:04
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.project.ProjectAgencyDTO>
*/
List<ProjectAgencyDTO> getAgencyClosedProjectTotal(String customerId, String date);
/**
* 已结案项目增量
* @author zhaoqifeng
* @date 2020/6/18 17:04
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.project.ProjectAgencyDTO>
*/
List<ProjectAgencyDTO> getAgencyClosedProjectInc(String customerId, String date);
}

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java

@ -19,6 +19,7 @@ package com.epmet.service.project.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.project.ProjectProcessDao;
import com.epmet.entity.project.ProjectEntity;
import com.epmet.entity.project.ProjectProcessEntity;
import com.epmet.service.project.ProjectProcessService;
import org.springframework.stereotype.Service;
@ -35,12 +36,12 @@ import java.util.List;
public class ProjectProcessServiceImpl extends BaseServiceImpl<ProjectProcessDao, ProjectProcessEntity> implements ProjectProcessService {
/**
* @param customerId
* @param projectEntity
* @Author sun
* @Description 查询客户项目处理进展表中是创建项目和结案两种进展的有效数据(创建日期截取yyyy-mm-dd格式字段值)
**/
@Override
public List<ProjectProcessEntity> getProcessList(String customerId) {
return baseDao.selectProcessList(customerId);
public List<ProjectProcessEntity> getProcessList(ProjectEntity projectEntity) {
return baseDao.selectProcessList(projectEntity);
}
}

17
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java

@ -21,6 +21,7 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.project.ProjectDao;
import com.epmet.dto.project.ProjectAgencyDTO;
import com.epmet.entity.project.ProjectEntity;
import com.epmet.service.project.ProjectService;
import org.springframework.beans.factory.annotation.Autowired;
@ -39,13 +40,23 @@ import java.util.List;
public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntity> implements ProjectService {
/**
* @param customerId
* @param projectEntity
* @Author sun
* @Description 根据客户Id查询客户项目业务表有效数据
**/
@Override
public List<ProjectEntity> getProjectList(String customerId) {
return baseDao.selectProjectList(customerId);
public List<ProjectEntity> getProjectList(ProjectEntity projectEntity) {
return baseDao.selectProjectList(projectEntity);
}
@Override
public List<ProjectAgencyDTO> getAgencyClosedProjectTotal(String customerId, String date) {
return baseDao.selectAgencyClosedProjectTotal(customerId, date);
}
@Override
public List<ProjectAgencyDTO> getAgencyClosedProjectInc(String customerId, String date) {
return baseDao.selectAgencyClosedProjectInc(customerId, date);
}
}

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

@ -93,14 +93,6 @@ public interface DimDateService extends BaseService<DimDateEntity> {
*/
void delete(String[] ids);
/**
* @param dto
* @return
* @Author sun
* @Description 根据创建时间查询日维度信息
**/
List<DimDateDTO> getDimDate(DimDateDTO dto);
void initDimDate();
}

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

@ -95,4 +95,14 @@ public interface DimDepartmentService extends BaseService<DimDepartmentEntity> {
void delete(String[] ids);
void addDepartmentDims(List<CustomerDepartmentEntity> departments);
/**
* desc: 根据客户Id获取 部门数据
*
* @param null
* @return:
* @date: 2020/6/18 17:45
* @author: jianjun liu
*/
List<DimDepartmentEntity> getDepartmentListByCustomerId(String customerId);
}

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

@ -18,8 +18,11 @@
package com.epmet.service.stats;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.project.form.MonthProjectListFormDTO;
import com.epmet.entity.stats.FactAgencyProjectDailyEntity;
import java.util.List;
/**
* 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据
*
@ -28,4 +31,17 @@ import com.epmet.entity.stats.FactAgencyProjectDailyEntity;
*/
public interface FactAgencyProjectDailyService extends BaseService<FactAgencyProjectDailyEntity> {
/**
* @param formDTO
* @Author sun
* @Description 查询上一月机关日统计数据按时间倒序
**/
List<FactAgencyProjectDailyEntity> getMonthProjectList(MonthProjectListFormDTO formDTO);
/**
* @param delEntity
* @Author sun
* @Description 根据客户Id日维度Id批量物理删除一下可能存在的历史数据
**/
void delDateProject(FactAgencyProjectDailyEntity delEntity);
}

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyProjectMonthlyService.java

@ -28,4 +28,11 @@ import com.epmet.entity.stats.FactAgencyProjectMonthlyEntity;
*/
public interface FactAgencyProjectMonthlyService extends BaseService<FactAgencyProjectMonthlyEntity> {
/**
* @param delEntity
* @return
* @Author sun
* @Description 根据客户Id月份Id批量物理删除可能存在的历史数据
**/
void delMonthProject(FactAgencyProjectMonthlyEntity delEntity);
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedDepartmentDailyService.java

@ -20,6 +20,8 @@ package com.epmet.service.stats;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity;
import java.util.Collection;
/**
* 文章发布数量部门日统计表
*
@ -28,4 +30,15 @@ import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity;
*/
public interface FactArticlePublishedDepartmentDailyService extends BaseService<FactArticlePublishedDepartmentDailyEntity> {
/**
* desc: 删除并插入数据
*
* @param dateId
* @param values
* @return:
* @date: 2020/6/18 14:54
* @author: jianjun liu
*/
boolean deleteAndInsertBatch(String customerId, String dateId, Collection<FactArticlePublishedDepartmentDailyEntity> values);
}

95
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyDailyService.java

@ -0,0 +1,95 @@
/**
* 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;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.stats.FactIssueAgencyDailyDTO;
import com.epmet.entity.stats.FactIssueAgencyDailyEntity;
import java.util.List;
import java.util.Map;
/**
* 议题数量(按日)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
public interface FactIssueAgencyDailyService extends BaseService<FactIssueAgencyDailyEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<FactIssueAgencyDailyDTO>
* @author generator
* @date 2020-06-17
*/
PageData<FactIssueAgencyDailyDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<FactIssueAgencyDailyDTO>
* @author generator
* @date 2020-06-17
*/
List<FactIssueAgencyDailyDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return FactIssueAgencyDailyDTO
* @author generator
* @date 2020-06-17
*/
FactIssueAgencyDailyDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-06-17
*/
void save(FactIssueAgencyDailyDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-06-17
*/
void update(FactIssueAgencyDailyDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-06-17
*/
void delete(String[] ids);
}

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

@ -0,0 +1,95 @@
/**
* 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;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.stats.FactIssueAgencyMonthlyDTO;
import com.epmet.entity.stats.FactIssueAgencyMonthlyEntity;
import java.util.List;
import java.util.Map;
/**
* 组织机关议题数量(按月)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
public interface FactIssueAgencyMonthlyService extends BaseService<FactIssueAgencyMonthlyEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<FactIssueAgencyMonthlyDTO>
* @author generator
* @date 2020-06-17
*/
PageData<FactIssueAgencyMonthlyDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<FactIssueAgencyMonthlyDTO>
* @author generator
* @date 2020-06-17
*/
List<FactIssueAgencyMonthlyDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return FactIssueAgencyMonthlyDTO
* @author generator
* @date 2020-06-17
*/
FactIssueAgencyMonthlyDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-06-17
*/
void save(FactIssueAgencyMonthlyDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-06-17
*/
void update(FactIssueAgencyMonthlyDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-06-17
*/
void delete(String[] ids);
}

95
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridDailyService.java

@ -0,0 +1,95 @@
/**
* 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;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.stats.FactIssueGridDailyDTO;
import com.epmet.entity.stats.FactIssueGridDailyEntity;
import java.util.List;
import java.util.Map;
/**
* 网格议题数量(按日)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
public interface FactIssueGridDailyService extends BaseService<FactIssueGridDailyEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<FactIssueGridDailyDTO>
* @author generator
* @date 2020-06-17
*/
PageData<FactIssueGridDailyDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<FactIssueGridDailyDTO>
* @author generator
* @date 2020-06-17
*/
List<FactIssueGridDailyDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return FactIssueGridDailyDTO
* @author generator
* @date 2020-06-17
*/
FactIssueGridDailyDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-06-17
*/
void save(FactIssueGridDailyDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-06-17
*/
void update(FactIssueGridDailyDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-06-17
*/
void delete(String[] ids);
}

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

@ -0,0 +1,95 @@
/**
* 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;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.stats.FactIssueGridMonthlyDTO;
import com.epmet.entity.stats.FactIssueGridMonthlyEntity;
import java.util.List;
import java.util.Map;
/**
* 网格议题数量(按月)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
public interface FactIssueGridMonthlyService extends BaseService<FactIssueGridMonthlyEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<FactIssueGridMonthlyDTO>
* @author generator
* @date 2020-06-17
*/
PageData<FactIssueGridMonthlyDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<FactIssueGridMonthlyDTO>
* @author generator
* @date 2020-06-17
*/
List<FactIssueGridMonthlyDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return FactIssueGridMonthlyDTO
* @author generator
* @date 2020-06-17
*/
FactIssueGridMonthlyDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-06-17
*/
void save(FactIssueGridMonthlyDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-06-17
*/
void update(FactIssueGridMonthlyDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-06-17
*/
void delete(String[] ids);
}

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

@ -104,17 +104,6 @@ public class DimDateServiceImpl extends BaseServiceImpl<DimDateDao, DimDateEntit
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @param dto
* @return
* @Author sun
* @Description 根据创建时间查询日维度信息
**/
@Override
public List<DimDateDTO> getDimDate(DimDateDTO dto) {
return baseDao.selectDimDate(dto);
}
@Override
public void initDimDate() {
LastExecRecordEntity lastExecRecord = lastExecRecordService.getLastExecRecord(StatsSubject.DIM_DATE);

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDepartmentServiceImpl.java

@ -20,16 +20,16 @@ package com.epmet.service.stats.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.stats.DimDepartmentDao;
import com.epmet.dto.stats.DimDepartmentDTO;
import com.epmet.entity.org.CustomerDepartmentEntity;
import com.epmet.entity.stats.DimDepartmentEntity;
import com.epmet.service.stats.DimDepartmentService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -44,6 +44,7 @@ import java.util.Map;
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Slf4j
@Service
public class DimDepartmentServiceImpl extends BaseServiceImpl<DimDepartmentDao, DimDepartmentEntity> implements DimDepartmentService {
@ -118,4 +119,12 @@ public class DimDepartmentServiceImpl extends BaseServiceImpl<DimDepartmentDao,
baseDao.insertOne(dim);
}
}
@Override
public List<DimDepartmentEntity> getDepartmentListByCustomerId(String customerId) {
if (StringUtils.isBlank(customerId)){
log.warn("getDepartmentListByCustomerId param is blank ");
}
return baseDao.getDepartmentListByCustomerId(customerId);
}
}

22
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectDailyServiceImpl.java

@ -19,10 +19,13 @@ package com.epmet.service.stats.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.stats.FactAgencyProjectDailyDao;
import com.epmet.dto.project.form.MonthProjectListFormDTO;
import com.epmet.entity.stats.FactAgencyProjectDailyEntity;
import com.epmet.service.stats.FactAgencyProjectDailyService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据
*
@ -33,4 +36,23 @@ import org.springframework.stereotype.Service;
public class FactAgencyProjectDailyServiceImpl extends BaseServiceImpl<FactAgencyProjectDailyDao, FactAgencyProjectDailyEntity> implements FactAgencyProjectDailyService {
/**
* @param formDTO
* @Author sun
* @Description 查询上一月机关日统计数据按时间倒序
**/
@Override
public List<FactAgencyProjectDailyEntity> getMonthProjectList(MonthProjectListFormDTO formDTO) {
return baseDao.selectMonthProjectList(formDTO);
}
/**
* @param delEntity
* @Author sun
* @Description 根据客户Id日维度Id批量物理删除一下可能存在的历史数据
**/
@Override
public void delDateProject(FactAgencyProjectDailyEntity delEntity) {
baseDao.delDateProject(delEntity);
}
}

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

@ -32,5 +32,14 @@ import org.springframework.stereotype.Service;
@Service
public class FactAgencyProjectMonthlyServiceImpl extends BaseServiceImpl<FactAgencyProjectMonthlyDao, FactAgencyProjectMonthlyEntity> implements FactAgencyProjectMonthlyService {
/**
* @param delEntity
* @return
* @Author sun
* @Description 根据客户Id月份Id批量物理删除可能存在的历史数据
**/
@Override
public void delMonthProject(FactAgencyProjectMonthlyEntity delEntity) {
baseDao.delMonthProject(delEntity);
}
}

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

@ -21,16 +21,27 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.stats.FactArticlePublishedDepartmentDailyDao;
import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity;
import com.epmet.service.stats.FactArticlePublishedDepartmentDailyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.Collection;
/**
* 文章发布数量部门日统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-18
*/
@Slf4j
@Service
public class FactArticlePublishedDepartmentDailyServiceImpl extends BaseServiceImpl<FactArticlePublishedDepartmentDailyDao, FactArticlePublishedDepartmentDailyEntity> implements FactArticlePublishedDepartmentDailyService {
@Override
public boolean deleteAndInsertBatch(String customerId, String dateId, Collection<FactArticlePublishedDepartmentDailyEntity> values) {
int i = baseDao.deleteByDateId(customerId, dateId);
log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId,i);
this.insertBatch(values, 100);
return true;
}
}

100
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyDailyServiceImpl.java

@ -0,0 +1,100 @@
/**
* 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.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.FactIssueAgencyDailyDao;
import com.epmet.dto.stats.FactIssueAgencyDailyDTO;
import com.epmet.entity.stats.FactIssueAgencyDailyEntity;
import com.epmet.service.stats.FactIssueAgencyDailyService;
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 FactIssueAgencyDailyServiceImpl extends BaseServiceImpl<FactIssueAgencyDailyDao, FactIssueAgencyDailyEntity> implements FactIssueAgencyDailyService {
@Override
public PageData<FactIssueAgencyDailyDTO> page(Map<String, Object> params) {
IPage<FactIssueAgencyDailyEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, FactIssueAgencyDailyDTO.class);
}
@Override
public List<FactIssueAgencyDailyDTO> list(Map<String, Object> params) {
List<FactIssueAgencyDailyEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, FactIssueAgencyDailyDTO.class);
}
private QueryWrapper<FactIssueAgencyDailyEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<FactIssueAgencyDailyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public FactIssueAgencyDailyDTO get(String id) {
FactIssueAgencyDailyEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, FactIssueAgencyDailyDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(FactIssueAgencyDailyDTO dto) {
FactIssueAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueAgencyDailyEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(FactIssueAgencyDailyDTO dto) {
FactIssueAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueAgencyDailyEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

101
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.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.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.FactIssueAgencyMonthlyDao;
import com.epmet.dto.stats.FactIssueAgencyMonthlyDTO;
import com.epmet.entity.stats.FactIssueAgencyMonthlyEntity;
import com.epmet.service.stats.FactIssueAgencyMonthlyService;
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 FactIssueAgencyMonthlyServiceImpl extends BaseServiceImpl<FactIssueAgencyMonthlyDao, FactIssueAgencyMonthlyEntity> implements FactIssueAgencyMonthlyService {
@Override
public PageData<FactIssueAgencyMonthlyDTO> page(Map<String, Object> params) {
IPage<FactIssueAgencyMonthlyEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, FactIssueAgencyMonthlyDTO.class);
}
@Override
public List<FactIssueAgencyMonthlyDTO> list(Map<String, Object> params) {
List<FactIssueAgencyMonthlyEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, FactIssueAgencyMonthlyDTO.class);
}
private QueryWrapper<FactIssueAgencyMonthlyEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<FactIssueAgencyMonthlyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public FactIssueAgencyMonthlyDTO get(String id) {
FactIssueAgencyMonthlyEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, FactIssueAgencyMonthlyDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(FactIssueAgencyMonthlyDTO dto) {
FactIssueAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueAgencyMonthlyEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(FactIssueAgencyMonthlyDTO dto) {
FactIssueAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueAgencyMonthlyEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

100
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridDailyServiceImpl.java

@ -0,0 +1,100 @@
/**
* 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.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.FactIssueGridDailyDao;
import com.epmet.dto.stats.FactIssueGridDailyDTO;
import com.epmet.entity.stats.FactIssueGridDailyEntity;
import com.epmet.service.stats.FactIssueGridDailyService;
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 FactIssueGridDailyServiceImpl extends BaseServiceImpl<FactIssueGridDailyDao, FactIssueGridDailyEntity> implements FactIssueGridDailyService {
@Override
public PageData<FactIssueGridDailyDTO> page(Map<String, Object> params) {
IPage<FactIssueGridDailyEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, FactIssueGridDailyDTO.class);
}
@Override
public List<FactIssueGridDailyDTO> list(Map<String, Object> params) {
List<FactIssueGridDailyEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, FactIssueGridDailyDTO.class);
}
private QueryWrapper<FactIssueGridDailyEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<FactIssueGridDailyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public FactIssueGridDailyDTO get(String id) {
FactIssueGridDailyEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, FactIssueGridDailyDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(FactIssueGridDailyDTO dto) {
FactIssueGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueGridDailyEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(FactIssueGridDailyDTO dto) {
FactIssueGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueGridDailyEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

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

@ -0,0 +1,100 @@
/**
* 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.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.FactIssueGridMonthlyDao;
import com.epmet.dto.stats.FactIssueGridMonthlyDTO;
import com.epmet.entity.stats.FactIssueGridMonthlyEntity;
import com.epmet.service.stats.FactIssueGridMonthlyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.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 FactIssueGridMonthlyServiceImpl extends BaseServiceImpl<FactIssueGridMonthlyDao, FactIssueGridMonthlyEntity> implements FactIssueGridMonthlyService {
@Override
public PageData<FactIssueGridMonthlyDTO> page(Map<String, Object> params) {
IPage<FactIssueGridMonthlyEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, FactIssueGridMonthlyDTO.class);
}
@Override
public List<FactIssueGridMonthlyDTO> list(Map<String, Object> params) {
List<FactIssueGridMonthlyEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, FactIssueGridMonthlyDTO.class);
}
private QueryWrapper<FactIssueGridMonthlyEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<FactIssueGridMonthlyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public FactIssueGridMonthlyDTO get(String id) {
FactIssueGridMonthlyEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, FactIssueGridMonthlyDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(FactIssueGridMonthlyDTO dto) {
FactIssueGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueGridMonthlyEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(FactIssueGridMonthlyDTO dto) {
FactIssueGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueGridMonthlyEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java

@ -18,8 +18,12 @@
package com.epmet.service.voice;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO;
import com.epmet.entity.voice.ArticleEntity;
import java.util.Date;
import java.util.List;
/**
* desc: 数据统计文章service
*
@ -30,4 +34,11 @@ import com.epmet.entity.voice.ArticleEntity;
*/
public interface ArticleService extends BaseService<ArticleEntity> {
/**
* desc:根据客户id发布时间 获取文章总数
* @param customerId
* @param publishDate
* @return
*/
List<ArticleGridPublishedSummaryDTO> getAllPublishedCount(String customerId, Date publishDate);
}

18
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java

@ -19,13 +19,20 @@ package com.epmet.service.voice.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.ProjectConstant;
import com.epmet.dao.voice.ArticleDao;
import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO;
import com.epmet.entity.voice.ArticleEntity;
import com.epmet.service.voice.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
* 项目表
*
@ -35,7 +42,12 @@ import org.springframework.stereotype.Service;
@Service
@DataSource(DataSourceConstant.GOV_VOICE)
public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntity> implements ArticleService {
@Autowired
private ArticleDao articleDao;
@Override
public List<ArticleGridPublishedSummaryDTO> getAllPublishedCount(String customerId, Date publishDate) {
if (StringUtils.isBlank(customerId) || publishDate == null){
throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg());
}
return baseDao.getAllPublishedCount(customerId,publishDate, ProjectConstant.PUBLISH_TYPE_DEPT);
}
}

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql

@ -56,7 +56,7 @@ CREATE TABLE `fact_article_published_department_daily` (
`ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID',
`CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID',
`AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发布文章单位所属机关ID 发布文章单位所属机关ID',
`DEPSARTMENT_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门ID',
`DEPARTMENT_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门ID',
`ARTICLE_TOTAL_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章累计发文数量 文章数量',
`ARTICLE_PUBLISHED_COUNT` int(11) NULL DEFAULT NULL COMMENT '当前发文数量 当前未下线的文章数量',
`DATE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期ID 日期ID',

67
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml

@ -2,7 +2,70 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.issue.StatsIssueDao">
<select id="listAllEntities" resultType="com.epmet.entity.issue.IssueEntity">
select * from issue
<select id="selectAgencyIssueTotal" resultType="com.epmet.dto.issue.IssueAgencyDTO">
SELECT ORG_ID AS "agencyId",
ORG_ID_PATH AS "pIds",
ISSUE_STATUS AS "status",
COUNT(ID) AS "count"
FROM
issue
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
GROUP BY
ORG_ID, ISSUE_STATUS
</select>
<select id="selectAgencyIssueInc" resultType="com.epmet.dto.issue.IssueAgencyDTO">
SELECT
i.ORG_ID AS "agencyId",
i.ORG_ID_PATH AS "pIds",
ip.ISSUE_STATUS AS "status",
COUNT(ip.ID) AS "count"
FROM
issue i
INNER JOIN issue_process ip ON i.ID = ip.ISSUE_ID
AND ip.DEL_FLAG = '0'
WHERE
i.DEL_FLAG = '0'
AND i.CUSTOMER_ID = #{customerId}
AND DATE(ip.ip.CREATED_TIME) = #{date}
GROUP BY
i.ORG_ID,
ip.ISSUE_STATUS
</select>
<select id="selectAgencyClosedIssueTotal" resultType="com.epmet.dto.issue.IssueAgencyDTO">
SELECT
ORG_ID AS "agencyId",
ORG_ID_PATH AS "pIds",
RESOLVE_TYPE AS "status",
COUNT( ID ) AS "count"
FROM
issue
WHERE
DEL_FLAG = '0'
AND ISSUE_STATUS = 'closed'
AND CUSTOMER_ID = #{customerId}
AND DATE(UPDATED_TIME) <![CDATA[ <= ]]> #{date}
GROUP BY
ORG_ID,
RESOLVE_TYPE
</select>
<select id="selectAgencyClosedIssueInc" resultType="com.epmet.dto.issue.IssueAgencyDTO">
SELECT
ORG_ID AS "agencyId",
ORG_ID_PATH AS "pIds",
RESOLVE_TYPE AS "status",
COUNT( ID ) AS "count"
FROM
issue
WHERE
DEL_FLAG = '0'
AND ISSUE_STATUS = 'closed'
AND CUSTOMER_ID = #{customerId}
AND DATE(UPDATED_TIME) = #{date}
GROUP BY
ORG_ID,
RESOLVE_TYPE
</select>
</mapper>

34
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml

@ -13,7 +13,41 @@
<if test="customerId != null and customerId.trim() != ''">
AND customer_id = #{customerId}
</if>
<![CDATA[AND DATE_FORMAT(created_time, "%Y-%m-%d") <= DATE_FORMAT(#{createdTime}, "%Y-%m-%d")]]>
ORDER BY created_time DESC
</select>
<select id="selectAgencyClosedProjectTotal" resultType="com.epmet.dto.project.ProjectAgencyDTO">
SELECT
AGENCY_ID AS "agencyId",
ORG_ID_PATH AS "pIds",
CLOSED_STATUS AS "status",
COUNT(ID) AS "count"
FROM project
WHERE
DEL_FLAG = '0'
AND ORIGIN = 'issue'
AND STATUS = 'closed'
AND CUSTOMER_ID = #{customerId}
AND UPDATED_TIME <![CDATA[ <= ]]> #{date}
GROUP BY
AGENCY_ID, CLOSED_STATUS
</select>
<select id="selectAgencyClosedProjectInc" resultType="com.epmet.dto.project.ProjectAgencyDTO">
SELECT
AGENCY_ID AS "agencyId",
ORG_ID_PATH AS "pIds",
CLOSED_STATUS AS "status",
COUNT(ID) AS "count"
FROM project
WHERE
DEL_FLAG = '0'
AND ORIGIN = 'issue'
AND STATUS = 'closed'
AND CUSTOMER_ID = #{customerId}
AND UPDATED_TIME = #{date}
GROUP BY
AGENCY_ID, CLOSED_STATUS
</select>
</mapper>

1
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml

@ -16,6 +16,7 @@
pro.del_flag = '0'
AND p.del_flag = '0'
AND p.customer_id = #{customerId}
<![CDATA[AND DATE_FORMAT(pro.created_time, "%Y-%m-%d") <= DATE_FORMAT(#{createdTime}, "%Y-%m-%d")]]>
ORDER BY
pro.project_id
</select>

13
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDateDao.xml

@ -3,19 +3,6 @@
<mapper namespace="com.epmet.dao.stats.DimDateDao">
<select id="selectDimDate" resultType="com.epmet.dto.stats.DimDateDTO">
SELECT
*
FROM
`dim_date`
WHERE
del_flag = '0'
<if test="createdTime != null and createdTime.trim() != ''">
AND DATE_FORMAT(created_time, "%Y-%m-%d") = DATE_FORMAT(#{createdTime}, "%Y-%m-%d")
</if>
ORDER BY created_time DESC
</select>
<!--最新的按日维度-->
<select id="getLatestDimDate" resultType="com.epmet.dto.stats.DimDateDTO">
SELECT *

11
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml

@ -8,4 +8,15 @@
updated_by, updated_time)
VALUE (#{id}, #{departmentName}, #{agencyId}, #{customerId}, #{delFlag}, #{revision}, #{createdBy}, #{createdTime}, #{updatedBy}, #{updatedTime})
</insert>
<select id="getDepartmentListByCustomerId" resultType="com.epmet.entity.stats.DimDepartmentEntity">
SELECT
ID,
AGENCY_ID,
CUSTOMER_ID
FROM
dim_department
WHERE
DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId,jdbcType=VARCHAR}
</select>
</mapper>

24
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml

@ -3,6 +3,30 @@
<mapper namespace="com.epmet.dao.stats.FactAgencyProjectDailyDao">
<select id="selectMonthProjectList" resultType="com.epmet.entity.stats.FactAgencyProjectDailyEntity">
SELECT
*
FROM
fact_agency_project_daily
WHERE
del_flag = '0'
AND customer_id = #{customerId}
AND agency_id = #{agencyId}
AND (
DATE_FORMAT(created_time, "%Y-%m-%d")
BETWEEN DATE_FORMAT(#{startTime}, "%Y-%m-%d")
AND DATE_FORMAT(#{endTime}, "%Y-%m-%d")
)
ORDER BY created_time DESC,project_total DESC
</select>
<delete id="delDateProject">
DELETE
FROM
fact_agency_project_daily
WHERE
customer_id = #{customerId}
AND date_id = #{dateId}
</delete>
</mapper>

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

@ -3,6 +3,13 @@
<mapper namespace="com.epmet.dao.stats.FactAgencyProjectMonthlyDao">
<delete id="delMonthProject">
DELETE
FROM
fact_agency_project_monthly
WHERE
customer_id = #{customerId}
AND month_id = #{monthId}
</delete>
</mapper>

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

@ -7,7 +7,7 @@
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="depsartmentId" column="DEPSARTMENT_ID"/>
<result property="departmentId" column="DEPSARTMENT_ID"/>
<result property="articleTotalCount" column="ARTICLE_TOTAL_COUNT"/>
<result property="articlePublishedCount" column="ARTICLE_PUBLISHED_COUNT"/>
<result property="dateId" column="DATE_ID"/>
@ -22,6 +22,9 @@
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<delete id="deleteByDateId">
DELETE FROM fact_article_published_department_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR}
</delete>
</mapper>

50
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyDailyDao.xml

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.stats.FactIssueAgencyDailyDao">
<resultMap type="com.epmet.entity.stats.FactIssueAgencyDailyEntity" id="factIssueAgencyDailyMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="pid" column="PID"/>
<result property="yearId" column="YEAR_ID"/>
<result property="quarterId" column="QUARTER_ID"/>
<result property="monthId" column="MONTH_ID"/>
<result property="weekId" column="WEEK_ID"/>
<result property="dateId" column="DATE_ID"/>
<result property="issueIncr" column="ISSUE_INCR"/>
<result property="issueTotal" column="ISSUE_TOTAL"/>
<result property="shiftProjectIncr" column="SHIFT_PROJECT_INCR"/>
<result property="shiftProjectTotal" column="SHIFT_PROJECT_TOTAL"/>
<result property="shiftProjectPercent" column="SHIFT_PROJECT_PERCENT"/>
<result property="votingIncr" column="VOTING_INCR"/>
<result property="votingTotal" column="VOTING_TOTAL"/>
<result property="votingPercent" column="VOTING_PERCENT"/>
<result property="closedIncr" column="CLOSED_INCR"/>
<result property="closedResolvedIncr" column="CLOSED_RESOLVED_INCR"/>
<result property="closedUnresolvedIncr" column="CLOSED_UNRESOLVED_INCR"/>
<result property="closedTotal" column="CLOSED_TOTAL"/>
<result property="closedResolvedTotal" column="CLOSED_RESOLVED_TOTAL"/>
<result property="closedUnresolvedTotal" column="CLOSED_UNRESOLVED_TOTAL"/>
<result property="closedPercent" column="CLOSED_PERCENT"/>
<result property="closedResolvedPercent" column="CLOSED_RESOLVED_PERCENT"/>
<result property="closedUnresolvedPercent" column="CLOSED_UNRESOLVED_PERCENT"/>
<result property="closedCaseIncr" column="CLOSED_CASE_INCR"/>
<result property="closedCaseResolvedIncr" column="CLOSED_CASE_RESOLVED_INCR"/>
<result property="closedCaseUnresolvedIncr" column="CLOSED_CASE_UNRESOLVED_INCR"/>
<result property="closedCaseTotal" column="CLOSED_CASE_TOTAL"/>
<result property="closedCaseResolvedTotal" column="CLOSED_CASE_RESOLVED_TOTAL"/>
<result property="closedCaseUnresolvedTotal" column="CLOSED_CASE_UNRESOLVED_TOTAL"/>
<result property="closedCaseResolvedPercent" column="CLOSED_CASE_RESOLVED_PERCENT"/>
<result property="closedCaseUnresolvedPercent" column="CLOSED_CASE_UNRESOLVED_PERCENT"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

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

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.stats.FactIssueAgencyMonthlyDao">
<resultMap type="com.epmet.entity.stats.FactIssueAgencyMonthlyEntity" id="factIssueAgencyMonthlyMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="pid" column="PID"/>
<result property="yearId" column="YEAR_ID"/>
<result property="quarterId" column="QUARTER_ID"/>
<result property="monthId" column="MONTH_ID"/>
<result property="issueIncr" column="ISSUE_INCR"/>
<result property="issueTotal" column="ISSUE_TOTAL"/>
<result property="shiftProjectIncr" column="SHIFT_PROJECT_INCR"/>
<result property="shiftProjectTotal" column="SHIFT_PROJECT_TOTAL"/>
<result property="shiftProjectPercent" column="SHIFT_PROJECT_PERCENT"/>
<result property="votingIncr" column="VOTING_INCR"/>
<result property="votingTotal" column="VOTING_TOTAL"/>
<result property="votingPercent" column="VOTING_PERCENT"/>
<result property="closedIncr" column="CLOSED_INCR"/>
<result property="closedResolvedIncr" column="CLOSED_RESOLVED_INCR"/>
<result property="closedUnresolvedIncr" column="CLOSED_UNRESOLVED_INCR"/>
<result property="closedTotal" column="CLOSED_TOTAL"/>
<result property="closedResolvedTotal" column="CLOSED_RESOLVED_TOTAL"/>
<result property="closedUnresolvedTotal" column="CLOSED_UNRESOLVED_TOTAL"/>
<result property="closedPercent" column="CLOSED_PERCENT"/>
<result property="closedResolvedPercent" column="CLOSED_RESOLVED_PERCENT"/>
<result property="closedUnresolvedPercent" column="CLOSED_UNRESOLVED_PERCENT"/>
<result property="closedCaseIncr" column="CLOSED_CASE_INCR"/>
<result property="closedCaseResolvedIncr" column="CLOSED_CASE_RESOLVED_INCR"/>
<result property="closedCaseUnresolvedIncr" column="CLOSED_CASE_UNRESOLVED_INCR"/>
<result property="closedCaseTotal" column="CLOSED_CASE_TOTAL"/>
<result property="closedCaseResolvedTotal" column="CLOSED_CASE_RESOLVED_TOTAL"/>
<result property="closedCaseUnresolvedTotal" column="CLOSED_CASE_UNRESOLVED_TOTAL"/>
<result property="closedCaseResolvedPercent" column="CLOSED_CASE_RESOLVED_PERCENT"/>
<result property="closedCaseUnresolvedPercent" column="CLOSED_CASE_UNRESOLVED_PERCENT"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

50
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridDailyDao.xml

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.stats.FactIssueGridDailyDao">
<resultMap type="com.epmet.entity.stats.FactIssueGridDailyEntity" id="factIssueGridDailyMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="yearId" column="YEAR_ID"/>
<result property="quarterId" column="QUARTER_ID"/>
<result property="monthId" column="MONTH_ID"/>
<result property="weekId" column="WEEK_ID"/>
<result property="dateId" column="DATE_ID"/>
<result property="issueIncr" column="ISSUE_INCR"/>
<result property="issueTotal" column="ISSUE_TOTAL"/>
<result property="shiftProjectIncr" column="SHIFT_PROJECT_INCR"/>
<result property="shiftProjectTotal" column="SHIFT_PROJECT_TOTAL"/>
<result property="shiftProjectPercent" column="SHIFT_PROJECT_PERCENT"/>
<result property="votingIncr" column="VOTING_INCR"/>
<result property="votingTotal" column="VOTING_TOTAL"/>
<result property="votingPercent" column="VOTING_PERCENT"/>
<result property="closedIncr" column="CLOSED_INCR"/>
<result property="closedResolvedIncr" column="CLOSED_RESOLVED_INCR"/>
<result property="closedUnresolvedIncr" column="CLOSED_UNRESOLVED_INCR"/>
<result property="closedTotal" column="CLOSED_TOTAL"/>
<result property="closedResolvedTotal" column="CLOSED_RESOLVED_TOTAL"/>
<result property="closedUnresolvedTotal" column="CLOSED_UNRESOLVED_TOTAL"/>
<result property="closedPercent" column="CLOSED_PERCENT"/>
<result property="closedResolvedPercent" column="CLOSED_RESOLVED_PERCENT"/>
<result property="closedUnresolvedPercent" column="CLOSED_UNRESOLVED_PERCENT"/>
<result property="closedCaseIncr" column="CLOSED_CASE_INCR"/>
<result property="closedCaseResolvedIncr" column="CLOSED_CASE_RESOLVED_INCR"/>
<result property="closedCaseUnresolvedIncr" column="CLOSED_CASE_UNRESOLVED_INCR"/>
<result property="closedCaseTotal" column="CLOSED_CASE_TOTAL"/>
<result property="closedCaseResolvedTotal" column="CLOSED_CASE_RESOLVED_TOTAL"/>
<result property="closedCaseUnresolvedTotal" column="CLOSED_CASE_UNRESOLVED_TOTAL"/>
<result property="closedCaseResolvedPercent" column="CLOSED_CASE_RESOLVED_PERCENT"/>
<result property="closedCaseUnresolvedPercent" column="CLOSED_CASE_UNRESOLVED_PERCENT"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

48
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.stats.FactIssueGridMonthlyDao">
<resultMap type="com.epmet.entity.stats.FactIssueGridMonthlyEntity" id="factIssueGridMonthlyMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="yearId" column="YEAR_ID"/>
<result property="quarterId" column="QUARTER_ID"/>
<result property="monthId" column="MONTH_ID"/>
<result property="issueIncr" column="ISSUE_INCR"/>
<result property="issueTotal" column="ISSUE_TOTAL"/>
<result property="shiftProjectIncr" column="SHIFT_PROJECT_INCR"/>
<result property="shiftProjectTotal" column="SHIFT_PROJECT_TOTAL"/>
<result property="shiftProjectPercent" column="SHIFT_PROJECT_PERCENT"/>
<result property="votingIncr" column="VOTING_INCR"/>
<result property="votingTotal" column="VOTING_TOTAL"/>
<result property="votingPercent" column="VOTING_PERCENT"/>
<result property="closedIncr" column="CLOSED_INCR"/>
<result property="closedResolvedIncr" column="CLOSED_RESOLVED_INCR"/>
<result property="closedUnresolvedIncr" column="CLOSED_UNRESOLVED_INCR"/>
<result property="closedTotal" column="CLOSED_TOTAL"/>
<result property="closedResolvedTotal" column="CLOSED_RESOLVED_TOTAL"/>
<result property="closedUnresolvedTotal" column="CLOSED_UNRESOLVED_TOTAL"/>
<result property="closedPercent" column="CLOSED_PERCENT"/>
<result property="closedResolvedPercent" column="CLOSED_RESOLVED_PERCENT"/>
<result property="closedUnresolvedPercent" column="CLOSED_UNRESOLVED_PERCENT"/>
<result property="closedCaseIncr" column="CLOSED_CASE_INCR"/>
<result property="closedCaseResolvedIncr" column="CLOSED_CASE_RESOLVED_INCR"/>
<result property="closedCaseUnresolvedIncr" column="CLOSED_CASE_UNRESOLVED_INCR"/>
<result property="closedCaseTotal" column="CLOSED_CASE_TOTAL"/>
<result property="closedCaseResolvedTotal" column="CLOSED_CASE_RESOLVED_TOTAL"/>
<result property="closedCaseUnresolvedTotal" column="CLOSED_CASE_UNRESOLVED_TOTAL"/>
<result property="closedCaseResolvedPercent" column="CLOSED_CASE_RESOLVED_PERCENT"/>
<result property="closedCaseUnresolvedPercent" column="CLOSED_CASE_UNRESOLVED_PERCENT"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

17
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleDao.xml

@ -29,6 +29,23 @@
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="getAllPublishedCount" resultType="com.epmet.dto.stats.ArticleGridPublishedSummaryDTO">
SELECT
ORG_ID AS agencyId,
PUBLISHER_ID,
count(ID) articleTotalCount,
sum( CASE PUBLISH_STATUS WHEN 'published' THEN 1 ELSE 0 END ) articlePublishedCount
FROM
article_publish_range
WHERE
DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId,jdbcType=VARCHAR}
AND PUBLISH_TYPE = #{publishType,jdbcType=VARCHAR}
AND PUBLISH_DATE <![CDATA[ <#{publishType,jdbcType=TIMESTAMP}]]>
GROUP BY
CUSTOMER_ID,
PUBLISHER_ID
</select>
</mapper>

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

@ -23,6 +23,7 @@
</resultMap>
<select id="getAllPublishedCount" resultType="com.epmet.dto.stats.ArticleGridPublishedSummaryDTO">
SELECT
AGENCY_ID,
GRID_ID,
count(ID) articleTotalCount,
sum( CASE PUBLISH_STATUS WHEN 'published' THEN 1 ELSE 0 END ) articlePublishedCount

Loading…
Cancel
Save